SlideShare a Scribd company logo
1 of 65
© 2020 Wael Badawy
11
Panaramas
— Computer Vision —
DISCLAIMER:
This video is optimized for HD large display using
patented and patent-pending “Nile Codec”, the first
Egyptian Video Codec for more information,
PLEASE check https://NileCodec.com
Also available as a PodCast
What’s inside your fridge?
© 2020 Wael Badawy
Copyright © 2020 Wael Badawy. All rights reserved
 This video is subject to copyright owned by Wael Badawy “WB”. Any
reproduction or republication of all or part of this video is expressly prohibited
unless WB has explicitly granted its prior written consent. All other rights
reserved.
 This video is intended for education and information only and is offered AS IS,
without any warranty of the accuracy or the quality of the content. Any other
use is strictly prohibited. The viewer is fully responsible to verify the accuracy
of the contents received without any claims of costs or liability arising .
 The names, trademarks service marked as logos of WB or the sponsors
appearing in this video may not be used in any any product or service,
without prior express written permission from WB and the video sponsors
 Neither WB nor any party involved in creating, producing or delivering
information and material via this video shall be liable for any direction,
incidental, consequential, indirect of punitive damages arising out of access
to, use or inability to use this content or any errors or omissions in the
content thereof.
 If you will continue to watch this video, you agree to the terms above and
other terms that may be available on http://nu.edu.eg & https://caiwave.net
2
© 2020 Wael Badawy
© 2020 Wael Badawy
Camera projection matrix: recap
0
=
(in homogeneous image coordinates)
© 2020 Wael Badawy
Projection matrix
translationrotationprojection
intrinsics
This part converts 3D points in
world coordinates to 3D rays in the
camera’s coordinate system. There
are 6 parameters represented (3 for
position/translation, 3 for rotation).
The K matrix converts 3D rays
in the camera’s coordinate
system to 2D image points in
image (pixel) coordinates.
© 2020 Wael Badawy
Projection matrix
(t in book’s
notation)
translationrotationprojection
intrinsics
© 2020 Wael Badawy
Typical intrinsics matrix
 2D affine transform corresponding to a scale
by f (focal length) and a translation by (xc, yc)
(principal point)
© 2020 Wael Badawy
Projection matrix
(t in book’s
notation)
or
© 2020 Wael Badawy
Projection matrix
0
=
(in homogeneous image coordinates)
© 2020 Wael Badawy
Questions?
© 2020 Wael Badawy
Perspective distortion
• Problem for architectural photography:
converging verticals
Source: F. Durand
© 2020 Wael Badawy
Perspective distortion
• Problem for architectural photography: converging
verticals
• Solution: view camera (lens shifted w.r.t. film)
Source: F. Durand
Tilting the camera
upwards results in
converging verticals
Keeping the camera level,
with an ordinary lens,
captures only the bottom
portion of the building
Shifting the lens
upwards results in a
picture of the entire
subject
http://en.wikipedia.org/wiki/Perspective_correction_lens
(Corresponds to shifting
the principal point)
© 2020 Wael Badawy
Perspective distortion
• Problem for architectural photography:
converging verticals
• Result:
Source: F. Durand
© 2020 Wael Badawy
Perspective distortion
• What does a sphere project to?
Image source: F. Durand
© 2020 Wael Badawy
Perspective distortion
• The exterior columns appear bigger
• The distortion is not due to lens flaws
• Problem pointed out by Da Vinci
Slide by F. Durand
© 2020 Wael Badawy
Perspective distortion: People
© 2020 Wael Badawy
© 2020 Wael Badawy Fredo Durand
http://petapixel.com/2013/01/11/how-focal-length-affects-your-subjects-apparent-weight-as-seen-with-a-
cat/
© 2020 Wael Badawy
Lens distortion
 Radial distortion of the image
 Caused by imperfect lenses
 Points are distorted along radial lines
 Deviations are most noticeable for rays that pass
through the edge of the lens
No distortion Pin cushion Barrel
© 2020 Wael Badawy
© 2020 Wael Badawy
Radial distortion
© 2020 Wael Badawy
Radial distortion
[Image credit: J. Bouguet http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html]
• Arrows show motion
of projected points
relative to an ideal
(distortion-free
lens)
© 2020 Wael Badawy
Correcting radial distortion
from Helmut Dersch
© 2020 Wael Badawy
Modeling distortion
 To model lens distortion
 Use the above conversion of rays to pixels, rather
