Webcam Captures 7 color (rainbow) display not RGB image
1 view (last 30 days)
Show older comments
Hi Everyone, I have to use webcam in a video processing project but webcam code that is given below is not working properly on my PC. while it is working on someone others PC. Both of us using MATLAB 2013. I have search a lot but not beneficial. Please help if someone have solution.
Code:
close all
clear all
clc
imaqhwinfo('winvideo',1);
vid = videoinput('winvideo',1,'RGB24_320x240');
% set(vid, 'SelectedSourceName', 'input1');
% src_obj = getselectedsource(vid);
% get(src_obj);
preview(vid);
start(vid);
frame = getsnapshot(vid);
image(frame);
%set(vid,'ReturnedColorSpace','RGB');
Output:
Captured image is attached. Please find it.
Thanks in Advance,
Regards,
Ahmer Malik
2 Comments
Image Analyst
on 7 Mar 2015
Captured image is NOT attached. It looks like it should work. Are you sure you're using an RGB adapter and not a YUV or YCbCr adapter?
Answers (1)
Image Analyst
on 7 Mar 2015
It looks like your camera is programmed to be outputting some kind of test pattern. I'd consult the manual or manufacturer to turn that off. The manufacturer will provide some kind of software to run the camera. Make sure you can get a live image of something other than that test pattern in the manufacturer's software first before you try it in MATLAB.
2 Comments
Image Analyst
on 7 Mar 2015
Maybe your RGB24_320x240 adapter is corrupted for some reason. Try a different adapter, like RGB24_640x480 or RGB32_320x240 or something.
See Also
Categories
Find more on Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!