Issuu on Google+

IOSR Journal of Computer Engineering (IOSR-JCE) e-ISSN: 2278-0661, p- ISSN: 2278-8727Volume 10, Issue 5 (Mar. - Apr. 2013), PP 95-104 www.iosrjournals.org

‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh Wavelet Dr. H. B. Kekre1, Dr. Sudeep D. Thepade2, Ratnesh N. Chaturvedi3 1

Sr. Prof. Computer Engineering Dept., Mukesh Patel School of Technology, Management & Engineering, NMIMS University, Mumbai, India 2 Professor & Dean (R&D), Pimpri Chinchwad College of Engineering, University of Pune, Pune, India 3 M.Tech (Computer Engineering), Mukesh Patel School of Technology, Management & Engineering, NMIMS University, Mumbai, India

Abstract: The paper shows performance comparison of three proposed methods with orthogonal wavelet alias Cosine, Haar & Walsh wavelet using Normalization for ‘Color to Gray and Back’. The color information of the image is embedded into its gray scale version using wavelet and normalization method. Instead of using the original color image for storage and transmission, gray image (Gray scale version with embedded color information) can be used, resulting into better bandwidth or storage utilization. Among three algorithms considered the second algorithm give better performance as compared to first and third algorithm. In our experimental results second algorithm for DCT wavelet using Normalization gives better performance in ‘Color to gray and Back’ w.r.t all other wavelet transforms in method 1, method 2 and method 3. The intent is to achieve compression of 1/3 and to print color images with black and white printers and to be able to recover the color information as and when required. Keywords- Color Embedding, Color-to-Gray Conversion, Transforms, Wavelets Normalization , Compression.

I. INTRODUCTION Digital images can be classified roughly to 24 bit color images and 8bit gray images. We have come to tend to treat colorful images by the development of various kinds of devices. However, there is still much demand to treat color images as gray images from the viewpoint of running cost, data quantity, etc. We can convert a color image into a gray image by linear combination of RGB color elements uniquely. Meanwhile, the inverse problem to find an RGB vector from a luminance value is an ill-posed problem. Therefore, it is impossible theoretically to completely restore a color image from a gray image. For this problem, recently, colorization techniques have been proposed [1]-[4]. Those methods can re-store a color image from a gray image by giving color hints. However, the color of the restored image strongly depends on the color hints given by a user as an initial condition subjectively. In recent years, there is increase in the size of databases because of color images. There is need to reduce the size of data. To reduce the size of color images, information from all individual color components (color planes) is embedded into a single plane by which gray image is obtained [5][6][7][8]. This also reduces the bandwidth required to transmit the image over the network. Gray image, which is obtained from color image, can be printed using a black-and-white printer or transmitted using a conventional fax machine [6]. This gray image then can be used to retrieve its original color image. In this paper, we propose three different methods of color-to-gray mapping technique using wavelet transforms and normalization [8][9], that is, our method can recover color images from color embedded gray images with having almost original color images. In method 1 the color information in normalized form is hidden in LH and HL area of first component as in figure 3. And in method 2 the color information in normalize form is hidden in HL and HH area of first component as in figure 3and in method 3 the color information in normalize form is hidden in LH and HH area of first component as in figure 3. Normalization is the process where each pixel value is divided by 256 to minimize the embedding error [9]. The paper is organized as follows. Section 2 describes transforms and wavelet generation. Section 3 presents the proposed system for “Color to Gray and back” using wavelets. Section 4 describes experimental results and finally the concluding remarks are given in section 5.

II.

TRANSFORMS AND WAVELET GENERATION

2.1 Discrete Cosine Transform [9][12] The NxN cosine transform matrix C={c(k,n)},also called the Discrete Cosine Transform(DCT),is defined as

www.iosrjournals.org

95 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh   c ( k , n)    

1  k  0,0  n  N  1   N  2 (2n  1)k cos 1  k  N  1,0  n  N  1  N 2N

-----(1)

