I am using ORB
feature matching algorithm to detect the object . I have followed this Sample . I am able to detect the object which is used as template Mat
.
So i have the Rect
of the object in the current Frame Mat
. How can i make a decision whether object is detected or not ?
If you need to see the algorithm you can check the link above . The code is quite big to post here. But i am posting the final drawing of points below .
Imgproc.line(rgb, new Point(sceneCorners.get(0, 0)), new Point(sceneCorners.get(1, 0)), new Scalar(0, 255, 0), 4);
Imgproc.line(rgb, new Point(sceneCorners.get(1, 0)), new Point(sceneCorners.get(2, 0)), new Scalar(0, 255, 0), 4);
Imgproc.line(rgb, new Point(sceneCorners.get(2, 0)), new Point(sceneCorners.get(3, 0)), new Scalar(0, 255, 0), 4);
Imgproc.line(rgb, new Point(sceneCorners.get(3, 0)), new Point(sceneCorners.get(0, 0)), new Scalar(0, 255, 0), 4);
i.e what i have is a Rect
of the object in the Mat
Frame. How can i decide if object was found or not . My question is quite similar to This one.