Hit-or-miss Transform
   HOME

TheInfoList



OR:

In
mathematical morphology Mathematical morphology (MM) is a theory and technique for the analysis and processing of Geometry, geometrical structures, based on set theory, lattice theory, topology, and random functions. MM is most commonly applied to digital images, but it ...
, hit-or-miss transform is an operation that detects a given configuration (or pattern) in a
binary image A binary image is a digital image that consists of pixels that can have one of exactly two colors, usually black and white. Each pixel is stored as a single bit — i.e. either a 0 or 1. A binary image can be stored in memory as a bitmap: a p ...
, using the morphological
erosion Erosion is the action of surface processes (such as Surface runoff, water flow or wind) that removes soil, Rock (geology), rock, or dissolved material from one location on the Earth's crust#Crust, Earth's crust and then sediment transport, tran ...
operator and a pair of disjoint
structuring element In mathematical morphology, a structuring element is a shape, used to probe or interact with a given image, with the purpose of drawing conclusions on how this shape fits or misses the shapes in the image. It is typically used in morphological oper ...
s. The result of the hit-or-miss transform is the set of positions where the first
structuring element In mathematical morphology, a structuring element is a shape, used to probe or interact with a given image, with the purpose of drawing conclusions on how this shape fits or misses the shapes in the image. It is typically used in morphological oper ...
fits in the foreground of the input image, and the second structuring element misses it completely.


Mathematical definition

In binary morphology, an image is viewed as a
subset In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
of a
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are ''Euclidean spaces ...
\mathbb^d or the integer grid \mathbb^d, for some dimension ''d''. Let us denote this space or grid by ''E''. A structuring element is a simple, pre-defined shape, represented as a binary image, used to probe another binary image, in morphological operations such as
erosion Erosion is the action of surface processes (such as Surface runoff, water flow or wind) that removes soil, Rock (geology), rock, or dissolved material from one location on the Earth's crust#Crust, Earth's crust and then sediment transport, tran ...
,
dilation wiktionary:dilation, Dilation (or dilatation) may refer to: Physiology or medicine * Cervical dilation, the widening of the cervix in childbirth, miscarriage etc. * Coronary dilation, or coronary reflex * Dilation and curettage, the opening of ...
,
opening Opening may refer to: Types of openings * Hole * A title sequence or opening credits * Grand opening of a business or other institution * Inauguration * Keynote * Opening sentence * Opening sequence * Opening statement, a beginning statemen ...
, and
closing Closing may refer to: Business and law * Closing (law), a closing argument, a summation * Closing (real estate), the final step in executing a real estate transaction * Closing (sales), the process of making a sale * Closing a business, the proc ...
. Let C and D be two structuring elements satisfying C\cap D=\emptyset. The pair (''C'',''D'') is sometimes called a ''composite structuring element''. The hit-or-miss transform of a given image ''A'' by ''B''=(''C'',''D'') is given by: ::A\odot B=(A\ominus C)\cap(A^c\ominus D), where A^c is the
set complement In set theory, the complement of a set , often denoted by A^c (or ), is the set of elements not in . When all elements in the universe, i.e. all elements under consideration, are considered to be members of a given set , the absolute complemen ...
of ''A''. That is, a point ''x'' in ''E'' belongs to the hit-or-miss transform output if ''C'' translated to ''x'' fits in ''A'', and ''D'' translated to ''x'' misses ''A'' (fits the background of ''A'').


Structuring elements

The hit-or-miss transform uses pairs of structuring elements that are disjoint. Here are four common structuring elements used in various morphological operations. Following structuring elements can be used to find different convex corner points in images.


Element 1

This mask identifies the bottom-left convex corner, with '1's indicating the corner and its surroundings, '0's representing the background, and 'X's as don't-care conditions. It is designed to match patterns where the corner pixel and the pixels directly adjacent form a specific configuration. This helps in locating the bottom-left convex corners in binary images. ----


Element 2

This mask identifies the top-left convex corner, with '1's indicating the corner and its surroundings, '0's representing the background, and 'X's as don't-care conditions. It is designed to match patterns where the corner pixel and the pixels directly adjacent form a specific configuration. This helps in locating the top-left convex corners in binary images. ----


Element 3

This mask detects the top-right convex corner, with a similar pattern of '1's for the corner and surroundings, '0's for the background, and 'X's as don't-care conditions. It is designed to match patterns where the corner pixel and the pixels directly adjacent form a specific configuration. This helps in locating the top-right convex corners in binary images. ----


Element 4

This mask targets the bottom-right convex corner, using '1's to mark the corner and its adjacent pixels, '0's for the background, and 'X's as don't-care conditions. It is designed to match patterns where the corner pixel and the pixels directly adjacent form a specific configuration. This helps in locating the bottom-right convex corners in binary images. After obtaining the locations of corners in each orientation, we can then simply OR(Logic OR) all these images together to get the final result showing the locations of all right angle convex corners in any orientation.


Some applications


Thinning

Let E=\mathbb^2, and consider the eight composite structuring elements, composed of: :C_1=\ and D_1=\, :C_2=\ and D_2=\ and the three rotations of each by 90°, 180°, and 270°. The corresponding composite structuring elements are denoted B_1,\ldots,B_8. For any ''i'' between 1 and 8, and any binary image ''X'', define ::X\otimes B_i=X\setminus (X\odot B_i), where \setminus denotes the set-theoretical difference. The thinning of an image ''A'' is obtained by cyclically iterating until convergence: :A\otimes B_1\otimes B_2\otimes\ldots\otimes B_8\otimes B_1\otimes B_2\otimes\ldots


Other applications

*
Pattern detection Pattern recognition is the task of assigning a class to an observation based on patterns extracted from data. While similar, pattern recognition (PR) is not to be confused with pattern machines (PM) which may possess PR capabilities but their pr ...
. By definition, the hit-or-miss transform indicates the positions where a certain pattern (characterized by the composite structuring element ''B'') occurs in the input image. *
Pruning Pruning is the selective removal of certain parts of a plant, such as branches, buds, or roots. It is practiced in horticulture (especially fruit tree pruning), arboriculture, and silviculture. The practice entails the targeted removal of di ...
. The hit-or-miss transform can be used to identify the end-points of a line to allow this line to be shrunk from each end to remove unwanted branches. * Computing the
Euler number Leonhard Euler ( ; ; ; 15 April 170718 September 1783) was a Swiss polymath who was active as a mathematician, physicist, astronomer, logician, geographer, and engineer. He founded the studies of graph theory and topology and made influential ...
.


Bibliography

* ''An Introduction to Morphological Image Processing'' by Edward R. Dougherty, {{ISBN, 0-8194-0845-X (1992) Mathematical morphology Digital geometry