than simply multiplying by the intrinsics matrix
Apply radial distortion
by approximating with
a (low-degree)
polynomial
Apply focal length &
translate image center
Project
to “normalized”
image coordinates
© 2020 Wael Badawy
Other types of projection
 Lots of intriguing variants…
 (I’ll just mention a few fun ones)
© 2020 Wael Badawy
360 degree field of view…
 Basic approach
 Take a photo of a parabolic mirror with an orthographic lens (Nayar)
 Or buy one a lens from a variety of omnicam manufacturers…
 See http://www.cis.upenn.edu/~kostas/omni.html
© 2020 Wael Badawy
Tilt-shift
Titlt-shift images from Olivo Barbieri
and Photoshop imitations
http://www.northlight-images.co.uk/article_pages/tilt_and_shift_ts-e.html
© 2020 Wael Badawy
Rollout Photographs © Justin Kerr
http://research.famsi.org/kerrmaya.html
Rotating sensor (or object)
Also known as “cyclographs”, “peripheral images”
© 2020 Wael Badawy
Back to panoramas
Can we use homographies to create a 360
© 2020 Wael Badawy
Idea: projecting images onto a
common plane
mosaic projection plane
each image is warped
with a homography
We’ll see what this homography means next
Can’t create a 360 panorama this way… we’ll fix
this shortly
© 2020 Wael Badawy
Creating a panorama
 Basic Procedure
 Take a sequence of images from the same position
 Rotate the camera about its optical center
 Compute transformation between second image and
first
 Transform the second image to overlap with the first
 Blend the two together to create a mosaic
 If there are more images, repeat
© 2020 Wael Badawy
Geometric Interpretation of Mosaics
• If we capture all 360º of rays, we can create a 360º
panorama
• The basic operation is projecting an image from one plane to
another
• The projective transformation is scene-INDEPENDENT
• This depends on all the images having the same optical center
Image 1
Image 2
Optical Center
© 2020 Wael Badawy
Image reprojection
 Basic question
 How to relate two images from the same camera center?
 how to map a pixel from PP1 to PP2
PP2
PP1
Answer
• Cast a ray through each pixel in PP1
• Draw the pixel where that ray intersects PP2
© 2020 Wael Badawy
What is the transformation?
Image 1
Image 2
Optical Center
How do we map points in image 2 into image 1?
image 1 image 2
3x3 homography
Step 1: Convert pixels in image 2
to rays in camera 2’s coordinate
system.
Step 2: Convert rays in camera 2’s
coordinates to rays in camera 1’s
coordinates.
Step 3: Convert rays in camera 1’s
coordinates to pixels in image 1’s
coordinates.
intrinsics
extrinsics
(rotation only)
© 2020 Wael Badawy
Can we use homography to create a
360 panorama?
© 2020 Wael Badawy
Panoramas
 What if you want a 360 field of view?
mosaic Projection Sphere
© 2020 Wael Badawy
Spherical projection
 Map 3D point (X,Y,Z) onto sphere
X
Y
Z
unit sphere
unwrapped sphere
• Convert to spherical coordinates
Spherical image
• Convert to spherical image coordinates
– s defines size of the final image
» often convenient to set s = camera focal length
© 2020 Wael Badawy
Unwrapping a sphere
Credit: JHT’s Planetary Pixel Emporium
© 2020 Wael Badawy
f = 200 (pixels)
Spherical reprojection
 Map image to spherical coordinates
 need to know the focal length
input f = 800f = 400
© 2020 Wael Badawy
Aligning spherical images
 Suppose we rotate the camera by  about the vertical axis
 How does this change the spherical image?
© 2020 Wael Badawy
Aligning spherical images
• Suppose we rotate the camera by  about the vertical axis
– How does this change the spherical image?
– Translation by 
– This means that we can align spherical images by translation
© 2020 Wael Badawy
Assembling the panorama
 Stitch pairs together, blend, then crop
© 2020 Wael Badawy
Problem: Drift
 Error accumulation
 small errors accumulate over time
© 2020 Wael Badawy
Problem: Drift
 Solution
 add another copy of first image at the end
 this gives a constraint: yn = y1
 there are a bunch of ways to solve this problem
 add displacement of (y1 – yn)/(n -1) to each image after the
first
 apply an affine warp: y’ = y + ax [you will implement
this for P3]
 run a big optimization problem, incorporating this constraint
 best solution, but more complicated
