Why doesn't CameraDemoNet set the chosen resolution?

Why doesn't CameraDemoNet set the chosen resolution?

Hi,

I started using and learning the CameraDemoNet sample and realized that the still image frames were all reported to be the same resolution no matter what I chose in either of the resolution combo boxes that list thesupported image and video resolutions. I then noticed that the sample code doesn't do anything when a resolution is chosen. For the image resolution control there is no event handler at all, and the video resolution control only resets the frame rate control. I would expecteither oneto call a method or set a property of the Camera object to set the desired resolution so that CaptureFrame() returns an image/frame of the desired resolution.

I see that adjusting the supported options via the scrollbar works like I would expect.

This ability to dynamically/programatically choose still image resolution is why I am trying the MCA SDK, so I hope this is possible! Is it?

Thanks again,
Margot

3 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Steven Murray (Intel)的头像

Hi Margot,

It is possible to change the resolution of the still image provided that the camera supports it. Sometimes the camera doesn't have a still pin and just uses the capture pin instead. In this case the resolution is changed for both capture and preview. But it is all limited to the capability of the camera itself.

Thanks,

Steve

Thanks Steve,

Yes, that's right in line with what I've learned working with DirectShow, and the images captured by CameraDemoNet are the default video resolution which makes sense. My camera's capabilities, even if it doesn't support separate still image capture, are sufficient for my needs.

I got more familiar with the MCA libraries today and found Camera.ImageSize and .VideoSize and modified CameraDemoNet to set the resolution that the user chooses and it's working great. Since this behavior was what I expected I'll share what I did in case it's helpful to someone else.

First I modified btnGetImageRes_Click.I changed the local variable getImageRes to a new class member named arrImageRes sothe Size objects arealways available.

Then I added an event handler for the combo box:

private void CboImageRes_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if ( CboImageRes.SelectedIndex < arrImageRes.Length )
oCam.ImageSize = arrImageRes[CboImageRes.SelectedIndex];
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

The same can be done for the video resolution.

Margot

登陆并发表评论。