A Shape Based Image Search Technique

This paper describes an interactive application we have developed based on shaped-based image retrieval technique. The key concepts described in the project are, i)matching of images based on contour matching; ii)matching of images based on edge matching; iii)matching of images based on pixel matching of colours. Further, the application facilitates the matching of images invariant of transformations like i) translation ; ii) rotation; iii) scaling. The key factor of the system is, the system shows the percentage unmatched of the image uploaded with respect to the images already existing in the database graphically, whereas, the integrity of the system lies on the unique matching techniques used for optimum result. This increases the accuracy of the system. For example, when a user uploads an image say, an image of a mango leaf, then the application shows all mango leaves present in the database as well other leaves matching the colour and shape of the mango leaf uploaded. Keywords—shape-based image retrieval; contour matching; edge matching; pixel matching I. MOTIVATION Humans can often recognize objects using shape information alone. This has proven to be a challenging task for computer vision systems. One of the main difficulties is, developing representations that can effectively capture important shape variations. We want to compare different objects such as leaves of a tree and to detect two different leaves. The computational complexity of these tasks and the recognition accuracy obtained are highly dependent on the choice of a shape representation and comparison among leaves of various shapes. I


I. MOTIVATION
Humans can often recognize objects using shape information alone. This has proven to be a challenging task for computer vision systems. One of the main difficulties is, developing representations that can effectively capture important shape variations. We want to compare different objects such as leaves of a tree and to detect two different leaves. The computational complexity of these tasks and the recognition accuracy obtained are highly dependent on the choice of a shape representation and comparison among leaves of various shapes.

II. INTRODUCTION
In this 21 st century where "searching" on the internet in a part and parcel of life, text and voice search are dominant whereas image search is still lagging behind. So we have tried to develop an application which shows optimum results on Image Searching.
Recognition [1] relies upon the existence of a set of predefined objectsContent-based image retrieval[2] is prevalent since 1992 for automatic retrieval of images from a database, based on the colors and shapes present. Since then, the term has been used to describe the process of retrieving desired images from a large collection on the basis of syntactical image features [3]. The techniques, tools, and algorithms that are used originate from fields like statistics, pattern recognition, signal processing, and computer vision [4].
The problem of recognition of objects represented in images is the problem of identifying homologous elements in shapes, which are usually defined by groups of points.Our approach focuses on finding the optimum matching of the images taking contour[5] as the key feature of the image. Contour matching[6] is an important issue and a difficult problem of image processing. The accuracy and the efficiency of the algorithms are the most two critical factors.Contour representation defines the boundary of an object. We must keep in mind that the object must be identified even if it undergoes some geometric transformations. We aim to find the output as images which match the input image in terms of maximum percentage matching. The user has options to find out results in terms of EDGE MATCHING[7],CONTOUR MATCHING,COLOUR MATCHING[8].In section III we discuss the related work, followed by the Methodology presented in section IV. Section V presents some snapshots while Section VI shows the experimental results and finally in Section VII we conclude the discussions.

III. RELATED WORK
Many methodologies have been proposed to analyze plant leaves in an automated fashion. A large percentage of such works utilize shape recognition techniques to model and represent the contour shapes of leaves, however additionally, color and texture of leaves have also been taken into consideration to improve recognition accuracies. One of the earliest works employs geometrical parameters like area, perimeter, maximum length, maximum width, elongation to differentiate between four types of rice grains, with accuracies around 95% [9]. Use of statistical discriminant analysis along with color based clustering and neural networks have been used for classification of a flowered plant and a cactus plant. The authors use the Curvature Scale Space (CSS) technique [10] and k-NN classifiers [11] to classify chrysanthemum leaves. Both color and geometrical features have been reported to detect weeds in crop fields employing k-NN classifiers. The authors propose a hierarchical technique of representing leaf shapes first by their polygonal approximations and then introducing more and more local details in subsequent steps. Fuzzy logic [12] decision making has been utilized to detect weeds in an agricultural field. The authors propose a two-step approach of using a shape characterization function called centroid-contour distance curve[13] and the object eccentricity[14] for leaf image retrieval. The centroid-contour distance (CCD) curve and eccentricity along with an angle code histogram (ACH) [15] have been used for plant recognition. There are several functions which the application can perform. It allows the user to input an image of his/her choice. Then the user has the facility of matching edge, contour which will take the image as input and perform several functions. For instance "Find edges" is a function, which will take an image as input, and find out the matching images as output whose edges match the edge of the input image. Contour representation defines the boundary of an object. The object has to be identified even if it undergoes some geometric transformation and our application succeds in finding out the matching of the input image even if it undergoes geometric transformations [16] like rotation, scaling etc.

E. OUR APPROACH
In this approach, we follow several steps one after another each of which is explained after the steps.
 User can upload any image of his or her choice.
 Detect the edge of the image.
 Store the RGB (Red, Green, Blue) configuration pixel by pixel for each pixel, in an array. Let us call it pixel array, say pa1.
 Repeat step 2 and 3 for each image stored in the database.
 Now, we compare each pixel array ,i.e pa2, pa3 , pa4 with the pixel array of the uploaded image and find the difference and the percentage unmatched.
 Based on the percentage unmatched, we find out if the images are similar or not.
 We show the difference in a graph.
 Thus we find which images match the most and display them.
Each step is described below in detail:

STEP 1
User can upload any image of his or her choice.

STEP 2
Next, we detect the edge of the image. Fig. 4. Image result after Find edges

STEP 3
Next, we find the RGB (Red, Green, Blue) configuration pixel by pixel for each pixel and store it in an array. Let us call it pixel array, say pa1. Repeat step 2 and 3 for each image stored in the database, that is we find out the edge and pixel arrays for each image. Let us name the pixel arrays as pa2, pa3, pa4 and so on.

STEP 5
Now, we compare each pixel array ,i.e pa2, pa3 , pa4 with the pixel array of the uploaded image and find the difference and the percentage unmatched.

STEP 6
Now based on the percentage unmatched, we determine if the images are similar or not. If percentage unmatched is  less than 20% , then the images are considered to be similar  greater than 20% but less than 60% , then we rotate the image and find any image matching the transformed, i.e rotated image.
 Greater than 60% , then the images are said to be Unmatched.

STEP 7
Next, we find out the difference between first 20 pixels of two images and plot a graph against pixel number and assume the same pattern to continue for the rest of the pixels.

STEP 8
Thus we find which images match the most, that is find out the images for which the percentage unmatched is the least, and display those images.
V. SCREENSHOTS        Table 1 shows the percentage differences between the input image and the database images.

VII. DISCUSSION AND CONCLUSIONS
In this study , we have developed an algorithm for shape based image retrieval and image search. We have used an approach where an user uploads an image and first edge detection is done, contour matching is done after contour detection, next pixels are found and stored in an array .Similar steps are performed on database images and percentage differences are found and images are displayed. Future work will be to improve the algorithm so that the skeleton of images can be found, for example finding leaf skeletons will help in leaf categorizations.