hi my task is i have to split a video into frames and then the frames should color procssed from RGB to CMY and grouped up to create a negative videp...im getting errors can anyone help me ..??
Show older comments
this is my code
vidobj = VideoReader('viptraffic.avi');
video = read(vidobj);
frameRate = get(vidobj,'FrameRate');
numFrames=vidobj.NumberOfFrames;
n=numFrames;
myVideo=VideoWriter('negative6.avi');
myVideo.FrameRate=30;
open(myVideo);
for i=1:n
F(i)=getframe;
img = frame2im(F);
img = im2double(img);
r=img(:,:,1);
g=img(:,:,2);
b=img(:,:,3);
c=1-r;
m=1-g;
y=1-b;
new_image=cat(3,c,m,y);
writeVideo(myVideo,new_image);
end
close(myVideo);
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!