Re: [OpenCV] OpenCV Webcamera resolution

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [OpenCV] OpenCV Webcamera resolution

by George Toderici :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On a side note, the cvSetCaptureProperty function also does nothing on MacOS X. I had to change the quicktime initialization code to get a different resolution for my purposes. Unfortunately, I am not familiar at all with the QT API to be able to write a function that changes the properties of the capture object on the fly. It would be really nice if someone added similar functionality on MacOS X.

It may be even nicer to be able to initlalize the capture with a "suggested" resolution. For instance, even before starting the capture process to specify that you'd prefer frames of size 320x240 instead of 1280x1024. This would require a (small) change in the API and it would make people a lot less confused about not having the proper capture resolution and how to set it.

George

On Sat, Apr 26, 2008 at 2:50 PM, Tim Hutt <tdhutt@...> wrote:
> Hi,
>
>  I am having problems with changing a logitech QuickCam Communicate Deluxe
> webcamera
>  resolution. I have tried to modified highgui.h and cvcap.cpp as suggested
> by one of the post I
>  read. I still couldnot change the resolution.
>
>  I also used the following code:
>
>  cvSetCaptureProperty (capture, CV_CAP_PROP_FRAME_WIDTH, 640);
>
>  it still gave me a default resolution of 320 x 240

I'm assuming you're using Windows? They should really add something to
the documentation to say that cvSetCaptureProperty() does nothing on
Windows. Anyway, if I recall the previous post correctly you should do
something like:

cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH_HEIGHT, 640480);

However I thought that call was unintuitive and people were much more
likely to try what you did (especially as it still compiles!) So I
implemented CV_CAP_PROP_FRAME_WIDTH and _HEIGHT and they both assume
the aspect ratio is 3:4 (since you can't change width and height one
at a time on windows).

I'll post the code when I get to work on Monday.

------------------------------------

Change settings: http://www.yahoogroups.com/mygroups, select
  Get Emails (get all posts)
  Daily Digest (one summary email per day)
  Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-unsubscribe@...
Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/OpenCV/

<*> Your email settings:
   Individual Email | Traditional

<*> To change settings online go to:
   http://groups.yahoo.com/group/OpenCV/join
   (Yahoo! ID required)

<*> To change settings via email:
   mailto:OpenCV-digest@...
   mailto:OpenCV-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
   OpenCV-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opencvlibrary-devel mailing list
Opencvlibrary-devel@...
https://lists.sourceforge.net/lists/listinfo/opencvlibrary-devel

Re: [OpenCV] OpenCV Webcamera resolution

by Nils Hasler-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 27 April 2008 11:01, George Toderici wrote:
> It may be even nicer to be able to initlalize the capture with a
> "suggested" resolution. For instance, even before starting the capture
> process to specify that you'd prefer frames of size 320x240 instead of
> 1280x1024. This would require a (small) change in the API and it would make
> people a lot less confused about not having the proper capture resolution
> and how to set it.

I really like the idea. I would even go one step further and allow requesting
a framerate as well. Some cameras only allow certain combinations of
resolution and framerate (high resolutions at low framerates and vice versa).
So some framerates+resolutions are tricky to reach when the parameters can
only be set one at a time because the order of setting framerate and
resolution is important.

Most camera interfaces require requesting resolution and framerate anyway. So
it makes sense to pass the option down to the user instead of choosing some
arbitrary value which may or may not be supported by the hardware. The user
may know something about that.

If we use initialized parameters, the API change should be backward compatible
for C++ at least. Plain C users will have to call cvCreateCameraCapture(0, 0,
0, 0) or something to get the same behaviour as before.

If nobody complains I'll change cvCreateCameraCapture() to

CVAPI(CvCapture*) cvCreateCameraCapture(int index, int width CV_DEFAULT(0),
int height CV_DEFAULT(0), double framerate CV_DEFAULT(0));

I only have access to a firewire camera so I won't be able to change all our
camera interfaces natively though. Although for interfaces that don't support
the options directly we can simply call cvSetCaptureProperty() from
cvCreateCameraCapture(). It's not the same as I mentioned above but it should
work at least for some cameras and resolution/framerate combinations.

cheers,
nils

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opencvlibrary-devel mailing list
Opencvlibrary-devel@...
https://lists.sourceforge.net/lists/listinfo/opencvlibrary-devel
LightInTheBox - Buy quality products at wholesale price