Lecture3 (1)
Lecture3 (1)
- Image Negatives
The negative of an image with gray levels in the range [ 0 – L-1 ] is
obtained by using the negative transformation shown in figure below,
which is given by the expression y = L – x ; L=255: for grayscale images
Example: convert the following image
into complement image : 0 50 255
R= 125 100 0
201 23 150
T=255 – R
T(1,1) = 255−R (1,1) = 255 − 0 = 255 255 205 0
T(1,2) = 255−R (1,2) = 255 −50 = 205 .. result is.. . T = 130 155 255
54 232 105
- Contrast Stretching
Produces an image of higher contrast than the original which is given by :
Example: enhance the image contrast for the following image
The result is :
3- Clipping
Special case of contrast stretching with α= γ= 0. Useful for noise reduction
when interested signal and mostly lie in range [a,b].
Example: enhance the following image by using clipping if you have
The result is:
Result
Histogram Processing
+Histogram: A graph indicating the number of times each gray level occurs
in the image and shows us the distribution of grey levels in the image.
◼ Grey level:0~L-1 ( L is the number of possible intensity)
◼ Histogram function: h(rk)=nk ,( rk : the kth grey level. nk: the # of
pixel with grey level k )
◼ Normalized Histogram: P(rk)=nk/m ( mn: the # of total pixel )
- -Information inherent in histograms is quite useful in other image
processing applications, such as image compression and segmentation
1- Histogram Stretching
The stretch will be expanding the low contrast of an image as showing :
If we use binary image the (Min, Max)=(0,1), If gray image the (Min,
Max)=(0,255) ---Example: expand the following image by using stretching
Sol. :
The result
2- Histogram Shrink
The shrink will be decrease image contrast by compressing the gray
levels. of an image as showing in figure below:
Sol. :
Result
3- Histogram Equalization :
It is a popular technique used for improving the appearance of a poor
image. It's a function provides more visually pleasing results across a wide
range of images. The histogram of the resultant image is as flat as possible,
makes the dark pixels appear darker and the light pixels appear lighter.
The histogram equalization process for digital images consists of four steps:
Smoothing Spatial Filters
- Smoothing filters are used for blurring and for noise reduction (i.e., low-
pass filters) , this filter will 1- Reduce noise and small details. 2- The
elements of the mask must be positive. 3- Sum of mask elements is 1
Noise reduction can be accomplished by:
Smoothing linear filter.
Smoothing nonlinear filter.
Smoothing Linear Filters
The following shows a 3 x 3 kernel for
performing a low-pass filter operation. Each
element in the kernel has a value of 1. The
output pixel is just the simple average of the
input neighborhood pixels.
Order-Statistic (Nonlinear)Filters
-- Order-statistic filters are nonlinear spatial filters whose response is based
on ranking the pixels contained in the image area encompassed by the filter
and then replacing the value of center pixel with the value determined by
the ranking result. The best-known filter in this category is the median, min
and max filters.
--Median filters are effective in the presence of impulse(salt and pepper)
noise because of its appearance as white and black dots superimposed on
an image.
Sharpening Spatial Filters
--The principal objective of sharpening is to highlight transitions in intensity
(i.e., high-pass filters) , this filter will
1-Highlight fine detail or enhance detail that has been blurred.
2-The elements of the mask contain both positive and negative weights.
3- Sum of the mask weights is 0.
--There are lots of slightly different versions of the Laplacian Filters :