Professional Documents
Culture Documents
Dr Tahir Nawaz
Website: https://www.tahirnawaz.com
Email: tahir.nawaz@ceme.nust.edu.pk
Histogram specification/matching
• Histogram equalization does not allow interactive image
enhancement and generates only one result: an
approximation to a uniform histogram
rk 0 1 2 3 4 5 6 7
nk 8 10 10 2 12 16 4 2
– Target histogram
rk 0 1 2 3 4 5 6 7
nk 0 0 0 0 20 20 16 8
Histogram specification/matching
• Implementation with the help of a numerical example
– Histogram equalization of the given image
– Discard the problem pixels (e.g. for a 3x3 mask with a 512x512
input image, the output image becomes 510x510)
f
f ( x 1) f ( x)
x
2 f
f ( x 1) f ( x 1) 2 f ( x)
x 2
– Simply takes into account the values both before and after the
current value
Sharpening spatial filters
• Foundation – Spatial Differentiation
Sharpening spatial filters
• The 2nd derivative is, at times, more useful for image
enhancement than the 1st derivative - Stronger response
to fine detail
2
f 2
f
f 2 2
2
x y
2 f
f ( x 1, y) f ( x 1, y) 2 f ( x, y)
x 2
2 f
f ( x, y 1) f ( x, y 1) 2 f ( x, y )
y 2
Sharpening spatial filters
• Laplacian Filter
– The implementation of 2-D Laplacian is obtained by summing
the two components:
2 f f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1)
- 4 f ( x, y)
• Steps
– Blur the original image
– Subtract the blurred image from the original
– Add the mask to the original
Unsharp masking
• Let f ( x, y ) denote the blurred image, unsharp masking is
g mask ( x, y) f ( x, y) f ( x, y)
Then add a weighted portion of the mask back to the original
g ( x, y ) f ( x, y) k * g mask ( x, y) k 0
– Magnitude
– Direction
First-order derivatives (Gradient) operator
• Gradient operators
Roberts
cross
gradient
operator
Sobel
operator