Image Analysis. Rasmus R. Paulsen DTU Compute. DTU Compute

Similar documents
Introduction to Medical Image Analysis

Lesson 24: Matrix Notation Encompasses New Transformations!

Image warping , , Computational Photography Fall 2017, Lecture 10

Image and Multidimensional Signal Processing

Lecture 25: Affine Transformations and Barycentric Coordinates

Lecture 5 2D Transformation

Lecture 9: Transformations. CITS3003 Graphics & Animation

Image transformations. Prof. Noah Snavely CS Administrivia

CS4670: Computer Vision

Lecture 2 Image Processing and Filtering

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Introduction to Computer Vision

CS4670: Computer Vision

CS664 Lecture #16: Image registration, robust statistics, motion

2D Geometric Transformations and Matrices

N-Views (1) Homographies and Projection

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

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Computer Vision Projective Geometry and Calibration. Pinhole cameras

CSE 167: Introduction to Computer Graphics Lecture #4: Coordinate Systems

Warping. 12 May 2015

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Therefore, after becoming familiar with the Matrix Method, you will be able to solve a system of two linear equations in four different ways.

CS1114 Assignment 5, Part 1

Prof. Noah Snavely CS Administrivia. A4 due on Friday (please sign up for demo slots)

Translations. Geometric Image Transformations. Two-Dimensional Geometric Transforms. Groups and Composition

Texture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism.

lecture 16 Texture mapping Aliasing (and anti-aliasing)

Junior Circle Meeting 9 Commutativity and Inverses. May 30, We are going to examine different ways to transform the square below:

Graphics and Interaction Transformation geometry and homogeneous coordinates

Introduction to Computer Vision

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Automatic Image Alignment (feature-based)

Humanoid Robotics. Projective Geometry, Homogeneous Coordinates. (brief introduction) Maren Bennewitz

Assignment 2 : Projection and Homography

CS 432 Interactive Computer Graphics

Interpolation. Applications to image

Chapter 2 - Basic Mathematics for 3D Computer Graphics

2D and 3D Transformations AUI Course Denbigh Starkey

Wikipedia - Mysid

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Graphics Pipeline 2D Geometric Transformations

Tracking Computer Vision Spring 2018, Lecture 24

Lecture 6 Geometric Transformations and Image Registration. Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2013

EE795: Computer Vision and Intelligent Systems

Augmented Reality VU. Computer Vision 3D Registration (2) Prof. Vincent Lepetit

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

Computer Vision, Assignment 1 Elements of Projective Geometry

XPM 2D Transformations Week 2, Lecture 3

RIGID IMAGE REGISTRATION

CPSC 4040/6040 Computer Graphics Images. Joshua Levine

What will we learn? Geometric Operations. Mapping and Affine Transformations. Chapter 7 Geometric Operations

CS 335 Graphics and Multimedia. Geometric Warping

Practical Image and Video Processing Using MATLAB

CV: Matching in 2D. Matching 2D images to 2D images; Matching 2D images to 2D maps or 2D models; Matching 2D maps to 2D maps MSU CSE 803

CS770/870 Spring 2017 Quaternions

6.837 LECTURE 7. Lecture 7 Outline Fall '01. Lecture Fall '01

Introduction to Video and Image Processing

Limitations of Thresholding

Lecture 6: More MatLab; Functions, Transformations

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

Volume Rendering. Computer Animation and Visualisation Lecture 9. Taku Komura. Institute for Perception, Action & Behaviour School of Informatics

Vector Calculus: Understanding the Cross Product

XPM 2D Transformations Week 2, Lecture 3

Interpolation is a basic tool used extensively in tasks such as zooming, shrinking, rotating, and geometric corrections.

Terrain correction. Backward geocoding. Terrain correction and ortho-rectification. Why geometric terrain correction? Rüdiger Gens

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

Camera Model and Calibration

Geometric Image Transformations and Related Topics

Lecture 1.3 Basic projective geometry. Thomas Opsahl

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Computer Vision, Laboratory session 1

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Linear and Affine Transformations Coordinate Systems

Feature Matching and RANSAC

CSE 527: Introduction to Computer Vision

3.6: First Person Computer Games

(Refer Slide Time: 00:04:20)

Geometric Transformations

1. Stereo Correspondence. (100 points)

Computer Graphics and Image Processing

Computer Vision, Laboratory session 1

Image Transformations

Image Warping CSE399b, Spring 07 Computer Vision

Radiography and Tomography Lab 2: Computing Radiographs

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

Image Registration Lecture 4: First Examples

