
Object Recognition System using Template Matching Based on Signature and Principal Component Analysis Inad A. Aljarrah Ahmed S. Ghorab Ismail M. Khater Jordan University of Science & University College of Applied Birzeit University, Birzeit, Technology, Irbid, Jordan Sciences, Gaza, Palestine. West Bank, Palestine [email protected] [email protected] [email protected] ABSTRACT machine understandable format. This is achieved by extracting features from In this paper an object recognition system images, and then the features are used to using template matching is implemented. classify and recognize objects. The Since objects are represented by either an process is completed by comparing these external or internal descriptors, a features with previously stored and combination of using signature, principal known features of different objects. component analysis and color is used. The Template matching is considered among system efficacy is measured by applying it to recognize an image of a chessboard with a the main techniques that are used to set of objects (pieces). The output of the accomplish this approach [1, 2, 3]. system includes the pieces names, locations Object recognition systems are and color. The signature feature is used to employed in many applications, such as distinguish the pieces types based on their industry and assembly lines, robotics, external shape but when it falls short, the object clustering, object tracking, face principal components analysis is used recognition and game playing [2, 4, 5]. instead. The object color is also obtained. All of these applications require a The matching between features is carried out computer vision program able to based on Euclidean distance metric .The recognize different types of objects as proposed system is implemented, trained, explained in [2, 3, 4]. Machine vision is and tested using Matlab based on a set of collected samples representing chessboard also needed for robotics to automatically images. The simulation results show the identify different chess pieces on a effectiveness of the proposed method in chessboard and spot their location. A recognizing the pieces locations, types, and Chinese chessboard is reconstructed in color. [6] based on binarized Gabor filter and Hough transform. KEYWORDS Template matching algorithms tend to use features extracted from boundary of Template Matching, Object Recognition, objects for recognition purposes [7]. In Signature, PCA, Euclidean Distance. some cases the method works very well, but in other cases where there is either a 1 INTRODUCTION distortion in the boundary or an occlusion to parts of the object, the A picture is worth a thousand words, process fails. In this work, the signature from human beings perspective; the feature is used as a boundary description same idea is true for machines. On the for object, but for some conditions when other hand, machines unlike humans it fails, a Principal Components Analysis need the translation of pictures into a (PCA) is used as an alternative to help build a recognition system that is both finding the location of a sub-image (i.e. computationally efficient and highly template) inside another big image. It is accurate. For the purpose of testing the conceptually a simple process. We need proposed approach, a chessboard that to match a template to an image, where contains chess pieces is used. the template is a sub-image that contains The input to the system consists of a 2-D the shape we are trying to find. [8, 9, 10, chessboard images, each image contains 11]. a set of objects (chess pieces); these In this work we have compared the pieces are arranged over the chessboard features extracted from the boundary of in different locations. In a chess game objects with the previously stored and there are two opponents each of the known features for recognition purposes. opponents have a set of pieces that differ Template matching is considered among from the pieces of the other opponent the main techniques that are used to only in color, here we have white and accomplish this approach [1, 2, 3], black pieces; the chessboard itself is a which then can be called features board that is divided into 8×8 squares matching instead of template matching. (blocks), so we have 8 rows and 8 Accordingly, we measure the Euclidian columns, the rows are numbered with distance between the object features and decimal numbers 1, 2, 3, …, 8 and the the stored features (which may be columns are labeled with alphabetical considered as the templates) and characters A, B, C, …, H. The squares calculate the matching between the are colored with two colors as a object feature and the stored features background for the board; each square is (templates). colored with a color that differs from the The procedure is then repeated for all color of its adjacent, and with the same extracted objects in the entire image, color of the square on its diagonal. A every object in the image is compared system that is capable of describing the with the stored templates, when a match type, the location, and the color of the is found, it is deemed to be recognized. pieces in the chessboard have been designed and built. 3 OVERALL SYSTEM SCHEME The rest of this paper is prepared as follows: In section II a definition of the The general block diagram that describes template matching has been stated, in the operation of the online system is section III the overall system scheme has shown in Figure (1).The input to the been presented. The case study of system is an image, and the output is a chessboard recognition system will be description of the objects found in the shown in section IV; in addition, this input image. In the image pre-processing section shows how the system has been step the region of interest (ROI) is trained. Finally, section V illustrates the determined, then, the image converted experimental results and the discussion. from RGB to gray scale image then to binary image. 2 TEMPLATE MATCHING In the features extraction step, all features were extracted for all the objects Template matching is an essential task that have been obtained from the that frequently occurs in image analysis previous stage, and then saved as a .mat applications. It is the procedure of file for future using. image (i.e. internal descriptor), so both descriptors have been combined. The location is determined by dividing the chessboard itself into 64 blocks as shown in Figure (8), so we have 8 rows and 8 columns, the rows are numbered Figure 1: A general block diagram of the system. with decimal numbers 1, 2, 3, …, 8 and the columns are labeled with The gotten features are then matched alphabetical characters A, B, C, …, H. with the features of the objects that have the location of the object is defined by been saved before (templates). In order its column and its row, for instance (A1, to do that, the Euclidean distances H3, G4,..). between the saved features and the The color of the chess piece is obtained features have been calculated determined using a simple method of and used to decide whether the object is calculating the percentage of the black recognized or not. pixels in the object as discussed in Finally, in the last step, the system section (4.4). classifies the objects and put a description according to the object types. 4.2 Extracting the Signature Feature For more convenience, a case study of chessboard recognition system has been The signature is a one-dimensional adopted to implement this methodology. function, that can be extracted by several methods, we have used a plot of the 4 A CASE STUDY: CHESSBOARD distance from the centroid to the RECOGNITION SYSTEM boundary of the object as a function of angle[15]; as shown in Figure (2); this 4.1 An Overview reduces the dimensionality of the boundary from 2-D to an easy 1-D In order to distinguish chessboard signature function. objects, good features or a set of features are needed. The signature feature was one of the most powerful features used for chessboard recognition system, it can be used alone to recognize the chessmen (chess pieces). When the signature comes to grief, the Figure 2: a) The binary image of the white rook, PCA (Principal Component Analysis) b) The external boundary of the piece and the [12, 13, 14] is used; in this case PCA is centroid point, c) Three samples of the signature considered as an additional feature that values at three different angels. supports the signature feature when it fails in recognizing the object with a The signature feature is size variant and high percentage of accuracy; this is relies on scaling, so; the signature values because the signature of the object is an have been normalized; the normalization external descriptor which will be badly is done by dividing the signature values affected by any noise, so PCA is adopted by its maximum value. There is no need which will describe the object as a whole to find all the points of the signature; just a point every 15 degrees was obtained; yielding 23 points due to ignoring 0 and [3, 12]. Often, its operation can be 360 degrees points. These points were believed as revealing the internal saved for each object as a vector feature structure of the data in a way which best (template) that will be used in the next explains the variance in the data. If a steps for recognition and matching. multivariate dataset is visualized as a set The signature is also rotation variant; of coordinates in a high-dimensional that means it would look different from data space (1 axis per variable), PCA different angles except if it is normalized supplies the user with a lower- for that by starting from the robust point dimensional picture, a "shadow" of this (angle), so we have started from angle 0 object when viewed from its most to angle 360 counter clockwise.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-