How to save the image into the c drive of my pc capturing continuosly from a webcam using C# code
Hi,
iam getting the webcam images in the picturebox using bellow code for every 2 seconds , but i want to save them in my pc's c drive how to save the images in to my c drive as a bitmap image
private void WebCamCapture_ImageCaptured(object source, WebCam_Capture.WebcamEventArgs e)
{
// set the picturebox picture
this.pictureBox1.Image = e.WebCamImage;
}
i want to save the image e.wabcamimage to my c drive for every 2 seconds by saving all the images i want to compare the image with its previous image
otherwise plss tell me any other way to compare the image with its previous image (for every two seconds i will get the new image)
thanks in advance please help me
Pramod Kumar NandagiriPosted Aug 25, 2009, 1:00 AM
U said it is impossible to compare images on such short span of time(2 sec), is it possible to compare if the time span is 2 hours
and is it possible to save those photos to in my c drive mypictures folder
and u said to run ocr program give me any links u have about that ocr program
I have written the following code to compare the images
timer1_tick (i have put this code in timer)
{
string img1_ref, img2_ref;
img1 = new Bitmap("c:\\dd.jpg"); //it is working fine in this way but i want to take img1 as previous image and img2 as current image and i will do the comparison and i want to interchange the img1 and img2 then current image becomes previous image img1 and img2 gets the new image from webcam like this i want to comapre continuously but it's not working plss tell me this way is possible or not with small modifications
img2 = new Bitmap(e.WebCamImage); //is image interchanging is possible simply giving img1=img2; is not working
if (img1.Width == img2.Width && img1.Height == img2.Height)
{
for (int i = 0; i < img1.Width; i++)
{
for (int j = 0; j < img1.Height; j++)
{
img1_ref = img1.GetPixel(i, j).ToString();
img2_ref = img2.GetPixel(i, j).ToString();
if (img1_ref != img2_ref)
{
count2++;
flag = false;
break;
}
count1++;
}
// progressBar1.Value++;
}
if (flag == false)
MessageBox.Show("Sorry, Images are not same , " + count2 + " wrong pixels found");
else
MessageBox.Show(" Images are same , " + count1 + " same pixels found and " + count2 + " wrong pixels found");
}
else
{
MessageBox.Show("can not compare this images");
}
img1 = img2;
}
Roei BarPosted Aug 24, 2009, 4:05 PM