- EmguCV 2.3.0 in C# QueryFrame returns the previous queried frame
- _capture = new Capture();
- Image<Bgr, Byte> frame = _capture.QueryFrame();
- Image<Gray, Byte> grayFrame = frame.Convert<Gray, Byte>();
- Image<Gray, Byte> smallGrayFrame = grayFrame.PyrDown();
- Image<Gray, Byte> smoothedGrayFrame = smallGrayFrame.PyrUp();
- Image<Gray, Byte> cannyFrame = smoothedGrayFrame.Canny(new Gray(100), new Gray(60));
- captureImageBox.Image = frame;
- grayscaleImageBox.Image = grayFrame;
- smoothedGrayscaleImageBox.Image = smoothedGrayFrame;
- cannyImageBox.Image = cannyFrame;
- _capture.Dispose();
- Image<Bgr, Byte> frame;
- using (Capture capture = new Capture())
- {
- frame = capture1.QueryFrame().Copy(); //You must copy else frame will be disposed off
- }
- Image<Gray, Byte> grayFrame = frame.Convert<Gray, Byte>();
- Image<Gray, Byte> smallGrayFrame = grayFrame.PyrDown();
- Image<Gray, Byte> smoothedGrayFrame = smallGrayFrame.PyrUp();
- Image<Gray, Byte> cannyFrame = smoothedGrayFrame.Canny(new Gray(100), new Gray(60));
- grayscaleImageBox.Image = grayFrame;
- smoothedGrayscaleImageBox.Image = smoothedGrayFrame;
- cannyImageBox.Image = cannyFrame;
- Image<Bgr, Byte> frame;
- using (Capture capture1 = new Capture())
- {
- frame = capture1.QueryFrame().Resize(0.5, Emgu.CV.CvEnum.INTER.CV_INTER_AREA).Copy();
- captureImageBox.Image = frame;
- }
- using (Image<Gray, Byte> grayFrame = frame.Convert<Gray, Byte>())
- {
- grayscaleImageBox.Image = grayFrame;
- using (Image<Gray, Byte> smallGrayFrame = grayFrame.PyrDown())
- {
- using (Image<Gray, Byte> smoothedGrayFrame = smallGrayFrame.PyrUp())
- {
- smoothedGrayscaleImageBox.Image = smoothedGrayFrame;
- using (Image<Gray, Byte> cannyFrame = smoothedGrayFrame.Canny(new Gray(100), new Gray(60)))
- {
- cannyImageBox.Image = cannyFrame;
- }
- }
- }
- }