DD2423 Image Analysis and Computer Vision IMAGE FORMATION. Computational Vision and Active Perception School of Computer Science and Communication

Similar documents
Homogeneous Coordinates. Lecture18: Camera Models. Representation of Line and Point in 2D. Cross Product. Overall scaling is NOT important.

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

Introduction to Computer Vision

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

Introduction to Computer Vision. Introduction CMPSCI 591A/691A CMPSCI 570/670. Image Formation

Understanding Variability

EXAM SOLUTIONS. Computer Vision Course 2D1420 Thursday, 11 th of march 2003,

CS6670: Computer Vision

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Vision Review: Image Formation. Course web page:

CS4670: Computer Vision

Rigid Body Motion and Image Formation. Jana Kosecka, CS 482

Projective Geometry and Camera Models

Robotics - Projective Geometry and Camera model. Marcello Restelli

Projective Geometry and Camera Models

Computer Vision. Coordinates. Prof. Flávio Cardeal DECOM / CEFET- MG.

Pinhole Camera Model 10/05/17. Computational Photography Derek Hoiem, University of Illinois

Chapter 2 - Fundamentals. Comunicação Visual Interactiva

Computer Vision Project-1

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD

Visual Recognition: Image Formation

All human beings desire to know. [...] sight, more than any other senses, gives us knowledge of things and clarifies many differences among them.

Agenda. Rotations. Camera models. Camera calibration. Homographies

Robotics - Projective Geometry and Camera model. Matteo Pirotta

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Camera Model and Calibration

Pin Hole Cameras & Warp Functions

Cameras and Radiometry. Last lecture in a nutshell. Conversion Euclidean -> Homogenous -> Euclidean. Affine Camera Model. Simplified Camera Models

Augmented Reality II - Camera Calibration - Gudrun Klinker May 11, 2004

Agenda. Perspective projection. Rotations. Camera models

Image warping , , Computational Photography Fall 2017, Lecture 10

Agenda. Rotations. Camera calibration. Homography. Ransac

Viewing. Reading: Angel Ch.5

L16. Scan Matching and Image Formation

Camera Calibration. Schedule. Jesus J Caban. Note: You have until next Monday to let me know. ! Today:! Camera calibration

Image Formation. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

METRIC PLANE RECTIFICATION USING SYMMETRIC VANISHING POINTS

Correspondence and Stereopsis. Original notes by W. Correa. Figures from [Forsyth & Ponce] and [Trucco & Verri]

Geometric camera models and calibration

Projective geometry for Computer Vision

Digital Image Processing COSC 6380/4393

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

calibrated coordinates Linear transformation pixel coordinates

Laser sensors. Transmitter. Receiver. Basilio Bona ROBOTICA 03CFIOR

CS201 Computer Vision Lect 4 - Image Formation

CS6670: Computer Vision

Image Formation I Chapter 1 (Forsyth&Ponce) Cameras

CHAPTER 3. Single-view Geometry. 1. Consequences of Projection

Computer Vision I - Appearance-based Matching and Projective Geometry

521466S Machine Vision Exercise #1 Camera models

Midterm Examination CS 534: Computational Photography

Image formation. Thanks to Peter Corke and Chuck Dyer for the use of some slides

CS4670: Computer Vision

Introduction to Homogeneous coordinates

Autonomous Navigation for Flying Robots

CSE 4392/5369. Dr. Gian Luca Mariottini, Ph.D.

BIL Computer Vision Apr 16, 2014

Image Formation I Chapter 1 (Forsyth&Ponce) Cameras

N-Views (1) Homographies and Projection

Pin Hole Cameras & Warp Functions

Perspective Projection [2 pts]

Mosaics. Today s Readings

Camera Calibration. COS 429 Princeton University

Structure from motion

Single View Geometry. Camera model & Orientation + Position estimation. What am I?

Camera Projection Models We will introduce different camera projection models that relate the location of an image point to the coordinates of the

MERGING POINT CLOUDS FROM MULTIPLE KINECTS. Nishant Rai 13th July, 2016 CARIS Lab University of British Columbia