The one-dimensional DCT of a sequence {u(n),0 n N-1} is defined as N 1  (2n  1)k  v(k )   (k ) u (n) cos    2N n 0

0  k  N 1

-----(2)

1

2 Where  (0)  ,  (k )  for 1  k  N  1 N N

The inverse transformation is given by N 1  (2n  1)k  u (n)   (k )v(k ) cos   , 0  n  N  1 2N  k 0

-----(3)

2.2 Haar Transfrom [9][10] The Haar wavelet's mother wavelet function  (t) can be described as 1    1 ,0  t  2    1    (t )   1 ,  t  1 2    0 , Otherwise     

-----(4)

And its scaling function  (t ) can be described as,  1 ,0  t  1   0 , Otherwise 

 (t )  

-----(5)

2.3 Walsh Transform [9][11][12] Walsh transform matrix is defined as a set of N rows, denoted Wj, for j = 0, 1, ...., N - 1, which have the following properties[9]  Wj takes on the values +1 and -1.  Wj[0] = 1 for all j.  Wj xWkT =0, for j ≠ k and Wj xWKT, Wj has exactly j zero crossings, for j = 0, 1, ...N-1.  Each row Wj is even or odd with respect to its midpoint.  Transform matrix is defined using a Hadamard matrix of order N. The Walsh transform matrix row is the row of the Hadamard matrix specified by the Walsh code index, which must be an integer in the range [0... N-1]. For the Walsh code index equal to an integer j, the respective Hadamard output code has exactly j zero crossings, for j = 0, 1... N - 1. 2.4 Wavelets [13] The first step is to select the transform for which the wavelet need to be generated i.e. let‟s assume “4 x 4 Walsh transform as shown in Figure 1”. The procedure of generating 16x16 Walsh wavelet transform from 4x4 Walsh transform is illustrated in Figure 2. 1 1 1 1

1 1 -1 -1

1 -1 -1 1

1 -1 1 -1

Figure 1: 4x4 Walsh Transform Matrix Figure

www.iosrjournals.org

96 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh

Figure 2: Generation of 16x16 Walsh wavelet transform from 4x4 Walsh transform Wavelets for other transforms can also be generated using the same procedure.

III. PROPOSED SYSTEM In this section, we propose three new wavelet based color-to-gray mapping algorithm and color recovery method.

3.1 Method 1 [6][7][8] The „Color to Gray and Back‟ has two steps as Conversion of Color to Matted Gray Image with color embedding into gray image & Recovery of Color image back. 3.1.1 Color-to-gray Step 1. First color component (R-plane) of size NxN is kept as it is and second (G-plane) & third (B-plane) color component are resized to N/2 x N/2. 2. Second & Third color component are normalized to minimize the embedding error. 3. Wavelet i.e. DCT, Haar or Walsh wavelet to be applied to first color components of image. 4. First component to be divided into four subbands as shown in figure1 corresponding to the low pass [LL], vertical [LH], horizontal [HL], and diagonal [HH] subbands, respectively. 5. LH to be replaced by normalized second color component, HL to be replace by normalized third color component. 6. Inverse Transform to be applied to obtain Gray image of size N x N.

LL LH HL HH Figure 1: Sub-band in Transform domain 3.1.2 Recovery Step 1. Transform to be applied on Gray image of size N x N to obtain four sub-bands as LL, LH, HL and HH. 2. Retrieve LH as second color component and HL as third color component of size N/2 x N/2 and the the remaining as first color component of size NxN. 3. De-normalize Second & Third color component by multiplying it by 256. www.iosrjournals.org

97 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh 4. 5. 6.

Resize Second & Third color component to NxN. Inverse Transform to be applied on first color component. All three color component are merged to obtain Recovered Color Image.

