We consider the problem of distinguishing between two hand-written alphabets "C" and "T" using image processing and pattern recognition techniques. Figure 1 shows an input image X. Let and denote integers corresponding to the and coordinates of a pixel. The value of a pixel is represented by . Here, we take the top-left pixel as the origin of the coordinates.
Following the procedure below, we extract some features to quantify the properties of the input image. First, we apply a size linear filter. Let denote the output value of the filter for a pixel , which is defined as
where is the array that contains the coefficients of the filter ( and are integer values).
Answer the following questions.
(1) We apply the linear filter L illustrated in Figure 2 to the image X. Compute the output value for the pixel P in Figure 1.
Next, we reduce the resolution of the filtered image to pixels and binarize its values. Specifically, the converted image is represented as . Figure 3 shows two examples of binary images Y1 and Y2. We extract features called "image moments" from them. The image moment of order is defined as . For example, we can see that corresponds to the [ (A) ] of the figure in the binary image, and corresponds to its [ (B) ].
(2) Fill in the blanks (A) and (B) with appropriate words. Also, compute the image moments and of Y1 and Y2 respectively.
Taking a pair of two features extracted by the above procedure as an input pattern, we classify this into one of two classes ("C" or "T"). Table 1 lists the values of features of four "C" and four "T" training examples. Also, Figure 4 shows their plots on a two-dimensional graph.
(3) We classify an input pattern using the nearest neighbor (-NN) method. Namely, a pattern is classified into the class that has the largest number of samples among its nearest training examples. Suppose we have a new pattern of an input image with the features . Classify this pattern into "C" or "T" using the -NN method and describe the reason when and , respectively. Distance between any two patterns is defined in terms of the Euclidean distance.
(4) As an alternative classification algorithm, we classify an input pattern into the class where the mean of its training examples is nearest to the pattern in terms of the Euclidean distance. Show the equation that defines the boundary of discrimination, and the methodology of discrimination using it. Also, classify the pattern using the methodology.
(5) Compare the two algorithms described at (3) and (4) and discuss their advantages respectively.