CSE152a Computer Vision Assignment 1 WI14 Instructor: Prof. David Kriegman. Revision 0

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Computer Vision Projective Geometry and Calibration

Computer Vision cmput 428/615

Midterm Exam Solutions

COS429: COMPUTER VISON CAMERAS AND PROJECTIONS (2 lectures)

Models and The Viewing Pipeline. Jian Huang CS456

How to achieve this goal? (1) Cameras

COMP30019 Graphics and Interaction Perspective Geometry

Camera Model and Calibration. Lecture-12

Camera model and calibration

Stereo Vision. MAN-522 Computer Vision

Image Formation I Chapter 2 (R. Szelisky)

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Representing the World

Computer Vision I Name : CSE 252A, Fall 2012 Student ID : David Kriegman Assignment #1. (Due date: 10/23/2012) x P. = z

Viewing. Part II (The Synthetic Camera) CS123 INTRODUCTION TO COMPUTER GRAPHICS. Andries van Dam 10/10/2017 1/31

CIS 580, Machine Perception, Spring 2016 Homework 2 Due: :59AM

3D Geometry and Camera Calibration

Feature descriptors and matching

5LSH0 Advanced Topics Video & Analysis

Single-view 3D Reconstruction

Instance-level recognition I. - Camera geometry and image alignment

Assignment 2 : Projection and Homography

Announcements. Image Formation: Outline. Homogenous coordinates. Image Formation and Cameras (cont.)

Topics and things to know about them:

CS 664 Slides #9 Multi-Camera Geometry. Prof. Dan Huttenlocher Fall 2003

Computer Vision. The image formation process

Image-Based Rendering

Other approaches to obtaining 3D structure

Image Transformations & Camera Calibration. Mašinska vizija, 2018.

Lecture 2 Image Processing and Filtering

Camera models and calibration

Transcription:

DD2423 Image Analysis and Computer Vision IMAGE FORMATION Mårten Björkman Computational Vision and Active Perception School of Computer Science and Communication November 8, 2013 1

Image formation Goal: Model the image formation process Image acquisition Perspective projection properties approximations Homogeneous coordinates Sampling Image warping 2

Image formation Image formation is a physical process that captures scene illumination through a lens system and relates the measured energy to a signal. 3

Basic concepts Irradiance E: Amount of light falling on a surface, in power per unit area (watts per square meter). If surface tilts away from light, same amount of light strikes bigger surface (foreshortening less irradiance). Radiance L: Amount of light radiated from a surface, in power per unit area per unit solid angle. Informally Brightness. Image irradiance E is proportional to scene radiance 4

Light source examples Left: Forest image (left): sun behind observer, (right): sun opposite observer Right: Field with rough surface (left): sun behind observer, (right): sun opposite observer. 5

Digital imaging Image irradiance E area exposure time Intensity Sensors read the light intensity that may be filtered through color filters, and digital memory devices store the digital image information either as RGB color space or as raw data. An image is discretized: sampled on a discrete 2D grid array of color values. 6

Imaging acqusition - From world point to pixel World points are projected onto a camera sensor chip. Camera sensors sample the irradiance to compute energy values. Positions in camera coordinates (in mm) are converted to image coordinates (in pixels) based on the intrinsic parameters of the camera: - size of each sensor element, - aspect ratio of the sensor (xsize/ysize), - number of sensor elements in total, - image center of sensor chip relative to the lens system. 7

Steps in a typical image processing system Image acquisition: capturing visual data by a vision sensor Discretization/digitalization - Quantization - Compression: Convert data into discrete form; compress for efficient storage/transmission Image enhancement: Improving image quality (low contrast, blur noise) Image segmentation: Partition image into objects or constituent parts. Feature detection: Extracting pertinent features from an image that are important for differentiating one class of objects from another. Image representation: Assigning labels to an object based on information provided by descriptors. Image interpretation: Assigning meaning to image information. 8

Pinhole camera or Camera Obscura 9

Pinhole camera and perspective projection A mapping from a three dimensionsal (3D) world onto a two dimensional (2D) plane in the previous example is called perspective projection. A pinhole camera is the simplest imaging device which captures the geometry of perspective projection. Rays of light enter the camera through an infinitesimally small aperture. The intersection of light rays with the image plane form the image of the object. 10

