Masks method

Different methods are used to recognize images. One of the simplest methods is the masks method. The mask method consists in comparing the recognized image with several specially selected images - masks, that is, in finding the mask with which the image is most similar. The magnitude characterizing the similarity is measured by projecting the recognized image onto a mask-mask, which is an image applied to a transparent information carrier, and measuring the total light flux passed through the mask. In this case, the brightness of the recognized image at each point of the mask plane is multiplied by the transparency coefficient of the mask at this point, and these products are summed over the entire plane. Consequently, the total luminous flux simulates functions that characterize the brightness of the image and the transparency of the mask. Sometimes recognition is preceded by discretization of the image.

Different methods are used to recognize images. One of the simplest methods is the masks method

In addition to the above, the method of masks is also a method of recognition, based on the calculation of scalar products of a recognizable signal with some fixed vectors and on finding the vector that gives the greatest value of this work. The calculation of scalar products is realized by means of computer technology. Although it is believed that the method of masks is applicable only for the recognition of simple images, the mask method is effective enough to recognize, for example, print texts of a fixed font in various reading machines.

For example, the mask method can be used in the face detection task. The most popular approach today is the detection of individuals using Haar cascades. Cascades Haar - sets of masks, rectangular windows, each of which is an image with a certain black and white pattern. Such masks can be an unlimited variety. In this method, masks are superimposed on different parts of the frame, and with this overlay, the program determines if there is a face. Applying a mask to a specific part of the frame gives a numerical value - the result of the convolution of the mask with the frame: the program adds the brightness of all the pixels of the image that were caught when applied to the white part of the mask, and also the brightness of all the pixels that fall into the black part of the mask, then calculates the difference of these values. The result of convolution is compared with the threshold value. The popularity of this approach is determined by the fact that the convolution is calculated very quickly and simply - it is enough to perform only three operations for each rectangular element of the mask.

Tools