bits planes technique for digital image processing

6
Abstract This work presents a technique for digital image processing. The technique consists on splitting the original image with 256 gray levels into its equivalent 8 binary images. The method is extended for true RGB color images by working out each color plane as a gray scale image and applying the same algorithm development for the former case to convert any intensity level into a byte of 8 bits. The results shown out to be useful for some basic applications such as separating the fine features of an image. Memory space for storing images is reduced since the images can be written in binary formats. Bits planes technique allows for logical operations and after that, get back to a gray scale image or color image very easily. The potential application of this technique is being studied in order to detect some anomalies in digital mammographies. A script in MatLab has been development with some menus to implement the bits planes technique for different image formats. Keywords Bits Planes, Color Bits Planes, Digital Image Processing, Gray Scale Image, RGB Color Image I. INTRODUCTION During the last years with the increasing use of the computer and its associate software, the digital image processing has become a powerful tool. Several methods and a multitude of algorithms have been development to perform processing on images and to explore new applications. One of the major objectives of digital image processing is oriented to improve the image appearance. Some techniques are designed to suppress interferences or noise, to enhance contrast, etc. But also the measurements of some features of the image are important to do automatic processing. The areas of application of the digital image processing are growing very fast. For example, in medicine it is used to improve X-ray images, to understand with better accuracy the body´s functions, the effects of some drugs by analyzing pictures with colored substances, to investigate the features and behavior of tumors, etc. In the artistic field, digital processing is used to restore photographs and famous pictures that have been deteriorated. Another application is in reconstruction and improvement of images send by spatial missions, photographs of satellites for weather or natural resources applications. Today, an important area that needs more and more image processing are movies and electronic games industries. Of course there are several military applications of digital image processing [1]. In this work a technique based on decomposing an image in its bits planes is presented to do digital image processing. II. METHODOLOGY To separate an intensity image into eight bits planes, we proceed as shown in Fig. 1. The intensity of each pixel in the original image is considered to be some value between 0 and 255 that is converted in a byte of 8 bits. Depending of the intensity value of each pixel on the original image, there will be a bit on one, some or all the bits planes. By scanning the whole image, there will appear eight images that correspond to the eight bits planes; from the least significative B0 to the most significative B7. To transform the complete image, a simple algorithm was implemented and it is described in the following steps: 1.- We start with the first pixel on the image: r=[i], c=[j]; 2.- The intensity level of the pixel is read: Level; 3.- If Level=0, the least significative plane has a zero: b(0)=0; 4.- If LevelͲ, the planes that have ones must be determine: 5.- While Levelͳ 6.- The half part of Level is calculated: Half=Level/2; 7.- Half is rounded towards zero: Rounded; 8.- The difference between Half and Rounded is calculated: Dif=Half-Rounded; 9.- If Dif=0, the plane gets a zero: b(q)=0; 10.- If Ͳ, the plane gets an one: b(q)=1; 11.- The value of Level is adjusted: Level=Rounded; 12.- We move to the next most significative plane: q=q+1; 13.- Steps 5 to 12 are repeated until Level<1; 14.- Zeros and ones are collocated in the different image planes: If b(0)=0, B0(i,j)=0, if b(0)=1, B0(i,j)=1; if b(1)=0, B1(i,j)=0, if b(7)=1, B7(i,j)=1. 15.- Auxiliar variables are reset and the level of the next pixel is read; 16.- Steps 3 to 15 are repeated until the whole image is scanned. The images corresponding to the different bits, from the least significative to the most significative, will be represented by the matrices: B0(i,j), B1(i,j), B7(i,j), respectively. Bits Planes Technique for Digital Image Processing Norma Ramírez Hernández 1 , José Luis Ramos Quirarte 2 1 Department of Computational Sciences, CUCEI-Universidad de Guadalajara, Jalisco, México 2 Department of Electronics, CUCEI-Universidad de Guadalajara, Jalisco, México Phone/Fax: (33) 1378-5900/7728 E-mail: [email protected] ; [email protected] 2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008) IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE 186

Upload: norma-ramirez

Post on 26-Aug-2014

56 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Bits Planes Technique for Digital Image Processing

Abstract �–�– This work presents a technique for digital image processing. The technique consists on splitting the original image with 256 gray levels into its equivalent 8 binary images. The method is extended for true RGB color images by working out each color plane as a gray scale image and applying the same algorithm development for the former case to convert any intensity level into a byte of 8 bits. The results shown out to be useful for some basic applications such as separating the fine features of an image. Memory space for storing images is reduced since the images can be written in binary formats. Bits planes technique allows for logical operations and after that, get back to a gray scale image or color image very easily. The potential application of this technique is being studied in order to detect some anomalies in digital mammographies. A script in MatLab has been development with some menus to implement the bits planes technique for different image formats.

