In this recipe, you will learn how to use the morphological compound operation, hit-or-miss-transform, to find patterns from a binary image. Hit-or-miss transform is a morphological operation that is used to detect a given pattern in a binary image. It uses a pair of disjointed structuring elements to define the pattern to be matched and the morphological erosion operator to implement the pattern matching. The hit-or-miss transform returns a binary image as output in which only those sets of positions are non-zero where the first SE matches and the second SE completely misses the foreground, respectively, in the input binary image.
Morphological pattern matching
Getting ready
In this recipe, we will use an image of a script...