Brigthtness detecction
I am working on a project to detect the brightness of an ID card. I am using OpenCV and C# to perform Image processing. Can someone help me detect the brightness in any environment taking into account that it will work with different camera resolutions. This is my code:
Imgproc.CvtColor(p0: dstMask, p1: gray, p2: Imgproc.ColorRgb2gray);
Imgproc.GaussianBlur(gray, briQ, new LogicStudio.Camera.Core.Size(11, 11), 0);
Imgproc.Threshold(briQ, thresh, 200, 255, Imgproc.ThreshBinary);
Core.MinMaxLocResult minmaxResultBlur = Core.MinMaxLoc(briQ);
double maxval = minmaxResultBlur.MaxVal;
double minval = minmaxResultBlur.MinVal;
if (maxval >= 252 && minval >= 0.0 && minval <= 30.0 )
{
Imgproc.PutText(input, "Brillos detectados mueva la camara..!!", new LogicStudio.Camera.Core.Point(20, 200), 4, 1.0, new Scalar(0, 255, 0));
}