2D transformations: An introduction to the maths behind computer graphics

Transformations Week 9, Lecture 18

Image Stitching. Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi

CSE328 Fundamentals of Computer Graphics

Separable Kernels and Edge Detection

CS1114: Study Guide 2

IMAGE-BASED RENDERING AND ANIMATION

Module 1 Topic C Lesson 14 Reflections

Computer Graphics: Geometric Transformations

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Last week. Machiraju/Zhang/Möller/Fuhrmann

Transcription:

Rasmus R. Paulsen rapa@dtu.dk http://www.compute.dtu.dk/courses/02502 Plenty of slides adapted from Thomas Moeslunds lectures

Lecture 8 Geometric Transformation 2, Technical University of Denmark

What can you do after today? Compute the translation of a point Compute the rotation of a point Compute the scaling of a point Compute the shearing of a point Construct a translation, rotation, scaling, and shearing transformation matrix Use transformation matrices to perform point transformations Describe the difference between forward and backward mapping Use bilinear interpolation to compute the interpolated value at a point Transform an image using backward mapping and bilinear interpolation Compute a line profile using bilinear interpolation 3, Technical University of Denmark

Geometric transformation Moving and changing the dimensions of images Why do we need it? 4, Technical University of Denmark

Change detection Patient imaged before and after surgery What are the changes in the operated organ? Patient can not be placed in the exact same position in the scanner Before surgery After surgery 5, Technical University of Denmark Bachelor project: Image Guided Surgery Planning

Image Registration Change one of the images so it fits with the other Formally Template image Reference image Template is moved to fit the reference Compute the difference Template Reference 6, Technical University of Denmark

Geometric Transform The pixel intensities are not changed The pixel values just change positions Same value Different place 7, Technical University of Denmark

Different transformations Translation Rotation Scaling Shearing Advanced transformations 8, Technical University of Denmark

Translation The image is shifted both vertically and horizontally 9, Technical University of Denmark

Rotation The image is rotated around the centre or the upper left corner Remember to use degrees and radians correctly Matlab uses radians Degrees easier for us humans 10, Technical University of Denmark

Rotation coordinate system x y 11, Technical University of Denmark

Rigid body transformation Translation and rotation Rigid body = stift legeme Angles and distances are kept 12, Technical University of Denmark

Scaling The size of the image is changed Scale factors X-scale factor S x Y-scale factor S y Uniform scaling: S x = S y 13, Technical University of Denmark

Similarity transformation Translation, rotation, and uniform scaling Angles are kept Distances change 14, Technical University of Denmark

Shearing Pixel shifted horizontally or/and vertically Shearing factors X-shear factor Y-shear factor B x B y Is less used than translation, rotation, and scaling 15, Technical University of Denmark

Transformation Mathematics f (x,y) Transformation of positions Structure found at position (x,y) in the input image f Now at position (x,y ) in output image g A mapping function is needed g (x,y ) 16, Technical University of Denmark

Translation mathematics The image is shifted both vertically and horizontally (x,y) (x,y ) 17, Technical University of Denmark

Matrix notation Coordinates in column matrix format 18, Technical University of Denmark

Translation mathematics in matrix notation The image is shifted both vertically and horizontally 19, Technical University of Denmark

Scaling The size of the image is changed Scale factors X-scale factor S x Y-scale factor S y Uniform scaling: S x = S y SS xx = 1.2 SS yy = 0.9 20, Technical University of Denmark

Matrix multiplication details Is equal to: 21, Technical University of Denmark

Transformation matrix Can be written as Where is a transformation matrix 22, Technical University of Denmark

x Rotation A rotation matrix is used y 23, Technical University of Denmark

Shearing Pixel shifted horizontally or/and vertically New x value depends on x and y 24, Technical University of Denmark

Affine transformation The collinearity relation between points, i.e., three points which lie on a line continue to be collinear after the transformation 25, Technical University of Denmark

Combining transformations Scaling Suppose you first want to rotate by 5 degrees and then scale by 10% Rotation How do we combine the transformations? 26, Technical University of Denmark

Combining transformations Combination is done by matrix multiplication Scaling Rotation Combined 27, Technical University of Denmark

Combining transformations Compact notation Scaling Rotation Combined 28, Technical University of Denmark

Combining transforms 29 4 2 1 0 A B C D E The point (x,y)=(5,6) is transformed. First with: and then with: The result is: A) 1 B) 2 C) 3 D) 4 E) 5 29, Technical University of Denmark

