I am using the Emgu library to integrate the open features of a CV webcam in C #.
I use this code to select a capture device and set its size:
camera = new Capture(0); camera.SetCaptureProperty(CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, videoSettings.width); camera.SetCaptureProperty(CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, videoSettings.height);
Then I show it in imageBox as follows: imageBox1.Image = camera.QueryFrame();
Then, to capture a snapshot of the current frame, I use this code:
Image<Bgr, byte> snapshot = camera.QueryFrame(); snapshot.Save("snapshot.jpg");
Although I would like to be able to save a picture with a higher resolution than the preview window.
But the problem is that, as far as I know, I can not create a new "Capture" object using the same webcam. So I wonder if it is possible to set the height and width of camera.setCaptureProperty to say 1028x720, but then somehow crop it to display it in an imageBox with a resolution of 514x360?
Or is there any other way to do this?
jimutt
source share