SlideShare a Scribd company logo
1 of 26
Transformation
Instructor: Neetu Singla
neetu.co19@nsut.ac.in
• Most computer vision applications makes use of image processing operations to pre-
process the image and convert it into a form suitable for further analysis.
• Examples of such operations include
• Exposure correction
• Color balancing
• Reduction of image noise
• Increasing sharpness
• Straightening the image by rotating it
• Transformation: A function or operator that takes an image as its input, performs some
function on the image and produces an image as its output.
• Depending on the transform chosen, the input and output images may appear entirely
different and have different interpretations.
Introduction
Neetu Singla, NSUT
Image Transforms
Neetu Singla, NSUT
• Image Enhancement
• Increase Brightness
• How?
Point Operations: Example
Neetu Singla, NSUT
• Image Enhancement
• Reversing the contrast
• Black -> White
• Dark Gray -> Light Gray
• How?
Point Operations: Example
Neetu Singla, NSUT
• Image Enhancement
• Stretching the contrast
• Light Gray - Dark Gray
• White - Black
• How?
Point Operations: Example
Neetu Singla, NSUT
Local Operations Example: Moving Average
Neetu Singla, NSUT
Local Operations: Example
Neetu Singla, NSUT
Local Operations: Example
Neetu Singla, NSUT
Local Operations: Example
Neetu Singla, NSUT
Values of Noise pixels have been smoothen out.
Global Operations: Example
Neetu Singla, NSUT
• Image Coordinate Transform
• Eg. Fourier Transform
• Geometric Transformations
• Rotation
• Scaling
• Translation
• Etc.
Geometric Transformations
Euclidean, Affine, Projective
2D Image Transformations
• Translation is shifting an image in coordinate space by adding a specified value to
the x- and y- coordinates.
• So, if you know the shift in (x,y) direction, then you can create transformation
matrix as follows:
What is Translation?
Neetu Singla, NSUT
u=1*x + 0*y +tx* 1
u = x + 0 + 100
u= x + 100
[1 0 0 1 1 ]
• Translation is shifting an image in coordinate space by adding a specified value to
the x- and y- coordinates.
• So, if you know the shift in (x,y) direction, then you can create transformation
matrix as follows:
What is Translation?
Neetu Singla, NSUT
(0,0)
(15,13)
• This technique rotates an image by a specified angle and by the given axis or
point.
• Rotation about the origin by an angle theta is given by:
What is Rotation?
Neetu Singla, NSUT
What is Scaling?
Neetu Singla, NSUT
• Scaling means resizing an image which means an image is made bigger or smaller
in x- or/and y- direction.
• We can resize an image in terms of scaling factor.
• If we have an image of size (300 x 400) and we want to transform it into an image
of shape (600 x 200).
• The scaling in x-direction will be: 600/300 = 2. (Sx =2)
• Similarily, Sy = 200/400 = ½.
• Shearing an image means shifting the pixels values either horizontally or
vertically.
• Basically, this shifts some part of an image to one direction and other part to
opposite direction.
• Horizontal shearing will shift the upper part to the right and lower part to the left.
• Here you can see in Figure that the upper part has shifted to the right and the
lower part to the left.
What is Shearing?
Neetu Singla, NSUT
• It is a combination of Translation and Rotation.
• Properties:
• Three degree of Freedom
• Two for Translation
• One for Rotation
• Distance remains preserved
• Angle remains preserved
• Shapes remains preserved
• Rectangle will remain rectangle
• Theta- Rotation we want to give
• tx – Translation in x-axis
• ty – Translation in y-axis
What is Euclidean Transform? (Isometric)
Neetu Singla, NSUT
• It is a combination of Translation, Rotation, Scaling and Shearing.
• An affine transformation is a transformation that preserves co-linearity and the
ratio of distances ( for example- the midpoint of a line segment is still the
midpoint even after the transformation)
• The parallel lines in the original image will be parallel in the output image.
What is Affine Transform?
Neetu Singla, NSUT
Three control points are needed for
generating Transformation Matrix
• Changes the view point.
• The projective transform can handle changes caused by a tilt of the image plane relative
to the object plane.
• A projective transformation shows how the perceived objects change as the observer's
viewpoint changes. These transformations allow the creating of perspective distortion.
Affine transformations are used for scaling, skewing and rotation.
• Projective transformations do not preserve parallelism, length, and angle.
What is Projective Transform?
Neetu Singla, NSUT
What is Projective Transform?
Neetu Singla, NSUT
Projective Transform: Application
Neetu Singla, NSUT
Document Scanning
Book
Image Formation, Refer Chapter 2.1, 3.1
Computer Vision: Algorithms and Applications
Richard Szeliski
Assignment
a. Read an image into a variable.
b. Display the image.
c. Convert the image to grayscale.
d. Check the height and width of the image.
e. Extract R, G, B Channels. (BGR)
f. Extract the middle 100 pixels from the greyscale image.
g. Write a pair of nested "for" loops to set a grid of every 10th pixel horizontally and every
20th pixel vertically to 0.
h. Flip the image vertically. Then show the original and the flipped image side-by-side.
i. Write the combined image back to a new file.

