Prev: Meshgrid a triangular domain
Next: MATLAB and Linux: incorrect characters displayed by latex interpreter in figures
From: Lautaro Carmona on 12 Feb 2010 00:37 "deepak " <deepakj20(a)gmail.com> wrote in message <hbh0ar$rs4$1(a)fred.mathworks.com>... > hello everyone... i've been using a webcam to get the frames from my video.. unfortunately the adaptor takes only the yuy2 format only... but the cam can support rgb too... i'm in need of a function that converts yuy2 to rgb images... kindly post your replies... also, i'm in need of the information about YUY2 format... > thanks in advance... I recently had the same problem, my webcam takes only the YUY2 format... I solved this problem doing this: %1st you set the camera to use. %'camera' is the DeviceID of your camera. vinfo = imaqhwinfo('winvideo',camera); %Then you set the video object 'vid', where 'camera' is the DeviceID of your camera. %'format' is the index which specifies one of the YUY2 formats of your camera. vid = videoinput('winvideo',camera,vinfo.SupportedFormats{format}); %Finally, you set the ReturnedColorSpace as RGB! set(vid,'ReturnedColorSpace','rgb'); %<----- This is the command!!!! Hope It Works!!!!! Lautaro Carmona
From: Gabi Teodoru on 12 Feb 2010 01:57
Hi, I referenced your message on my yuy2 to rgb converter M-file page (http://www.mathworks.com/matlabcentral/fileexchange/26249-yuy2-to-rgb-converter). "Lautaro Carmona" <lcarmona(a)alu.itba.edu.ar> wrote in message <hl2pe0$2jq$1(a)fred.mathworks.com>... > "deepak " <deepakj20(a)gmail.com> wrote in message <hbh0ar$rs4$1(a)fred.mathworks.com>... > > hello everyone... i've been using a webcam to get the frames from my video.. unfortunately the adaptor takes only the yuy2 format only... but the cam can support rgb too... i'm in need of a function that converts yuy2 to rgb images... kindly post your replies... also, i'm in need of the information about YUY2 format... > > thanks in advance... > > I recently had the same problem, my webcam takes only the YUY2 format... > I solved this problem doing this: > > %1st you set the camera to use. > %'camera' is the DeviceID of your camera. > > vinfo = imaqhwinfo('winvideo',camera); > > > %Then you set the video object 'vid', where 'camera' is the DeviceID of your camera. > %'format' is the index which specifies one of the YUY2 formats of your camera. > > vid = videoinput('winvideo',camera,vinfo.SupportedFormats{format}); > > %Finally, you set the ReturnedColorSpace as RGB! > > set(vid,'ReturnedColorSpace','rgb'); %<----- This is the command!!!! > > > > Hope It Works!!!!! > > > Lautaro Carmona |