This is a follow up article on video boundary detection part 2, gradual transition detection.

In part 2, I’ve covered the detection of gradual transition detection. The twin-comparison method is effective in detecting graudual transitions, but it cannot determine which type of gradual transition it is.

This article introduces another method for video boundary detection, Standard Deviation of Pixel Intensities. This method is effective for detecting fade in/fade out transitions.

A sample sequence of fade out transition frames is as below,

This transition is produced by decreasing of pixel intensities over time, until the screen goes completely black. Fade in is the opposite of fade out.

The scaling of pixel intensities of fade in/out transitions is visible in the standard deviation of the pixel intensities. A plot of the standard deviation of pixel intensities for one of the test videos is as below,

The down lines and up lines correspond to fade out and fade in respectively. The zero value corresponds to the frame that is completely black.

Therefore, the fade in / fade out detection problem is equivalent to detection of the down lines and up lines.

Part 1 of video detection has covered the conversion of RGB channels to form an intensity component. The standard deviation calculation is a common mathematical computation and is not covered here. (But you can just google to find tons of materials about it.)

Use it with Twin-Comparison Method

The standard deviation of intensities can be used together with the twin-comparison method to better detect the fade in/fade out transition.

The idea is to use twin-comparison method to detect the gradual transitions, and then use standard deviation of pixel intensity to determine if the gradual transition is fade in/fade out.

A sample plot of the instensity histogram difference (left), accumulated intensitiy histogram difference and the standard deviation of pixel intensities (scaled and overlapped) (right)is as below,

The right graph shows the twin-comparison method can detect the transition effectively, and the standard deviation of pixel intensities method can be applied to determine it’s a fade in/fade out transition.

Side note: First Draft on Apr 15 2011.

## 1 thought on “Video Boundary Detection Part 3–Fade In and Fade Out”

1. safika says:

Very useful content.But images and codes are missing. it would be grateful if u can solve the issue.