Perspective projection 11

Pinhole camera - Perspective geometry Y optical center X image plane Z optical axis p=(x,y,f) image coordinates P=(X,Y,Z) world coordinates focal length The image plane is usually modeled in front of the optical center. The coordinate systems in the world and in the image domain are parallel. The optical axis is image plane. 12

Lenses Purpose: gather light from from larger opening (aperture) Problem: only light rays from points on the focal plane intersect the same point on the image plane Result: blurring in-front or behind the focal plane Focal depth: the range of distances with acceptable blurring 13

Imaging geometry - Basic camera models Perspective projection (general camera model) All visual rays converge to a common point - the focal point Orthographic projection (approximation: distant objects, center of view) All visual rays are perpendicular to the image plane Image Image focal point Perspective projection Orthographic projection 14

Projection equations Perspective mapping Orthographic projection f Z y x f = X Z, x = X, y f = Y Z y = Y Y Scaled orthography - Z 0 constant (representative depth) x f = X Z 0, y f = Y Z 0 15

Perspective transformation A perspective transformation has three components: - Rotation - from world to camera coordinate system - Translation - from world to camera coordinate system - Perspective projection - from camera to image coordinates Basic properties which are preserved: - lines project to lines, - collinear features remain collinear, - tangencies, - intersections. 16

Perspective transformation (cont) parallel lines e vanishing point image camera centre Each set of parallel lines meet at a different vanishing point - vanishing point associated to this direction. Sets of parallel lines on the same plane lead to collinear vanishing points - the line is called the horizon for that plane. 17

Homogeneous coordinates Model points (X,Y,Z) in R 3 world by (kx,ky,kz,k) where k is arbitrary 0, and points (x,y) in R 2 image domain by (cx,cy,c) where c is arbitrary 0. Equivalence relation: (k 1 X,k 1 Y,k 1 Z,k 1 ) is same as (k 2 X,k 2 Y,k 2 Z,k 2 ). Homogeneous coordinates imply that we regard all points on a ray (cx,cy,c) as equivalent (if we only know the image projection, we do not know the depth). Possible to represent points in infinity with homogreneous coordinates (X,Y, Z, 0) - intersections of parallel lines. 18

Computing vanishing points 19

Homogeneous coordinates (cont) In homogeneous coordinates the projection equations can be written cx cy = f 0 0 0 kx 0 f 0 0 ky kz = f kx f ky c 0 0 1 0 kz k Image coordinates obtained by normalizing the third component to one (divide by c = kz). x = xc c = f kx kz = f X Z, y = yc c = f ky kz = f Y Z 20

Transformations in homogeneous coordinates Translation X Y Z X Y Z + X Y Z X 1 0 0 X X Y Z 0 1 0 Y Y 0 0 1 Z Z 1 0 0 0 1 1 Scaling X S X 0 0 0 X Y Z 0 S Y 0 0 Y 0 0 S Z 0 Z 1 0 0 0 1 1 21

Transformations in homogeneous coordinates II Rotation around the Z axis X Y Z 1 cosθ sinθ 0 0 sinθ cosθ 0 0 0 0 1 0 0 0 0 1 X Y Z 1 Mirroring in the XY plane X Y Z 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 X Y Z 1 22

Transformations in homogeneous coordinates III Common case: Rigid body transformations (Euclidean) X Y R X Y + X Y Z Z Z where R is a rotation matrix (R 1 = R T ) is written X X Y Z = R Y Z 1 0 0 0 1 X Y Z 1 23

Perspective projection - Extrinsic parameters Consider world coordinates (X,Y,Z,1) expressed in a coordinate system not aligned with the camera coordinate system X X X X Y Z = R Y Y Z Z = A Y Z 1 0 0 0 1 1 1 Perspective projection (more general later) c x y = f 0 0 0 X 0 f 0 0 Y = PA 1 0 0 1 0 Z 1 X Y Z 1 = M X Y Z 1 24

