SlideShare a Scribd company logo
Image Mosaicing
Elsayed Hemayed
Image Mosaicing
• Are you getting the whole picture?
– Compact Camera FOV = 50 x 35°
Image Mosaicing
• Are you getting the whole picture?
– Compact Camera FOV = 50 x 35°
– Human FOV = 200 x 135°
Image Mosaicing
• Are you getting the whole picture?
– Compact Camera FOV = 50 x 35°
– Human FOV = 200 x 135°
– Panoramic Mosaic = 360 x 180°
Mosaics: stitching images
together
virtual wide-angle camera
• Combine two or more overlapping images
to make one larger image
Add example
Slide credit: Vaibhav Vaish
6
The Problem
Q: “Static” ?
Ans.: No moving objects in the scene.
+Image 1 Image 2 Mosaiced image
The Solution
Original
images
Image Registration /
Alignment / Warping
Image Blending
How to do it?
• Basic Procedure
1. Take a sequence of images from the same
position
2. Compute transformation between second
image and first
3. Shift the second image to overlap with the
first
4. Blend the two together to create a mosaic
5. If there are more images, repeat
9
1. Take a sequence of images from the same
position
10
2. Compute transformation between images
• Extract interest points
• Find Matches
• Compute transformation?
11
3. Shift the images to overlap
12
4. Blend the two together to create a mosaic
13
5. Repeat for all images
14
How to do it?
• Basic Procedure
1. Take a sequence of images from the same
position
2. Compute transformation between second
image and first
3. Shift the second image to overlap with the
first
4. Blend the two together to create a mosaic
5. If there are more images, repeat
✓
15
Compute Transformations
• Extract interest points
• Find good matches
• Compute transformation
✓
Let’s assume we are given a set of good matching
interest points
✓
16
Aligning images
Translations are not enough to align the images
left on top right on top
Image reprojection
• Observation
– Rather than thinking of this as a 3D reprojection,
think of it as a 2D image warp from one image to
another
18
Motion models
• What happens when we take two images
with a camera and try to align them?
• translation?
• rotation?
• scale?
• affine?
• Perspective?
19
Parametric (global) warping
• Examples of parametric warps:
translation rotation scaling
affine
perspective
20
2D coordinate transformations
• translation: x’ = x + t x = (x,y)
• rotation: x’ = R x + t
• similarity: x’ = s R x + t
• affine: x’ = A x + t
• perspective: x’  H x x = (x,y,1)
(x is a homogeneous coordinate)
21
Translation
Preserves: Orientation
Translation and rotation
Scale
Similarity transformations
Similarity transform (4 DoF) = translation +
rotation + scale
Preserves: Angles
Shear
Affine transformations
Affine transform (6 DoF) = translation + rotation
+ scale + shear
Preserves: Parallelism
Projective transformations
a.k.a. Homographies
“keystone” distortions
Preserves: Straight Lines
Finding the transformation
Translation = 2 degrees of freedom
Similarity = 4 degrees of freedom
Affine = 6 degrees of freedom
Homography = 8 degrees of freedom
How many corresponding points do we
need to solve?
Solving for homographies
30
• A homography is a projective object, in that it has no
scale. It is represented by the above matrix, up to scale.
• One way of fixing the scale is to set one of the coordinates
to 1, though that choice is arbitrary.
• But that’s what most people do.
Solving for homographies
31
Solving for homographies
32
This is just for one pair of points.
Direct Linear Transforms (n points)
Defines a least squares problem:
• Since is only defined up to scale, solve for unit vector
• Solution: = eigenvector of with smallest
eigenvalue
• Works with 4 or more points
2n × 9 9 2n
33
34
Matching features
What do we do about the “bad” matches?
Simple example: fit a line
• Rather than homography H (8 numbers)
fit y=ax+b (2 numbers a, b) to 2D pairs
35
Simple example: fit a line
• Pick 2 points
• Fit line
• Count inliers
36
3 inliers
Simple example: fit a line
• Pick 2 points
• Fit line
• Count inliers
37
4 inliers
Simple example: fit a line
• Pick 2 points
• Fit line
• Count inliers
38
9 inliers
Simple example: fit a line
• Pick 2 points
• Fit line
• Count inliers
39
8 inliers
Simple example: fit a line
• Use biggest set of inliers
• Do least-square fit
40
41
RAndom SAmple Consensus
Select one match, count inliers
42
RAndom SAmple Consensus
Select one match, count inliers
43
Least squares fit (from inliers)
Find “average” translation vector
44
RANSAC for estimating homography
• RANSAC loop:
1. Select four feature pairs (at random)
2. Compute homography H (exact)
3. Compute inliers where ||pi´, H pi|| < ε
• Keep largest set of inliers
• Re-compute least-squares H estimate
using all of the inliers
45
Where are we?
• Basic Procedure
1. Take a sequence of images from the same
position
2. Compute transformation between second
image and first
3. Shift the second image to overlap with the
first
4. Blend the two together to create a mosaic
5. If there are more images, repeat
46
Image Warping
• Given a coordinate transform x’ = h(x) and
a source image f(x), how do we compute a
transformed image g(x’) = f(h(x))?
f(x) g(x’)
x x’
h(x)
47
Forward Warping
• Send each pixel f(x) to its corresponding
location x’ = h(x) in g(x’)
f(x) g(x’)
x x’
h(x)
• What if pixel lands “between” two pixels?
48
Forward Warping
Old Colored Image f(x,y) New non-Colored Image f’(x’,y’)
T
Finding the point in the digital raster which matches
the transformed point and determining its brightness.
Forward Warping
• Send each pixel f(x) to its corresponding
location x’ = h(x) in g(x’)
f(x) g(x’)
x x’
h(x)
• What if pixel lands “between” two pixels?
50
51
Inverse Warping
• Get each pixel g(x’) from its corresponding
location x’ = h(x) in f(x)
f(x) g(x’)
x x’
h-1(x)
• What if pixel comes from “between” two pixels?
Inverse Warping
Old Colored Image f(x,y) New non-Colored Image f’(x’,y’)
(x,y)=T-1(x’,y’)
Inverse Transform
53
Inverse Warping
• Get each pixel g(x’) from its corresponding
location x’ = h(x) in f(x)
• What if pixel comes from “between” two pixels?
• Answer: resample color value from
interpolated source image
f(x) g(x’)
x x’
h-1(x)
Image Interpolation
• The brightness interpolation problem is usually
expressed in a dual way (by determining the
brightness of the original point in the input image
that corresponds to the point in the output image
lying on the discrete raster).
• Usually, a small neighborhood is used.
Nearest neighbor interpolation
Assigns to the point (x,y) the brightness value of
the nearest point g in the discrete raster
inverse planar
transformation of
the output image
onto the input
image
Linear Interpolation
Uses the four points neighboring the point
(x,y).
Interpolation vs. Nearest Neighbor
• Error of the nearest neighborhood
interpolation is at most half a pixel
• Linear interpolation can cause a small
decrease in resolution and blurring due to
its averaging nature.
• The problem of step like straight
boundaries with the nearest neighborhood
interpolation is reduced.
Interpolation Vs NN
NN
Interpolation
Bicubic Interpolation
• Improves the model of the brightness function by
approximating it locally by a bicubic polynomial
surface; sixteen neighboring points are used for
interpolation.
• The interpolation kernel (`Mexican hat') is given
by
Bicubic Interpolation
The brightness values of the
neighbors are first interpolated
horizontally to determine the
brightness values at the
locations outlined in red,
then
these values are interpolated
vertically to determine the
brightness at the target pixel
outlined in blue.
The summation goes from k-1 to
k+2 then from j-1 to j+2.
Implementation Steps
1. Determine the closest pixel to (x’,y’). Then select the
other 15 pixels (x-1 x+2 and y-1 y+2)
2. For Row 1 (y-1): Assume the four pixels have grey levels
(g1, g2, g3, g4) and are at distances dx (-1.1, -0.2, 0.9,
1.5).
Then the new grey level should be:
Gy-1=(4-8(1.1)+5(1.1^2)-(1.1^3))*g1 +
(4-8(1.5)+5(1.5^2)-(1.5^3))*g4 +
(1-2(0.2^2)+(0.2^3)*g2 +
(1-2(0.9^2)+(0.9^3)*g3.
3. Repeat for Gy, Gy+1, and Gy+2
4. Then Apply similar equation in step 2 but with the
calculated grey levels and dy (-1,0,1,2).
Bicubic Interpolation
• Bicubic interpolation does not suffer from the
step-like boundary problem of nearest
neighborhood interpolation, and copes with
linear interpolation blurring as well.
• Bicubic interpolation is often used in raster
displays that enable zooming with respect to an
arbitrary point -- if the nearest neighborhood
method were used, areas of the same
brightness would increase.
• Bicubic interpolation preserves fine details in the
image very well.
Cost !!
Nearest Neighbor
Bilinear Interpolation
Bicubic Interpolation
NN
Bilinear
Bicubic
NN
Bilinear
Bicubic
Where are we?
• Basic Procedure
1. Take a sequence of images from the same
position
(Rotate the camera about its optical center)
2. Compute transformation between second
image and first
3. Shift the second image to overlap with the
first
4. Blend the two together to create a mosaic
5. If there are more images, repeat 72
Image Blending
• Simple averaging
• Weighted averaging
• Also Pyramid Blending
2/)),('),((),( 21 yxfyxfyxf 
),('),(),(),(),( 2211 yxfyxwyxfyxwyxf 
 Smooth transition (edges, illumination artifacts)
Image Blending
Simple averaging Weighted averaging
Sample results
from Amin Charaniya (UCSC)
Sample results
from Amin Charaniya (UCSC)
Go Explore!

More Related Content

What's hot

Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
Maaz Rizwan
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
Kamal Acharya
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
Amnaakhaan
 
04 image enhancement edge detection
04 image enhancement edge detection04 image enhancement edge detection
04 image enhancement edge detection
Rumah Belajar
 
Cs580
Cs580Cs580
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgosRoziq Bahtiar
 
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
Prabin Gautam
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEAU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
Thiyagarajan G
 
Lesson 19: Double Integrals over General Regions
Lesson 19: Double Integrals over General RegionsLesson 19: Double Integrals over General Regions
Lesson 19: Double Integrals over General RegionsMatthew Leingang
 
Lesson18 Double Integrals Over Rectangles Slides
Lesson18   Double Integrals Over Rectangles SlidesLesson18   Double Integrals Over Rectangles Slides
Lesson18 Double Integrals Over Rectangles Slides
Matthew Leingang
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
Ankit Garg
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
PrathimaBaliga
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.Mohd Arif
 
CS 354 Graphics Math
CS 354 Graphics MathCS 354 Graphics Math
CS 354 Graphics Math
Mark Kilgard
 
Model Selection with Piecewise Regular Gauges
Model Selection with Piecewise Regular GaugesModel Selection with Piecewise Regular Gauges
Model Selection with Piecewise Regular Gauges
Gabriel Peyré
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
Marwa Al-Rikaby
 

What's hot (20)

Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
 
04 image enhancement edge detection
04 image enhancement edge detection04 image enhancement edge detection
04 image enhancement edge detection
 
Cs580
Cs580Cs580
Cs580
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgos
 
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEAU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
 
Lesson 19: Double Integrals over General Regions
Lesson 19: Double Integrals over General RegionsLesson 19: Double Integrals over General Regions
Lesson 19: Double Integrals over General Regions
 
Lesson18 Double Integrals Over Rectangles Slides
Lesson18   Double Integrals Over Rectangles SlidesLesson18   Double Integrals Over Rectangles Slides
Lesson18 Double Integrals Over Rectangles Slides
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.
 
CS 354 Graphics Math
CS 354 Graphics MathCS 354 Graphics Math
CS 354 Graphics Math
 
Model Selection with Piecewise Regular Gauges
Model Selection with Piecewise Regular GaugesModel Selection with Piecewise Regular Gauges
Model Selection with Piecewise Regular Gauges
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
 

Similar to 07 cie552 image_mosaicing

lec07_transformations.pptx
lec07_transformations.pptxlec07_transformations.pptx
lec07_transformations.pptx
AneesAbbasi14
 
Computer Vision transformations
Computer Vision  transformationsComputer Vision  transformations
Computer Vision transformations
Wael Badawy
 
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
Charles Deledalle
 
Geometric transformation cg
Geometric transformation cgGeometric transformation cg
Geometric transformation cgharinipriya1994
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
54MahakBansal
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
Mattupallipardhu
 
Transforms UNIt 2
Transforms UNIt 2 Transforms UNIt 2
Transforms UNIt 2
sandeep kumbhkar
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
Kokebe2
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
Patel Punit
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
Janie Clayton
 
UNIT-1.pptx
UNIT-1.pptxUNIT-1.pptx
UNIT-1.pptx
RizwanBasha12
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
Ankit Garg
 
Elliptical curve cryptography
Elliptical curve cryptographyElliptical curve cryptography
Elliptical curve cryptography
Barani Tharan
 
2d transformations
2d transformations2d transformations
2d transformations
rajeshranjithsingh
 
Quadratic functions
Quadratic functionsQuadratic functions
Quadratic functions
Neil MacIntosh
 
Graphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions LectureGraphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions Lecture
Froyd Wess
 
UNIT I_5.pdf
UNIT I_5.pdfUNIT I_5.pdf
UNIT I_5.pdf
Muthukumar P
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-online
lifebreath
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
Bala Murali
 
Chap7 2 Ecc Intro
Chap7 2 Ecc IntroChap7 2 Ecc Intro
Chap7 2 Ecc IntroEdora Aziz
 

Similar to 07 cie552 image_mosaicing (20)

lec07_transformations.pptx
lec07_transformations.pptxlec07_transformations.pptx
lec07_transformations.pptx
 
Computer Vision transformations
Computer Vision  transformationsComputer Vision  transformations
Computer Vision transformations
 
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
 
Geometric transformation cg
Geometric transformation cgGeometric transformation cg
Geometric transformation cg
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
 
Transforms UNIt 2
Transforms UNIt 2 Transforms UNIt 2
Transforms UNIt 2
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
 
UNIT-1.pptx
UNIT-1.pptxUNIT-1.pptx
UNIT-1.pptx
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
Elliptical curve cryptography
Elliptical curve cryptographyElliptical curve cryptography
Elliptical curve cryptography
 
2d transformations
2d transformations2d transformations
2d transformations
 
Quadratic functions
Quadratic functionsQuadratic functions
Quadratic functions
 
Graphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions LectureGraphs of the Sine and Cosine Functions Lecture
Graphs of the Sine and Cosine Functions Lecture
 
UNIT I_5.pdf
UNIT I_5.pdfUNIT I_5.pdf
UNIT I_5.pdf
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-online
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Chap7 2 Ecc Intro
Chap7 2 Ecc IntroChap7 2 Ecc Intro
Chap7 2 Ecc Intro
 

More from Elsayed Hemayed

14 cie552 camera_calibration
14 cie552 camera_calibration14 cie552 camera_calibration
14 cie552 camera_calibration
Elsayed Hemayed
 
12 cie552 object_recognition
12 cie552 object_recognition12 cie552 object_recognition
12 cie552 object_recognition
Elsayed Hemayed
 
11 cie552 image_featuresii_sift
11 cie552 image_featuresii_sift11 cie552 image_featuresii_sift
11 cie552 image_featuresii_sift
Elsayed Hemayed
 
10 cie552 image_featuresii_corner
10 cie552 image_featuresii_corner10 cie552 image_featuresii_corner
10 cie552 image_featuresii_corner
Elsayed Hemayed
 
09 cie552 image_featuresi
09 cie552 image_featuresi09 cie552 image_featuresi
09 cie552 image_featuresi
Elsayed Hemayed
 
08 cie552 image_segmentation
08 cie552 image_segmentation08 cie552 image_segmentation
08 cie552 image_segmentation
Elsayed Hemayed
 
06 cie552 image_manipulation
06 cie552 image_manipulation06 cie552 image_manipulation
06 cie552 image_manipulation
Elsayed Hemayed
 
05 cie552 image_enhancement
05 cie552 image_enhancement05 cie552 image_enhancement
05 cie552 image_enhancement
Elsayed Hemayed
 
04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency
Elsayed Hemayed
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
Elsayed Hemayed
 
02 cie552 image_andcamera
02 cie552 image_andcamera02 cie552 image_andcamera
02 cie552 image_andcamera
Elsayed Hemayed
 
01 cie552 introduction
01 cie552 introduction01 cie552 introduction
01 cie552 introduction
Elsayed Hemayed
 
Csci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionCsci101 lect04 advanced_selection
Csci101 lect04 advanced_selection
Elsayed Hemayed
 
Csci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iiiCsci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iii
Elsayed Hemayed
 
Csci101 lect09 vectorized_code
Csci101 lect09 vectorized_codeCsci101 lect09 vectorized_code
Csci101 lect09 vectorized_code
Elsayed Hemayed
 
Csci101 lect08b matlab_programs
Csci101 lect08b matlab_programsCsci101 lect08b matlab_programs
Csci101 lect08b matlab_programs
Elsayed Hemayed
 
Csci101 lect08a matlab_programs
Csci101 lect08a matlab_programsCsci101 lect08a matlab_programs
Csci101 lect08a matlab_programs
Elsayed Hemayed
 
Csci101 lect07 algorithms_ii
Csci101 lect07 algorithms_iiCsci101 lect07 algorithms_ii
Csci101 lect07 algorithms_ii
Elsayed Hemayed
 
Csci101 lect06 advanced_looping
Csci101 lect06 advanced_loopingCsci101 lect06 advanced_looping
Csci101 lect06 advanced_looping
Elsayed Hemayed
 
Csci101 lect05 formatted_output
Csci101 lect05 formatted_outputCsci101 lect05 formatted_output
Csci101 lect05 formatted_output
Elsayed Hemayed
 

More from Elsayed Hemayed (20)

14 cie552 camera_calibration
14 cie552 camera_calibration14 cie552 camera_calibration
14 cie552 camera_calibration
 
12 cie552 object_recognition
12 cie552 object_recognition12 cie552 object_recognition
12 cie552 object_recognition
 
11 cie552 image_featuresii_sift
11 cie552 image_featuresii_sift11 cie552 image_featuresii_sift
11 cie552 image_featuresii_sift
 
10 cie552 image_featuresii_corner
10 cie552 image_featuresii_corner10 cie552 image_featuresii_corner
10 cie552 image_featuresii_corner
 
09 cie552 image_featuresi
09 cie552 image_featuresi09 cie552 image_featuresi
09 cie552 image_featuresi
 
08 cie552 image_segmentation
08 cie552 image_segmentation08 cie552 image_segmentation
08 cie552 image_segmentation
 
06 cie552 image_manipulation
06 cie552 image_manipulation06 cie552 image_manipulation
06 cie552 image_manipulation
 
05 cie552 image_enhancement
05 cie552 image_enhancement05 cie552 image_enhancement
05 cie552 image_enhancement
 
04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
 
02 cie552 image_andcamera
02 cie552 image_andcamera02 cie552 image_andcamera
02 cie552 image_andcamera
 
01 cie552 introduction
01 cie552 introduction01 cie552 introduction
01 cie552 introduction
 
Csci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionCsci101 lect04 advanced_selection
Csci101 lect04 advanced_selection
 
Csci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iiiCsci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iii
 
Csci101 lect09 vectorized_code
Csci101 lect09 vectorized_codeCsci101 lect09 vectorized_code
Csci101 lect09 vectorized_code
 
Csci101 lect08b matlab_programs
Csci101 lect08b matlab_programsCsci101 lect08b matlab_programs
Csci101 lect08b matlab_programs
 
Csci101 lect08a matlab_programs
Csci101 lect08a matlab_programsCsci101 lect08a matlab_programs
Csci101 lect08a matlab_programs
 
Csci101 lect07 algorithms_ii
Csci101 lect07 algorithms_iiCsci101 lect07 algorithms_ii
Csci101 lect07 algorithms_ii
 
Csci101 lect06 advanced_looping
Csci101 lect06 advanced_loopingCsci101 lect06 advanced_looping
Csci101 lect06 advanced_looping
 
Csci101 lect05 formatted_output
Csci101 lect05 formatted_outputCsci101 lect05 formatted_output
Csci101 lect05 formatted_output
 

Recently uploaded

special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

07 cie552 image_mosaicing

  • 2. Image Mosaicing • Are you getting the whole picture? – Compact Camera FOV = 50 x 35°
  • 3. Image Mosaicing • Are you getting the whole picture? – Compact Camera FOV = 50 x 35° – Human FOV = 200 x 135°
  • 4. Image Mosaicing • Are you getting the whole picture? – Compact Camera FOV = 50 x 35° – Human FOV = 200 x 135° – Panoramic Mosaic = 360 x 180°
  • 6. • Combine two or more overlapping images to make one larger image Add example Slide credit: Vaibhav Vaish 6
  • 7. The Problem Q: “Static” ? Ans.: No moving objects in the scene. +Image 1 Image 2 Mosaiced image
  • 8. The Solution Original images Image Registration / Alignment / Warping Image Blending
  • 9. How to do it? • Basic Procedure 1. Take a sequence of images from the same position 2. Compute transformation between second image and first 3. Shift the second image to overlap with the first 4. Blend the two together to create a mosaic 5. If there are more images, repeat 9
  • 10. 1. Take a sequence of images from the same position 10
  • 11. 2. Compute transformation between images • Extract interest points • Find Matches • Compute transformation? 11
  • 12. 3. Shift the images to overlap 12
  • 13. 4. Blend the two together to create a mosaic 13
  • 14. 5. Repeat for all images 14
  • 15. How to do it? • Basic Procedure 1. Take a sequence of images from the same position 2. Compute transformation between second image and first 3. Shift the second image to overlap with the first 4. Blend the two together to create a mosaic 5. If there are more images, repeat ✓ 15
  • 16. Compute Transformations • Extract interest points • Find good matches • Compute transformation ✓ Let’s assume we are given a set of good matching interest points ✓ 16
  • 17. Aligning images Translations are not enough to align the images left on top right on top
  • 18. Image reprojection • Observation – Rather than thinking of this as a 3D reprojection, think of it as a 2D image warp from one image to another 18
  • 19. Motion models • What happens when we take two images with a camera and try to align them? • translation? • rotation? • scale? • affine? • Perspective? 19
  • 20. Parametric (global) warping • Examples of parametric warps: translation rotation scaling affine perspective 20
  • 21. 2D coordinate transformations • translation: x’ = x + t x = (x,y) • rotation: x’ = R x + t • similarity: x’ = s R x + t • affine: x’ = A x + t • perspective: x’  H x x = (x,y,1) (x is a homogeneous coordinate) 21
  • 24. Scale
  • 25. Similarity transformations Similarity transform (4 DoF) = translation + rotation + scale Preserves: Angles
  • 26. Shear
  • 27. Affine transformations Affine transform (6 DoF) = translation + rotation + scale + shear Preserves: Parallelism
  • 28. Projective transformations a.k.a. Homographies “keystone” distortions Preserves: Straight Lines
  • 29. Finding the transformation Translation = 2 degrees of freedom Similarity = 4 degrees of freedom Affine = 6 degrees of freedom Homography = 8 degrees of freedom How many corresponding points do we need to solve?
  • 30. Solving for homographies 30 • A homography is a projective object, in that it has no scale. It is represented by the above matrix, up to scale. • One way of fixing the scale is to set one of the coordinates to 1, though that choice is arbitrary. • But that’s what most people do.
  • 32. Solving for homographies 32 This is just for one pair of points.
  • 33. Direct Linear Transforms (n points) Defines a least squares problem: • Since is only defined up to scale, solve for unit vector • Solution: = eigenvector of with smallest eigenvalue • Works with 4 or more points 2n × 9 9 2n 33
  • 34. 34 Matching features What do we do about the “bad” matches?
  • 35. Simple example: fit a line • Rather than homography H (8 numbers) fit y=ax+b (2 numbers a, b) to 2D pairs 35
  • 36. Simple example: fit a line • Pick 2 points • Fit line • Count inliers 36 3 inliers
  • 37. Simple example: fit a line • Pick 2 points • Fit line • Count inliers 37 4 inliers
  • 38. Simple example: fit a line • Pick 2 points • Fit line • Count inliers 38 9 inliers
  • 39. Simple example: fit a line • Pick 2 points • Fit line • Count inliers 39 8 inliers
  • 40. Simple example: fit a line • Use biggest set of inliers • Do least-square fit 40
  • 41. 41 RAndom SAmple Consensus Select one match, count inliers
  • 42. 42 RAndom SAmple Consensus Select one match, count inliers
  • 43. 43 Least squares fit (from inliers) Find “average” translation vector
  • 44. 44
  • 45. RANSAC for estimating homography • RANSAC loop: 1. Select four feature pairs (at random) 2. Compute homography H (exact) 3. Compute inliers where ||pi´, H pi|| < ε • Keep largest set of inliers • Re-compute least-squares H estimate using all of the inliers 45
  • 46. Where are we? • Basic Procedure 1. Take a sequence of images from the same position 2. Compute transformation between second image and first 3. Shift the second image to overlap with the first 4. Blend the two together to create a mosaic 5. If there are more images, repeat 46
  • 47. Image Warping • Given a coordinate transform x’ = h(x) and a source image f(x), how do we compute a transformed image g(x’) = f(h(x))? f(x) g(x’) x x’ h(x) 47
  • 48. Forward Warping • Send each pixel f(x) to its corresponding location x’ = h(x) in g(x’) f(x) g(x’) x x’ h(x) • What if pixel lands “between” two pixels? 48
  • 49. Forward Warping Old Colored Image f(x,y) New non-Colored Image f’(x’,y’) T Finding the point in the digital raster which matches the transformed point and determining its brightness.
  • 50. Forward Warping • Send each pixel f(x) to its corresponding location x’ = h(x) in g(x’) f(x) g(x’) x x’ h(x) • What if pixel lands “between” two pixels? 50
  • 51. 51 Inverse Warping • Get each pixel g(x’) from its corresponding location x’ = h(x) in f(x) f(x) g(x’) x x’ h-1(x) • What if pixel comes from “between” two pixels?
  • 52. Inverse Warping Old Colored Image f(x,y) New non-Colored Image f’(x’,y’) (x,y)=T-1(x’,y’) Inverse Transform
  • 53. 53 Inverse Warping • Get each pixel g(x’) from its corresponding location x’ = h(x) in f(x) • What if pixel comes from “between” two pixels? • Answer: resample color value from interpolated source image f(x) g(x’) x x’ h-1(x)
  • 54. Image Interpolation • The brightness interpolation problem is usually expressed in a dual way (by determining the brightness of the original point in the input image that corresponds to the point in the output image lying on the discrete raster). • Usually, a small neighborhood is used.
  • 55. Nearest neighbor interpolation Assigns to the point (x,y) the brightness value of the nearest point g in the discrete raster inverse planar transformation of the output image onto the input image
  • 56. Linear Interpolation Uses the four points neighboring the point (x,y).
  • 57. Interpolation vs. Nearest Neighbor • Error of the nearest neighborhood interpolation is at most half a pixel • Linear interpolation can cause a small decrease in resolution and blurring due to its averaging nature. • The problem of step like straight boundaries with the nearest neighborhood interpolation is reduced.
  • 59. Bicubic Interpolation • Improves the model of the brightness function by approximating it locally by a bicubic polynomial surface; sixteen neighboring points are used for interpolation. • The interpolation kernel (`Mexican hat') is given by
  • 60. Bicubic Interpolation The brightness values of the neighbors are first interpolated horizontally to determine the brightness values at the locations outlined in red, then these values are interpolated vertically to determine the brightness at the target pixel outlined in blue. The summation goes from k-1 to k+2 then from j-1 to j+2.
  • 61. Implementation Steps 1. Determine the closest pixel to (x’,y’). Then select the other 15 pixels (x-1 x+2 and y-1 y+2) 2. For Row 1 (y-1): Assume the four pixels have grey levels (g1, g2, g3, g4) and are at distances dx (-1.1, -0.2, 0.9, 1.5). Then the new grey level should be: Gy-1=(4-8(1.1)+5(1.1^2)-(1.1^3))*g1 + (4-8(1.5)+5(1.5^2)-(1.5^3))*g4 + (1-2(0.2^2)+(0.2^3)*g2 + (1-2(0.9^2)+(0.9^3)*g3. 3. Repeat for Gy, Gy+1, and Gy+2 4. Then Apply similar equation in step 2 but with the calculated grey levels and dy (-1,0,1,2).
  • 62. Bicubic Interpolation • Bicubic interpolation does not suffer from the step-like boundary problem of nearest neighborhood interpolation, and copes with linear interpolation blurring as well. • Bicubic interpolation is often used in raster displays that enable zooming with respect to an arbitrary point -- if the nearest neighborhood method were used, areas of the same brightness would increase. • Bicubic interpolation preserves fine details in the image very well. Cost !!
  • 66. NN
  • 69. NN
  • 72. Where are we? • Basic Procedure 1. Take a sequence of images from the same position (Rotate the camera about its optical center) 2. Compute transformation between second image and first 3. Shift the second image to overlap with the first 4. Blend the two together to create a mosaic 5. If there are more images, repeat 72
  • 73. Image Blending • Simple averaging • Weighted averaging • Also Pyramid Blending 2/)),('),((),( 21 yxfyxfyxf  ),('),(),(),(),( 2211 yxfyxwyxfyxwyxf   Smooth transition (edges, illumination artifacts)
  • 74. Image Blending Simple averaging Weighted averaging
  • 75. Sample results from Amin Charaniya (UCSC)
  • 76. Sample results from Amin Charaniya (UCSC)