MATLAB: Finding a horizontal line for maximum pixels in a video

image processingmatlab coderplottingvideo analysisvideo processing

Hey guys,
I have this video of lightning strikes that consists of 1300 frames. I would like to determine a row in the video where it has the maximum luminous pixels. I also need to plot it vs time. I know how to determine it for a picture but finding it difficult to do for a video. I have already done plotting for maximum and average luminosity vs time for the whole 512×512 resolution successive frames of each video.
Any sort of help is appreciated. Even if there is a demo out there, that would be great.

Best Answer

Use mean and then max. So for each frame image, assuming it's a grayscale image:
verticalProfile = mean(grayImage, 2);
[brightestLineValue, lineNumberOfBrightestLine] = max(verticalProfile);