Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
luma
Posts:
11
Registered:
11/17/12
|
|
Re: Display only red channel of a video
Posted:
Nov 21, 2012 5:10 PM
|
|
"heider" wrote in message <k8j7qr$5ep$1@newscl01ah.mathworks.com>... > I'm wondering how to process and display only the red channel of a video?
Hello I think at the first step ,you need to convert the video to images and then display the image. I wish this code help you for convert the video to images and then it is easy to display red channel only
mov=mmreader('E:\Matlab\bin\seq3\3.avi'); frame=read(mov); numFrames=get(mov) fnum1=get(mov,'NumberOfFrames')
for frame1=1:fnum1 if frame1<=9 & frame1>=1 num_Frame = ['00',num2str(frame1)]; elseif frame1 <= 99 & frame1 >=10 num_Frame = ['0',num2str(frame1)]; else num_Frame = num2str(frame1); end FrameName = strcat('E:\Matlab\bin\seq3\seq',int2str( frame1), '.jpg'); avi(frame1).cdata=frame(:,:,:,frame1); avi(frame1).colormap=[]; imwrite(avi(frame1).cdata,FrameName); end
to read the red channel x=imread('image path.jpg') imshow(x(:,:,1))
with my best wishes
|
|
|
|