Search Minimal Value in Open CV
Excuse me, is there anyone knows how to search minimal value from this value
i have tried with minMaxLoc but it didn't work... am I wrong? Or any suggestion? Thank you
Excuse me, is there anyone knows how to search minimal value from this value
i have tried with minMaxLoc but it didn't work... am I wrong? Or any suggestion? Thank you
i have tried with minMaxLoc but it didn't work... am I wrong? Or any suggestion? Thank you
Then this means you are using it wrong. I've used it successfuly for that purpose multiple times.
First, you should have a cv::Mat or an std::vector containing the data you need to check.
Lets assume your structure containing the data is cv::Mat distanceData
.
Then, to find the minimum value and index, you should use the cv::minMaxLoc as in this example.
cv::Mat distanceData; //-- This structure contains the distance values
double min, max;
cv::Point minLoc, maxLoc;
cv::minMaxLoc(distanceData, &min, &max, &minLoc, &maxLoc);
min, max, minLoc and maxLoc are actually output arguments that should be entered as pointers, so that the function can change them inside.
After doing this, min and max will contain the minimum and maximum values present in the data structure, and minLoc and maxLoc are cv::Points with the coordinates of such minimum and maximum values.
Asked: 2017-07-25 21:57:23 -0600
Seen: 149 times
Last updated: Jul 26 '17
"i have tried with minMaxLoc but it didn't work..." please show us your code! Then only we can tell where you were wrong!