Upload
jainatin
View
525
Download
1
Embed Size (px)
Citation preview
Spatial Transformations
IT472: Digital Image Processing, Lecture 5
Spatial Transformations
Affine transformations of the support of the image f (x , y)
Scaling: x ′ = cxx and y ′ = cyy → f (x ′, y ′) = f (x , y).
Rotation: x ′ = x cos θ − y sin θ andy ′ = x cos θ + y sin θ → f (x ′, y ′) = f (x , y).
Translation: x ′ = x + tx andy ′ = y + ty → f (x ′, y ′) = f (x , y).
Shear: x ′ = x + syy and y ′ = y → f (x ′, y ′) = f (x , y).
All these collected together can be represented in a matrixform using Homogeneous coordinates, as follows: x ′
y ′
1
=
cos θ/cx/1 sin θ/sy/0 0/tx− sin θ/sx/0 cos θ/cy/1 0/ty
0 0 1
xy1
(1)
IT472: Lecture 5 2/18
Spatial Transformations
Affine transformations of the support of the image f (x , y)
Scaling: x ′ = cxx and y ′ = cyy → f (x ′, y ′) = f (x , y).
Rotation: x ′ = x cos θ − y sin θ andy ′ = x cos θ + y sin θ → f (x ′, y ′) = f (x , y).
Translation: x ′ = x + tx andy ′ = y + ty → f (x ′, y ′) = f (x , y).
Shear: x ′ = x + syy and y ′ = y → f (x ′, y ′) = f (x , y).
All these collected together can be represented in a matrixform using Homogeneous coordinates, as follows: x ′
y ′
1
=
cos θ/cx/1 sin θ/sy/0 0/tx− sin θ/sx/0 cos θ/cy/1 0/ty
0 0 1
xy1
(1)
IT472: Lecture 5 2/18
Spatial Transformations
Affine transformations of the support of the image f (x , y)
Scaling: x ′ = cxx and y ′ = cyy → f (x ′, y ′) = f (x , y).
Rotation: x ′ = x cos θ − y sin θ andy ′ = x cos θ + y sin θ → f (x ′, y ′) = f (x , y).
Translation: x ′ = x + tx andy ′ = y + ty → f (x ′, y ′) = f (x , y).
Shear: x ′ = x + syy and y ′ = y → f (x ′, y ′) = f (x , y).
All these collected together can be represented in a matrixform using Homogeneous coordinates, as follows: x ′
y ′
1
=
cos θ/cx/1 sin θ/sy/0 0/tx− sin θ/sx/0 cos θ/cy/1 0/ty
0 0 1
xy1
(1)
IT472: Lecture 5 2/18
Spatial Transformations
Affine transformations of the support of the image f (x , y)
Scaling: x ′ = cxx and y ′ = cyy → f (x ′, y ′) = f (x , y).
Rotation: x ′ = x cos θ − y sin θ andy ′ = x cos θ + y sin θ → f (x ′, y ′) = f (x , y).
Translation: x ′ = x + tx andy ′ = y + ty → f (x ′, y ′) = f (x , y).
Shear: x ′ = x + syy and y ′ = y → f (x ′, y ′) = f (x , y).
All these collected together can be represented in a matrixform using Homogeneous coordinates, as follows: x ′
y ′
1
=
cos θ/cx/1 sin θ/sy/0 0/tx− sin θ/sx/0 cos θ/cy/1 0/ty
0 0 1
xy1
(1)
IT472: Lecture 5 2/18
Spatial Transformations
Affine transformations of the support of the image f (x , y)
Scaling: x ′ = cxx and y ′ = cyy → f (x ′, y ′) = f (x , y).
Rotation: x ′ = x cos θ − y sin θ andy ′ = x cos θ + y sin θ → f (x ′, y ′) = f (x , y).
Translation: x ′ = x + tx andy ′ = y + ty → f (x ′, y ′) = f (x , y).
Shear: x ′ = x + syy and y ′ = y → f (x ′, y ′) = f (x , y).
All these collected together can be represented in a matrixform using Homogeneous coordinates, as follows: x ′
y ′
1
=
cos θ/cx/1 sin θ/sy/0 0/tx− sin θ/sx/0 cos θ/cy/1 0/ty
0 0 1
xy1
(1)
IT472: Lecture 5 2/18
Implementation issues
For a given affine transformation matrix A, A · (x , y)t is notalways an integer.
Is it possible that due to rounding offA · (x1, y1)t = A · (x2, y2)t
Solution:
� Instead of using a forward mapping, let’s work with the inversemapping.
A−1 : (x ′, y ′)t → (x , y)t
� We can scan the output image coordinates and see where theycome from, and accordingly assign them grey values.
IT472: Lecture 5 3/18
Implementation issues
For a given affine transformation matrix A, A · (x , y)t is notalways an integer.
Is it possible that due to rounding offA · (x1, y1)t = A · (x2, y2)t
Solution:
� Instead of using a forward mapping, let’s work with the inversemapping.
A−1 : (x ′, y ′)t → (x , y)t
� We can scan the output image coordinates and see where theycome from, and accordingly assign them grey values.
IT472: Lecture 5 3/18
Implementation issues
For a given affine transformation matrix A, A · (x , y)t is notalways an integer.
Is it possible that due to rounding offA · (x1, y1)t = A · (x2, y2)t
Solution:
� Instead of using a forward mapping, let’s work with the inversemapping.
A−1 : (x ′, y ′)t → (x , y)t
� We can scan the output image coordinates and see where theycome from, and accordingly assign them grey values.
IT472: Lecture 5 3/18
Implementation issues
For a given affine transformation matrix A, A · (x , y)t is notalways an integer.
Is it possible that due to rounding offA · (x1, y1)t = A · (x2, y2)t
Solution:
� Instead of using a forward mapping, let’s work with the inversemapping.
A−1 : (x ′, y ′)t → (x , y)t
� We can scan the output image coordinates and see where theycome from, and accordingly assign them grey values.
IT472: Lecture 5 3/18
Implementation issues
For a given affine transformation matrix A, A · (x , y)t is notalways an integer.
Is it possible that due to rounding offA · (x1, y1)t = A · (x2, y2)t
Solution:
� Instead of using a forward mapping, let’s work with the inversemapping.
A−1 : (x ′, y ′)t → (x , y)t
� We can scan the output image coordinates and see where theycome from, and accordingly assign them grey values.
IT472: Lecture 5 3/18
Implementation issues
For a given affine transformation matrix A, A · (x , y)t is notalways an integer.
Is it possible that due to rounding offA · (x1, y1)t = A · (x2, y2)t
Solution:
� Instead of using a forward mapping, let’s work with the inversemapping.
A−1 : (x ′, y ′)t → (x , y)t
� We can scan the output image coordinates and see where theycome from, and accordingly assign them grey values.
IT472: Lecture 5 3/18
Examples
Figure: (top-left) Image of Lena (top-right) Image rotated by 23◦
(bottom-left) Shear sx = 1.2, (bottom-right) Shear sx = −1.2
IT472: Lecture 5 4/18
End of Chapter 2
Chapter 3: Intensity transformations and Spatial filtering(Image enhancement in the spatial domain)
IT472: Lecture 5 5/18
End of Chapter 2
Chapter 3: Intensity transformations and Spatial filtering(Image enhancement in the spatial domain)
IT472: Lecture 5 5/18
Image enhancement
Image enhancement is a pre-processing step that makes theinput image better suited for further processing. For example,for segmentation, recognition, or simply better for somebodyto view the image.
Intensity transformations: Depends only on the intensity valueat a point: g(x , y) = T [f (x , y)], can be also written ass = T [r ], where r and s are the input and output grey valuesrespectively.
IT472: Lecture 5 6/18
Image enhancement
Image enhancement is a pre-processing step that makes theinput image better suited for further processing. For example,for segmentation, recognition, or simply better for somebodyto view the image.
Intensity transformations: Depends only on the intensity valueat a point: g(x , y) = T [f (x , y)], can be also written ass = T [r ], where r and s are the input and output grey valuesrespectively.
IT472: Lecture 5 6/18
Intensity transformations
Image negative: s = L− 1− r
Powers, nth roots, Log transformations etc..
IT472: Lecture 5 7/18
Intensity transformations
Image negative: s = L− 1− r
Powers, nth roots, Log transformations etc..
IT472: Lecture 5 7/18
Intensity transformations
Image negative: s = L− 1− r
Powers, nth roots, Log transformations etc..
IT472: Lecture 5 7/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Applications of Intensity transformations
Intensity transformations are used frequently for Contrastenhancement.
Contrast measures how much the object color/grey valuediffers from its surroundings.
Objective definitions:
� Weber contrast: I−IbIb
� Michelson contrast: Imax−Imin
Imax+Imin
� RMS contrast:√∑M
i=1
∑Nj=1(Iij − I )2
Appropriate transformation must be chosen depending onwhat grey values you want to enhance and what is thecontent of the input image.
IT472: Lecture 5 8/18
Contrast enhancement
We will frequently use the log-transformation to view theFourier spectrum of an image.
IT472: Lecture 5 9/18
Contrast enhancement
We will frequently use the log-transformation to view theFourier spectrum of an image.
IT472: Lecture 5 9/18
Gamma transformations
s = crγ
IT472: Lecture 5 10/18
Gamma transformations
Gamma correction in CRTs
IT472: Lecture 5 11/18
Gamma transformations
Enhance dark grey-values in the image.
IT472: Lecture 5 12/18
Gamma transformations
Enhance brighter grey-values in the image.
IT472: Lecture 5 13/18
Contrast stretching
IT472: Lecture 5 14/18
Intensity slicing
IT472: Lecture 5 15/18
Bit-plane slicing
Every pixel needs 8 bits (assuming gray values from 0 - 255).
Every bit plane can be thought of as a binary image.
IT472: Lecture 5 16/18
Bit-plane slicing
Every pixel needs 8 bits (assuming gray values from 0 - 255).
Every bit plane can be thought of as a binary image.
IT472: Lecture 5 16/18
Bit-plane slicing
Every pixel needs 8 bits (assuming gray values from 0 - 255).
Every bit plane can be thought of as a binary image.
IT472: Lecture 5 16/18
Bit-plane slicing
IT472: Lecture 5 17/18
Bit-plane slicing
Can be used for image compression.
Figure: (top row) Reconstructions from bit planes (bottom) Originalimage
IT472: Lecture 5 18/18