How do I get the lowest value of all the non zero value pixels?
How do I get the lowest value of all the non zero value pixels?
You can use mask :
Mat im = imread("f:/lib/opencv/samples/data/lena.jpg", IMREAD_GRAYSCALE);
Mat mask = im>0;
double minc[1], maxc[1];
minMaxLoc(im, minc, maxc,NULL,NULL,mask);
cout<<minc[0];
I think,mast is not a must.
int main( int argc, char** argv )
{
Mat im = imread("e:/template/lena.jpg", IMREAD_GRAYSCALE);
double minc[1], maxc[1];
minMaxLoc(im, minc, maxc,NULL,NULL);
cout<<minc[0];
return 0;
}
it works.
Asked: 2017-02-24 04:46:32 -0600
Seen: 3,545 times
Last updated: Feb 25 '17
Doubt about how to access a pixel in cvMat structure
How to get the descriptor value from "SiftDescriptorExtractor"?
Need small prog - I will donate
Android counting white pixels in binary Mat.
fix focal length in calibrateCamera()
'value' : is not a member of 'cv::DataDepth<_Tp>'
How can I work with pixels of an image directly?
Arbitrary grayscale pixel range
How to calculate the pixel density of a sampled binary image