Keywords �–�– Bits Planes, Color Bits Planes, Digital Image

Processing, Gray Scale Image, RGB Color Image

I. INTRODUCTION During the last years with the increasing use of the computer and its associate software, the digital image processing has become a powerful tool. Several methods and a multitude of algorithms have been development to perform processing on images and to explore new applications. One of the major objectives of digital image processing is oriented to improve the image appearance. Some techniques are designed to suppress interferences or noise, to enhance contrast, etc. But also the measurements of some features of the image are important to do automatic processing. The areas of application of the digital image processing are growing very fast. For example, in medicine it is used to improve X-ray images, to understand with better accuracy the body´s functions, the effects of some drugs by analyzing pictures with colored substances, to investigate the features and behavior of tumors, etc. In the artistic field, digital processing is used to restore photographs and famous pictures that have been deteriorated. Another application is in reconstruction and improvement of images send by spatial missions, photographs of satellites for weather or natural resources applications. Today, an important area that needs more and more image processing are movies and electronic games industries. Of course there are several military applications of digital image processing [1].

In this work a technique based on decomposing an image in its bits planes is presented to do digital image processing.

II. METHODOLOGY To separate an intensity image into eight bits planes, we proceed as shown in Fig. 1. The intensity of each pixel in the original image is considered to be some value between 0 and 255 that is converted in a byte of 8 bits. Depending of the intensity value of each pixel on the original image, there will be a bit on one, some or all the bits planes. By scanning the whole image, there will appear eight images that correspond to the eight bits planes; from the least significative B0 to the most significative B7. To transform the complete image, a simple algorithm was implemented and it is described in the following steps: 1.- We start with the first pixel on the image: r=[i], c=[j]; 2.- The intensity level of the pixel is read: Level; 3.- If Level=0, the least significative plane has a zero: b(0)=0; 4.- If Level , the planes that have ones must be determine: 5.- While Level 6.- The half part of Level is calculated: Half=Level/2; 7.- Half is rounded towards zero: Rounded; 8.- The difference between Half and Rounded is calculated: Dif=Half-Rounded; 9.- If Dif=0, the plane gets a zero: b(q)=0; 10.- If , the plane gets an one: b(q)=1; 11.- The value of Level is adjusted: Level=Rounded; 12.- We move to the next most significative plane: q=q+1; 13.- Steps 5 to 12 are repeated until Level<1; 14.- Zeros and ones are collocated in the different image planes: If b(0)=0, B0(i,j)=0, if b(0)=1, B0(i,j)=1; if b(1)=0, B1(i,j)=0, �… if b(7)=1, B7(i,j)=1. 15.- Auxiliar variables are reset and the level of the next pixel is read; 16.- Steps 3 to 15 are repeated until the whole image is scanned. The images corresponding to the different bits, from the least significative to the most significative, will be represented by the matrices: B0(i,j), B1(i,j), �…B7(i,j), respectively.

Bits Planes Technique for Digital Image Processing

Norma Ramírez Hernández1, José Luis Ramos Quirarte2 1Department of Computational Sciences, CUCEI-Universidad de Guadalajara, Jalisco, México

2Department of Electronics, CUCEI-Universidad de Guadalajara, Jalisco, México Phone/Fax: (33) 1378-5900/7728 E-mail: [email protected]; [email protected]

2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008)

IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE

186

Page 2: Bits Planes Technique for Digital Image Processing

Fig. 1. Splitting a digital image on eight bits planes from B0 to B7

III. RESULTS

A. Bits Planes for an Intensity Image

There are many different type of formats for images: images .tiff (tagged image file format), that can be an indexed color image, a true RGB color image, or a gray scale image; images .jpeg (joint photographic experts group), it can represents a true RGB color image, or a gray scale image, a image .pbm (portable bitmap) is very appropriate for binary images; etc. Due to the great multiplicity of image formats, during the development of this work, a script in MatLab was written to select throw a menu a desired image among different kind of image formats. In order to minimize the computer time, if the image is too big, there is an option to reduce it to an image of about 500X500 pixels. The image is also converted to a gray scale image for some applications. A script in MatLab was also development to implement the algorithm to obtain de bits planes outlined before and some results are shown in the following. In order to apply the development algorithm, the image shown in Fig. 2, that represents an image .tiff of 328X438 pixels in size was chosen and converted to a 0-255 gray levels.

Fig. 2. Image of Saturn in tiff format, 328X438 pixels in size and 0 to 255

gary scale In Fig. 3 are presented the eight bits planes obtained when the bits planes script was used for the image of Fig. 2. The first image represents the least significative plane (B0) and the last one correspond to the most significative (B7).

