5_Image Enhancement in Spatial Domain
5_Image Enhancement in Spatial Domain
Enhancement in
Spatial Domain
Image Enhancement
•The shape of the log curve shows that this transformation maps a narrow range of low intensity
values (input) into a wider range of output levels.
• The opposite is true of higher values of input levels.
•This technique is used to expand the values of dark pixels while compressing the higher-level
values.
1/2.5 0.4
𝑠=𝑟 =𝑟
Power-Law (Gamma) Transformations
Piecewise-linear Transformation functions
Observation:
• If the histogram is distributed uniformly, the image
will have an appearance of high contrast
Histogram Processing methods discussed in the previous two sections are Global,
in the sense that pixels are modified by a transformation function based on the
intensity distribution of an entire image.
There are some cases in which it is necessary to enhance detail over small areas
in an image.
This procedure is to define a neighborhood and move its center pixel to pixel.
At each location, the histogram of the points in the neighborhood is computed
and either a histogram equalization or histogram specification transformation
function is obtained.
Local Histogram Processing
• Image differentiation
• Enhances edges and other discontinuities (noise)
• De-emphasizes smooth areas
Requirements
First derivative
• zero in areas of constant intensity
• nonzero at the onset of an intensity step or ramp
• nonzero along ramps
Second derivative
• zero in constant areas
• nonzero at the onset and end of an intensity step or ramp
• zero along ramps of constant slope
Sharpening spatial filters
𝜕2𝑓
2
= 𝑓(𝑥 + 1) + 𝑓(𝑥 − 1) − 2𝑓(𝑥)
𝜕𝑥
Sharpening spatial filters
Sharpening spatial filters
• The second order derivative is useful for edge detection
𝜕2𝑓
2
= 𝑓(𝑥 + 1, 𝑦) + 𝑓(𝑥 − 1, 𝑦) − 2𝑓(𝑥, 𝑦)
𝜕𝑥
Laplacian filter
ሜ 𝑦)
𝑔𝑚𝑎𝑠𝑘 (𝑥, 𝑦) = 𝑓(𝑥, 𝑦) − 𝑓(𝑥,
k=4.5
The gradient- first-order derivative
𝜕𝑓
𝑔𝑥 𝜕𝑥
∇𝑓 ≡ 𝑔𝑟𝑎𝑑 𝑓 = 𝑔 = 𝜕𝑓
𝑦
𝜕𝑦
• It is the value at (x, y) of the rate of change in the direction of the gradient
vector,
•Magnitude of gradient at every pixel forms the gradient image
• It is a nonlinear operator
The gradient- first-order derivative
𝑀(𝑥, 𝑦) ≈ 𝑔𝑥 + 𝑔𝑦
The gradient- first-order derivative