What do we have now? We can pick a position in the input image f and find it in the output image g We can transfer one pixel what about the whole image? f g 30, Technical University of Denmark

Solution 1 : Input-to-output Run through all pixel in input image Find position in output image and set output pixel value Scaling example 0 1 2 3 x 0 1 2 3 x 0 0 23 216 120 1 1 2 2 Missing value! 3 y f 3 y g 31, Technical University of Denmark

Input-to-Output The input to output transform is not good! It creates holes and other nasty looking stuff What do we do now? 32, Technical University of Denmark

Some observations We want to fill all the pixels in the output image Not just the pixels that are hit by the pixels in the input image Run through all pixels in the output image? Pick the relevant pixels in the input image? We need to go backwards From the output to the input 0 1 0 1 2 3 x 2 3 y g 33, Technical University of Denmark

Inverse transformation We want to go from the output to the input Scaling example inverse 0 0 1 2 3 x? 0 0 1 2 3 x 1 1 2 2 3 y f 3 y g 34, Technical University of Denmark

Output-to-input transformation Backward mapping Run through all pixel in output image Find position in input image and get the value 0 1 2 3 x 0 1 2 3 x 0 0 1 1 2 2 3 y f 35, Technical University of Denmark 3 y What is the value here? g

Bilinear Interpolation Value? The value is calculated from 4 neighbours The value is based on the distance to the neighbours Lots of 89! Not so much 189 36, Technical University of Denmark

Linear Interpolation vv = tttt + 1 tt aa 1 t V=? a b 37, Technical University of Denmark

Bilinear interpolation 38, Technical University of Denmark

Bilinear interpolation 12 Bilinear interpolation is used to create a line profile from an image. In a given point (x,y) = (173.1, 57.8), the four nearest pixels are: A) 1 B) 2 C) 3 D) 4 E) 5 What is the interpolated value in the point: 1 0 2 0 A B C D E 39, Technical University of Denmark

Output-to-input transformation Backward mapping Run through all the pixel in the output image Use the inverse transformation to find the position in the input image Use bilinear interpolation to calculate the value Put the value in the output image 40, Technical University of Denmark

Inverse transformation Scaling We can calculate the inverse transformation for the scaling What about the others? Inverse 41, Technical University of Denmark

General inverse transformation Affine transformation The transformation is expressed as a transformation matrix A The matrix inverse of A gives the inverse transformation Inverse transformation Where 42, Technical University of Denmark

General inverse transformation You can create an arbitrary sequence of rotation, scaling, and shearing Scaling Rotation Scaling Combined: Inverse: 43, Technical University of Denmark

Transformation 23 0 0 0 1 A B C D E A) 1 The point (x,y) = (45, 23) is transformed using: B) 2 C) 3 D) 4 E) 5 And the result is translated with (-15, 20). The result is: 44, Technical University of Denmark

Profile Analysis Sample the pixel values under the profile From start point to end point 45, Technical University of Denmark

Profile Analysis p s Length of profile Unit vector p e Point on profile 46, Technical University of Denmark

Profile Analysis p s Point on profile Sample all points on profile using bi-linear interpolation p e 47, Technical University of Denmark

Profile Analysis ps p e p s p e 48, Technical University of Denmark

DTU Sign Challenge exercise 8 49, Technical University of Denmark

Data 34 photos with ground truth (GT) 50, Technical University of Denmark

Goal To create a function that can locate signs Should create a label image Label 0: Background Label 1: Sign 1 Label 2: Sign 2 51, Technical University of Denmark

Supplied scripts and functions Some scripts and functions supplied MyDTUSignFinder.m Should be renamed into a new cool name You should also make a commercial (a powerpoint slide or similar) for your amazing method! 52, Technical University of Denmark

How do we measure performance? 53, Technical University of Denmark

DICE Scores DDDDDDDD = 2(AA BB) AA + BB A: area of ground truth B: area of your result AA BB: area of intersection/overlap Residuals is the difference between ground truth and your result 54, Technical University of Denmark

DICE Scores DDDDDDDD = 2(AA BB) AA + BB 1 is perfect No residuals 0 is really bad Only residuals 55, Technical University of Denmark

Multiple DICE scores Average DICE score over found matches Penalises Too many sign candidates Too few sign candidates 56, Technical University of Denmark

57, Technical University of Denmark

58, Technical University of Denmark

Epic_SpleenMasterOrz9000Extreme_supre me_premium_deluxe_edition 59, Technical University of Denmark

60, Technical University of Denmark

Next week Company presentations Visiopharm JLI Vision Dalux IH Food 61, Technical University of Denmark