Professional Documents
Culture Documents
Abstract
Background/Objectives: Shape recognition is the most important issue in image understanding and computer vi-
sion. Shape representation is a primary issue in shape recognition. This work aims to image retrieval from image
databases based on shape recognition. Methods: The Chain Code Histogram is used to generate a numerical feature vec-
tor which is used to describe a given shape; the problems of chain code consist of its sensitivity to rotation, scaling and
flipping changes. In this paper, new methods are proposed to solve the problems of image rotation and flipping, by ap-
plying the second-moments method to calculating the rotation angle, and analyzing the data of the histogram directions.
Findings: The rotation angle of the object and the similarity between the horizontally/ vertically flipping shapes and
the original shape. Application: The proposed system works efficiently in recognize both regular and irregular objects
for the different categories of the MRI images and results of this research will be useful for the calculate the brain ob-
ject tilted; research will be extended in near future when we combining this method with color and texture features.
Keywords: Chain Code Histogram, Flipping, Image Retrieval, Image Segmentation, Rotation
images based on the spatial distance functions. The mini- irregular shapes letters.5 The reported article used a shape
mum distance indicates the closest match and specifies the number to eliminate the inherent non-invariance of chain
number of best matched images to be extracted. Figure 1 codes and obtained unique chain codes for shapes based
shows the block diagram of a basic of shape based image on the unique chain code, then derived the unique binary
retrieval system.3 In this paper, we focus on contour-base number which is suitable for shape indexing.6 The article
methods to compute the Chain Code Histogram (CCH) work is focused on the recognition of a shape and shape
and calculating the shape feature vectors for the aim of matching based on their chain codes, applied canny edge
similarity. detector to generate binary image chain code concept
Various chain code techniques for representation and which is extended to obtain the unique chain codes for
recognition of shape have been proposed, such as reported shape representation.7 The unique chain code is invariant
in the article research which representation and recogni- to translation, rotation and scaling. The reported authors
tion of rectangle, square, triangle, hexagon, pentagon, proposed a method for English Handwritten recognition,
circle and a line based on chain codes and Compactness that utilized Freeman Chain Code (FCC), and applied
features. As presented in the article attempt was con-
4
the preprocess to produce a Thinned Binary Image (TBI),
cerned with irregular objects; it is based on chain code neural network was used as letters’ classification method.8
histogram to recognition alphabets from A to Z and
2 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
size as the array containing A ), whose set of all zero’s pix- Where B is a 3 × 3 structuring element.
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 3
Chain Code Approach for Shape based Image Retrieval
5. Shape Descriptors Feature extraction techniques are applied to get discrimi-
nating information that will be useful in the comparison
Shape descriptors can be divided into two main cat-
objects of query image and database image.1 In this paper,
egories: region-based and contour-based methods
we generate feature vector created from extracted his-
(boundary based). Region-based methods use the whole
togram directions of chain code to be entered into the
pixels within a shape region and they are considered to
matching stage later. Chain codes are used to represent a
obtain the shape description; they usually require more
boundary of the shape of each object in the image by reg-
computation and need more storage than contour based
istering the list of edge points along a contour and specify
descriptors. Contour-based shape description can be
contour direction at each edge in the list of numbers. The
exploit shape boundary information present in the con-
directions of each edge are quantified into one of the 4- or
tour of an object and neglect the content within the object
8-directions. The generated chain code based on deter-
shape. Its transforms the boundary information of a shape
mining the starting point at first edge in the contour list
image from two-dimensional to a one-dimensional sig-
and going clockwise around the contour, traversal from
nature function for shape representation.14 Some of the
one pixel to the next boundary pixel. Figure 2 shows the 4
contour-based methods include some of the techniques
and 8- directional chain codes to find the direction code.4
for shape descriptors such as chain code, shape signature,
It is not desirable to use chain code directly for shape
polygonal approximation, autoregressive models, FD
description and matching. The small disturbances along
and wavelet descriptors and CSS.15 In this paper, we used
the boundary due to the noise can cause false contour
chain code for images retrieval.
values, and using 4-connectivity causes the loss of the
diagonal points where these points are very useful in most
6. Feature Extraction image applications. To solve this problem by selecting
Shape feature extraction is an important task because larger grid spacing (i.e. eight-direction instead of four).2
it plays a significant role in shape retrieval application. One of the advantages of chain code is that its translat-
4 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
ability is invariant, but any changes of the scale, rotation 6.1 Chain Code Histogram
or mirror object effects on the chain code results, hence
The frequency distributions of the occurrence of the
we get boundaries with different chain codes results to the
various directions reflect the shape of the object. Thus
same object.17,4 In this paper, new methods were proposed
many applications used the chain code histogram (CCH)
to solve problems of rotations, mirror and flipped shape
method to implement object recognition; it is to recognize
object.
both regular and irregular objects.18 The chain code histo-
(a) (b)
(c)
Figure 3. (a) Original MRI scan image, (b) The Binary image with chain code, (c) Chain
code Histogram.
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 5
Chain Code Approach for Shape based Image Retrieval
gram (CCH) groups together objects that look the same to shows the result binary image with chain code after apply-
the human observer. It counts the number of each step in ing the preprocessing and extract connected object, Figure
the chain code representation of the contour. The CCH is
17
3(c) shows chain code histogram.
independent with respect to the starting point. However,
the chain coding direction (clockwise or counterclock-
6.2 Rotation Normalization
wise) should be same for all contours.5 Figure 3(a) shows A boundary of any regular or irregular object after rota-
the original hand MRI scan image, while Figure 3(b) tion has different results of chain code. This is because the
(a) (b)
(c)
Figure 4. Specifies the rotation angle of MRI scan hand image, (a) Original image,
(b) binary image after processing and extracting the connected component object, (c)
determines the tilt angle by using analytic geometry of the rotation ellipse.
6 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 7
Chain Code Approach for Shape based Image Retrieval
0 0 4
1 7 3
2 6 2
3 5 1
4 4 0
5 3 7
6 2 6
7 1 5
the vertical flipping image of the boundary in Figure 5(a). of the original object (for example) at 2-direction is 4, and
Table 2 illustrates the CCH results of the objects of Figure its matches both flipping: horizontal flipping at 6-direc-
5 when applying the proposed Table 1, the CCH values tion, and vertical flipping at 2-direction.
(a) (b)
8 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
(c)
Table 2. Results of the 8-direction CCH to the original and flipping
images in Figure 5
0 1 1 0
1 1 2 2
2 4 3 4
3 2 2 1
4 0 0 1
5 2 2 2
6 3 4 3
7 2 1 2
Total contour 15 15 15
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 9
Chain Code Approach for Shape based Image Retrieval
10 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
• Denote the boundary of the selected object A by 8.6 Algorithm of Detecting the Flipping of
the Object
β(A), • Compute the CCH to the query and database
images by applying algorithm 8.5,
• Erode A by using structuring element B ,
• Save the CCH results into vector 1 and vector 2
respectively,
• Extract the boundary by performing the set differ-
ence between A and its erosion by applying • Find horizontal flipping by computing the simi-
larity score between vector 1 and vector 2 based
Equation (2). on the index direction between column 1 and col-
umn 2 in Table 1,
8.5 Algorithm of Compute the CCH of the
Object
• Find vertical flipping by computing the similar-
• Extract boundary of the object by applying algo- ity score between vector 1 and vector 2 based on
rithm 8.4, the index direction of column 1 and column 3 in
Table 1.
• Indicate the starting pixel’s location on the bound-
ary of the foreground object region;
9. Experiments and Results
• Store the starting pixel’s location; In this paper, all stages of the shape based image retrieval
system are implemented in MATLAB R2016A with a
• Examine each pixel on the object boundaries in a using a database that consists of 500 images, which con-
counter-clockwise direction tains the four different categories; that includes knees,
brains, leaves, and hand wrists. Figure 6(a) shows the
• For each pixel located on object boundaries do original RGB image, Figure 6(b) represents the result of an
image enhancement process after applying the Algorithm
• Select the boundary directions according to the
8.1. Then, the segmentation and isolation of the desired
8-direction in Figure 2;
object from the background by applying algorithm 8.2.
The desired segmented image is shown in Figure 6(c).
• Save the output result in an array or a list;
Figure 6(d) shows the process of locating the object rota-
• End For; tion angle by applying algorithm 8.3, where the result of
rotation angle is 89°. Consequently the rotation angle of
• Counting the frequencies that correspond every the object is corrected by a 1° degree in a counter-clock-
chain code number, that is from 0 to 7. wise direction as shown in Figure 6(e). Figure 6(f) shows
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 11
Chain Code Approach for Shape based Image Retrieval
(a) (b)
(c) (d)
(e) (f)
Figure 6. An example of the CCH method, (a) Original image, (b) image enhancement result,
(c) determining the object after segmentation process, (d) calculate rotate angle of the object
image, (e) rotate an object image, (f) calculate the contour boundaries object image.
12 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
(a) (b)
(c) (d)
(e)
Figure 7. Flipping image; (a) original image, (b) horizontal flipping image, (c) contour
boundary to the horizontal flipping image, (d) vertical flipping image, (f) contour boundary to
the vertical flipping image.
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 13
Chain Code Approach for Shape based Image Retrieval
Figure 8. CCH of the query and flipping (horizontal and vertical) images
the process of extract contour boundaries for the chain For testing the horizontal and vertical flipping, the
code by applying algorithm 8.4. CCH values to all three different images in Figures. 6(f),
Figure 9. User interface of the results of CCH and flipping-CCH similarity
between hand wrist image and different images.
14 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
7(c) and 7(e) are calculated by using the algorithm 8.5. images that describe the enhancement of query image,
Finally applying algorithm 8.6 to find similarity index boundary object image, and chain code histogram objects
.The experimental results show that the values of similar- for both query image and database images are shown in
ity index between query image and flipping image fall Figures 9 and 10 respectively.
within the values greater than 0.90, as shown in Figure 8. In order to measure the performance of the proposed
The system executes six images from each of the four system, the precision and recall parameters are calculated
categories and calculates the similarity to both CCH and by computing the histogram to both chain code and flip-
CCH-flipping between query image and database image; ping image; four different category of images are shown
for each image, the system can display some results of the in Table 3.
Figure 10. User interface of the results of CCH and flipping-CCH similarity between MRI brain
slice and different images.
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 15
Chain Code Approach for Shape based Image Retrieval
Table 3. CCH and CCH with flipping based precision and recall analysis
10. Conclusion 11. References
1. Khokher A, Talwar R. Content-based Image Retrieval: Feature
The objective of this paper consists of the retrieval of the
Extraction Techniques and Applications. International
matching images from database based on shape represen- Journal of Computer Applications. 2012; 4(1):9–14.
tation by using CCH features; First conclusion, chain code 2. D. Zhang. Image Retrieval Based on Shape. [Ph.D. disserta-
tion Thesis]. Faculty of Information Technology, Monash
histogram is a good method to recognize both regular University; Australia; 2002.
and irregular objects and independent with respect to the 3. Mathew SP, Balas VE, Zachariah K, Samuel PA Content-
based Image Retrieval System Based on Polar Raster Edge
starting point of the chain code. Another conclusion, the Sampling Signature. Acta Polytechnica Hungarica. 2014;
experiments showed that the proposed method is power- 11(3):25–36.
4. Sleit AT, Jabay RO. A Chain Code Approach for Recognizing
ful in increasing retrieval accuracy as shown in Table 3.
Basic Shapes. Proceedings of the 4th International
The experiments showed also, some image categories, and Multiconference on Computer Science and Information
Technology (CSIT); Jordan; 2006. p. 298–302.
the CCH-flipping values are close to the CCH values such
5. Iivarinen J, Visa A. Shape recognition of irregular objects.
as brain image, this is due to the circularity of the object. Proceeding of SPIE 2904, Intelligent Robots and Computer
We believe that by combining this method with low-level Vision XV: Algorithms, Techniques, Active Vision and
Materials; United States; 1996.
features of color and texture, a very high performance 6. Lu G. An approach to image retrieval based on shape. Journal
image retrieval system can be achieved. The proposed sys- of Information Science. 1997; 23(2):119–27. Crossref.
7. Barua J, Chirgaiya S. Shape Recognition & Matching using
tem has achieved the highest average precision which is Chain Code. International Journal on Advanced Computer
73%. Theory and Engineering (IJACTE). 2013; 2(5):7–10.
16 Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology
Faiq Baji and Mihai Mocanu
8. Azmi AN, Nasien D. Feature Vector of Binary Image using 16. Kumar G, Bhatia PK. A Detailed Review of Feature
Freeman Chain Code Representation based on Structural Extraction in Image Processing Systems. IEEE 2014
Classifier. International Journal Advance Soft Computer. Fourth International Conference on Advanced Computing
Appl. 2014; 6(2):1–19. & Communication Technologies; India; 2014. p. 5–12.
9. Nixon MS, Aguado AS. Feature Extraction and Image Crossref.
Processing. Replika Press PVT Ltd. India; 2002. p. 89–129. 17. Fating K, Ghotkar A. Performance Analysis Of Chain Code
PMid:12123223 Descriptor For Hand Shape Classification. International
10. Praveen KS, Hamarnath G, Babu KP, Sreenivasulu M, Journal of Computer Graphics & Animation. 2014; 4(2):9–
Sudhakar K. Implementation Of Image Sharpening And 19. Crossref.
Smoothing Using Filters. International Journal of Scientific 18. Xie Y, Hopke PK, Casuccio G, Henderson B. Use of Chain
Engineering and Applied Science. 2016; 2(1):7–14. Code Histogram Method to Quantify Airborne Particle
11. Rajaraman S, Chokkalingam A. Connected Components Shapes. Aerosol Science and Technology. 1994; 21(3):210–
Labeling and Extraction Based Interphase Removal from 8. Crossref.
Chromosome Images. International Journal of Bio-Science 19. Rocha L, Velho L, Carvalho PP. Image Moments-Based
and Bio-Technology. 2013; 5(1):81–90. Structuring and Tracking of Objects. Proceeding of IEEE
12. Tcheslavski GV. Morphological Image Processing: Basic XV Brazilian Symposium on Computer Graphics and
concept. Spring ELEN; 2009. Image Processing; Brazil; 2002. p. 1–7. Crossref.
13. Salem AM, Sewisy AA, Elyan UA. A Vertex Chain Code 20. Hu Ming-Kuel. Pattern recognition by moment invari-
Approach for Image Recognition. ICGST-GVIP Journal. ants. Proceeding of IEEE IRE Transactions on Information
2005; 5(3):1–8. Theory; USA; 1962. p. 179–87.
14. Lakehal A, Beqqali OE, Zemzami OA. Retrieval of Similar 21. Bagri N, Johari PK. A Comparative Study on Feature
Shapes Under Affine Transform Using Affine Length Extraction using Texture and Shape for Content Based
Parameterization. Journal of Computer Science. 2010; Image Retrieval. International Journal of Advanced Science
6(10):1226–32. Crossref. and Technology. 2015; 80(4):41–52. Crossref.
15. Zhang D, Lu G. Content-Based Shape Retrieval Using 22. Otsu N. A Threshold Selection Method from Gray-Level
Different Shape Descriptors: A Comparative Study. IEEE Histograms. IEEE Transactions On Systems, Man, And
International Conference on Multimedia and Expo; India; Cybernetics; Japan. 1979; 9(1):62–6. Crossref.
2001. p. 22–5.
Vol 11 (3) | January 2018 | www.indjst.org Indian Journal of Science and Technology 17