3.2 Method 2 [6][7][8][9] 3.2.1 Color-to-gray Step 1. First color component (R-plane) of size NxN is kept as it is and second (G-plane) & third (B-plane) color component are resized to N/2 x N/2. 2. Second & Third color component are normalized to minimize the embedding error. 3. Wavelet i.e. DCT, Haar or Walsh wavelet to be applied to first color components of image. 4. First component to be divided into four subbands as shown in figure1 corresponding to the low pass [LL], vertical [LH], horizontal [HL], and diagonal [HH] subbands, respectively. 5. HL to be replaced by normalized second color component, HH to be replace by normalized third color component. 6. Inverse Transform to be applied to obtain Gray image of size N x N. 3.2.2 Recovery Step 1. Transform to be applied on Gray image of size N x N to obtain four sub-bands as LL, LH, HL and HH. 2. Retrieve HL as second color component and HH as third color component of size N/2 x N/2 and the the remaining as first color component of size NxN. 3. De-normalize Second & Third color component by multiplying it by 256. 4. Resize Second & Third color component to NxN. 5. Inverse Transform to be applied on first color component. 6. All three color component are merged to obtain Recovered Color Image.

3.3 Method 3 [6][7][8][9] 3.3.1 Color-to-gray Step 1. First color component (R-plane) of size NxN is kept as it is and second (G-plane) & third (B-plane) color component are resized to N/2 x N/2. 2. Second & Third color component are normalized to minimize the embedding error. 3. Wavelet i.e. DCT, Haar or Walsh wavelet to be applied to first color components of image. 4. First component to be divided into four subbands as shown in figure1 corresponding to the low pass [LL], vertical [LH], horizontal [HL], and diagonal [HH] subbands, respectively. 5. LH to be replaced by normalized second color component, HH to be replace by normalized third color component. 6. Inverse Transform to be applied to obtain Gray image of size N x N. 3.3.2 Recovery Step 1. Transform to be applied on Gray image of size N x N to obtain four sub-bands as LL, LH, HL and HH. 2. Retrieve LH as second color component and HH as third color component of size N/2 x N/2 and the the remaining as first color component of size NxN. 3. De-normalize Second & Third color component by multiplying it by 256. 4. Resize Second & Third color component to NxN. 5. Inverse Transform to be applied on first color component. 6. All three color component are merged to obtain Recovered Color Image.

IV.

RESULTS & DISCUSSION

These are the experimental results of the images shown in figure 2 which were carried out on DELL N5110 with below Hardware and Software configuration. Hardware Configuration: 1. Processor: Intel(R) Core(TM) i3-2310M CPU@ 2.10 GHz. 2. RAM: 4 GB DDR3. 3. System Type: 64 bit Operating System. Software Configuration: 1. Operating System: Windows 7 Ultimate [64 bit]. 2. Software: Matlab 7.0.0.783 (R2012b) [64 bit]. The quality of „Color to Gray and Back' is measured using Mean Squared Error (MSE) of original color image with that of recovered color image, also the difference between original gray image and reconstructed gray www.iosrjournals.org

98 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh image (where color information is embedded) gives an important insight through user acceptance of the methodology. This is the experimental result taken on 10 different images of different category as shown in Figure 4. Figure 5 shows the sample original color image, original gray image and its gray equivalent having colors information embedded into it, and recovered color image using method 1, method 2 and method 3 for DCT, Haar and Walsh wavelet transform. As it can be observed that the gray images obtained from these methods does not have any distortion, it does not give any clue that something is hidden in gray image, which is due to the normalizing as it reduces the embedding error.

Figure 4: Test bed of Image used for experimentation.

Original Color DCT

Haar

Original Gray Walsh

Reconstructed Gray (Method 1)

Reconstructed Gray (Method 1)

Reconstructed Gray (Method 1)

www.iosrjournals.org

99 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh

Recovered Color (Method 1)

Recovered Color (Method 1)

Recovered Color (Method 1)

Reconstructed Gray (Method 2)

Reconstructed Gray (Method 2)

Reconstructed Gray (Method 2)

Recoverd Color (Method 2)

Recoverd Color (Method 2)

Recoverd Color (Method 2)

Reconstructed Gray (Method 3)

