Ask Your Question
1

How to resize the contours and Draw it on Resized Image

asked 2018-12-04 23:24:58 -0600

sreevathsabr gravatar image

updated 2020-10-18 13:52:10 -0600

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-12-05 00:07:43 -0600

blues gravatar image

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.

edit flag offensive delete link more

Comments

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

LBerger gravatar imageLBerger ( 2018-12-05 02:23:25 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 1,874 times

Last updated: Dec 04 '18