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

1 visualización (últimos 30 días)
THAKIF ILMAN
THAKIF ILMAN el 26 de Oct. de 2020
Respondida: Pratyush Roy el 29 de Oct. de 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.

Respuestas (1)

Pratyush Roy
Pratyush Roy el 29 de Oct. de 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.

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by