{'fraction_non_alphanumeric': 0.022964509394572025, 'fraction_numerical': 0.0, 'mean_word_length': 4.847560975609756, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An efficient binary image activity detector based on connected components

Activity detection on binary images can be a useful part of image processing for detecting noise, texture, printed text, or dithering. We present an image activity detector based on computing a density of selected connected components (CCs). Connectedness is a useful property because it is present in individual printed letters, lines, and edges. In contrast, salt-and-pepper noise and dithering are typically composed of a large number of disconnected patterns. By filtering the CCs based on size, we can measure different kinds of activities, and segment or filter the image accordingly. The activity detector is extremely efficient and can be run in a fraction of the time it takes to compute a run-length encoding version of the image. As an example, we built a noise removal filter based on the density of CCs, which is both faster and better than a conventional median filter.