Finding sumpixel value (in graph) for a video which has 514 frames.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a video for detecting fire which consist of 514 frames. I need to get all frame's sumpixel value in graph. How can i get the sumpixel values of all frame in 1 graph? The picture is the coding that i have but it only gives particular frame.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/392253/image.jpeg)
0 commentaires
Réponses (1)
Pratyush Roy
le 29 Oct 2020
Hi Thakif,
Appending the sumpixel value for every frame in an empty array using for loop and plotting the array outside the loop might be helpful.
The code snippet for obtaining the plot is given below:
clc
clear all;
close all hidden;
arr = [];
for i=1:frameNum % Here frameNum refers to the total number of video frames
Im1 = imread('path-to-ith-frame');
rchannel =Im1(:,:,1);
gchannel =Im1(:,:,2);
bchannel =Im1(:,:,3);
sumpixelg = sum(gchannel);
arr = [arr;sumpixelg];
end
plot(arr');
Hope this helps!
Regards,
Pratyush.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!