public cameracaps() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { try { Capture cam = new Capture(); } catch (NullReferenceException exception) { MessageBox.Show(exception.Message); return; } Application.Idle += new EventHandler(processFunction); capturingprocess=true; } void processFunction(object sender,EventArgs e) { imgOrg=capturecam.QueryFrame(); if(imgOrg ==null)return; imgproc=imgOrg.InRange(new Bgr(50,50,50),new Bgr(250,250,250)); imgproc = imgproc.SmoothGaussian(9); original.Image=imgOrg; processed.Image=imgproc; } private void Button1_Click(object sender, EventArgs e) { if(capturingprocess==true) { Application.Idle-=processFunction; capturingprocess = false; Button1.Text="play"; } else { Application.Idle+= processFunction; capturingprocess= true; Button1.Text="pause"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)