Intrinsic camera parameters Due to imperfect placement of the camera chip relative to the lens system, there is always a small relative rotation and shift of center position. 25

A more general projection matrix allows: Intrinsic camera parameters Image coordinates with an offset origin Non-square pixels Skewed coordinate axes Five variables below are known as the camera s intrinsic parameters K = f u γ u 0 0 f v v 0 0 0 1, P = ( K 0 ) = f u γ u 0 0 0 f v v 0 0 0 0 1 0 Most important is the focal length ( f u, f v ). Normally, f u and f v are assumed equal and the parameters γ, u o and v o close to zero. 26

Example: Perspective mapping 27

Example: Perspective mapping in stereo 28

Mosaicing 29

Exercise Assume you have a point at (3m, 2m,8m) with respect to the cameras coordinate system. What is the image coordinates, if the image has a size (w,h) = (640,480) and origin in the upper-left corner, and the focal length is f = 480? 30

Exercise Assume you have a point at (3m, 2m,8m) with respect to the cameras coordinate system. What is the image coordinates, if the image has a size (w,h) = (640,480) and origin in the upper-left corner, and the focal length is f = 480? Answer: x = f X Z + w 2 = (480 3/8 + 640/2) = 500 y = f Y Z + h 2 = ( 480 2/8 + 480/2) = 120 31

Approximation: affine camera 32

Approximation: affine camera A linear approximation of perspective projection x y = m X 11 m 12 m 13 m 14 m 21 m 22 m 23 m 24 Y Z 1 0 0 0 1 1 Basic properties linear transformation (no need to divide at the end) parallel lines in 3D mapped to parallel lines in 2D Angles are not preserved! 33

Planar Affine Transformation Original Flipped x-size Shifted and scaled Sheared 34

Summary of models Projective (11 degrees of freedom): M = m 11 m 12 m 13 m 14 m 21 m 22 m 23 m 24 m 31 m 32 m 33 m 34 Affine (8 degrees of freedom): M = m 11 m 12 m 13 m 14 m 21 m 22 m 23 m 24 0 0 0 1 Scaled orthographic (6 degrees of freedom): M = r 11 r 12 r 13 X r 21 r 22 r 23 Y 0 0 0 Z 0 Orthographic (5 degrees of freedom): M = r 11 r 12 r 13 X r 21 r 22 r 23 Y 0 0 0 1 All these are just approximations, since they all assume a pin-hole, which is supposed to be infinitesimally small. 35

Sampling and quantization Sample the continuous signal at a finite set of points and quantize the registered values into a finite number of levels. Sampling distances x, y and t determine how rapid spatial and temporal variations can be captured. 36

Sampling and quantization Sampling due to limited spatial and temporal resolution. Quantization due to limited intensity resolution. 37

Factors that affect quality Quantization: Assigning, usually integer, values to pixels (sampling an amplitude of a function). Quantization error: Difference between the real value and assigned one. Saturation: When the physical value moves outside the allocated range, then it is represented by the end of range value. 38

Different image resolutions 39

Different number of bits per pixel 40

Image warping Resample image f (x,y) to get a new image g(u,v), using a coordinate transformation: u = u(x,y), v = v(x,y). Examples of transformations: 41

Image Warping For each grid point in (u,v) domain compute corresponding (x,y) values. Note: transformation is inverted to avoid holes in result. Create g(u,v) by sampling from f (x,y) either by: Nearest neighbour look-up (noisy result) Bilinear interpolation (blurry result) f (x + s,y +t) = (1 t) ((1 s) f (x,y) + s f (x + 1,y)) + + t ((1 s) f (x,y + 1) + s f (x + 1,y + 1)) 42

Nearest Neighbor vs. Bilinear Interpolation 43

Summary of good questions What parameters affects the quality in the acquisition process? What is a pinhole camera model? What is the difference between intrinsic and extrinsic camera parameters? How does a 3D point get projected to a pixel with a perspective projection? What are homogeneous coordinates and what are they good for? What is a vanishing point and how do you find it? What is an affine camera model? What is sampling and quantization? 44

Readings Gonzalez and Woods: Chapter 2 Szeliski: Chapters 2.1 and 2.3.1 45