Fig. 3. Bits planes for the image of Saturn in Fig. 2

Binary Plane, B0 (the least significative) Binary Plane, B1

Binary Plane, B2 Binary Plane, B3

Binary Plane, B4 Binary Plane, B5

Binary Plane, B6 Binary Plane, B7 (the most significative)

2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008)

IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE

187

Page 3: Bits Planes Technique for Digital Image Processing

B. Recovering the original intensity image

In order to recover the original image, each matrix corresponding to each bits plane, has to be multiply by the appropriate decimal: the B0 plane has to be multiply by 1, the B1 plane by 2, the B2 plane by 4, �… , the B6 plane by 64, and the B7 plane by 128. After that, all matrices can be added and the original image is obtained. Since the bits planes least significative contribute only with the finest details of the image, the addition of the five most significative bits planes will give an image that is almost as good as the original is. This is shown in Fig. 4.

Fig. 4. Image composed of the five most significative bits planes

One of the most attractive results by splitting the image in its bits planes is in saving memory space for storing inasmuch the original is only one and the resulting bits planes are eight, these are binary images that can be stored with a convenient format, like for instance .pbm (portable bitmap) that requires very few memory.

C. Logic Operations with Bits Planes

Since the resulting images for the different bits planes are all them binary images, it allows the direct use of logic operations between them. During the last few years, the digital image processing has been used with great success in medical applications. One of the most promising applications is the possibility to be able to make diagnoss of cancerigen tumors during the early faces throw the good use of digital mammographies [2-6]. Since the fact that tumors appear in the mammographies as spots of certain intensity, it seems useful to simplify the original mammography throw logic operations in order to extract some useful information for further processing.

Sometimes it is convenient to enhance or to show only some intensities of a mammography for further processing. For purposes of time consuming, in Fig. 5 it is shown a reduced original mammography and in Figs. 6 and 7, there are shown images obtained by the use of AND and OR logic operations of some of the bits planes for the image of Fig. 5 where some relevant characteristics of the mammography are enhanced.

Fig. 5. Mammography used for processing

Fig. 6. Logic operation: AND between B5 and B6 planes

Fig. 7. Logic operation: OR between B6 and B7 planes

Image of the restored Planes: B7, B6, B5, B4 and B3

Converted image from RGB.jpeg to gray scale

Image of the logic Operation AND: Planes B6 and B5

Image of the logic Operation OR: Planes B7 and B6

2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008)

IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE

188

Page 4: Bits Planes Technique for Digital Image Processing

D. Bits Planes for a RGB True Color Image

A RGB Image is stored as a three-dimensional (m-by-n-by-3) array of integers in the range [0, 255]. The three planes correspond to the red color, the green color and the blue color respectively. Fig. 8 shows a RGB image that has been reduced in size in order to get better computer response. Throw a computer program made in MatLab, it is possible to see the three color planes of the color image. These color planes are shown in Figs. 9, 10 and 11.

Fig. 8. Original RGB color image

Fig. 9. Red plane of the RGB color image of Fig. 8

Fig. 10. Green plane of the RGB color image of Fig. 8

Fig. 11. Blue plane of the RGB color image of Fig. 8

In order to obtain the bits planes of the RGB color image, each color plane (red, green and blue) is worked out as a gray scale image with 0 to 255 levels and using the same software that implements the development algorithm. Obviously, in this case it will be 24 bits planes, 8 for each color plane. In Fig. 12 are presented two bits planes of the eight corresponding to each color plane.

Fig. 12. Examples of bits planes in intensity for each color plane of Figs. 9,

10 and 11 As it was explained before, the bits planes shown in Fig. 12, correspond to intensity bits planes so if it is desired to obtain bits color planes, it is necessary to fuse the bits planes of the three color planes in the appropriate order: B0r+B0g+B0b, B1r+B1g+B1b, �… etc. the software includes this option allowing us to observe the behavior of the bits color planes.

RGB color Image .jpg for processing

Color Image: Red Plane

Color Image: Green Plane

Color Image: Blue Plane

Color Image: Red Plane; B4 Color Image: Red Plane; B6

Color Image: Green Plane; B3 Color Image: Green Plane; B4

Color Image: Blue Plane; B3 Color Image: Blue Plane; B5

2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008)

IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE

189

Page 5: Bits Planes Technique for Digital Image Processing

The resulting planes for the image of Fig. 8 that also represents the fusion of the 24 bits planes like the shown in Fig. 12, are presented in Fig. 13.