(x1,y1)
copy of first image
(xn,yn)
© 2020 Wael Badawy
Project 3
 Take pictures on a tripod (or handheld)
 Warp to spherical coordinates (optional if using
homographies to align images)
 Extract features
 Align neighboring pairs using RANSAC
 Write out list of neighboring translations
 Correct for drift
 Read in warped images and blend them
 Crop the result and import into a viewer
 Roughly based on Autostitch
 By Matthew Brown and David Lowe
 http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.ht
ml
© 2020 Wael Badawy
+
+
+
+
Microsoft Lobby: http://www.acm.org/pubs/citations/proceedings/graph/258734/p251-szeliski
Spherical panoramas
© 2020 Wael Badawy
Different projections are
possible
Cube-map
© 2020 Wael Badawy
Blending
 We’ve aligned the images – now what?
© 2020 Wael Badawy
Blending
 Want to seamlessly blend them together
© 2020 Wael Badawy
Image Blending
© 2020 Wael Badawy
Feathering
0
1
0
1
+
=
© 2020 Wael Badawy
Effect of window size
0
1 left
right
0
1
© 2020 Wael Badawy
0
1
0
1
Effect of window size
© 2020 Wael Badawy
Good window size
0
1
“Optimal” window: smooth but not ghosted
• Doesn’t always work...
© 2020 Wael Badawy
Pyramid blending
Create a Laplacian pyramid, blend each level
• Burt, P. J. and Adelson, E. H., A multiresolution spline with applications to image mosaics, ACM Transactions on
Graphics, 42(4), October 1983, 217-236.
© 2020 Wael Badawy
Gaussian Pyramid Laplacian Pyramid
The Laplacian Pyramid
0G
1G
2G
nG
- =
0L
- =
1L
- = 2L
nn GL 
)expand( 1 iii GGL
)expand( 1 iii GLG
© 2020 Wael Badawy
Encoding blend weights: I(x,y) = (R, G, B, )
color at p =
Implement this in two steps:
1. accumulate: add up the ( premultiplied) RGB values at each pixel
2. normalize: divide each pixel’s accumulated RGB by its  value
Q: what if  = 0?
Alpha Blending
Optional: see Blinn (CGA, 1994) for details:
http://ieeexplore.ieee.org/iel1/38/7531/00310740.pdf?isNumb
er=7531&prod=JNL&arnumber=310740&arSt=83&ared=87&a
rAuthor=Blinn%2C+J.F.
I1
I2
I3
p
© 2020 Wael Badawy
Poisson Image Editing
 For more info: Perez et al, SIGGRAPH 2003
 http://research.microsoft.com/vision/cambridge/papers/perez_siggraph03.pdf
© 2020 Wael Badawy
Some panorama examples
“Before SIGGRAPH Deadline” Photo credit: Doug Zongker
© 2020 Wael Badawy
Some panorama examples
 Every image on Google Streetview
© 2020 Wael Badawy
Magic: ghost removal
M. Uyttendaele, A. Eden, and R. Szeliski.
Eliminating ghosting and exposure artifacts in image mosaics.
In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition,
volume 2, pages 509--516, Kauai, Hawaii, December 2001.
© 2020 Wael Badawy
Magic: ghost removal
M. Uyttendaele, A. Eden, and R. Szeliski.
Eliminating ghosting and exposure artifacts in image mosaics.
In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition,
volume 2, pages 509--516, Kauai, Hawaii, December 2001.
© 2020 Wael Badawy
Other types of mosaics
 Can mosaic onto any surface if you know the geometry
 See NASA’s Visible Earth project for some stunning earth mosaics
 http://earthobservatory.nasa.gov/Newsroom/BlueMarble/
 Click for images…
© 2020 Wael Badawy
 http://earthobservatory.nasa.gov/NaturalHazards/
view.php?id=87675&src=twitter-nh
© 2020 Wael Badawy
Questions?

More Related Content

Similar to Computer Vision panoramas

Np complete reductions
Np complete reductionsNp complete reductions
Np complete reductionsWael Badawy
 
Multi-hypothesis projection-based shift estimation for sweeping panorama reco...
Multi-hypothesis projection-based shift estimation for sweeping panorama reco...Multi-hypothesis projection-based shift estimation for sweeping panorama reco...
Multi-hypothesis projection-based shift estimation for sweeping panorama reco...Tuan Q. Pham
 
Omniphotos Whitepaper | SIGGRAPH Asia 2020
Omniphotos Whitepaper | SIGGRAPH Asia 2020Omniphotos Whitepaper | SIGGRAPH Asia 2020
Omniphotos Whitepaper | SIGGRAPH Asia 2020Alejandro Franceschi
 
Regular expressions
Regular expressions Regular expressions
Regular expressions Wael Badawy
 
Holus - Glassless 3d system and modular apparatus
Holus  - Glassless 3d system and modular apparatusHolus  - Glassless 3d system and modular apparatus
Holus - Glassless 3d system and modular apparatusDhruv Adhia
 
V Ray For Sketch Up 2007 Manual
V Ray For Sketch Up 2007 ManualV Ray For Sketch Up 2007 Manual
V Ray For Sketch Up 2007 ManualPheo8x
 
Virtual Reality 3D home applications
Virtual Reality 3D home applicationsVirtual Reality 3D home applications
Virtual Reality 3D home applicationsslebrun
 
Universal turing
Universal turing Universal turing
Universal turing Wael Badawy
 
Luis cataldi-ue4-vr-best-practices2
Luis cataldi-ue4-vr-best-practices2Luis cataldi-ue4-vr-best-practices2
Luis cataldi-ue4-vr-best-practices2Luis Cataldi
 
MVisio: A Computer Graphics Platform for Virtual Reality, Science and Education
MVisio: A Computer Graphics Platform for Virtual Reality, Science and EducationMVisio: A Computer Graphics Platform for Virtual Reality, Science and Education
MVisio: A Computer Graphics Platform for Virtual Reality, Science and EducationAchille Peternier
 
Measuring Project Health at VMware
Measuring Project Health at VMwareMeasuring Project Health at VMware
Measuring Project Health at VMwareDawn Foster
 
Matterhorn 2014 Unconference: Ideas for automated post-recording video handling
Matterhorn 2014 Unconference: Ideas for automated post-recording video handlingMatterhorn 2014 Unconference: Ideas for automated post-recording video handling
Matterhorn 2014 Unconference: Ideas for automated post-recording video handlingStephen Marquard
 
IRJET- Digital Watermarking using Integration of DWT & SVD Techniques
IRJET- Digital Watermarking using Integration of DWT & SVD TechniquesIRJET- Digital Watermarking using Integration of DWT & SVD Techniques
IRJET- Digital Watermarking using Integration of DWT & SVD TechniquesIRJET Journal
 
Turing variations
Turing variations Turing variations
Turing variations Wael Badawy
 
Optimized Rendering Techniques for Mobile VR
Optimized Rendering Techniques  for Mobile VROptimized Rendering Techniques  for Mobile VR
Optimized Rendering Techniques for Mobile VRDevGAMM Conference
 

Similar to Computer Vision panoramas (20)

Np complete reductions
Np complete reductionsNp complete reductions
Np complete reductions
 
Vray
VrayVray
Vray
 
Multi-hypothesis projection-based shift estimation for sweeping panorama reco...
Multi-hypothesis projection-based shift estimation for sweeping panorama reco...Multi-hypothesis projection-based shift estimation for sweeping panorama reco...
Multi-hypothesis projection-based shift estimation for sweeping panorama reco...
 
Omniphotos Whitepaper | SIGGRAPH Asia 2020
Omniphotos Whitepaper | SIGGRAPH Asia 2020Omniphotos Whitepaper | SIGGRAPH Asia 2020
Omniphotos Whitepaper | SIGGRAPH Asia 2020
 
Regular expressions
Regular expressions Regular expressions
Regular expressions
 
Holus - Glassless 3d system and modular apparatus
Holus  - Glassless 3d system and modular apparatusHolus  - Glassless 3d system and modular apparatus
Holus - Glassless 3d system and modular apparatus
 
V Ray For Sketch Up 2007 Manual
V Ray For Sketch Up 2007 ManualV Ray For Sketch Up 2007 Manual
V Ray For Sketch Up 2007 Manual
 
視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用
 
Virtual Reality 3D home applications
Virtual Reality 3D home applicationsVirtual Reality 3D home applications
Virtual Reality 3D home applications
 
Universal turing
Universal turing Universal turing
Universal turing
 
BYO3D 2011: Construction
BYO3D 2011: ConstructionBYO3D 2011: Construction
BYO3D 2011: Construction
 
Luis cataldi-ue4-vr-best-practices2
Luis cataldi-ue4-vr-best-practices2Luis cataldi-ue4-vr-best-practices2
Luis cataldi-ue4-vr-best-practices2
 
MVisio: A Computer Graphics Platform for Virtual Reality, Science and Education
MVisio: A Computer Graphics Platform for Virtual Reality, Science and EducationMVisio: A Computer Graphics Platform for Virtual Reality, Science and Education
MVisio: A Computer Graphics Platform for Virtual Reality, Science and Education
 
Measuring Project Health at VMware
Measuring Project Health at VMwareMeasuring Project Health at VMware
Measuring Project Health at VMware
 
06714519
0671451906714519
06714519
 
Artikel.pdf
Artikel.pdfArtikel.pdf
Artikel.pdf
 
Matterhorn 2014 Unconference: Ideas for automated post-recording video handling
Matterhorn 2014 Unconference: Ideas for automated post-recording video handlingMatterhorn 2014 Unconference: Ideas for automated post-recording video handling
Matterhorn 2014 Unconference: Ideas for automated post-recording video handling
 
IRJET- Digital Watermarking using Integration of DWT & SVD Techniques
IRJET- Digital Watermarking using Integration of DWT & SVD TechniquesIRJET- Digital Watermarking using Integration of DWT & SVD Techniques
IRJET- Digital Watermarking using Integration of DWT & SVD Techniques
 
Turing variations
Turing variations Turing variations
Turing variations
 
Optimized Rendering Techniques for Mobile VR
Optimized Rendering Techniques  for Mobile VROptimized Rendering Techniques  for Mobile VR
Optimized Rendering Techniques for Mobile VR
 

More from Wael Badawy

HTML introduction
HTML introduction HTML introduction
HTML introduction Wael Badawy
 
N F A - Non Deterministic Finite Automata
N F A - Non Deterministic Finite AutomataN F A - Non Deterministic Finite Automata
N F A - Non Deterministic Finite AutomataWael Badawy
 
Computer Vision Gans
Computer Vision GansComputer Vision Gans
Computer Vision GansWael Badawy
 
Computer Vision image classification
Computer Vision image classificationComputer Vision image classification
Computer Vision image classificationWael Badawy
 
Computer Vision Structure from motion
Computer Vision Structure from motionComputer Vision Structure from motion
Computer Vision Structure from motionWael Badawy
 
Regular pumping
Regular pumping Regular pumping
Regular pumping Wael Badawy
 
Regular pumping examples
Regular pumping examples Regular pumping examples
Regular pumping examples Wael Badawy
 
Regular properties
Regular propertiesRegular properties
Regular propertiesWael Badawy
 
Pushdown Automota
Pushdown Automota Pushdown Automota
Pushdown Automota Wael Badawy
 
Pda accept context free
Pda accept context freePda accept context free
Pda accept context freeWael Badawy
 
Computer Vision sfm
Computer Vision sfmComputer Vision sfm
Computer Vision sfmWael Badawy
 
Computer vision - photometric
Computer vision - photometricComputer vision - photometric
Computer vision - photometricWael Badawy
 
Computer vision - light
Computer vision - lightComputer vision - light
Computer vision - lightWael Badawy
 
Computer vision - two view geometry
Computer vision -  two view geometryComputer vision -  two view geometry
Computer vision - two view geometryWael Badawy
 
Computer Vision - Stereo Vision
Computer Vision - Stereo VisionComputer Vision - Stereo Vision
Computer Vision - Stereo VisionWael Badawy
 
Computer Vision - Single View
Computer Vision - Single ViewComputer Vision - Single View
Computer Vision - Single ViewWael Badawy
 
Computer Vision panoramas
Computer Vision  panoramasComputer Vision  panoramas
Computer Vision panoramasWael Badawy
 
Computer Vision - cameras
Computer Vision - camerasComputer Vision - cameras
Computer Vision - camerasWael Badawy
 

More from Wael Badawy (20)

HTML introduction
HTML introduction HTML introduction
HTML introduction
 
N F A - Non Deterministic Finite Automata
N F A - Non Deterministic Finite AutomataN F A - Non Deterministic Finite Automata
N F A - Non Deterministic Finite Automata
 
Parsers -
Parsers -Parsers -
Parsers -
 
Computer Vision Gans
Computer Vision GansComputer Vision Gans
Computer Vision Gans
 
Computer Vision image classification
Computer Vision image classificationComputer Vision image classification
Computer Vision image classification
 
Computer Vision Structure from motion
Computer Vision Structure from motionComputer Vision Structure from motion
Computer Vision Structure from motion
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Regular pumping
Regular pumping Regular pumping
Regular pumping
 
Regular pumping examples
Regular pumping examples Regular pumping examples
Regular pumping examples
 
Regular properties
Regular propertiesRegular properties
Regular properties
 
Pushdown Automota
Pushdown Automota Pushdown Automota
Pushdown Automota
 
Pda accept context free
Pda accept context freePda accept context free
Pda accept context free
 
Computer Vision sfm
Computer Vision sfmComputer Vision sfm
Computer Vision sfm
 
Computer vision - photometric
Computer vision - photometricComputer vision - photometric
Computer vision - photometric
 
Computer vision - light
Computer vision - lightComputer vision - light
Computer vision - light
 
Computer vision - two view geometry
Computer vision -  two view geometryComputer vision -  two view geometry
Computer vision - two view geometry
 
Computer Vision - Stereo Vision
Computer Vision - Stereo VisionComputer Vision - Stereo Vision
Computer Vision - Stereo Vision
 
Computer Vision - Single View
Computer Vision - Single ViewComputer Vision - Single View
Computer Vision - Single View
 
Computer Vision panoramas
Computer Vision  panoramasComputer Vision  panoramas
Computer Vision panoramas
 
Computer Vision - cameras
Computer Vision - camerasComputer Vision - cameras
Computer Vision - cameras
 

Recently uploaded

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 

Recently uploaded (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

Computer Vision panoramas

  • 1. © 2020 Wael Badawy 11 Panaramas — Computer Vision — DISCLAIMER: This video is optimized for HD large display using patented and patent-pending “Nile Codec”, the first Egyptian Video Codec for more information, PLEASE check https://NileCodec.com Also available as a PodCast What’s inside your fridge?
  • 2. © 2020 Wael Badawy Copyright © 2020 Wael Badawy. All rights reserved  This video is subject to copyright owned by Wael Badawy “WB”. Any reproduction or republication of all or part of this video is expressly prohibited unless WB has explicitly granted its prior written consent. All other rights reserved.  This video is intended for education and information only and is offered AS IS, without any warranty of the accuracy or the quality of the content. Any other use is strictly prohibited. The viewer is fully responsible to verify the accuracy of the contents received without any claims of costs or liability arising .  The names, trademarks service marked as logos of WB or the sponsors appearing in this video may not be used in any any product or service, without prior express written permission from WB and the video sponsors  Neither WB nor any party involved in creating, producing or delivering information and material via this video shall be liable for any direction, incidental, consequential, indirect of punitive damages arising out of access to, use or inability to use this content or any errors or omissions in the content thereof.  If you will continue to watch this video, you agree to the terms above and other terms that may be available on http://nu.edu.eg & https://caiwave.net 2
  • 3. © 2020 Wael Badawy
  • 4. © 2020 Wael Badawy Camera projection matrix: recap 0 = (in homogeneous image coordinates)
  • 5. © 2020 Wael Badawy Projection matrix translationrotationprojection intrinsics This part converts 3D points in world coordinates to 3D rays in the camera’s coordinate system. There are 6 parameters represented (3 for position/translation, 3 for rotation). The K matrix converts 3D rays in the camera’s coordinate system to 2D image points in image (pixel) coordinates.
  • 6. © 2020 Wael Badawy Projection matrix (t in book’s notation) translationrotationprojection intrinsics
  • 7. © 2020 Wael Badawy Typical intrinsics matrix  2D affine transform corresponding to a scale by f (focal length) and a translation by (xc, yc) (principal point)
  • 8. © 2020 Wael Badawy Projection matrix (t in book’s notation) or
  • 9. © 2020 Wael Badawy Projection matrix 0 = (in homogeneous image coordinates)
  • 10. © 2020 Wael Badawy Questions?
  • 11. © 2020 Wael Badawy Perspective distortion • Problem for architectural photography: converging verticals Source: F. Durand
  • 12. © 2020 Wael Badawy Perspective distortion • Problem for architectural photography: converging verticals • Solution: view camera (lens shifted w.r.t. film) Source: F. Durand Tilting the camera upwards results in converging verticals Keeping the camera level, with an ordinary lens, captures only the bottom portion of the building Shifting the lens upwards results in a picture of the entire subject http://en.wikipedia.org/wiki/Perspective_correction_lens (Corresponds to shifting the principal point)
  • 13. © 2020 Wael Badawy Perspective distortion • Problem for architectural photography: converging verticals • Result: Source: F. Durand
  • 14. © 2020 Wael Badawy Perspective distortion • What does a sphere project to? Image source: F. Durand
  • 15. © 2020 Wael Badawy Perspective distortion • The exterior columns appear bigger • The distortion is not due to lens flaws • Problem pointed out by Da Vinci Slide by F. Durand
  • 16. © 2020 Wael Badawy Perspective distortion: People
  • 17. © 2020 Wael Badawy
  • 18. © 2020 Wael Badawy Fredo Durand http://petapixel.com/2013/01/11/how-focal-length-affects-your-subjects-apparent-weight-as-seen-with-a- cat/
  • 19. © 2020 Wael Badawy Lens distortion  Radial distortion of the image  Caused by imperfect lenses  Points are distorted along radial lines  Deviations are most noticeable for rays that pass through the edge of the lens No distortion Pin cushion Barrel
  • 20. © 2020 Wael Badawy
  • 21. © 2020 Wael Badawy Radial distortion
  • 22. © 2020 Wael Badawy Radial distortion [Image credit: J. Bouguet http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html] • Arrows show motion of projected points relative to an ideal (distortion-free lens)
  • 23. © 2020 Wael Badawy Correcting radial distortion from Helmut Dersch
  • 24. © 2020 Wael Badawy Modeling distortion  To model lens distortion  Use the above conversion of rays to pixels, rather than simply multiplying by the intrinsics matrix Apply radial distortion by approximating with a (low-degree) polynomial Apply focal length & translate image center Project to “normalized” image coordinates
  • 25. © 2020 Wael Badawy Other types of projection  Lots of intriguing variants…  (I’ll just mention a few fun ones)
  • 26. © 2020 Wael Badawy 360 degree field of view…  Basic approach  Take a photo of a parabolic mirror with an orthographic lens (Nayar)  Or buy one a lens from a variety of omnicam manufacturers…  See http://www.cis.upenn.edu/~kostas/omni.html
  • 27. © 2020 Wael Badawy Tilt-shift Titlt-shift images from Olivo Barbieri and Photoshop imitations http://www.northlight-images.co.uk/article_pages/tilt_and_shift_ts-e.html
  • 28. © 2020 Wael Badawy Rollout Photographs © Justin Kerr http://research.famsi.org/kerrmaya.html Rotating sensor (or object) Also known as “cyclographs”, “peripheral images”
  • 29. © 2020 Wael Badawy Back to panoramas Can we use homographies to create a 360
  • 30. © 2020 Wael Badawy Idea: projecting images onto a common plane mosaic projection plane each image is warped with a homography We’ll see what this homography means next Can’t create a 360 panorama this way… we’ll fix this shortly
  • 31. © 2020 Wael Badawy Creating a panorama  Basic Procedure  Take a sequence of images from the same position  Rotate the camera about its optical center  Compute transformation between second image and first  Transform the second image to overlap with the first  Blend the two together to create a mosaic  If there are more images, repeat
  • 32. © 2020 Wael Badawy Geometric Interpretation of Mosaics • If we capture all 360º of rays, we can create a 360º panorama • The basic operation is projecting an image from one plane to another • The projective transformation is scene-INDEPENDENT • This depends on all the images having the same optical center Image 1 Image 2 Optical Center
  • 33. © 2020 Wael Badawy Image reprojection  Basic question  How to relate two images from the same camera center?  how to map a pixel from PP1 to PP2 PP2 PP1 Answer • Cast a ray through each pixel in PP1 • Draw the pixel where that ray intersects PP2
  • 34. © 2020 Wael Badawy What is the transformation? Image 1 Image 2 Optical Center How do we map points in image 2 into image 1? image 1 image 2 3x3 homography Step 1: Convert pixels in image 2 to rays in camera 2’s coordinate system. Step 2: Convert rays in camera 2’s coordinates to rays in camera 1’s coordinates. Step 3: Convert rays in camera 1’s coordinates to pixels in image 1’s coordinates. intrinsics extrinsics (rotation only)
  • 35. © 2020 Wael Badawy Can we use homography to create a 360 panorama?
  • 36. © 2020 Wael Badawy Panoramas  What if you want a 360 field of view? mosaic Projection Sphere
  • 37. © 2020 Wael Badawy Spherical projection  Map 3D point (X,Y,Z) onto sphere X Y Z unit sphere unwrapped sphere • Convert to spherical coordinates Spherical image • Convert to spherical image coordinates – s defines size of the final image » often convenient to set s = camera focal length
  • 38. © 2020 Wael Badawy Unwrapping a sphere Credit: JHT’s Planetary Pixel Emporium
  • 39. © 2020 Wael Badawy f = 200 (pixels) Spherical reprojection  Map image to spherical coordinates  need to know the focal length input f = 800f = 400
  • 40. © 2020 Wael Badawy Aligning spherical images  Suppose we rotate the camera by  about the vertical axis  How does this change the spherical image?
  • 41. © 2020 Wael Badawy Aligning spherical images • Suppose we rotate the camera by  about the vertical axis – How does this change the spherical image? – Translation by  – This means that we can align spherical images by translation
  • 42. © 2020 Wael Badawy Assembling the panorama  Stitch pairs together, blend, then crop
  • 43. © 2020 Wael Badawy Problem: Drift  Error accumulation  small errors accumulate over time
  • 44. © 2020 Wael Badawy Problem: Drift  Solution  add another copy of first image at the end  this gives a constraint: yn = y1  there are a bunch of ways to solve this problem  add displacement of (y1 – yn)/(n -1) to each image after the first  apply an affine warp: y’ = y + ax [you will implement this for P3]  run a big optimization problem, incorporating this constraint  best solution, but more complicated (x1,y1) copy of first image (xn,yn)
  • 45. © 2020 Wael Badawy Project 3  Take pictures on a tripod (or handheld)  Warp to spherical coordinates (optional if using homographies to align images)  Extract features  Align neighboring pairs using RANSAC  Write out list of neighboring translations  Correct for drift  Read in warped images and blend them  Crop the result and import into a viewer  Roughly based on Autostitch  By Matthew Brown and David Lowe  http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.ht ml
  • 46. © 2020 Wael Badawy + + + + Microsoft Lobby: http://www.acm.org/pubs/citations/proceedings/graph/258734/p251-szeliski Spherical panoramas
  • 47. © 2020 Wael Badawy Different projections are possible Cube-map
  • 48. © 2020 Wael Badawy Blending  We’ve aligned the images – now what?
  • 49. © 2020 Wael Badawy Blending  Want to seamlessly blend them together
  • 50. © 2020 Wael Badawy Image Blending
  • 51. © 2020 Wael Badawy Feathering 0 1 0 1 + =
  • 52. © 2020 Wael Badawy Effect of window size 0 1 left right 0 1
  • 53. © 2020 Wael Badawy 0 1 0 1 Effect of window size
  • 54. © 2020 Wael Badawy Good window size 0 1 “Optimal” window: smooth but not ghosted • Doesn’t always work...
  • 55. © 2020 Wael Badawy Pyramid blending Create a Laplacian pyramid, blend each level • Burt, P. J. and Adelson, E. H., A multiresolution spline with applications to image mosaics, ACM Transactions on Graphics, 42(4), October 1983, 217-236.
  • 56. © 2020 Wael Badawy Gaussian Pyramid Laplacian Pyramid The Laplacian Pyramid 0G 1G 2G nG - = 0L - = 1L - = 2L nn GL  )expand( 1 iii GGL )expand( 1 iii GLG
  • 57. © 2020 Wael Badawy Encoding blend weights: I(x,y) = (R, G, B, ) color at p = Implement this in two steps: 1. accumulate: add up the ( premultiplied) RGB values at each pixel 2. normalize: divide each pixel’s accumulated RGB by its  value Q: what if  = 0? Alpha Blending Optional: see Blinn (CGA, 1994) for details: http://ieeexplore.ieee.org/iel1/38/7531/00310740.pdf?isNumb er=7531&prod=JNL&arnumber=310740&arSt=83&ared=87&a rAuthor=Blinn%2C+J.F. I1 I2 I3 p
  • 58. © 2020 Wael Badawy Poisson Image Editing  For more info: Perez et al, SIGGRAPH 2003  http://research.microsoft.com/vision/cambridge/papers/perez_siggraph03.pdf
  • 59. © 2020 Wael Badawy Some panorama examples “Before SIGGRAPH Deadline” Photo credit: Doug Zongker
  • 60. © 2020 Wael Badawy Some panorama examples  Every image on Google Streetview
  • 61. © 2020 Wael Badawy Magic: ghost removal M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition, volume 2, pages 509--516, Kauai, Hawaii, December 2001.
  • 62. © 2020 Wael Badawy Magic: ghost removal M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition, volume 2, pages 509--516, Kauai, Hawaii, December 2001.
  • 63. © 2020 Wael Badawy Other types of mosaics  Can mosaic onto any surface if you know the geometry  See NASA’s Visible Earth project for some stunning earth mosaics  http://earthobservatory.nasa.gov/Newsroom/BlueMarble/  Click for images…
  • 64. © 2020 Wael Badawy  http://earthobservatory.nasa.gov/NaturalHazards/ view.php?id=87675&src=twitter-nh
  • 65. © 2020 Wael Badawy Questions?