Ask Your Question
0

What exactly minmaxLoc () function returns ?

asked 2016-04-20 09:22:33 -0600

Naved gravatar image

While using matchTemplate fuction. Result we get exactly does it contains and what we will get using minmaxLoc() fuction on it. I mean which point in a image does it returns.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-04-20 10:53:39 -0600

Croolman gravatar image

updated 2016-04-20 10:57:28 -0600

This function as the documentation says returns the minimum and maximum value found in image/array.

Mat inArray;
double min, max; 
minMaxLoc(inArray, &min, &max);

If you need the exact location, you pass another two arguments as well. Then it will return the point where the extreme is. The function goes through the matrix and find the minimum and the maximum value. Note that the input image has to be grayscale.

Using it with matchTemplate function. The returned points would be the part of matched image.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-20 09:22:33 -0600

Seen: 13,238 times

Last updated: Apr 20 '16