Homography separate good from bad results
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
You can add an if that display the image only if the object is found (you have the corners).
I tried to use the CvPoint's for the if. But they are not empty or (0,0) if the result is bad.
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 thescene_corners
if the image does not contain the objects (maybe 4cv::Point(-1, -1)
), then you can add that condition in the if statement