Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

perspectiveTransform Error handler

I use http://docs.opencv.org/trunk/d7/dff/tutorial_feature_homography.html , but i changed SURF to SIFT, but it doesn't matter. Everything works good, but there are one problem: it hasn't error handler when img_object didn't find on img_scene. For example when images are really different - it's error in this:

perspectiveTransform(obj_corners, scene_corners, H);

So i need some error handler like:

if (**something**) { 
printf("Didn't find!"); }


else { ...    
perspectiveTransform(obj_corners, scene_corners, H);
...}

My questin is: What something ?? min_dist > 20 ? Or what condition i need?

P.S. Thank you for your answers, and sorry for my english :D

perspectiveTransform Error handler

I use http://docs.opencv.org/trunk/d7/dff/tutorial_feature_homography.html , but i changed SURF to SIFT, but it doesn't matter. Everything works good, but there are one problem: it hasn't error handler when img_object didn't find on in img_scene. For example when images are really different - it's error in this:

perspectiveTransform(obj_corners, scene_corners, H);

So i need some error handler like:

if (**something**) { 
printf("Didn't find!"); }


else { ...    
perspectiveTransform(obj_corners, scene_corners, H);
...}

My questin is: What something ?? min_dist > 20 ? Or what condition i need?

P.S. Thank you for your answers, and sorry for my english :D