Ask Your Question

How to resize the contours and Draw it on Resized Image

Hello ,

I am using Python OpenCv

I have an original Image of size 1275x1650 , I am extracting Images from the that original Image and extracted images will be of Size 82x94 . (Here I am successful in finding the contours)

So Now I am resizing the original image to smaller size 338x478 , I need to apply the contours on the resized image .

Why I need to do this :

I am NOT able to Find edges in the resized image.

So i need to apply the contours which is found on the original image to Resized image . Mathematically I am able to find the resized image will be have each extracted image will be of size 21.73x27.23

Please help me over this .

edit retag close merge delete

1 answer

Sort by ยป oldest newest most voted

contour is vector of points, just multiply x,y of each point on contour with corresponding width/height ratio, you get new points on resized image.

more

Comments

Method proposed is good only if gravity center of contour is (0,0)

( 2018-12-05 02:23:25 -0500 )edit

Stats

Asked: 2018-12-04 23:24:58 -0500

Seen: 341 times

Last updated: Dec 04 '18