How to add the format to Image acquisition toolbox?

4 views (last 30 days)
Hello, every one.
I have a question about my code. There is something wrong when I coding the example from image acquisition.
% Access an image acquisition device.
vidobj = videoinput('winvideo', 1, 'RGB24_320X240');
end
but my computer shows that:
The FORMAT specified is not supported by this device.
Because when I debug
info=imaqhwinfo('winvideo');
info.DeviceInfo.SupportedFormats;
The lists of SupportedFormats do not include RGB, so what can I do to add RGB into this?
Thanks for your kindness.
Hang Yang

Accepted Answer

Walter Roberson
Walter Roberson on 10 Sep 2017
Specify one of the color formats that the device supports. But then specify 'ReturnedColorSpace', 'rgb'
  2 Comments
Y
Y on 10 Sep 2017
Edited: Walter Roberson on 10 Sep 2017
Thanks a lot.
info=imaqhwinfo('winvideo');
vid=videoinput('winvideo',1,'YUY2_800x600');
vidReturnedColorspace='rgb';% originally it was ycrcb
img=getsnapshot(vid);
I have still one question about that.
In the workplace,i find the size of img =600x800x3 unit8, why originally I set 800x600, now it reverse, I have meet this problem several times.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!