Ask Your Question
0

Problem with cvSetCaptureProperty in Windows 8

asked 2013-02-28 18:53:14 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi everyone,


I use OpenCV in my project of Augment Reality. The original platform is Windows 7 and everything works perfect - full-screen with 1080p. However, when I launched my program on Windows 8 it showed live video with resolution 640x480. The same program on the same hardware, but with different OS Windows shows different results. I wrote simple test program which show the same problem:

include "highgui.h"

int main()

{

cvNamedWindow("VideoTest", CV_WINDOW_AUTOSIZE);

CvCapture *capture = cvCreateCameraCapture(0);

CvSize size = cvSize(1920, 1080);

cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH , size.width);

cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT , size.height);

IplImage* frame;

while(1)
{
    frame = cvQueryFrame(capture);

    if(!frame) break;

    cvShowImage("VideoTest", frame);

    char c = cvWaitKey(33);

    if(c == 27) break;
}

cvReleaseCapture(&capture);

cvDestroyWindow("VideoTest");

return 0;

}

I think that there is problem with - cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH , size.width); But I have no idea how to resolve it. I would be glad any help.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-03-24 20:34:46 -0600

Xirexel gravatar image

After some times I found the suitable decision of this problem. I have included Media Foundation in my project and have written simple C++ class for this. Short article about it is showed on Capturing of video from web-camera on Windows 7 and 8 by Media Foundation

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-02-28 18:53:14 -0600

Seen: 1,235 times

Last updated: Mar 24 '13