ABSTRACT
The images are described by its content like color, texture, and shape information present in them. In this paper novel image retrieval methods discussed based on shape features extracted using gradient operators using and slope magnitude technique with Block Truncation Coding (BTC) using Gray Level Co-occurrence Matrix. Four variations of proposed Gradient operators and BTC image retrieval techniques are proposed using gradient operators like Robert, Sobel, Prewitt and Canny. Masking of Gradient operators takes place for continuing the discontinue edges. Morphological operations like erosion and dilation are used along with canny. The proposed image retrieval techniques are tested on generic image database images spread across different categories. In Block Truncation Coding (BTC) features are extracted using Gray Level Co-occurrence Matrix (GLCM) and for gradient operator’s features are extracted using Figure of Merit (FOM).BTC can be used for grayscale as well as for color images. The average precision and recall of all queries are computed and considered for performance analysis. The performance ranking of the masks for proposed image retrieval methods can be listed as Robert, Canny, Prewitt, and Sobel.
Index Terms: CBIR, GLCM, FOM, Slope magnitude technique, BTC
I. INTRODUCTION
Information retrieval (IR) is the science of searching for documents, for information within documents, and for metadata about documents, as well as that of searching relational databases and the World Wide Web. There is overlap in the usage of the terms data retrieval, document retrieval, information retrieval, and text retrieval, but each also has its own body of literature, theory and technologies. IR is interdisciplinary, based on computer science, mathematics, cognitive psychology, linguistics, statistics, and physics. Automated information retrieval systems are used to reduce what has been called "information overload"[1,2]. Many universities and public libraries use IR systems to provide access to books and journals. Web search engines are the most visible IR applications. Images do have giant share in this information being stored and retrieved.
Content Based Image Retrieval (CBIR)
The images are very rich in the content like color, texture, shape information present in them. Retrieving images based on color similarity is achieved by computing color histogram for each image that identifies the proportion of pixels within an image holding specific values (that humans express as colors). Color searches will usually involve comparing color histograms, though this is not the only technique in practice. Texture measures look for visual patterns in images and how they are spatially defined. The identification of specific textures in an image is achieved primarily by modeling texture as a two-dimensional gray level variation[3]. The relative brightness of pairs of pixels is computed such that degree of contrast, regularity, coarseness and directionality may be estimated. Shape does not refer to the shape of an image but to the shape of a particular region that is being sought out. Shapes will often be determined first applying segmentation or edge detection to an image. Other methods use shape filters to identify given shapes of an image. In some case accurate shape detection will require human intervention because methods like segmentation are very difficult to completely automate. Here the paper discuss shape extraction using edge detection masks like Sobel, Roberts, Prewitt and Canny gradient operators[4].Some other CBIR systems with their disadvantages are QBIC – Query by Image Content reqires long indexing time[17].The problem associated with Virage are weights attached to each image. VisualSEEk considers spatial relationships between objects.Global features like mean color, color histogram can give many false positives. Disadvantage of MARS are weight updating, Modification of distance function. Disadvantage of Pic-Hunter is Probability asoociated with each image[18,19].
Figure1 : Basic CBIR System
Image Retrieval Using Shape Measures and BTC
Dr.Anjali S.Bhalchandra Sr.Professor, Associate Professor, Government College of Engineering,
Aurangabad,Maharashtra,India
Ajinkya P.Nilawar. M.E.(EC)
II. First Order Derivative Based Edge Detection (Gradient method):
Edges gives maximum information,it detects by analysing for the maximum and minimum in the first derivative of the image.Sharpening an image results in the detection of fine details as well as enhancing blurred ones. The magnitude of the gradient is the most powerful technique that forms the basis for various approaches to sharpening.[5,6] The gradient vector points in the direction of maximum rate of change. For a function f(x, y), the magnitude of the gradient of f at coordinates (x, y) is defined as
|∆f(x,y)| = (𝜕𝑥(f(x, y))2 + (𝜕𝑥(f x, y )2 (1)
While the gradient orientation is given by,
∆f(x,y) = 𝐴𝑟𝑐𝑇𝑎𝑛(𝜕𝑦(f(x, y)/𝜕𝑥(f x, y ) (2)
III. SLOPE MAGNITUDE METHOD
The problem with edge extraction using gradient operators is detection of edges in only either horizontal or vertical directions. Shape feature extraction in image retrieval requires the extracted edges to be connected in order to reflect the boundaries of objects present in the image. Slope magnitude method is used along with the gradient operators (Sobel, Prewitt, Robert and Canny) to extract the shape features in form of connected boundaries. The process of applying the slope magnitude method is given as follows. First one needs to convolve the original image with theGx mask to get the x gradient and Gy mask to get the y gradient of the image.[7] Then the individual squares of both are taken. Finally the two squared terms are added and square root of this sum is taken as given in equation.
Edge Magnitude G = 𝐺𝑥2+ 𝐺𝑦2 (3)
Edge Direction d =tan-1(Gy/Gx) (4)
Orignal Image Sobel operator
Prewitt operator Roberts Operator
Canny operator with Erosion & Dilation
Figure 2 : Gradient operators with slope magnitude technique.
IV. BLOCK TRUNCATION CODING (BTC)
Block truncation coding (BTC) is a relatively simple image coding technique.The method first computes the mean pixel value of the whole block and then each pixel in that block is compared to the block mean. If a pixel is greater than or equal to the block mean, the corresponding pixel position of the bitmap will have a value of 1 otherwise it will have a value of 0.Two mean pixel values one for the pixels greater than or equal to the block mean and the other for the pixels smaller than the block mean are also calculated. At decoding stage, the small blocks are decoded one at a time. For each block, the pixel positions where the corresponding bitmap has a value of 1 is replaced by one mean pixel value and those pixel positions where the corresponding bitmap has a value of 0 is replaced by another mean pixel value.[9,10].
Algorithm for BTC
•Step1: The given image is divided into non overlapping rectangular regions. For the sake of simplicity the blocks were let to be square regions of size m x m.
• Step 2: For a two level (1 bit) quantizer, the idea is to select two luminance values to represent each pixel in the block. These values are the mean x and standard deviation σ.
X‟ = 𝑛1 𝑥𝑖𝑛
1 (5)
σ = √𝑛1 (𝑥𝑖 − 𝑥′𝑖)𝑛 2
1 (6)
Where xi represents the ith pixel value of the image block and n is the total number of pixels in that block.
• Step3: The two values x and σ are termed as quantizers of BTC. Taking x as the threshold value a two-level bit plane is obtained by comparing each pixel value xi with the threshold. A binary block, denoted by B, is also used to represent the pixels. We can use“1” to represent a pixel whose gray level is greater than or equal to x and “0” to represent a pixel whose gray level is less than B = 1 xi > x‟
0 xi < x‟ (7)
• Step 4: In the decoder an image block is reconstructed by replacing „1‟s in the bit plane with H and the „0‟s with L, which are given by:
H = x‟ + σ √ 𝑝𝑞 (8)
L = x‟ – σ √𝑝𝑞 (9) Where p and q are the number of 0‟s and 1‟s in the compressed bit plane respectively.
Figure 3 : BTC for Grayscale Image.
Figure 4 : BTC for color Image
GLCM
A statistical method of examining texture that considers the spatial relationship of pixels is the gray-level co-occurrence matrix (GLCM), also known as the gray-level spatial dependence matrix. The GLCM functions characterize the texture of an image by calculating how often pairs of pixel with specific values and in a specified spatial relationship occur in an image, creating a GLCM, and then extracting statistical measures from this matrix. To create a GLCM, use the graycomatrix function. The graycomatrix function creates a gray-level co-occurrence matrix (GLCM) by calculating how often a pixel with the intensity (gray-level) value i occurs in a specific spatial relationship to a pixel with the value j.
V. PROPOSED CBIR TECHNIQUES
The paper proposes image retrieval techniques using four different gradient operators (Roberts, Sobel, Prewitt and Canny) using slope magnitude technique and BTC. The performance of proposed image retrieval methods is compared with Gradient operators based CBIR techniques.
i. Gradient Operators using Figure of Merit
The shape feature vector of Gradient operator consist of Figure of Merit(FOM) of query image considered for
finding the similarity with database images. Morphological operations erosion and dilation used with canny.. The problem of this technique is that all the images in the database must have same dimensions as that of query image. The selection of gradient operators like Robert, Sobel, Prewitt and canny results into four variations of Gradient operator based image retrieval. The Figure of Merit calculated as,
FOM = max {𝐼𝑖,𝐼𝑎}1 𝐼𝑎𝑖=11+𝛼𝑑1 2 (10)
where Ii and Ia are the number of ideal and actual edge points, dis the pixel miss distance of the ith edge detected, and α is a scaling constant chosen to be α = (1/9) to provide
arelative penalty between smeared edges and isolated, but offset, edges.
ii. BTC using GLCM
The problem of having all the databse images with same size for image retrieval can be resolved using proposed BTC based CBIR methods.We use BTC technique with matrices of 2x2,4x4,8x8 the feature are extracted using GLCM from decoded image.The extracted feature are applied for finding the similarity with database images.
VI. IMPLEMENTATION
The discussed image retrieval methods are implemented using MATLAB 2008b on Intel Core i3-380M processor with 2 GB of RAM. To check the performance of proposed technique a database of 1000 variable sized images spread across different categories has been used.
Figure 5: Sample Images from Generic Image Database
The similarity between feature vectors is found using mean square error (MSE). The MSE between two feature vectors Vpi and Vqi can be computed as shown in equation 4.
MSE = 𝑛 (𝑉𝑝𝑖 − 𝑉𝑞𝑖)2
𝑖=1 (11)
To assess the retrieval effectiveness, we have used the precision and recall as statistical comparison parameters for our proposed technique of CBIR. The standard definitions of these two measures are given by following equations.
Number of relevant images retrieved Precision = --- (12) Total number of images retrieved
Number of relevant images retrieved Recall = --- (13) Total number of relevant images
in database
Table 1: Performance analysis of discussed CBIR technique
Parameter PRECISION RECALL MSE
BTC 2X2 0.4 0.2857 0.0136
BTC 4X4 0.6 0.3764 0.0499
BTC 8X8 1 0.7142 0.0816
SOBEL 0.6 0.4285 0.0294
PREWITT 0.8 0.5714 0.0522
CANNY 1 0.7138 0.0812
ROBERTS 1 0.7142 0.0816
The values of crossover points of precision and recall for all proposed image retrieval methods are given in above table. Among all BTC technique BTC 8X8 gives maximum result compare to other BTC as shown in figure 6.As shown in figure 7 a mong all Gradient Operators Robert gradient operator performs the best followed by Canny. Figure 8 shows Performance comparison of discussed CBIR technique.
Figure 6: Performance comparison BTC.
Figure 7: Performance comparison Gradient Operators
Figure 8: Performance comparison of discussed CBIR technique.
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
BTC 2X2 BTC 4X4 BTC 8X8
MSE
BTC
0 0.02 0.04 0.06 0.08 0.1
SOBEL PREWITT CANNY ROBERTS
MSE
Gradient
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
SOBEL PREWITT CANNY ROBERTS
MSE
VIII. CONCLUSIONS
Image Retrieval is gaining momentum among researchers working in image processing and computer vision areas because of the wide number of applications. Image retrieval using shape features is the theme of work presented h e r e . The shape features can be extracted using Figure of Merit a p p l i e d o n gradient of images taken in both horizontal and vertical directions. Using Roberts, Sobel, Prewitt and Canny used with erosion and dilation gradient operators four variations in gradient operator methods can be obtained. The experimentation results show t h a t the Robert gradient operator gives best performance followed by Canny, Prewitt and Sobel Operator. The problem with these Gradient operator methods is the need of resizing the database images to match it with the size of query. The problem of having all the database images with same size for image retrieval can be resolved using proposed BTC based CBIR methods. We use BTC technique with matrices of 2x2,4x4,8x8 among them BTC 8X8 gives good results compare to other the feature are extracted using GLCM from decoded image. The extracted features are applied for finding the similarity with database i m a g e s .
IX. REFERENCES
[1]. Dr.H.B.Kekre, Sudeep D. Thepade, Shobhit W., Miti K., Styajit S., Priyadarshini M. “Image Retrieval with Shape Features Extracted using Gradient Operators and Slope Magnitude Technique with BTC”, International Journal of Computer Applications (IJCA), Volume 6,
Number 8, pp.28-33, September 2010.
[2]. Guoping Qiu, “Color Image Indexing Using BTC,” IEEE Transactions on Image Processing,
VOL.12, NO.1, pp.93-101, January 2003.
[3]. B.G.Prasad, K.K. Biswas, and S. K.Gupta, “Region–based image retrieval using integrated
color, shape, and location index”, computer vision and image understanding, Oct 2003.
[4]. Rafael C.Gonzalez, Richard E. Woods,” Digital Image Processing,” University of Tennessee,Second Edition, ISBN 81-7808-629-8, Pearson Education Pvt. Ltd.,2002.
[5]. Y.C. Hu, C.C. Chang, “Edge detection using block truncation coding, Int. J. Pattern Recognition”, Artif. Intell. 17 (2003) 951–966.
[6]. B.C. Dhara, B. Chanda, “Block truncation coding using pattern fitting,Pattern Recognition”, 37 (2004) 2131–2139.
[7]. W. K. Pratt, Lligital Image Processing. New York, Wiley-Interscience,1978.
[8]. Y.C. Hu,” Predictive moment preserving block truncation coding for graylevel image compression”, J. Electron. Imaging 13 (2004) 871–877.
[9]. O. R. Mitchell , E. J. Delp, and S. G. Carlton, “Block truncation coding: a new approach to image compression,” Proceedings of the IEEE International Conference on Communications, vol. 1, June 4-7 1978, pp. 12B.1.1-12B.1.4.
[10]. E. J. Delp and O. R. Mitchell, “Image compression using block truncation coding,” IEEETransactions on Communications, vol. 27, no. 9, September 1979, pp. 1335-1341.
[11]. Bibhas Dhara, Bhabatosh Chanda,”Color image compression based on block truncation coding using pattern fitting principle,” Journal Pattern Recognition archive, Volume 40 Issue 9, September, 2007,Elsevier
Science Inc. New York, NY, USA
[12]. Doaa Mohammed, Fatma Abou-Chadi,”Image Compression Using Block Truncation Coding,” Cyber Journals: Multidisciplinary Journals in Science and Technology, Journal of Selected Areas in
Telecommunications (JSAT), February Edition, 2011.
[13]. Image Database
http://wang.ist.psu.edu/docs/related/Image.orig (Last referred on 23 Sept 2008)
[14]R. 0. Duds and P. E. Hart, Pattern ChsPification and Scene Analysis. New York: Wiley, 1973.
[15]R. Kirsch, “Computer determination of the constituent structureof biological images,” Comput. Biomed Res., vol. 4, no. 3, pp.
[16]E. S. Deutsch and J. R. Fram, “A quantitative study of the orientation bias of some edge detector schemes,” IEEE Tnvn Comput., vol. C-27, no. 3, pp. 205-213, Mar. 1978.
[17] “IBM‟s Query by Image Content”. [Online]. Available: http://domino.research.ibm.com/comm/wwwr_thinkresearch .nsf/pages/image396.html
[18] P Liu, K. Jia, Z. Wang and Z. Lv, “A New and Effective Image Retrieval Method Based on Combined Features”, Proc. IEEE Int. Conf. on Image and Graphics, vol. I, pp. 786-790, August 2007.