Ask Your Question
0

I want get image with my device

asked Nov 3 '0

wilber1222 gravatar image

updated Nov 3 '0

Hi all,

I want to catch image from UVC capture card,

The resolution of this device is 1920X1081,

I was setting this resolution as following:

VideoCapture camera1;

camera1.open(0);

camera1.set(CV_CAP_PROP_FOURCC,CV_FOURCC('U','Y','V','Y'));

camera1.set(CV_CAP_PROP_FRAME_WIDTH,1920);

camera1.set(CV_CAP_PROP_FRAME_HEIGHT,1081);

But when I get height information, it will be 1080,

Is OpenCV allow catch special size image?

Please help me. Thanks.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Nov 3 '0

mvuori gravatar image

This is because an YUVY image height and width must be a multiple of 4.

Preview: (hide)

Comments

Hi mvuori, Thanks for your reply. Because the sensor of my device will exist some information on the image. Thus, the output data will be (1920*1080 image data + 180Byte information). So, OpenCV does not support this case?

wilber1222 gravatar imagewilber1222 (Nov 3 '0)edit

Change this:

camera1.set(CV_CAP_PROP_FOURCC,CV_FOURCC('U','Y','V','Y'));

to:

camera1.set(CV_CAP_PROP_FOURCC,CV_FOURCC('I','Y','V','Y'));
supra56 gravatar imagesupra56 (Nov 3 '0)edit

Hi all, I found my device's descriptor setting was wrong. It work after I fix my descriptor.

wilber1222 gravatar imagewilber1222 (Nov 4 '0)edit

Question Tools

1 follower

Stats

Asked: Nov 3 '0

Seen: 488 times

Last updated: Nov 03 '20