Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

minimum value per pixel (w.r.t channel) in a 3 channel image

$
0
0
Hi everyone, Is there any function in openCV which can return the minimum/maximum value of a pixel w.r.t channel in a 3 channel image (e.g. a BGR image) like the following available in MATLAB: temp = min(im, [], 3); I know that you can use nested loops to access each pixel using `Mat::at(i,j)` operator and then use `min` function twice to get the minimum value per pixel like this: for (int m = 0; m(m, n); rgbmin.at(m, n) = min(min(intensity.val[0], intensity.val[1]), intensity.val[2]); } } but this seems slower and I am looking for a more efficient way to do this. Thanks

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>