如何在opencv中查找图像的最大和最小亮度值? [英] How to find max and min lightness values of an image in opencv?
本文介绍了如何在opencv中查找图像的最大和最小亮度值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要计算图像的动态范围。所以我需要计算图像的最大和最小亮度值。我需要这样做使用opencv。任何想法如何在opencv中做这个?
I need to calculate Dynamic range of an image. So that I need to calculate the max and min lightness values of an image. I need to do this using opencv. Any idea how to do this in opencv?
推荐答案
这可能有帮助:
// find minimum intensity and location of minimum intensiy
void min_Loc(Mat* img, Point* minloc, double* minVal)
{
Mat dst2gray;
double maxVal;
Point maxloc;
cvtColor(*img, *img, CV_RGB2GRAY);
minMaxLoc(*img, minVal, &maxVal,minloc,&maxloc); //find minimum and maximum intensities and their positions
}
这篇关于如何在opencv中查找图像的最大和最小亮度值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文