Professional Documents
Culture Documents
DIP Unit II
DIP Unit II
Unit- II
Image Transformations
In General
Reflections: These are like mirror images as seen across a line or a point.
Translations ( or slides): This moves the figure to a new location with no change to the
looks of the figure.
Dr. R. Rajkamal
2
1
28-09-2020
Reflections
You can reflect a figure using a line or a point. All measures (lines and angles) are
preserved but in a mirror image.
You could fold the picture along line l and the left figure l
would coincide with the corresponding parts of right figure.
Dr. R. Rajkamal
3
Reflections
Reflection across the x-axis: the x values stay the same and the y values change sign.
(x , y) (x, -y)
Reflection across the y-axis: the y values stay the same and the x values change sign.
(x , y) (-x, y)
2
28-09-2020
Example:
Reflect the fig. across the line y = 1.
(2, 3) (2, -1).
(-3, 6) (-3, -4)
(-6, 2) (-6, 0)
Dr. R. Rajkamal
Lines of Symmetry
• If a line can be drawn through a figure so the one side of the figure is a reflection of the
other side, the line is called a “line of symmetry.”
• Some figures have 1 or more lines of symmetry.
• Some have no lines of symmetry.
3
28-09-2020
Translations
• If a figure is simply moved to another location without change to its shape or direction, it
is called a translation (or slide).
• If a point is moved “a” units to the right and “b” units up, then the translated point will
be at (x + a, y + b).
• If a point is moved “a” units to the left and “b” units down, then the translated point will
be at (x - a, y - b).
Example: A
Image A translates to image B by moving to the right
3 units and down 8 units.
B
A (2, 5) B (2+3, 5-8) B (5, -3)
Dr. R. Rajkamal Lesson 10-5: Transformations
7
Composite Reflections
• If an image is reflected over a line and then that image is reflected over a parallel line
(called a composite reflection), it results in a translation.
Example: C
A B
4
28-09-2020
Rotations
C
m
B n
Dr. R. Rajkamal
9
Rotations
It is a type of transformation where the object is rotated around a fixed point called the point of
rotation.
When a figure is rotated 90° counterclockwise about the origin, switch each coordinate and
multiply the first coordinate by -1.
(x, y) (-y, x)
Ex: (1,2) (-2,1) & (6,2) (-2, 6)
When a figure is rotated 180° about the origin, multiply
both coordinates by -1.
(x, y) (-x, -y)
Ex: (1,2) (-1,-2) & (6,2) (-6, -2)
Dr. R. Rajkamal
10
5
28-09-2020
Angles of rotation
• In a given rotation, where A is the figure and B is the resulting figure after rotation,
and X is the center of the rotation, the measure of the angle of rotation AXB is twice
the measure of the angle formed by the intersecting lines of reflection.
Example: Given segment AB to be rotated over lines l and m, which intersect to form a
35° angle. Find the rotation image segment KR.
35 °
Dr. R. Rajkamal
11
Angles of Rotation
• Since the angle formed by the lines is 35°, the angle of rotation is 70°.
• 1. Draw AXK so that its measure is 70° and AX = XK.
• 2. Draw BXR to measure 70° and BX = XR.
• 3. Connect K to R to form the rotation image of segment AB.
B
K
A
R
35 °
X
Dr. R. Rajkamal Lesson 10-5: Transformations
12
6
28-09-2020
Dilations
• A dilation is a transformation which changes the size of a figure but not its shape. This
is called a similarity transformation.
• Since a dilation changes figures proportionately, it has a scale factor k.
– If the absolute value of k is greater than 1, the dilation is an enlargement.
– If the absolute value of k is between 0 and 1, the dilation is a reduction.
– If the absolute value of k is equal to 0, the dilation is congruence transformation. (No
size change occurs.)
Dr. R. Rajkamal
13
Dilations
• In the figure, the center is C. The distance from C to E is three times the distance from C to A. The distance
from C to F is three times the distance from C to B. This shows a transformation of segment AB with center
C and a scale factor of 3 to the enlarged segment EF.
A E
R
A
C B C F
W B
• In this figure, the distance from C to R is ½ the distance from C to A. The distance from C to W is ½ the
distance from C to B. This is a transformation of segment AB with center C and a scale factor of ½ to the
reduced segment RW.
7
28-09-2020
Intensity Transformations
G (x,y) = T [F(x,y)]
T is “compute the average intensity of the
neighborhood.
Horizontal Scan
Intensity Transformations
In this technique, sometimes called contrast
stretching , values of r lower than k are
compressed by the transformation function
into a narrow range of s, toward black.
T(r) produces a two-level (binary) image. A
mapping of this form is called a thresholding
function.
The effect of applying the transformation to every pixel of f to generate the corresponding pixels in g
would be to produce an image of higher contrast than the original by darkening the intensity levels
below k and brightening the levels above k.
Dr. R. Rajkamal
8
28-09-2020
Intensity Transformations
Dr. R. Rajkamal
Negative images are useful for enhancing white or grey detail embedded in dark regions of an image
Dr. R. Rajkamal
9
28-09-2020
Log transform
The log transformations can be defined by this formula
s = c log(r + 1) c is a constant
The value 1 is added to each of the pixel value of the
input image because if there is a pixel intensity of 0 in
the image, then log (0) is equal to infinity. So 1 is added,
to make the minimum value at least 1.
Original image Log Transformed
image
During log transformation, the dark pixels in an image are expanded as compare to the higher pixel
values. The higher pixel values are kind of compressed in log transformation.
Dr. R. Rajkamal
Gamma transformation.
Variation in the value of γ varies the enhancement of
the images.
This type of transformation is used for enhancing
images for different type of display devices. The gamma
of different display devices is different.
For example Gamma of CRT lies in between of 1.8 to 2.5
that means the image displayed on CRT is dark.
Dr. R. Rajkamal
10
28-09-2020
Histogram
The histogram of a digital image with intensity levels in the range [ 0, L-1 ] is a discrete function
h(rk) = nk
where rk is the kth intensity value and nk is the number of pixels in the image with intensity.
Dr. R. Rajkamal
Histogram
Dr. R. Rajkamal
11
28-09-2020
Histogram
Dark, light, low contrast, high contrast, and their corresponding histograms
Dr. R. Rajkamal
Histogram
Suppose that a 3-bit image of size pixels has the intensity
distribution shown in Table, where the intensity levels are
integers in the range.
Values of the histogram equalization transformation function are
obtained using
histogram of hypothetical image
Dr. R. Rajkamal
12
28-09-2020
r0 = 0 was mapped to s0=1, there are 790 pixels in the histogram equalized image with this value.
Dividing these numbers by MN = 4096 yielded the equalized histogram .
Dr. R. Rajkamal
Dr. R. Rajkamal
13
28-09-2020
Smoothing filters are used for blurring and Output (response) of a smoothing, linear
for noise reduction. spatial filter is simply the average of the
Blurring is used in preprocessing tasks, such pixels contained in the neighborhood of
as removal of small details from an image the filter mask.
prior to (large) object extraction, and These filters sometimes are called
bridging of small gaps in lines or curves. averaging filters, low pass filters.
Noise reduction by blurring with a linear
filter and also by nonlinear filtering.
Dr. R. Rajkamal
However, edges (which almost always are desirable features of an image) also are
characterized by sharp intensity transitions, so averaging filters have the undesirable side
effect that they blur edges.
Dr. R. Rajkamal
14
28-09-2020
A spatial averaging filter in which all coefficients are equal sometimes is called a box filter.
Dr. R. Rajkamal
Weighted average, terminology used to indicate that pixels are multiplied by different coefficients,
thus giving more importance (weight) to some pixels at the expense of others.
Dr. R. Rajkamal
15
28-09-2020
Uses of image sharpening vary and include applications ranging from electronic printing
and medical imaging to industrial inspection and autonomous guidance in military systems.
Dr. R. Rajkamal
16
28-09-2020
Dr. R. Rajkamal
Dr. R. Rajkamal
17
28-09-2020
Dr. R. Rajkamal
18
28-09-2020
Dr. R. Rajkamal
19
28-09-2020
Dr. R. Rajkamal
20
28-09-2020
Dr. R. Rajkamal
All frequencies on or inside a circle of radius D0 are A Butterworth filter of order 20 exhibits
passed without attenuation, whereas all frequencies characteristics similar to those of the ILPF
outside the circle are completely attenuated (filtered out). (in the limit, both filters are identical).
Dr. R. Rajkamal
21
28-09-2020
Dr. R. Rajkamal
Dr. R. Rajkamal
22