More Related Content

Similar to Lecture3 Transformation.pptx

Image enhancement
Image enhancementImage enhancement
Image enhancement
Ayaelshiwi
 

Similar to Lecture3 Transformation.pptx (20)

CV PPT.pptx
CV PPT.pptxCV PPT.pptx
CV PPT.pptx
 
Feature detection and matching
Feature detection and matchingFeature detection and matching
Feature detection and matching
 
Core Animation
Core AnimationCore Animation
Core Animation
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
aip.pptx
aip.pptxaip.pptx
aip.pptx
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Video stabilization
Video stabilizationVideo stabilization
Video stabilization
 
Introduction to Real Time Rendering
Introduction to Real Time RenderingIntroduction to Real Time Rendering
Introduction to Real Time Rendering
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
PPT s11-machine vision-s2
PPT s11-machine vision-s2PPT s11-machine vision-s2
PPT s11-machine vision-s2
 
DIP Notes Unit-1 PPT.pdf
DIP Notes Unit-1 PPT.pdfDIP Notes Unit-1 PPT.pdf
DIP Notes Unit-1 PPT.pdf
 
DIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer ScienceDIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer Science
 
Digital image processing techniques
Digital image processing techniquesDigital image processing techniques
Digital image processing techniques
 
SpatialEnhancement of course CE7491 of NTU
SpatialEnhancement of course CE7491 of NTUSpatialEnhancement of course CE7491 of NTU
SpatialEnhancement of course CE7491 of NTU
 
3D transformation and viewing
3D transformation and viewing3D transformation and viewing
3D transformation and viewing
 
Geometric transformation
Geometric transformationGeometric transformation
Geometric transformation
 

Recently uploaded

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 

