Trademark recognition using the PDH shape descriptor

The paper presents the results of experiments, where trademark shapes were described using the PDH algorithm and recognized using the template matching approach. Those experiments were performed to verify some properties of the PDH shape descriptor in the presence of real contour object deformations.


Introduction
In the following subsections some results of experiments on the PDH algorithm for shape description are presented. Those experiments were performed to verify some properties of the PDH shape descriptor in the presence of contour object deformations.
The PDH method is a combination of two approaches widely explored by researchers -polar coordinates and histograms. The first on is used to calculate the distance from a particular point to all contour points. The second one is used to compute the number of particular distance values and make the description invariant to selected shape deformations, namely -to rotation, scaling and translation. Obviously, some additional steps are also performed.
The method was developed to recognize erythrocyte shapes extracted from the digital microscopic images [1] for automatic diagnosis of certain blood diseases, based on distortions in a cell shape.
In this paper the properties are explored for completely different kinds of objects. It was interesting, how the PDH works, when shapes are more dissimilar, and more affected by various distortions. Those conditions were satisfied by trademark shapes.

Trademark recognition
Trademarks are very common in our milieu nowadays. One can find them on packets, in advertising brochures, on the Internet. In many cases, the appearance of a particular trademark can significantly change our actions, e.g. decisions about consumption or purchasing of a particular article. A trademark can be deeply associated with a firm. The care for conditions of its usage by others is strictly connected with strategy and public image of a company.
Keeping in mind common character and importance (in an economic sense) of trademarks, many algorithms and systems for their automatic recognition are designed (developed) all the time. Identification of a new logo under registration is a popular example [2]. In this case we check whether the new trademark is similar to a previously registered one. In [3] this problem was extended to the case of partially modified trademark for fraudulent creation of a 'new' logo based on a popular registered one.
Obviously, some other applications of trademarks recognition can be mentioned -automatic calculation of the time of particular logo exposition during TV broadcast, document flow in a company, searching for exposition of a popular pictogram on the Internet, etc.

Origins of the PDH approach and similar solutions
The PDH (Point Distance Histogram) was proposed in [4] and is based on two solutions, very popular in image recognition -calculation of the polar coordinates of points and the histogram.
The first one is very common in recognition of shapes. The simplest approach is based on calculation of distances from all the points on the boundary to the centroid of an object. It is called a signature of objects or CDP (Centroidal Distance Profile, [5]). The UNL transform [6] is a slightly more sophisticated, but more efficient approach. In this method, the resultant coordinates are put into matrix, and the angular information is used, not only the distances.
The histogram is one of the most popular image characteristics in various applications, not only in its processing and recognition, but also in image retrieval. This popularity comes from the many desirable features of the histogram, which is simple, intuitive, and above all -provides useful information about an image.
Usually histogram is derived for grayscale image or RGB components [7], but its application for shapes has become more popular lately. An example is the EDH (Edge Direction Histogram) algorithm [8].
Two more advanced approaches are specially worth mentioning. They are in part similar to the PDH, used here. The first one is the DH (Distance Histogram) approach ( [9]),where the Euclidean distances are calculated from centroid to all Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 21/05/2022 01:21:35 U M C S Trademark recognition using the PDH shape descriptor 69 points within a shape (not only to boundary points). Each distance is normalized according to the highest value. This approach is rather simple, yet sufficient for example in Content Based Image Retrieval, based on shape. The second proposition is the PH (Polar Histogram) method ( [10]). It is very similar to the previous one, but the transformation to the polar coordinates is here exploited more.

