05 - Chapter 5 Image Enhancement Part5
05 - Chapter 5 Image Enhancement Part5
import pydicom
import numpy as np
import skimage.exposure as imexp
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
from PIL import Image
file_name = "../Figures/FluroWithDisplayShutter.dcm"
dfh = pydicom.read_file(file_name, force=True)
im = dfh.pixel_array
# convert to float and scale before applying filter
im = im.astype(np.float)
im1 = im/np.max(im)
im4 = Image.fromarray(im3).convert("L")
im4.save('../Figures/local_normalization_output.png')
im4.show()
The authors have found that this filter works especially well for
highlighting high-contrast objects surrounded by low-contrast struc-
tures.
Image Enhancement 121
5.11 Summary
• Image inverse transformation is used to invert the pixel intensities
in an image. This process is similar to obtaining a negative of a
photograph.
5.12 Exercises
1. Explain briefly the need for image enhancement with some exam-
ples.
7. In sigmoid correction, the choice of the cutoff and gain will deter-
mine the quality of the output image. The readers are recom-
mended to try different settings for the hyper-parameter to under-
stand their effect.