drothlis/stb-tester — pull request #82 by abaharna (2014-01-15 18:39:33+00:00)
Title: Adds stbt function `is_black_screen()` to detect a black screen

This adds a new function `stbt.is_black_screen()` to detect the presence of a black screen in a video frame. It converts the video frame to grayscale, applies a binary threshold with an optional mask, and then checks that the maximum intensity value is zero. It returns `True` if it detects a black screen and `False` otherwise.

Most of the logic was copied from code in the existing test `test_using_frames_to_measure_black_screen` added in commit c96503e. However, this version adds an optional image `mask` as well as making the threshold value configurable.