Can not calculate full area of contour

asked 2016-01-05 08:00:25 -0600

lamngoctam gravatar image

When I rotated the object, I calculated the area of the contours. I do not know why there is so far differences between two areas although the shape was not changed so much.

1st image: area is about 11300 2nd image: area is about 120

image description image description

The program is the same in this link, so simple: http://docs.opencv.org/2.4/doc/tutori...

Please help me to solve this problems!

edit retag flag offensive close merge delete

Comments

Is the second contour the contour of a contour? can you post the 2 images on witch you have computed the contours?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-05 08:20:44 -0600 )edit

I projected the object to image. The object was turned 36degree before projected to the 2nd image. Both of two images are the largest contour for each one. Here there are. 1st 2nd

lamngoctam gravatar imagelamngoctam ( 2016-01-05 17:45:44 -0600 )edit

Ok, that is strange, can you post also the code of computing the area of the contour? Is it a vector of contours and you are computing the area of the 1st and the 2nd contours? Aren't there more than 2 contours in your result?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-06 02:07:03 -0600 )edit

I must wait for 48hours from the 1st post. But my code is the same with OpenCv source: http://docs.opencv.org/2.4/doc/tutori... I have just found the largest contour from lots of other contours, absolutely, I have already checked all areas.

lamngoctam gravatar imagelamngoctam ( 2016-01-06 19:29:00 -0600 )edit