Contrast Enhancement of Medical X-Ray Image Using Morphological Operators with Optimal Structuring Element Rafsanjany Kushol #

Contrast Enhancement of Medical X-Ray Image Using
Morphological Operators with Optimal Structuring Element
Rafsanjany Kushol #, Md. Nishat Raihan?, A. B. M. Ashikur Rahman£, Md Sirajus Salekin*
# ? £Department of Computer Science and Engineering, Islamic University of Technology, Bangladesh
# [email protected], ? [email protected], £ [email protected], *[email protected]

Abstract—This is the abstract section.

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
Writers Experience
Recommended Service
From $13.90 per page
4,6 / 5
Writers Experience
From $20.00 per page
4,5 / 5
Writers Experience
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team

Index Terms—Medical X-Ray image, Contrast
enhancement, Top-hat, Bottom-hat, Structuring element size.
With the rapid increase in the usage and applications of
medical images, it has become quite common to
implement image enhancement methods on various types
of medical images. The enhancement methods are
fundamentally a collection of techniques that are used so
that the visual quality of the image is improved. In several
types of medical images, extracting features visually is
quite difficult for human eye. Without necessary
enhancements, these images are not always usable.
Nowadays, Medical image enhancement techniques are
playing more and more important roles not only in the
diagnosis and treatment of diseases but also in disease
prevention, health checking, severe disease screening,
health management, early diagnosis etc.
One of the major types of medical image is X-Ray
image. Discovered in 1901, X-Ray images have
revolutionised the world of medical science. X-Rays can’t
be seen, felt or heard but they can effortlessly pass through
skin, bone and metal to produce images that the human
eye would never be able to see. There are far too many
applications of X-Ray images not only in medical science
but also in all other fields. The most common applications
are the detection of broken bones inside human body,
detection of several types of diseases and the radiation
therapy. Also X-Ray images are used in human
identification 1 and airport security. Almost every
airport nowadays is fitted with some form of x-ray
security system that can scan baggage to check for
dangerous items.
Medical science recognizes different types of X-Ray
images. Chest X-Rays are prescribed in case of shortness
of breath, fever, chest pain etc. While lungs X-Rays are
done comparing the upper, middle and lower zones of the
lungs. The most common type is the teeth and bones X-
rays which give high level of details about bones, teeth
and supporting tissues of the mouth. In the cases of bones
and teeth X-Ray images, detection of broken or cracked
bones and any type of dental diseases can be detected
straight from the X-Ray images as these images contain
quite high level of information compared to the other
types of X-Ray images. So with efficient enhancement
techniques applied, judging these X-Ray images can be a
lot easier.
X-Ray images are commonly grey-scale images with
high amount of noises and low level of intensity. Also the
contrasts in these images are poor and the boundary
representation tends to be weak 2. With very limited
information and low quality image, visually feature
extraction from these X-Ray images is quite a challenging
task. The quality of these images can be enhanced by
applying some pre-processing enhancement techniques.
Thus segmentation and feature extraction from these
images can be done visually with more efficiency and
Due the huge amount of applications in many areas of
our lives, especially in the medical diseases diagnosis, the
field of medical image enhancement is a very important
aspect of medical image processing.
There are quite some notable works on X-Ray images
of the chest in recent years. While examining any X-Ray
image of chest (CXR), it is very important to know from
which viewing angle it is observed. Zhiyun Xue et al. 3
developed a methodology to detect whether a chest X-Ray
image (CXR) is the frontal view or the lateral view based
on histogram of oriented gradients and contour based
shape descriptor. There also has been works on detecting
common diseases from the CXR of a patient. Pranav
Rajpurkar et al. 4 developed their own algorithm
CheXNet based on a 121 layered Convolutional Neural
Network that can detect radiologist-level pneumonia from
X-Ray images of the chest. Also Hoo-Chang Shin et al. 5
designed a deep learning model based on Convolution
Neural Network and Recurrent Neural Network to detect
common diseases from chest X-Ray images and annotate
its context (e.g., location, severity etc.).
In case of dental X-Ray images commonly referred as
DXR images, these are used to detect several types of
dental diseases, cracks and the overall condition of the

