From: Sandip Sahoo on
I'm working on image segmentation using watershed. From offline images succesfully segmented, I've gone onto segmenting images acquired from webcam in real time. But the image capture of white metal balls in MATLAB, they come over as tinted red and the black cloth/background looks green. :(

here's the code and the photos as well

v1=videoinput('winvideo', 1,'YUY2_640x480');
v1.Timeout = 30;
% Configure object to capture every fifth frame.
set(v1, 'FrameGrabInterval', 5);
v2=getselectedsource(v1);
set(v1,'FramesPerTrigger', 20);
% Configure the device to provide 30 frames per second.
set(v2, 'FrameRate', '10');
preview(v1);
start(v1);
imav=getdata(v1);
delete(v1);
clear v1;
imshow(imav(:,:,:,17))

The vid preview looks good but the actual capture is :(

http://img199.imageshack.us/i/vidpreviewsnapshot.jpg/
http://img99.imageshack.us/i/matlabcapture.jpg/

Please help me sort this out...
From: Sandip Sahoo on
Pleaaase help me!!!

I tried the same imaq code on 2 PCs and 3 different webcams. All of them showed the same kind of distorted photos. I used get(videosourceobject) to view the brightness, contrast, hue, saturation properties. Using propinfo(), I came to know that different webcams have different range and default values for brightness, for ex, Brightness on one was [-64 64] , default(-20)and on another [0 200], default(97). Changing these values for every setting is really cumbersome and I was wondering if there's a auto setting/function for properties like brightness, saturation, etc.

The photos captured on these webcams were distorted similarly.

I thought matlab capture(multi frame acquisition) using webcams is always this distorted till I checked out the imaq demos(Logging data to memory one) in MATLAB R2009a and the multi frames look just fine.

I urgently need some help with this imaq problem so that I can get started on the segmenting part.

Thanking in advance,

Sandip
From: Mark Jones on
Sandip Sahoo wrote:
> Pleaaase help me!!!
>
> I tried the same imaq code on 2 PCs and 3 different webcams. All of them
> showed the same kind of distorted photos. I used get(videosourceobject)
> to view the brightness, contrast, hue, saturation properties. Using
> propinfo(), I came to know that different webcams have different range
> and default values for brightness, for ex, Brightness on one was [-64
> 64] , default(-20)and on another [0 200], default(97). Changing these
> values for every setting is really cumbersome and I was wondering if
> there's a auto setting/function for properties like brightness,
> saturation, etc.
>
> The photos captured on these webcams were distorted similarly.
> I thought matlab capture(multi frame acquisition) using webcams is
> always this distorted till I checked out the imaq demos(Logging data to
> memory one) in MATLAB R2009a and the multi frames look just fine.
>
> I urgently need some help with this imaq problem so that I can get
> started on the segmenting part.
> Thanking in advance,
>
> Sandip

Hi Sandip,

Have you tried setting the ReturnedColorSpace?

http://www.mathworks.com/access/helpdesk/help/toolbox/imaq/returnedcolorspace.html

Mark