Reconstructed Gray (Method 3)

Reconstructed Gray (Method 3)

www.iosrjournals.org

100 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh

Recoverd Color (Method 3) Recoverd Color (Method 3) Recoverd Color (Method 3) Figure 5: Color to gray and Back of sample image using Method 1, Method 2 and Method 3 Table 1: MSE between Original Gray-Reconstructed Gray Image

Img 1 Img 2 Img 3 Img 4 Img 5 Img 6 Img 7 Img 8 Img 9 Img 10 Average

Method 1 8068.00 16077.00 4961.90 15348.00 5172.40 2264.30 21724.00 26767.00 4735.10 3556.50 10867.42

DCT Method 2 8154.70 16099.00 5001.70 15363.00 5176.20 2274.00 21710.00 26783.00 4739.00 3602.80 10890.34

Method 3 8106.30 16082.00 4992.00 15363.00 5173.70 2269.20 21764.00 26768.00 4737.30 3560.70 10881.62

Method 1 7949.70 16039.00 4892.90 15319.00 5150.50 2246.60 21722.00 26758.00 4727.00 3537.60 10834.23

Haar Method 2 8094.80 16081.00 4960.30 15340.00 5169.90 2264.10 21713.00 26781.00 4734.40 3589.10 10872.76

Method 3 8025.00 16056.00 4952.80 15354.00 5157.20 2258.50 21760.00 26761.00 4732.20 3548.80 10860.55

Method 1 7949.70 16039.00 4892.90 15319.00 5150.50 2246.60 21722.00 26758.00 4727.00 3537.60 10834.23

Walsh Method 2 8094.80 16081.00 4960.30 15340.00 5169.90 2264.10 21713.00 26781.00 4734.40 3589.10 10872.76

Method 3 8025.00 16056.00 4952.80 15354.00 5157.20 2258.50 21760.00 26761.00 4732.20 3548.80 10860.55

Figure 6: Average MSE of Original Gray w.r.t Reconstructed Gray for Method 1 & Method 2

www.iosrjournals.org

101 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh Table 2: MSE between Original Color-Recovered Color Image

Img 1 Img 2

Method 1 414.1566 92.8247

DCT Method 2 349.1929 80.1499

Method 3 374.6981 83.5076

Method 1 493.5136 121.3339

Haar Method 2 386.796 94.1969

Method 3 423.3483 99.7293

Method 1 493.5136 121.3339

Walsh Method 2 386.8058 94.1646

Method 3 423.3483 99.7293

Img 3 Img 4 Img 5

231.7073 93.1414 25.5738

195.6875 80.3857 21.0175

208.1551 81.8979 22.9094

280.6049 116.5854 41.9297

219.3106 96.5028 25.5594

236.8208 90.456 35.3552

280.6049 116.5854 41.9297

219.3244 96.5012 25.5649

236.8208 90.456 35.3552

Img 6 Img 7

64.5579 271.2525

55.7771 247.0677

57.4603 233.6903

77.6847 278.6486

62.8366 248.9137

64.5713 240.0452

77.6847 278.6486

62.844 248.9923

64.5713 240.0452

Img 8 Img 9 Img 10 Averag e

77.0258 86.3452 396.0637

59.6358 75.2929 339.331

73.3799 75.6982 361.2053

84.2198 99.8884 409.9195

62.8612 83.1166 347.9036

78.2887 82.5429 368.5165

84.2198 99.8884 409.9195

62.8707 83.1185 347.9225

78.2887 82.5429 368.5165

175.2649

150.3538

157.2602

200.4329

162.7997

171.9674

200.4329

162.8109

171.9674

