How to make a video in which every alternate frame is gray?

15 vues (au cours des 30 derniers jours)
Febin Benjamin
Febin Benjamin le 6 Sep 2013
I have extracted frames from a video(e.g. Rhino.avi). Now I have to convert the alternate images among the extracted frames to grayscale and then write the frames back into a video file. So when the new video is played its every alternate frame would be in grayscale.
  1 commentaire
Doug Hull
Doug Hull le 6 Sep 2013
What part are you having trouble with?
I think you need to be able to read a given frame, convert a frame to gray, then store it back in the file. What format do you want out, RGB where the RGB just happens to look gray? You need to give details of the specific problem that you are having so we can help you more effectively.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 6 Sep 2013
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_extract_frames_from_a_video_file.3F Then, at the appropriate place, convert the image to 3D grayscale before saving.
grayImage = rgb2gray(colorFrame);
grayFrame = cat(3, grayImage, grayImage, grayImage);
% Then write out grayFrame.

Plus de réponses (0)

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by