I want to find the coordinates of black colored dots from a Colored Image. If i put three dots on a white background, my code detects it and shows the coordinates in textboxes. But my code doesn't work for the image given in the following link. what should I do??
https://drive.google.com/file/d/0B6ynC-W5aF41cWxtU3BVN3g3U00/view?usp=sharing
My Code is :
for (int i = 0; i < PatientImage.Image.Height; i++)
{
for (int j = 0; j < PatientImage.Image.Width; j++)
{
//Get the color at each pixel
Color now_color = bmp.GetPixel(j, i);
//Compare Pixel's Color ARGB property with the picked color's ARGB Property
if (now_color.ToArgb() == Color.Black.ToArgb())
{
// MessageBox.Show("Color Found!");
// MessageBox.Show("X = " + j + " , " + "Y =" + i);
bool flag = false;
if (String.IsNullOrEmpty(COPX.Text))
{
COPX.Text = Convert.ToString(j);
COPY.Text = Convert.ToString(i);
flag = true;
}
}
}
}