Figure 7: Average MSE of Original Color w.r.t Recovered Color for Method 1 & Method 2 It is observed in Table 2 and Figure 7 that DCT using method 2 gives least MSE between Original Color Image and the Recovered Color Image. Among all considered wavelet transforms, DCT wavelet using method 2 gives best results. And in Table 1 and Figure 6 it is observed that Haar and Walsh wavelet using method 1 gives least MSE between Original Gray Image and the Reconstructed Gray Image. Among all considered wavelet transforms, less distortion in Gray Scale image after information embedding is observed for Haar and Walsh wavelet transform using method 1. The quality of the matted gray is not an issue, just the quality of the recovered color image matters. This can be observed that when DCT wavelet using method 1 is applied the recovered color image is of best quality as compared to other image transforms used in method 1, method 2 and method 3. As in Figure 4 and Table 2 it can be observed that mse between original color image and recovered color is high wherever the granularity of the image is high and it is low wherever the granularity of the image is low.

V.

CONCLUSION

This paper have presented three methods to convert color image to gray image with color information embedding into it in two different regions and method of retrieving color information from gray image. These methods allows one to achieve 1/3 compression and send color images through regular black and white fax systems, by embedding the color information in a gray image. These methods are based on transforms i.e DCT, Haar and Walsh wavelet using Normalization technique. DCT wavelet using method 2 is proved to be the best approach with respect to other wavelet transforms using method 1, method 2 and method 3 for „Color-to-Gray

www.iosrjournals.org

102 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh and Back‟. The images with less granularity gives minimum MSE and via.Our next research step could be to test other wavelet transforms and hybrid wavelets for „Color-to-Gray and Back‟.

REFERENCES [1] [2] [3] [4] [5] [6] [7]

[8]

[9]

[10] [11] [12]

[13]

T. Welsh, M. Ashikhmin and K.Mueller, Transferring color to grayscale image, Proc. ACM SIGGRAPH 2002, vol.20, no.3, pp.277-280, 2002. A. Levin, D. Lischinski and Y. Weiss, Colorization using Optimization, ACM Trans. on Graphics, vol.23, pp.689-694, 2004. T. Horiuchi, "Colorization Algorithm Using Probabilistic Relaxation," Image and Vision Computing, vol.22, no.3, pp.197-202, 2004. L. Yatziv and G.Sapiro, "Fast image and video colorization using chrominance blending", IEEE Trans. Image Processing, vol.15, no.5, pp.1120-1129, 2006. H.B. Kekre, Sudeep D. Thepade, “Improving `Color to Gray and Back` using Kekre‟s LUV Color Space.” IEEE International Advance Computing Conference 2009, (IACC 2009),Thapar University, Patiala,pp 1218-1223. Ricardo L. de Queiroz,Ricardo L. de Queiroz, Karen M. Braun, “Color to Gray and Back: Color Embedding into Textured Gray Images” IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 15, NO. 6, JUNE 2006, pp 1464- 1470. H.B. Kekre, Sudeep D. Thepade, AdibParkar, “An Extended Performance Comparison of Colour to Grey and Back using the Haar, Walsh, and Kekre Wavelet Transforms” International Journal of Advanced Computer Science and Applications (IJACSA) , 0(3), 2011, pp 92 - 99. H.B. Kekre, Sudeep D. Thepade, Ratnesh Chaturvedi & Saurabh Gupta, “Walsh, Sine, Haar& Cosine Transform With Various Color Spaces for „Color to Gray and Back‟”, International Journal of Image Processing (IJIP), Volume (6) : Issue (5) : 2012, pp 349-356. H. B. Kekre, Sudeep D. Thepade, Ratnesh N. Chaturvedi, “ NOVEL TRANSFORMED BLOCK BASED INFORMATION HIDING USING COSINE, SINE, HARTLEY, WALSH AND HAAR TRANSFORMS”, International Journal of Advances in Engineering & Technology, Mar. 2013. ©IJAET ISSN: 2231-1963, Vol. 6, Issue 1, pp. 274-281 Alfred Haar, “ZurTheorie der orthogonalenFunktionensysteme” (German), MathematischeAnnalen, Volume 69, No 3, pp 331 – 371, 1910. J Walsh, “A closed set of normal orthogonal functions”, American Journal of Mathematics, Volume 45, No 1, pp 5-24, 1923. Dr. H. B. Kekre, DrTanuja K. Sarode, Sudeep D. Thepade, Ms.SonalShroff, “Instigation of Orthogonal Wavelet Transforms using Walsh, Cosine, Hartley, Kekre Transforms and their use in Image Compression”, International Journal of Computer Science and Information Security, Volume 9, No 6,pp 125-133, 2011. Dr. H. B. Kekre, Archana Athawale & Dipali Sadavarti, “Algorithm to Generate Wavelet Transform from an Orthogonal Transform”, International Journal Of Image Processing (IJIP), Volume (4): Issue (4), pp 445-455.

