From: Afraz on
Hey everyone, I am new to the Image aquisition toolbox in matlab. I am having a problem while trying to aquire image frames using a webcam.

Using the Imaqtool I am able to aquire and save image frames, and the image frames look fine. However I am trying to do some real-time video processing using simulink, but the video stream appears to be discoloured. I was just testing(as i'm new to simulink) a "From video device" block connected to a "To video display" block.

If I preview the image aquisition in the "From video device" block, the video stream looks fine, and is coloured. However when I run simulink with the "To video display" block the resulting video feed is discoloured. The image is a mixture of pink and grey for some reason.

I have tested using a different camera, but the result is the same.

If anyone has an idea about whats going on, please let me know, help will be appreciated.

Thankyou

Afraz
From: Shankar on
Hi Afraz,

The preview window converts the image from the camera to RGB format. I presume your camera returns in YUV format and that is why you are noticing the pink and grey discoloration. The Simulink block From Video Device returns in the default colorspace that the webcam is set to. The VIP blockset consists of a "Color Space Conversion" block. Type "vipconversions" in MATLAB command line and you will find that block.

You need to connect the output of From Video Device block to Color Space Conversion block before connecting to the To Video Display block. In the color space conversion block, change the settings to output RGB out of the block (Y'CbCr to R'G'B').

Let me know if that worked.

Thanks
Shankar

"Afraz " <afrazmamoon(a)googlemail.com> wrote in message <hri4bh$r44$1(a)fred.mathworks.com>...
> Hey everyone, I am new to the Image aquisition toolbox in matlab. I am having a problem while trying to aquire image frames using a webcam.
>
> Using the Imaqtool I am able to aquire and save image frames, and the image frames look fine. However I am trying to do some real-time video processing using simulink, but the video stream appears to be discoloured. I was just testing(as i'm new to simulink) a "From video device" block connected to a "To video display" block.
>
> If I preview the image aquisition in the "From video device" block, the video stream looks fine, and is coloured. However when I run simulink with the "To video display" block the resulting video feed is discoloured. The image is a mixture of pink and grey for some reason.
>
> I have tested using a different camera, but the result is the same.
>
> If anyone has an idea about whats going on, please let me know, help will be appreciated.
>
> Thankyou
>
> Afraz