{'fraction_non_alphanumeric': 0.015103338632750398, 'fraction_numerical': 0.0, 'mean_word_length': 5.591623036649215, '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}}
Efficient convolution based algorithms for erosion and dilation

Morphological operations based on primitives such as dilation and erosion are slow to compute in practice especially for large structuring elements. For direct implementation of these primitives, the computing time grows exponentially with the size of the structuring element used. The latter renders these implementations impractical for large structuring elements due to a rapid increase in computation time. There have been attempts in the literature to develop fast algorithms for implementation of morphological primitive operations. These are mainly restricted to convex and often symmetric structuring element shapes. We have developed a fast convolution-based approach for implementing morphological erosion and dilation and other operations such as opening and closing based on these primitives. The major advantages of this approach are: (i) it can use any structuring element shape including non-convex cases and (ii) it is very fast. This paper briefly introduces the approach and presents timing results for dilation and erosion using three different implementations of the approach. These results are also compared against a direct (brute force) implementation of the primitives.