I am using OpenCV template matching to find an image within another image.
Specifically matchTemplate()
which returns a cv::Mat
containing a similarity map of the matches.
Is there any way to sort through the cv::Point
s contained in that cv::Mat
besides using minMaxLoc()
?
minMaxLoc(result, &minVal, &maxVal, &minLoc, &maxLoc);
I have tried:
cv::Mat_<uchar>::iterator it = result.begin<uchar>();
cv::Mat_<uchar>::iterator end = result.end<uchar>();
for (; it != end; ++it)
{
cv::Point test(it.pos());
}
With limited success.