{'fraction_non_alphanumeric': 0.026161543959971407, 'fraction_numerical': 0.0052894924946390275, 'mean_word_length': 4.8642078792958925, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Image Enhancement Using Modified Partial Contrast Technique in Ziehl-Neelsen Sputum Slide Images

Image contrast and brightness for sputum slide images are among important factors that can affect the accuracy of image analysis process. Microscopic images usually have the problem of low contrast and blurry, which are caused by a couple of factors such as uneven thickness of the slides and manual preparation of the slide in the first place. In this research, image enhancement procedure has been considered for either increasing the image quality, increasing the visibility of tubercle bacilli or to ease the segmentation process. Partial contrast technique is considered for the contrast enhancement method. The results show that the modified technique helps to improve tubercle bacilli visibility. Hence the resulted images would become useful for the microbiologists and technologists for further analysis of Ziehl-Neelsen (ZN) sputum slide.


Introduction
Several computer-aided image diagnosis methods for tuberculosis (TB) detection have been described in the literature [1 -5]. These methods can be divided into two approaches: using fluorescence and light microscope. Early works focused on using the fluorescence microscope [1 -3]. Images viewed using a fluorescence microscope is more sensitive to TB bacilli and the screening process can be conducted quickly under lower magnification, compared to the light microscope [4]. However, it is expensive and difficult to maintain, thus limiting the use of fluorescence microscope in low and medium income countries. Therefore, recent works in detecting pulmonary tuberculosis (PTB) used images acquired from both fluorescence and light microscope [5 -7]. The specimens are stained using Ziehl-Neelsen (ZN) staining procedure to visualize the bacilli. The automated technique can save the time and cost involved, with reduced human error.
Image contrast and brightness for sputum slide images are among important factors that can affect the accuracy of image analysis process. Microscopic images usually have the problem of low contrast and blurry, which are caused by a couple of factors which have been mentioned earlier. In this paper, image enhancement procedure has been considered for either increasing the image quality, increasing the visibility of TB bacilli or to ease the segmentation process. Modified approaches to perform image enhancement using partial contrast algorithm is presented. The performances of the method are being presented through the resulted image of Ziehl-Neelsen slide after the image enhancement process has been done.

Methodology
The aim of partial contrast is to generate an image with higher contrast than the original image. Stretching method is carried out by modifying each pixel value to a new value using pre-specified function. Linear stretching will generally improve the overall contrast of an image. Contrast stretching is a process that applies auto-scaling method, which is a linear mapping function. It is usually used to enhance the brightness as well contrast level of the image. The general mapping function is shown in Equation 1 [8].
By applying this technique, the value of pixels within the range of min f and max f will be stretched to a wider new range of min and max . On the other hand, the pixels with values that are outside of this range will be compressed.
In the original algorithm, the technique is meant to be applied to monochrome image that only have one intensity level, which is its greyscale intensity ranging from 0 to 255. However, since the sputum slide images are colour images, modifications need to be made to adopt the original algorithm for implementation on colour images. Colour imaging may be considered as a layered intensity image processing scheme. This is based on the assumption that each of the colour layers can be processed separately and finally the results are combined. In this study, the process of stretching and compressing for partial contrast technique is implemented as illustrated in Fig. 1.
Each pixel in colour images are represented by three components; red (R), green (G) and blue (B). Therefore, in order to accommodate the algorithm of partial contrast, each parameter in Equation 2 will need to consider for the values from these RGB components. Therefore, the technique is done separately for all three components. Some modifications have been made to the original partial contrast algorithm to be applied to the sputum slide images. The procedure for implementing partial contrast technique in this study is mentioned as follows: i) Read the intensity value of RGB component for each pixel of the original image. ii) Develop the RGB histograms for original image using the intensity values obtained. iii) Find the intensity value of

min(G), min(B) , max(R), max(G) and max(B) for each parameter. iv) Perform partial contrast algorithm for each of the RGB component based on Equation 2. v)
Construct the output image using the combination of RGB components obtained in step (iv). Initialize the current intensity value to 0. iii) Find out the total number of pixels (from the whole image) for each of the specified parameter which is having the current intensity value. iv) Sum up the number of pixels obtained in (iii) with the previous summation value (summation value starts with 0). v) Calculate the current percentage of the summation value by using Equation 3.
If the result of current percentage is less than the percentage value chosen in (i), increase the current intensity value by 1 and go back to step (iii). vii) If the result of current percentage is equal or more than the percentage value chosen in (i), then take the current intensity value as the real intensity value for the specified parameter.
The reason of using percentage value for the parameters is because each of the images has different minimum and maximum intensity level. ) values, the images that are having a minimum intensity of 60 ( min ) and maximum intensity of 150 ( max ) would not experience a complete partial contrast process on its pixels.
In this research, the percentage value for step (iii) that has been chosen for parameters On the other hand, the real intensity value that has been chosen for parameter min(R) , min(G) and min(B) is 10 while intensity value for max(R), max(G) and max(B) is 245. After partial contrast, the intensity level for RGB components will be spread out to values between 10 and 245. Fig. 2 illustrates the process of compressing and stretching the pixels to new intensity value. The usage of partial contrast technique helps to increase the contrast for images with low contrast. Images can appear too bright if the sputum smear on the specimen slide is too thin at that particular field that is being captured. On the other hand, images can appear darker if the sputum smear on the specimen slide is too thick. Fig. 3 shows the resulted image for partial contrast process together with their histograms.