I am trying to perform some color video operations in MATLAB, however I have to face two problems:
I get an error when converting color video to black and white video. I mean, I need to convert the color video to black and white video and write it back to the .avi file
How can I perform some operation (say, defining borders) on grayscale frames (extracted from a color video), and then record the edge detection result in .avi format?
My incomplete code (which consists of color format conversion) looks like this:
vid = VideoReader('Big_buck_bunny_480p_Cut.avi');
numImgs = get(vid, 'NumberOfFrames');
frames = read(vid);
for i=1:numImgs
frames(:,:,:,i)=rgb2gray(frames(:,:,:,i));
end
Any pointer to fix these two issues?
user3402601