Lecture3 Transformation.pptx

  • 2. • Most computer vision applications makes use of image processing operations to pre- process the image and convert it into a form suitable for further analysis. • Examples of such operations include • Exposure correction • Color balancing • Reduction of image noise • Increasing sharpness • Straightening the image by rotating it • Transformation: A function or operator that takes an image as its input, performs some function on the image and produces an image as its output. • Depending on the transform chosen, the input and output images may appear entirely different and have different interpretations. Introduction Neetu Singla, NSUT
  • 3.
  • 5. • Image Enhancement • Increase Brightness • How? Point Operations: Example Neetu Singla, NSUT
  • 6. • Image Enhancement • Reversing the contrast • Black -> White • Dark Gray -> Light Gray • How? Point Operations: Example Neetu Singla, NSUT
  • 7. • Image Enhancement • Stretching the contrast • Light Gray - Dark Gray • White - Black • How? Point Operations: Example Neetu Singla, NSUT
  • 8. Local Operations Example: Moving Average Neetu Singla, NSUT
  • 11. Local Operations: Example Neetu Singla, NSUT Values of Noise pixels have been smoothen out.
  • 12. Global Operations: Example Neetu Singla, NSUT • Image Coordinate Transform • Eg. Fourier Transform • Geometric Transformations • Rotation • Scaling • Translation • Etc.
  • 15. • Translation is shifting an image in coordinate space by adding a specified value to the x- and y- coordinates. • So, if you know the shift in (x,y) direction, then you can create transformation matrix as follows: What is Translation? Neetu Singla, NSUT u=1*x + 0*y +tx* 1 u = x + 0 + 100 u= x + 100 [1 0 0 1 1 ]
  • 16. • Translation is shifting an image in coordinate space by adding a specified value to the x- and y- coordinates. • So, if you know the shift in (x,y) direction, then you can create transformation matrix as follows: What is Translation? Neetu Singla, NSUT (0,0) (15,13)
  • 17. • This technique rotates an image by a specified angle and by the given axis or point. • Rotation about the origin by an angle theta is given by: What is Rotation? Neetu Singla, NSUT
  • 18. What is Scaling? Neetu Singla, NSUT • Scaling means resizing an image which means an image is made bigger or smaller in x- or/and y- direction. • We can resize an image in terms of scaling factor. • If we have an image of size (300 x 400) and we want to transform it into an image of shape (600 x 200). • The scaling in x-direction will be: 600/300 = 2. (Sx =2) • Similarily, Sy = 200/400 = ½.
  • 19. • Shearing an image means shifting the pixels values either horizontally or vertically. • Basically, this shifts some part of an image to one direction and other part to opposite direction. • Horizontal shearing will shift the upper part to the right and lower part to the left. • Here you can see in Figure that the upper part has shifted to the right and the lower part to the left. What is Shearing? Neetu Singla, NSUT
  • 20. • It is a combination of Translation and Rotation. • Properties: • Three degree of Freedom • Two for Translation • One for Rotation • Distance remains preserved • Angle remains preserved • Shapes remains preserved • Rectangle will remain rectangle • Theta- Rotation we want to give • tx – Translation in x-axis • ty – Translation in y-axis What is Euclidean Transform? (Isometric) Neetu Singla, NSUT
  • 21. • It is a combination of Translation, Rotation, Scaling and Shearing. • An affine transformation is a transformation that preserves co-linearity and the ratio of distances ( for example- the midpoint of a line segment is still the midpoint even after the transformation) • The parallel lines in the original image will be parallel in the output image. What is Affine Transform? Neetu Singla, NSUT Three control points are needed for generating Transformation Matrix
  • 22. • Changes the view point. • The projective transform can handle changes caused by a tilt of the image plane relative to the object plane. • A projective transformation shows how the perceived objects change as the observer's viewpoint changes. These transformations allow the creating of perspective distortion. Affine transformations are used for scaling, skewing and rotation. • Projective transformations do not preserve parallelism, length, and angle. What is Projective Transform? Neetu Singla, NSUT
  • 23. What is Projective Transform? Neetu Singla, NSUT
  • 24. Projective Transform: Application Neetu Singla, NSUT Document Scanning
  • 25. Book Image Formation, Refer Chapter 2.1, 3.1 Computer Vision: Algorithms and Applications Richard Szeliski
  • 26. Assignment a. Read an image into a variable. b. Display the image. c. Convert the image to grayscale. d. Check the height and width of the image. e. Extract R, G, B Channels. (BGR) f. Extract the middle 100 pixels from the greyscale image. g. Write a pair of nested "for" loops to set a grid of every 10th pixel horizontally and every 20th pixel vertically to 0. h. Flip the image vertically. Then show the original and the flipped image side-by-side. i. Write the combined image back to a new file.