Fig. 13. Bits color planos for a RGB image E. Recovering of the RGB Image To recover the original color image, one proceeded in an analogous way to the case of images in levels of grey. Nevertheless, due to the own characteristics of the images RGB, we put in the program two procedures: The first one consists of adding in a considered way every plane of bits of every plane of color of an independent way to obtain hereby three planes of intensity corresponding to every color. The result obtained for the example of the Fig. 12, it appears in the Figs. 14, 15 and 16. The image in color is obtained by merging the three previous planes. The result is showed in the Fig. 17.

Fig. 14. Red plane recovered from the bits planes

Fig. 15. Green plane recovered from the bits planes

Fig. 16. Blue plane recovered from the bits planes

Color Image: Color Plane, B0 Color Image: Color Plane, B1

Color Image: Color Plane, B2 Color Image: Color Plane, B3

Color Image: Color Plane, B4 Color Image: Color Plane, B5

Color Image: Color Plane, B6 Color Image: Color Plane, B7

Red Color Image. All the Planes

Green Color Image. All the Planes

Blue Color Image. All the Planes

2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008)

IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE

190

Page 6: Bits Planes Technique for Digital Image Processing

Fig. 17. RGB image recovered from the 24 bits planes

The second procedure incorporated in the program consists of the merger of 8 bits color planes. For the example presented in this work, it corresponds to the planes showed in the Fig. 13. The result as it was of waited, coincides with the image of the Fig. 17 and it is shown in the Fig. 18.

Fig. 18. RGB image recovered from the 8 bits color planes F. Logic Operations with the Bits Color Planes

In the case of the images in levels of grey, binary planes are obtained. Then it is possible to realize logical operations with the diverse planes of bits. In this case, it is feasible realize logical operations with planes of bits correspondents to every plane of color or, to experiment with planes of bits of two or of three planes of color depending on what one tries to show. The obtained results are very interesting, but there would be necessary to analyze images with different characteristics in order to be able to do appropriate recommendations.

IV. CONCLUSION This work has presented a method to separate into its elements an image in levels of grey to his representation in 8 binary planes and from an image RGB to color in his 24 binary planes or equivalently to his 8 binary planes to color. The fundamental intention of this work is to present this technology as one more tool, which allows enhancement the digital processing of the images. Eliminate some characteristics, highlight others or stand out certain information, and inclusive to save space of storage or of sending of information. Interesting results have been obtained for both types of images but it is important to mention that practical applications like the Figs. 5-7 are very promising but the study is in process since a great quantity of cases they have to be analyzed to obtain conclusive results. With regard to the use of the logical operations with the planes of bits, it allows to eliminate or to extract with facility certain characteristics of the image, such as its thin details. With the purpose of enriching this technology, one is employed at the search of finding correlations with other characteristics. Example: with the histogram of the image.

REFERENCES

[1] R.C Gonzalez, R.E.Woods �“Tratamiento digital de imágenes�” Ed. Addison-Wesley, 1996.

[2] Liyang Wei, Yongyi Yang, Robert M. Nishikawa, Miles N. Wernick, and Alexandra Edwardsm, �”Relevance Vector Machine for Automatic Detection of Clustered Microcalcifications�”, IEEE transactions on medical imaging, vol. 24, no. 10, october 2005, pp. 1278-1285.

[3] Robert A. Brown*, Hongmei Zhu, and J. Ross Mitchell , �“Correspondence Distributed Vector Processing of a New Local MultiScale Fourier Transform for Medical Imaging Applications�” IEEE Transactions on medical imaging, vol. 24, no. 5, may 2005 689 pp.689-691.

[4] Segyeong Joo, Yoon Seok Yang, Woo Kyung Moon, and Hee Chan Kim*, Member, IEEE, �“Computer-Aided Diagnosis of Solid Breast Nodules: Use of an Artificial Neural Network Based on Multiple Sonographic Features�”, IEEE transactions on medical imaging, vol. 23, no. 10, october 2004, pp. 1292-1300.

[5] J. D. Martínez, J. M. Benlloch, J. Cerdá, Ch. W. Lerche, N. Pavón, and A. Sebastiá �“High-Speed Data Acquisition and Digital Signal Processing System for PET Imaging Techniques Applied to Mammography�”, IEEE transactions on nuclear science, vol. 51, no. 3, june 2004, pp. 407-412.

[6] Norma Ramírez Hernández, �“Procesamiento de Imágenes Médicas�”, Tesis de Maestría en Ciencias en Ingeniería Electrónica, CUCEI, U. de G., Diciembre de 2006.

Restored Color Image with Restored Planes

Color Image: Made of all the Color Planes

2008 5th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE 2008)

IEEE Catalog Number: CFP08827-CDR ISBN: 978-1-4244-2499-3 Library of Congress: 2008903800 978-1-4244-2499-3/08/$25.00 ©2008 IEEE

191