Effacer les filtres
Effacer les filtres

Finding sumpixel value (in graph) for a video which has 514 frames.

2 vues (au cours des 30 derniers jours)
THAKIF ILMAN
THAKIF ILMAN le 26 Oct 2020
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.

Réponses (1)

Pratyush Roy
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.

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by