Lecture 5
Image Enhancement in Spatial Domain - I
Background
Intensity Transformation Functions:
● Negative
● Log
● Gamma
● Contrast Stretching
● Intensity-level Slicing
● Bit-plane Slicing
❖ The term spatial domain refers to the image plane itself.
❖ Image processing methods in spatial domain are based on direct
manipulation of pixels in an image.
❖ Principal categories of spatial processing:
➢ Intensity Transformations
➢ Spatial Filtering
❖ Intensity transformations operate on single pixels of an image for tasks such
as contrast manipulation and image thresholding.
❖ Spatial filtering performs operations on the neighborhood of every pixel in an
image. Examples of spatial filtering include image smoothing and sharpening.
lecture
(a) (b)
Image enhancement
● Manipulate an image such that the result is more suitable than the original for a specific application.
● A method that is quite useful for enhancing X-ray images may not be the best approach for
enhancing infrared images.
● The viewer is the ultimate judge of how well a particular method works, which is difficult to quantify.
● However, in machine perception, enhancement is easier to quantify. In automated
character-recognition system, the most appropriate enhancement method would be the one with the
best recognition rate.
Intensity Transformations
IMAGE NEGATIVES
LOG TRANSFORMATIONS
POWER-LAW (GAMMA) TRANSFORMATIONS
PIECEWISE LINEAR TRANSFORMATION FUNCTIONS
Image Negatives
L=number of intensity levels
r=pixel intensity level of input image
s=output intensity level of output image
Darkest pixels become brightest; brightest pixels become darkest.
We can do it for color images also by
applying it on individual channels
Applications
Text image processing
Text becomes the foreground
Another application
Enhancing camouflaged objects
A. Gupta, K. R. Jerripothula and T. Tillo, "CIRCOD: Co-Saliency Inspired Referring Camouflaged Object Discovery," 2025
IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), Tucson, AZ, USA, 2025, pp. 8313-8323, doi:
10.1109/WACV61041.2025.00806.
Log Transforms
c= a constant
r=pixel intensity level of input image
s=output intensity level of output image
It maps a narrow range of low intensity values in the
input image into a wider range of output levels.
Conversely, higher values of input levels are mapped to a narrower range in the output.
Here,
c=255/log(256)
(a) (b)
There is also something called inverse log transformation:
s=exp(r/c)-1
Basically, it’s the inverse function of the log transformation function.
It gives opposite results: compresses lower values; expands higher values
Here,
c=255/log(256)
POWER-LAW (GAMMA) Transformation
A family of
curves gets
generated
The response of many devices used for image capture,
printing, and display obey a power law. By convention, the
exponent in a power-law equation is referred to as gamma
What should be the value of gamma?
If the ROI/Image has more bright values, use gamma>1
If the ROI/Image has more darker values, use gamma<1
Piecewise Linear Transformation
We can create complex functions, but it requires considerable user input
● Contrast Stretching
● Intensity-level Slicing
● Bit-plane Slicing
Contrast
Stretching
m=mean pixel value
Intensity Level Slicing: Highlighting or Suppressing certain intensity levels
Reconstructed Image: 128*B8+64*B7+32*B6+16*B5+8*B4+4*B3+2*B2+1*B1
If all 8 planes are available
Bit-plane Depending upon different bit planes available, different
Slicing reconstructed images can be created. If a particular bit plane
isn’t available, the corresponding term gets removed.