Some properties and derivation of the PDH representation
The important novelty of the explored shape descriptor, except the way the combination of the polar coordinates and histogram is performed, is the possibility of unconstrained choice of the method of calculating the point, according to which the transformation is performed. When this decision is made, the point is denoted as O. This opportunity is important and desirable, because, as it turned out, in some cases, e.g. when the silhouette is strongly deformed, the traditional centre of gravity (so called centroid) is not sufficient [4].
It is desirable to incorporate the name of the method of calculating the origin of the transform into the name of the shape descriptor. For example, if the centroid (despite its disadvantages in especially difficult cases) is used, the whole name will be the centroid-PDH. In this paper, for simplicity, that case occurs. The centroid is calculated using the following formula: The next step is the conversion of the obtained real values into the nearest integers: again, i = 1, 2, ..., n. The elements in Θ i and Ρ i are now rearranged, according to the increasing values in Θ i . After that the elements in the vectors are denoted as θ j , ρ j Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 21/05/2022 01:21:35 U M C S (j = 1,2,...,n), and the new vectors Θ j , Ρ j . If some elements in Θ j are equal, only the one with the highest corresponding value Ρ j is selected. That gives in the end the vector with at most 360 elements, one for each integer angle. For further work, only the vector of radii is needed. We denote it as Ρ k , where k = 1,2,...,m and m is the number of elements in Ρ k (m is less or equal to 360). Now, the normalization of elements in vector Ρ k is performed: The elements in Ρ k are assigned to bins in histogram (ρ k to l k ): again, k = 1,2,...,m. The possible bin index ranges from 1 to r, where r is a predetermined number of bins. It can influence the behavior of the descriptor. If it is too small, the obtained histogram will not be able to distinguish dissimilar shapes. If it is too high, the influence of noise on the resultant description will be more significant.
In the experiments here r equal to 50 was assumed.
The next step is the normalization of the values in bins, according to the highest one: The final histogram representing a shape can be formally rewritten as a function h(l k ): Various measures can be applied for matching the achieved representations, e.g. L 0 , L 1 , L 2 , Matusita ( [11]). In the experiments described in the next section the L 2 metric was used:

Experimental results
Three separate experiments were performed to check the properties of the centroid-PDH shape descriptor. The first one explored the unambiguity of the descriptor, when representing various shapes. It is known that in some cases histogram can be identical for completely different objects. Yet, it is less probable in real shapes than in theory, because natural shapes are much more complicated. However, this problem was worth exploring.
The second experiment explored the invariance of the representation to rotation, and the third one -to scaling. In each case, deformations were performed on shapes represented in bitmaps, therefore additionally the influence of noise into the coordinates being extracted during the process of vectorisation was noticeable.
In each of the three experiments, the base was composed of 50 various trademark shapes, represented in bitmaps of size 100 by 100 pixels. One object represented one class, which is typical of the template matching approach. Some examples of base trademarks are depicted in Figure 1. The test objects in the first experiment were the same as those in the database. As expected, 100% recognition rate was achieved, which confirms the property of unambiguity of the centroid-PDH descriptor in this simple case. The descriptions obtained for several objects are depicted in Figure 2, to show that despite using the histogram within the algorithm, representations are different.   The last experiment explored the influence of scaling on the recognition results. This time, two separate values of deformation were utilized. At first the test objects were twice diminished, then twice enlarged. That gave 100 instances of test objects. A few of them are presented in Fig. 4. This time the recognition rate was equal to 91%. As it turned out, the reduction in size was much more difficult to handle (8 incorrect matches) than enlargement (only 1). It can be explained by small sizes of the resulting objects. Part of an image with the test trademark was only 50 by 50 pixels in size. Therefore, the results can be nevertheless assumed as satisfactory.

Conclusions
Three distinct experiments were performed. Firstly, the ability for unambiguous description was tested. The recognition rate was equal to 100%, which implies that the PDH is an unambiguous descriptor. The second experiment explored the invariance to noise, and the last one -to scaling. In each case, the deformations were performed on the real bit-maps, therefore the additional noise and other distortions affected the contours. For rotation the RR was 96% and for scaling -91%. It turned out that the scale reduction was much more difficult to handle (8 trademarks recognized incorrectly), than enlargement, Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 21/05/2022 01:21:35 U M C S the reason for which is the small size of resulting test objects (even smaller than 20 pixels). Therefore the achieved results can be considered very promising.