How to create a video from grayscale and rgb images?
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MatlabUser
il 2 Gen 2023
Commentato: MatlabUser
il 3 Gen 2023
I have e.g., 20 grayscale frames and 20 RGB color images.
I would like to make a video that has in each frame one grayscale image in the left and one RGB color image in the right.
I am using this code but I get all the frames are black :
vid = VideoWriter(['./video.avi']);
vid.Quality = 100;
vid.FrameRate = 10;
open(vid);
for i = 1: 20
imout = [ cat(3,grayImg(:, :,i),grayImg(:, :, i),grayImg(:, :, i)) zeros( size(grayImg,1), 10, 3) (RGBImg(:, :, :,i)) ];
writeVideo( vid, imout);
end
close(vid);
any help will be appreciated :)
0 Commenti
Risposta accettata
Image Analyst
il 2 Gen 2023
Modificato: Image Analyst
il 2 Gen 2023
3 Commenti
Image Analyst
il 2 Gen 2023
Modificato: Image Analyst
il 2 Gen 2023
grayImg is not defined. You need to define it. And when you do this:
for i = 1: 20
imout = [ cat(3,grayImg(:, :,i),grayImg(:, :, i),grayImg(:, :, i)) zeros( size(grayImg,1), 10, 3) (RGBImg(:, :, :,i)) ];
you're assuming grayImg will be a hyperspectral image with 20 color channels, which it's not.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!