BIOGRAPHICAL NOTES H. B. Kekre has received B.E. (Hons.) in Telecomm. Engineering. From Jabalpur Uiversity in 1958, M.Tech (Industrial Electronics) from IIT Bombay in 1960, M.S.Engg. (Electrical Engg.) from University of Ottawa in 1965 and Ph.D. (System Identification) from IIT Bombay in 1970 He has worked as Faculty of Electrical Engg. and then HOD Computer Science and Engg. at IIT Bombay. For 13 years he was working as a professor and head in the Department of Computer Engg. at Thadomal Shahani Engineering. College, Mumbai. Now he is Senior Professor at MPSTME, SVKM‟s NMIMS University. He has guided 17 Ph.Ds, more than 100 M.E./M.Tech and several B.E./B.Tech projects. His areas of interest are Digital Signal processing, Image Processing and Computer Networking. He has more than 450 papers in National / International Conferences and Journals to his credit. He was Senior Member of IEEE. Presently He is Fellow of IETE and Life Member of ISTE. Recently fifteen students working under his guidance have received best paper awards. Eight students under his guidance received Ph. D. From NMIMS University. Currently five students are working for Ph. D. Under his guidance Sudeep D. Thepade has Received Ph.D. Computer Engineering from SVKM„s NMIMS in 2011, M.E. in Computer Engineering from University of Mumbai in 2008 with Distinction, B.E.(Computer) degree from North Maharashtra University with Distinction in 2003. He has about 10 years of experience in teaching and industry. He was Lecturer in Dept. of Information Technology at Thadomal Shahani Engineering College, Bandra(w), Mumbai for nearly 04 years, then worked as Associate Professor and HoD Computer Engineering at Mukesh Patel School of Technology Management and Engineering, SVKM„s NMIMS, Vile Parle(w), Mumbai. Currently he is Professor and Dean (R&D), at Pimpri Chinchwad College of Engineering, Pune. He is member of International Advisory Committee for many International Conferences, acting as reviewer for many referred international journals/transactions including IEEE and IET. His areas of interest are Image Processing and Biometric Identification. He has guided five M.Tech. Projects and several B.Tech projects. He more than 185 papers inInternational Conferences/Journals to his credit with a Best Paper Award at International Conference SSPCCIN-2008, Second Best Paper Award at ThinkQuest-2009, Second Best Research Project Award at Manshodhan 2010, Best Paper Award for paper published in June 2011 issue of International Journal IJCSIS (USA), Editor„s Choice Awards for papers published in International Journal IJCA (USA) in 2010 and 2011. www.iosrjournals.org

103 | Page


‘Color to Gray and back’ using normalization of color components with Cosine, Haar and Walsh Ratnesh N. Chaturvedi is currently pursuing M.Tech. (Computer Engg.) from MPSTME, SVKM‟s NMIMS University, Mumbai. B.E.(Computer) degree from Mumbai University in 2009. Currently working as T.A in Computer Engineering at Mukesh Patel School of Technology Management and Engineering, SVKM‟s NMIMS University, VileParle(w), Mumbai, INDIA. He has about 04 years of experience in teaching. He has published papers in several international journals like IJIP, IJCA, IJAET, IJACR etc. His area of interest is Image Colorization & Information Security.

www.iosrjournals.org

104 | Page


Q10595104