max and min values in a Mat
Hi..How do I get the max and min value in a Mat? Is there any function in Opencv which return these two values?
Hi..How do I get the max and min value in a Mat? Is there any function in Opencv which return these two values?
minMaxLoc(), see http://docs.opencv.org/modules/core/doc/operations_on_arrays.html?highlight=minmaxloc#minmaxloc
Usage:
double min, max;
cv::minMaxLoc(your_mat, &min, &max);
The function can also give you the location of the min and max-values:
cv::Point min_loc, max_loc
cv::minMaxLoc(your_mat, &min, &max, &min_loc, &max_loc);
is there any way to do this for a float? or do i have to write my own?
Asked: 2014-01-27 04:54:43 -0600
Seen: 156,803 times
Last updated: Jan 27 '14
min and max values hsv in an image
Source image having 2 or more part matched with a template image
what is the maximum readable size of image in opencv
getting subpixel with MatchTemplate
minVal of minmaxLoc is not what I read by direct reading at matchLoc point
minMaxLoc crashed using opencl when location is needed
cv::minMaxLoc argument problem
How do I interpret the information in the location output matrix from cuda::findMinMaxLoc?
How to get actual height and width of object in the image in android OpenCv?