teeth. Jufriadif et al. 6 implemented a Multiple
Morphological Gradient (mMG) method on panaromic
DXR images to detect dental carries. Also Tran Thi Ngan
et al. 7 designed a framework to first divide the DXR
into some segments and then detect the potential diseases
using fuzzy aggregation operators and Affinity
Propagation Clustering (APC+).
For X-Ray images of bones it is important to enhance
the quality of the image as it consists of a lot of
information in it. Ren You-Huang et al. 8 suggested a
noise removal and contrast enhancement method based on
two stage filtering, adaptive filtering and bilateral filtering.
They improved contrast by applying grey-level
morphology and contrast limited histogram equalization
(CLAHE). Wang Rui et al. 9 used completely new type
of filter called TV-Homomorphic filter to enhance the
image further. On the other hand Yijiang Zhang et al. 10
implemented Fruit Fly algorithm to enhance the quality of
the image.
Work Year Method Used
Chest CXR Image
2015 Histogram of Oriented
Gradients and Contour-based
Shape Descriptor
CheXNet 4 2017 CNN
diseases and
annotate its
context 5
2016 CNN and RNN
Dental Detection of
Dental Carries
2016 mMG Method
diseases from
DXRs 7
2016 Fuzzy Aggregation Operators
and APC+
Bone Noise
Reduction and
2016 Grey-level morphology and
Based on TV-
Filter 9
2017 Filter

X-Ray Image
using the
Fruit Fly
2014 Fruit Fly Algorithm
The stages of the proposed methodology is noted below.
A. Image Pre-processing

B. Apply Combined Top-hat and Bottom-hat Transform

C. Finding Optimal Structuring Element Size

Experiment is performed in MATLAB software with a
system environment of 2.20GHz processor and 8GB RAM.
A. Dataset
We used five different datasets for our experiment to
test how our proposed method performs. Firstly,
Montgomery County chest X-ray set 11 is used. It
contains 138 frontal chest X-rays from Montgomery
County’s Tuberculosis screening program, of which 80 are
normal cases and 58 are cases with manifestations of TB.
Secondly, from the same work, Shenzhen chest X-ray set
11 is used, which consists of 662 frontal chest X-rays,
of which 326 are normal cases and 336 are cases with
manifestations of TB. These two datasets have moderate
amount of data and is well organized.
Thirdly, the dataset used by Ching-Wei Wang et al. 12
is used. It contains 400 dental X-Ray images in TIFF
format and these were explored by certified doctors to
label them. Fourthly, the JSRT dataset 13 is used which
consists of 247 images of chest X-Ray images from 13
medical institutions in Japan. This dataset is quite old but
heavily used in the field of X-Ray image enhancement.
Fifthly, another old dataset used by Junji Shiraishi et al.
14 is used that has 154 chest X-Ray images.
Finally, the ChestX-ray8 dataset 15 is used which is
the largest dataset we worked with. It comprises of
108,948 frontal view X-ray images of 32,717 unique
patients with eight disease image labels (where each
image can have multi-labels). The eight type of diseases
are – Atelectasis, Cardiomegaly, Effusion, Infiltration,
Mass, Nodule, Pneumonia, Pneumothorax.
Year Attributes
County chest
X-ray set 11

Number of Images: 138
Medical Organ: Chest (Frontal)
Image Type: PNG
Image Resolution: 4,020×4,892 or
4,892×4,020 pixels

chest X-ray set
2014 Number of Images: 662
Medical Organ: Chest (Frontal)
Image Type: PNG
Image Resolution: 3K×3K pixels
Dataset used by
Wang et al.
2016 Number of Images: 400
Medical Organ: Dental
Image Type: TIFF
Image Resolution: 1935 × 2400 pixels
JSRT Database
2004 Number of Images: 247
Medical Organ: Chest
Image Resolution: 2048 × 2048 pixels
Dataset used by
Junji Shiraishi
et al. 14
1999 Number of Images: 154
Medical Organ: Chest
Image Resolution: 2048 × 2048 pixels
2017 Number of Images: 108948
Medical Organ: Chest (Frontal)
Image Resolution: 2000 × 3000 pixels

B. Comparison with other methods


