I have to make a macros, it should detect object by color on the certain area on the picture of the screen. Further, I need to continue execute code if object has been detected.
Image<Bgr, Byte> imgWindowScreen;
Image<Gray, Byte> imgWindowScreenProcessed;
Bitmap bmpScreenshot;
System.Drawing.Graphics gfxScreenshot;
Size size = new Size(400, 120);
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height,
PixelFormat.Format32bppArgb);
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(700, 347, 0, 0, size);
imgWindowScreen = new Image<Bgr, Byte>(bmpScreenshot);
imgWindowScreenProcessed = imgWindowScreen.InRange(new Bgr(3, 25, 82),
new Bgr(50, 98, 200));
Is it right I have choosen the area? I have a upper left point and I need to get something like that:

How to define that imgWindowScreenProcessed has a pixels of searched color? I need to build a following structure:
if (picture has pixels of searched color) {...}
else {...}