4

I want an histogram of the brightness of a video.

I define brightness of an image as the sum of RGB values of all its pixels, divided by 3, divided by the number of pixels.

The program would calculate this brightness value for each frame of the video, then draw an histogram that could look like this:

Brightness                 __
 ^                 _      /
 |                / \    /      
 |__             /   \__/           
 |  \___        /                 
 |      \______/                     
 |                           
 +---------------------------> Time
 Start                      End

Free, or at least free trial, ideally open source.

1

Step 1: Split video into frames

Step 2: As you know, there are many definitions of brightness:

You can compute the brightness in any language e.g. in Matlab:

[X,map] = imread('corn.tif'); % Read image
Im = ind2rgb(X,map); % convert the data in X to RGB.
brightness = mean2(Im); % using your formula.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.