public Form1() { InitializeComponent(); Thread camThread = new Thread(() => { Mat mat = new Mat(); VideoCapture capture = new VideoCapture(0); while(!this.Disposing) { capture.Read(mat); if(!mat.Empty()) { this.Invoke((MethodInvoker)(() => { this.pictureBox1.Image = BitmapConverter.ToBitmap(mat); })); } Thread.Sleep(1); GC.Collect(); } }); camThread.Start(); }
등록된 댓글이 없습니다.