identification using X-Ray image matching. InProceedings
of the International MultiConference of Engineers and
Computer Scientists 2017 (Vol. 1).
2 R. Ramani, N. S. Vanitha, and S. Valarmathy, “The pre-
processing techniques for breast cancer detection in
mammography images,” Int. J. Image, Graph. Signal
Process, vol. 5, no. 5, 2013, pp. 47–54.
3 Xue, Z., You, D., Candemir, S., Jaeger, S., Antani, S.,
Long, L.R. and Thoma, G.R., 2015, June. Chest x-ray
image view classification. In Computer-Based Medical
Systems (CBMS), 2015 IEEE 28th International
Symposium on (pp. 66-71). IEEE.
4 Rajpurkar, P., Irvin, J., Zhu, K., Yang, B., Mehta, H., Duan,
T., Ding, D., Bagul, A., Langlotz, C., Shpanskaya, K. and
Lungren, M.P., 2017. Chexnet: Radiologist-level
pneumonia detection on chest x-rays with deep learning.
5 Shin, H.C., Roberts, K., Lu, L., Demner-Fushman, D., Yao,
J. and Summers, R.M., 2016. Learning to read chest x-rays:
Recurrent neural cascade model for automated image
annotation. In Proceedings of the IEEE conference on
computer vision and pattern recognition (pp. 2497-2506).
6 Naam, J., Harlan, J., Madenda, S. and Wibowo, E.P., 2016.
The Algorithm of Image Edge Detection on Panoramic
Dental X-Ray Using Multiple Morphological Gradient
(mMG) Method. International Journal on Advanced
Science, Engineering and Information Technology, 6(6),
7 Ngan, T.T., Tuan, T.M., Minh, N.H. and Dey, N., 2016.
Decision making based on fuzzy aggregation operators for
medical diagnosis from dental X-ray images. Journal of
medical systems, 40(12), p.280.M. Shell. (2007) IEEEtran
webpage on CTAN. Online. Available:
8 Huang, R.Y., Dung, L.R., Chu, C.F. and Wu, Y.Y., 2016.
Noise Removal and Contrast Enhancement for X-Ray
Images. Journal of Biomedical Engineering and Medical
Imaging, 3(1), p.56.
9 Rui, W. and Guoyu, W., 2017, June. Medical X-ray image
enhancement method based on TV-homomorphic filter. In
Image, Vision and Computing (ICIVC), 2017 2nd
International Conference on (pp. 315-318). IEEE.
10 Zhang, Y., 2016. X-Ray Image Enhancement using the
Fruit Fly Optimization Algorithm. International Journal of
Simulation–Systems, Science & Technology, 17(36).
11 Jaeger, S., Candemir, S., Antani, S., Wáng, Y.X.J., Lu, P.X.
and Thoma, G., 2014. Two public chest X-ray datasets for
computer-aided screening of pulmonary diseases.
Quantitative imaging in medicine and surgery, 4(6), p.475.
12 Wang, C.W., Huang, C.T., Lee, J.H., Li, C.H., Chang,
S.W., Siao, M.J., Lai, T.M., Ibragimov, B., Vrtovec, T.,
Ronneberger, O. and Fischer, P., 2016. A benchmark for
comparison of dental radiography analysis algorithms.
Medical image analysis, 31, pp.63-76.
13 B. van Ginneken, M. Stegmann, M. Loog, Segmentation of
anatomical structures in chest radiographs using supervised
methods: a comparative study on a public database, Med.
Image Anal. 10 (2006) 19–40
14 Shiraishi J, Katsuragawa S, Ikezoe J, Matsumoto T,
Kobayashi T, K-i Komatsu, et al. Development of a digital
image database for chest radiographs with and without a
lung nodule: receiver operating characteristic analysis of
radiologists’ detection of pulmonary nodules. Am J
Roentgenol. 2000;174(1):71–74.
15 Wang, X., Peng, Y., Lu, L., Lu, Z., Bagheri, M. and
Summers, R.M., 2017, July. Chestx-ray8: Hospital-scale
chest x-ray database and benchmarks on weakly-
supervised classification and localization of common
thorax diseases. In Computer Vision and Pattern
Recognition (CVPR), 2017 IEEE Conference on (pp.
3462-3471). IEEE.