Dear friends,
I am sitting here with the c# windows application.
I have set a picture box to capture image.
I want to detect motion from web camera.
I don't know how to set a path for capturing images continuously in to a folder.
Please explain me in codes.
In code project there are some project's motion_src.
I can't catch where they will call and close the program.
I am waiting for your valuable answers.
I've tried this till now:
using System;
using System.Linq;
using System.Text;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;
namespace WinFormCharpWebCam
{
public partial class mainWinForm : Form
{
public mainWinForm()
{
InitializeComponent();
}
WebCam webcam;
private void mainWinForm_Load(object sender, EventArgs e)
{
webcam = new WebCam();
webcam.InitializeWebCam(ref imgVideo);
}
private void bntStart_Click(object sender, EventArgs e)
{
webcam.Start();
detector = new MotionDetector3();
detectorType = 3;
SetMotionDetector();
}
private void SetMotionDetector()
{
Camera camera = cameraWindow.Camera;
if (detector != null)
{
detector.MotionLevelCalculation = motionAlarmItem.Checked;
}
if (camera != null)
{
camera.Lock();
camera.MotionDetector = detector;
statIndex = statReady = 0;
camera.Unlock();
}
}
private void bntStop_Click(object sender, EventArgs e)
{
webcam.Stop();
}
private void bntContinue_Click(object sender, EventArgs e)
{
webcam.Continue();
}
private void bntCapture_Click(object sender, EventArgs e)
{
imgCapture.Image = imgVideo.Image;
}
private void bntSave_Click(object sender, EventArgs e)
{
Helper.SaveImageCapture(imgCapture.Image);
}
private void bntVideoFormat_Click(object sender, EventArgs e)
{
webcam.ResolutionSetting();
}
private void bntVideoSource_Click(object sender, EventArgs e)
{
webcam.AdvanceSetting();
}
}
}
Till now I've been able to capture the image when I press a button but I would like to be able to capture the images automatically.
I don't know how to proceed, could you help?
Thank you in advance.