Ask Your Question

Decreasing capture resolution of webcam

asked 2013-04-12 02:42:25 -0600

unmesh gravatar image

How to reduce capturing resolution of webcam?? I have used iball C8.0(FACE2FACE) webcam. Without using function cvSetCaptureProperty it captures frame with 640x480 resolution, with this function it shows same resolution i.e. 640X480. I want change into 320X240 or 480x320 resolution. If i used following function to reduce resolution,

  1. cvSetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH, 320);
  2. cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 240);

it captures in 640x480 resolution and gives error


edit retag flag offensive close merge delete


Are you sure that your camera supports these other resolutions? Many cheaper camera's only support single resolutions.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-12 03:40:07 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-12 09:25:40 -0600

hjf gravatar image

this is a limitation of the opencv against the Linux video API. I'm using a logitech C170, lsusb -v shows that it supports a lot of resolutions and formats (can even do BGR which would be good to feed opencv with).

on windows I can set the resolution and FPS just fine with this camera. for linux I had to change the opencv source (there's a define somewhere, i think #DEFAULT_WIDTH or something like that) and you can set to 320x240, for example. but it's a hardcoded value.

edit flag offensive delete link more

Question Tools


Asked: 2013-04-12 02:42:25 -0600

Seen: 3,996 times

Last updated: Apr 12 '13