Imgproc.matchTemplate() API returns void. IS there any way to know that a match has been found?
A rectangle is drawn irrespective of the template found or not. How can I know taht a valid match for the template has been found?
Take a look at the matchTemplate tutorial, it does exactly what you need.
Hi Steven, I am trying to match a template in camera frame, but even before I bring the template in camera frame , a rectangle is displayed.However, once the template is in camera frame,, then the rectangle is drawn only around the template. So I wanted to draw the rectangle only when template is found. Any suggestion will be of great help.
Without code, impossible for us to help you further ...
I managed drawing the rectangle only when my image is in camera preview, but that is very hard to detect. As well as when I rotate this image nothing happens, is this the correct algorithm to detect an image. The frames per second is 1, which makes it very slow. How can I fix these issues?
Below is the code: Imgproc.matchTemplate(image, template, result, match_method); Imgproc.threshold(result, result,0.8, 1.0, Imgproc.THRESH_TOZERO);