Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Display only red channel of a video
Replies: 1   Last Post: Nov 21, 2012 5:10 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
luma

Posts: 11
Registered: 11/17/12
Re: Display only red channel of a video
Posted: Nov 21, 2012 5:10 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.