perspectiveTransform Error handler
I use http://docs.opencv.org/trunk/d7/dff/t... , 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 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
What is error message? Have you check obj-corners size?
obj_corners.size(): 4
obj_corners: [0, 0; 500, 0; 500, 200; 0, 200]
obj_corners is about template left in img_matches - not about template on scene image. So, if I have template image 500x200 it has this corners
error in cv.perspectiveTransform(_InputArray , _OutputArray* , _InputArray* )* System.Runtime.InteropServices.SEHException
It is not an opencv error message. Is it an egmu message ?