Hi,
While this reply is late I thought best to include the answer in case any other fall across this question.
Lets assume you have read your image in as a colour image:
Image<bgr,Byte> My_Image = new Image<bgr,Byte>("filename_string");
To access each individual pixel of My_Image you call the .Data property but lets not forget that a Bgr image has 3 matrices representing Red, Green, Blue
byte Red_val = My_Image.Data[y,x,0];
byte Green_val = My_Image.Data[y,x,1];
byte Blue_val = My_Image.Data[y,x,2];
Now to check if this pixel is white "Red_Val", "Green_val" and "Blue_Val" will be equal to 255.
Now to set a pixel to a colour EMGU has made the method slighter simpler then setting the red green and blue spectrum's individually you can simply use:
My_Image[i,j] = new Bgr(Color.Red);
Now if you are using greyscale images you obviously can't assign the colour red but its worth noting that for this image type there is only 1 matrix representing it's values therefore to access its data you would use:
byte Gray_val = My_Image.Data[y,x,0];
So putting it all together you would be after something like this:
Timer timer = new Timer();
Image<bgr,byte> My_Image;
Image<bgr,byte> My_Image_todrawon;
Random xy_rand = new Random();
public FormWithTimer()
{
InitializeComponent();
My_Image = new Image<bgr,byte>("filename_string");
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = (3000);
timer.Enabled = true;
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
My_Image_todrawon = My_Image.Copy();
for(int i = 0; i< 300; i++)
{
int ran_x_pos = xy_rand.Next(My_Image.Width);
int ran_y_pos = xy_rand.Next(My_Image.Height);
byte Red_val = My_Image.Data[ran_y_pos,ran_x_pos,0];
byte Green_val = My_Image.Data[ran_y_pos,ran_x_pos,1];
byte Blue_val = My_Image.Data[ran_y_pos,ran_x_pos,2];
if(Red_val == 255 && Green_val == 255 && Blue_val == 255)
{
My_Image[i,j] = new Bgr(Color.Red);
}
}
}
This should help get you started in whatever you application may be.
Cheers
Chris