Well I’m working hard on my vehicle license plate detection algorithm, and need a little help with something simple.
Basically I’m trying to do the following, the code is self explanatory, I just can’t find an example of what I’m trying to implement.
Thanks in advance
if (img.GetPixel(bottomRightc.X, y) <= Color.FromArgb(255, 255, 255, 255)
&&
img.GetPixel(bottomRightc.X, y) >= Color.FromArgb(255, 166,166,166))
{
return false;
}
EDIT:
Thanks for the replies everyone, I didn’t put much thought into the comparison, and saw the problem with it after creating this thread. I think I’ll go with brightness comparison since my image has been grayscaled and has a high contrast.
Have you considered working in another color space? With HSV/HSB you could simply do something like
Assuming min-max of Value/Brightness 0-255. And assuming you are trying to accomplish brightness comparison, which is not entirely clear to me.
Edit:
There are methods for this in System.Drawing.Color, and brightness is between 0.0 and 1.0. So the above would become ~something like this: