Homography separate good from bad results

asked 2015-05-19 02:52:05 -0500

CHMA23 gravatar image

updated 2015-05-19 02:53:26 -0500

berak gravatar image

I am trying to find a method, to separate good homography-results from bad. I use the C++ example from link text. I have one object picture (box.png) and one folder full of scene-images. I want to display only the pictures those really contains the object image. In the used example it draws lines for every picture without the object, but no green frame.

Best Regards

edit retag flag offensive close merge delete


You can add an if that display the image only if the object is found (you have the corners).

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-05-19 03:08:44 -0500 )edit

I tried to use the CvPoint's for the if. But they are not empty or (0,0) if the result is bad.

CHMA23 gravatar imageCHMA23 ( 2015-05-21 03:58:09 -0500 )edit

OK, first that should be changed to C++ api (use cv::Point instead of cvPoint, and others); second, what I meant is you have perspectiveTransform( obj_corners, scene_corners, H);, I am not sure what are the values, but you can test what are the values inserted in the scene_corners if the image does not contain the objects (maybe 4 cv::Point(-1, -1)), then you can add that condition in the if statement

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-05-21 04:49:04 -0500 )edit