(OpenCV3+python) How to change the origin of a contour- cv2.drawcontours

asked 2018-04-20 22:19:24 -0600

kzmn gravatar image

updated 2018-04-20 22:23:23 -0600

Hi.. in my project the target object is always in the center of picture...since the image is too busy I crop the image first ( clip=image[X1:X2,Y1:Y2] ) and then I can successfully do measurements, etc. on clip. Now I need to draw a certain contour (found in clip) on the original image for visualization purposes. But obviously the contour will not be in the correct place as the origin of clip is different than image (so contour will be drawn on top left corner of image instead of center). Is there a way to fix this? Thanks.

edit retag flag offensive close merge delete

Comments

look at the docs it has an offset point

berak gravatar imageberak ( 2018-04-21 00:25:02 -0600 )edit

Thanks Berak!

kzmn gravatar imagekzmn ( 2018-04-23 12:06:02 -0600 )edit