Hello
My name is Boris, Recently i start to learning about video processing.
I wrote a simple code in Matlab that convert video file from "RGB" to "Grayscale",
But when i trying to Play converted file by using "implay" function i get errors about last line of the code.
I hope someone can guide me to solve the errors
I use MATLAB 2008b
The Class of the video file is : uint8
Code:
-------------------------------------------------------------------------------------
clc
clear
close all
rgb = 3;
gray = 1;
my_video = mmreader('CIMG1232.avi');
frameRate = get(my_video,'FrameRate');
nframes = get(my_video, 'NumberOfFrames');
I = read(my_video, 1);
video_p = zeros([size(I,1) size(I,2) gray nframes], class(I));
for i = 1 : nframes
singleFrame = rgb2gray(read(my_video, i));
video_p
,:,:,i) = singleFrame;
end;
implay(video_p, frameRate);
----------------------------------------------------------------------------------------
Thanks in advance