69 CHAPTER 6: REGION OF INTEREST (ROI) BASED IMAGE COMPRESSION FOR RADIOGRAPHIC WELD IMAGES 6.0 INTRODUCTION Every image has a background and foreground detail. The background region contains details which can be compromised during compression. The details in the foreground region represent the object captured during imaging. This detail of the object can t be compromised during compression for radiographic weld and medical images. This foreground region is called as the Region of Interest (ROI). To identify the ROI, segmentation techniques are more suitable. A number of segmentation techniques are available in the literature and for our study the threshold based segmentation is used. Tsallis entropy is calculated and used as the threshold value in the segmentation process. After obtaining the ROI through the segmentation process, the background of the image is compressed using lossy compression technique and the ROI is compressed using lossless compression. ROI is compressed using lossless compression because the accuracy of the details is of high importance for weld and medical radiographic images. 6.1 TSALLIS ENTROPY Segmentation of images results in separation of image objects from
70 the background. The area of interest in an image is obtained by segmenting it based on a certain threshold value. This threshold value can be designated by entropy method: One such method is the Tsallis entropy method. The Tsallis entropy was first used by Albuquerque et al. to obtain threshold values for segmenting digital images (Lin et al., 2012). Let p 1, p 2,.. p n be the probability distribution of the gray level histogram of an image. Thus, two probability distributions can be derived from this distribution, one for the background (class A) and the other for the object (class B). They can be written as (Albuquerque et al., 2004) A: p 1 P A, p 2 P A,.., p t P A (6.1) B: p t+1 P B, p t+2,.., p n (6.2) P B P B t where P A = i=1 p i and P B = i=t+1 p i H q A (t) = 1 t ( Pi i=1 ) q P A H q B (t) = 1 ( n q 1 (6.3) n P i i=t+1 ) q P B q 1 (6.4) H q A+B (t) = H q A (t) + H q B (t) + (1 q)h q A (t)h q B (t) (6.5) The maximum of H q A+B (t) is used as the optimal threshold value to form segments of the digital image. Upon segmentation the pixels at the region of interest are assigned white colour while the other pixels are assigned black. This segmented image is stored and then used for compression. The Albuquerque s method improved further for the images
71 having the neighbouring long-range association which is useful for segmentation. The modified equations are given below and there is no change in the H B q (t)(lin et al., 2012). t opt = Arg max min{h A (t), H B q (t) (6.6) H A (t) = t i=1(p i P A ) ln(p i P A ) (6.7) 6.2 PROPOSED MODIFIED TSALLIS ENTROPY Tsallis entropy given in equation 6.6 is used for image segmentation. The result obtained by this segmentation process does not identify the ROI accurately. Varying the parameter q in equation 6.6 showed that the quality was better for q=0.8. Adding a constant parameter C to the equation 6.4 and 6.7 leads to better results. The value of C was found to be in between 75 and 100 for radiographic images. The modified versions of equation 6.4 and 6.7 are given below. Threshold value will be calculated based on equation 6.6 as follows: H A q (t) = t i=1 C {(p i P A ) ln(p i P A )} (6.8) H q B (t) = n P 1 C {( i i=t+1 ) q } P B q 1 (6.9) The constant value C used in the equation 6.8 and 6.9 amplifies the entropy which leads to identifying the ROI more accurately.
72 6.3 ROI BASED IMAGE COMPRESSION The image segmented using modified Tsallis entropy (expressed in equation 6.8 and 6.9) gives us the region of interest. Since lossy compression techniques give better compression results with the accuracy compromised, they are used only for non crucial regions of the image. The crucial regions are compressed using lossless compression techniques. This increases the efficiency of process by retaining the accuracy of crucial region alone and the rest of the region is not given much importance on accuracy. For the industrial weld radiographic images, the modified Tsallis entropy expression gives the threshold value. Based on this threshold value, the image is divided into ROI and non-roi. The ROI contains the details about weld part and non-roi contains details about the rest of the part. Similarly for the medical radiographic image, the ROI contains details about bone or other diagnostically important parts (Gokturk., 2001). The non-roi contains details about background of the image or rest of the parts. Generally, Huffman coding is used since it is lossless coding algorithm. It has many advantages like it uses small code words for high probability elements and the converse for the lesser probable elements. Applying Huffman coding in the digital image segmented using modified Tsallis entropy thresholding method satisfies the previously mentioned criteria. It compresses the region of interest effectively since the
73 segmentation of image converts the pixels intensity at region of interest to white (1) while the other pixels into black (0). The ROI in the actual image is identified by retaining the values of the pixel for which the values are 1 in the segmented image. The values of all other pixel are made as zero. The entire image obtained after this process is compressed using the Huffman compression. These steps constitute the compression part which completes by transmitting the compressed image to the required destination. Along with the compressed image the corresponding dictionary and some other important details like the size of image data at various stages that will be used for decompression or extraction. The transmission of compressed image has advantages like reduced bandwidth requirements, high speed and therefore low time. Also, security is increased since the compressed data is not meaningful if viewed by any third party without proper decoder. The other side receives these details and reconstructs the image using the same Huffman coding and the dictionary. The resulting image is of the same details at the region of interest i.e. crucial regions but varies at other non-crucial areas. The block diagram for encoding and decoding process is shown in Figures 6.1 and 6.2 respectively. The modified Tsallis entropy based segmentation which is proposed in equation 6.7 and 6.8 and ROI based image compression is also applied to medical radiographic
74 images. These concepts are tested for various images and have been verified that it also works for most of the medical radiographic images. INPUT IMAGE IMPROVED TSALLIS ENTROPY THRESHOLDING STORING INFORMATION OF CRUCIAL REGIONS HUFFMAN CODING COMPRESSED DATA AND DICTIONARY Figure 6.1: Block diagram for encoding process COMPRESSED DATA, DICTIONARY AND OTHER INFORMATIONS HUFFMAN DECODING PLOT INTENSITY VALUES USING DECODED DATA DECOMPRESSED IMAGE Figure 6.2: Block diagram for decoding process 6.4 RESULTS AND DISCUSSION The compression method discussed above is tested on various images and the results are summarized. The Figure 6.3 (a) (d) is the set of test images that are used for analysis. The Figure 6.4 (a) (d) shows the segmented results of the test images. The results of these images after decompression are shown in Figure 6.5 (a) (d) respectively. The Table 6.1 summarizes the size of the images after compression.
75 (a) (b) (c) (d) Figure 6.3: (a) (d) Sample weld radiographic images before compression
76 (a) (b) (c) (d) Figure 6.4: (a) (d) Corresponding segmented images of Figure 6.3
77 (a) (b) (c) (d) Figure 6.5: (a) (d) Decompressed images of Figure 6.3
78 The Table 6.1 shows the comparison of storage space usage by JPEG 2000 lossy ( Lossy) and lossless ( Lossless) with Huffman and the proposed methods. Their compression ratio and the amount of storage space that can be saved in percentage are also tabulated in Table 6.2 and 6.3 respectively. The compression ratio (Salomon., 2004) can be calculated by using equation 6.10. Compression Ratio = size of the output file size of the input file (6.10) Table 6.1: Comparison of storage space usage (in KBs) by different methods for weld radiographic images IMAGE INPUT SIZE LOSSLESS LOSSLESS HUFFMAN PROPOSED METHOD Img1 673.64 500.65 533.71 245.89 151.00 Img2 178.00 87.22 95.37 48.84 34.02 Img3 15625.70 3239.92 4275.60 1993.52 1876.16 Img4 219.14 107.36 119.93 59.45 39.75 Table 6.2: Comparison of compression ratio by different methods for weld radiographic images IMAGE LOSSLESS LOSSY HUFFMAN PROPOSED METHOD Img1 0.743 0.792 0.365 0.224
79 Img2 0.490 0.536 0.274 0.191 Img3 0.207 0.274 0.128 0.120 Img4 0.490 0.547 0.271 0.181 Table 6.3: Comparison of storage space saved (in %) by different methods for weld radiographic images IMAGE LOSSLESS LOSSY HUFFMAN PROPOSED METHOD Img1 25.68 20.77 63.50 77.58 Img2 51.00 46.42 72.56 80.89 Img3 79.27 72.64 87.24 87.99 Img4 51.01 45.27 72.87 81.86 Space saved (%) 100 90 80 70 60 50 40 30 20 10 0 Img1 Img2 Img3 Img4 Sample Images lossless lossy Huffman Proposed Figure 6.6: Comparison of storage space saved for weld radiographic image
80 From the above results, it is concluded that the proposed method performs better than JPEG 2000 lossless by 8% to 51% for the weld radiographic image. This is shown in Figure 6.6. The following Figures 6.7, 6.8 and 6.9 shows the initial medical radiographic image, Tsallis entropy based image segmentation and modified Tsallis entropy based segmentation correspondingly. The modified Tsallis entropy gives better image segmentation than the Tsallis entropy based image segmentation. The quality of the image segmentation is a subjective parameter. (a) (b)
81 (c) Figure 6.7: (a) Medical radiographic image1, (b) Results of Tsallis entropy based segmentation, (c) Results of Modified Tsallis entropy based segmentation (a) (b)
82 (c) Figure 6.8: (a) Medical radiographic image2, (b) Results of Tsallis entropy based segmentation, (c) Results of Modified Tsallis entropy based segmentation (a) (b)
83 (c) Figure 6.9: (a) Medical radiographic image3, (b) Results of Tsallis entropy based segmentation, (c) Results of Modified Tsallis entropy based segmentation The modified Tsallis entropy gives more accurate ROI than the previous results. In ROI, lossless compression has to be used as loss of information cannot be tolerated whereas in non-roi lossy compression is used. This technique is applied for various medical radiographic images and some results are as shown in Figure 6.10.
84 (a) (b) (c) (d)
85 (e) (f) Figure 6.10: (a), (c) & (e) Sample medical radiographic images before compression and (b), (d) & (f) its corresponding decompressed images The performance comparison of storage space usage, compression ratio and space saved for the radiographic medical images is tabulated in Table 6.4 to 6.6. Table 6.4: Comparison of storage space usage (in KBs) by different methods for medical radiographic images IMAGE INPUT SIZE LOSSLESS LOSSY HUFFMAN PROPOSED METHOD Img1 22149.4 9194.25 7058.6 9795.91 7931.8 Img2 4604.53 1299.84 1087.5 2780.07 1223.9 Img3 4604.53 1883.16 1563.8 3342.44 1628.1 Img4 1154.28 491.38 174.29 940.48 467.05
86 Table 6.5: Comparison of compression ratio by different methods for medical radiographic images IMAGE LOSSLESS LOSSY HUFFMAN PROPOSED METHOD Img1 58.49 68.13 55.77 64.19 Img2 71.77 76.38 39.62 73.42 Img3 59.10 66.04 27.41 64.64 Img4 57.43 84.90 18.52 59.54 Table 6.6: Comparison of storage space saved (in %) by different methods for medical radiographic images IMAGE LOSSLESS LOSSY HUFFMAN PROPOSED METHOD Img1 0.415 0.319 0.442 0.358 Img2 0.282 0.236 0.604 0.266 Img3 0.409 0.340 0.726 0.354 Img4 0.426 0.151 0.815 0.405 From the above results, for the medical radiographic image it can be concluded that the proposed method performs better than JPEG 2000 lossless by 2% to 5%. The weld radiographic images provide more disk space saving than the medical radiographic images because it has less distinct gray value.
87 6.5 SUMMARY This chapter explains the advantages of compression of digital images, especially weld and medical radiographic images. To maintain accuracy of certain crucial regions, the image is segmented by using proposed modified Tsallis entropy and then compressed using Huffman coding, a type of lossless encoding scheme. As lossless encoding is used, the decompressed image retains its crucial regions exactly as the original image thereby increasing the efficiency of the process. The identification of ROI is a very crucial parameter in ROI based image compression. This chapter concludes that a modified Tsallis entropy expression which is used to identify the ROI in an efficient manner.