Message Boards Message Boards

GROUPS:

CurrentImage[] Limited Resolution

Posted 9 years ago
11581 Views
|
10 Replies
|
20 Total Likes
|
If you run ImageDimensions[CurrentImage[]] it returns {320,240} even though the camera on my computer is {1080,720}.  I tried pluging in an external HD webcam, but that made no difference.  Is there any way to get the full resilution of the camera?

Thanks,
Chris


EDIT:

It turns out you can run
IMAQ`StartCamera[options]
the options you can set can be listed with:
Options[IMAQ`StartCamera]

Also there is a IMAQ`StopCamera[] which turns off the camera.
10 Replies
Chris,

Try setting the option on ImageCapture, like so:

 
 $DefaultImagingDevice
 
 (* Out[29]= "IPEVO Point 2 View" *)
 
 $ImagingDevices
 
 (* Out[30]= {"IPEVO Point 2 View"} *)
 
SetOptions[ImageCapture, RasterSize -> {1024, 768},  ImageSize -> {1024, 768}]

(* Out[32]= {"CaptureAction" -> Automatic, "CaptureRunning" -> True, "FrameRate" -> Automatic, ImageSize -> {1024, 768}, RasterSize -> {1024, 768}, "Device" :> $DefaultImagingDevice} *)


Then:

In[33]:= CurrentImage[]
When I just run the code you gave me it stays at the some old resolution, but if I then run ImageCapture[] twice (the first time it hangs then says $Aborted) then run CurrentImage[], then it works.  Is there any way to do this programmatically?


Chris
Setting RasterSize on ImageCapture is the way to control the resolution of the image stream.  We'll look into adding more programmatic stream control functions in the future.

Lambert
I have a logitech camera and this does not work very well at all. It seems to limit the camera to the upper right corner.
Also is there a way to "release" the camera?
 
Luc, I believe you are on Mac.  Logitech cameras often have issues on Mac.   Most of them are not UVC-compliant (USB video device class) which is what is needed for support on Mac.  They do put out some Mac models which are UVC-compliant, but I have still encountered issues with them.

You can release the camera using the power button on the ImageCapture pod.

Hope that helps,
Lambert
BTW, I am using a Logitech QuickCam Vision Pro for Mac (Black), which is one of the UVC compliant one.
SetOptions[ImageCapture, RasterSize -> Automatic, ImageSize -> Automatic]
brought things back to normal. It is really slow though...

Luc
@Chris If you don't mind a bit of c-coding than you can implement your own ImageCapture[] using the OpenCV library in only a few minutes.
Download the OpenCV library and use my MathCam MathLink program which is only a few lines of code from here:

http://www.bioinf.uni-leipzig.de/~patrick/download/MathCam.tm

I'm pretty sure the OpenCV supports the full resolution of your webcam under Windows.
Hi Patrick,

I read your code, following your link. But I realized that can be implementend only on Linux enviroment. Is there a similar code for windows?
Originally, the code was written by Jens-Peer for Windows and I just adapted it to run with a current version of OpenCV and to return an Image[..]. Although my comments describe how to compile it in Linux, is should word for Windows too. (Un)fortunately I'm in a complete Windows-free environment and I cannot compile it myself.

I'm having the same issue using a UVC webcam on Mac OS X, ImageCapture[] and CurrentImage[] return the image in 320x240 instead of 640x480 which is supported by other applications on Mac OS, no matter what I pass as options for ImageSize and RasterSize.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract