jorge s. marques image processing



Similar documents
Convolution. 1D Formula: 2D Formula: Example on the web:

Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition

Admin stuff. 4 Image Pyramids. Spatial Domain. Projects. Fourier domain 2/26/2008. Fourier as a change of basis

Sharpening through spatial filtering

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

Digital Imaging and Multimedia. Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Computational Foundations of Cognitive Science

Edge detection. (Trucco, Chapt 4 AND Jain et al., Chapt 5) -Edges are significant local changes of intensity in an image.

Sachin Patel HOD I.T Department PCST, Indore, India. Parth Bhatt I.T Department, PCST, Indore, India. Ankit Shah CSE Department, KITE, Jaipur, India

Classification of Fingerprints. Sarat C. Dass Department of Statistics & Probability

5.3 The Cross Product in R 3

Numerical methods for American options

REAL TIME TRAFFIC LIGHT CONTROL USING IMAGE PROCESSING

Høgskolen i Narvik Sivilingeniørutdanningen STE6237 ELEMENTMETODER. Oppgaver

Logistic Regression. Jia Li. Department of Statistics The Pennsylvania State University. Logistic Regression

Correlation and Convolution Class Notes for CMSC 426, Fall 2005 David Jacobs

Lecture 3: Linear methods for classification

Interpolation of RGB components in Bayer CFA images

3. Diffusion of an Instantaneous Point Source

Automatic Traffic Estimation Using Image Processing

Vision based Vehicle Tracking using a high angle camera

High Quality Image Magnification using Cross-Scale Self-Similarity

Machine Learning and Data Mining. Regression Problem. (adapted from) Prof. Alexander Ihler

8. Linear least-squares

Robert Collins CSE598G. More on Mean-shift. R.Collins, CSE, PSU CSE598G Spring 2006

Least-Squares Intersection of Lines

Comparison of Non-linear Dimensionality Reduction Techniques for Classification with Gene Expression Microarray Data

Numerical Methods For Image Restoration

Implementation of Canny Edge Detector of color images on CELL/B.E. Architecture.

DATA ANALYSIS II. Matrix Algorithms

Analecta Vol. 8, No. 2 ISSN

FINITE ELEMENT : MATRIX FORMULATION. Georges Cailletaud Ecole des Mines de Paris, Centre des Matériaux UMR CNRS 7633

Inner Product Spaces

SOLUTIONS. f x = 6x 2 6xy 24x, f y = 3x 2 6y. To find the critical points, we solve

521466S Machine Vision Assignment #7 Hough transform

5. Orthogonal matrices

degrees of freedom and are able to adapt to the task they are supposed to do [Gupta].

PERFORMANCE ANALYSIS OF HIGH RESOLUTION IMAGES USING INTERPOLATION TECHNIQUES IN MULTIMEDIA COMMUNICATION SYSTEM

Lectures 6&7: Image Enhancement

Pattern Analysis. Logistic Regression. 12. Mai Joachim Hornegger. Chair of Pattern Recognition Erlangen University

II. Linear Systems of Equations

Modelling, Extraction and Description of Intrinsic Cues of High Resolution Satellite Images: Independent Component Analysis based approaches

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

The continuous and discrete Fourier transforms

A Learning Based Method for Super-Resolution of Low Resolution Images

AP Physics - Vector Algrebra Tutorial

Coding and decoding with convolutional codes. The Viterbi Algor

Lecture 2 Linear functions and examples

Algorithms for the resizing of binary and grayscale images using a logical transform

An Iterative Image Registration Technique with an Application to Stereo Vision

A System for Capturing High Resolution Images

1 Finite difference example: 1D implicit heat equation

Figure 1.1 Vector A and Vector F

3D Scanner using Line Laser. 1. Introduction. 2. Theory

(Refer Slide Time: 06:10)

Statistical Machine Learning

Aliasing, Image Sampling and Reconstruction

Applications to Data Smoothing and Image Processing I

Canny Edge Detection

Joint MAP Registration and High Resolution Image Estimation Using a Sequence of Undersampled Images 1

α = u v. In other words, Orthogonal Projection

Image Segmentation and Registration

A Novel Method to Improve Resolution of Satellite Images Using DWT and Interpolation


Time series analysis Matlab tutorial. Joachim Gross

DIGITAL IMAGE PROCESSING AND ANALYSIS

Image Gradients. Given a discrete image Á Òµ, consider the smoothed continuous image ܵ defined by

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

MVA ENS Cachan. Lecture 2: Logistic regression & intro to MIL Iasonas Kokkinos Iasonas.kokkinos@ecp.fr

Wavelet analysis. Wavelet requirements. Example signals. Stationary signal 2 Hz + 10 Hz + 20Hz. Zero mean, oscillatory (wave) Fast decay (let)

Linear Algebra: Vectors

Derive 5: The Easiest... Just Got Better!


F Matrix Calculus F 1

Digital image processing

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Probability and Random Variables. Generation of random variables (r.v.)

OBJECT TRACKING USING LOG-POLAR TRANSFORMATION

Chapter 6. Linear Transformation. 6.1 Intro. to Linear Transformation

Shear :: Blocks (Video and Image Processing Blockset )

Feature Tracking and Optical Flow

Linear Filtering Part II

Probabilistic Latent Semantic Analysis (plsa)

Visualization and Feature Extraction, FLOW Spring School 2016 Prof. Dr. Tino Weinkauf. Flow Visualization. Image-Based Methods (integration-based)

Single Depth Image Super Resolution and Denoising Using Coupled Dictionary Learning with Local Constraints and Shock Filtering

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Section 9.1 Vectors in Two Dimensions

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Linear Algebra Notes for Marsden and Tromba Vector Calculus

Component Ordering in Independent Component Analysis Based on Data Power

Visualization by Linear Projections as Information Retrieval

Programming Exercise 3: Multi-class Classification and Neural Networks

Lecture 14. Point Spread Function (PSF)

DERIVATIVES AS MATRICES; CHAIN RULE

Introduction to Algebraic Geometry. Bézout s Theorem and Inflection Points

Metrics on SO(3) and Inverse Kinematics

COMPUTATION OF THREE-DIMENSIONAL ELECTRIC FIELD PROBLEMS BY A BOUNDARY INTEGRAL METHOD AND ITS APPLICATION TO INSULATION DESIGN

Point Lattices in Computer Graphics and Visualization how signal processing may help computer graphics

Numerical Methods for Differential Equations

4 Sums of Random Variables

Transcription:

image processing

images

images: what are they?

what is shown in this image? What is this?

what is an image images describe the evolution of physical variables (intensity, color, reflectance, condutivity) in a plane or in a 3D volume.

coordinate systems y y y x x x most common choice

discrete images Most electronic sensors produce discrete images defined on a grid of points 42 45 49 57 65 54 66 63 42 64 95 73 72 68 67 69 75 59 62 55 35 37 n 82 83 83 84 85 81 79 90 77 76 73 96 95 95 92 90 93 88 79 95 88 93 sccd sensor m f(m,n) 93 91 93 95 95 96 97 104 94 96 104 110 107 102 104 110 107 103 102 110 97 106 109 112 113 109 105 107 101 108 116 115 111 109 107 109 112 113 101 119 128 143 121 122 114 114 115 115 113 119 146 154 115 110 116 pixel 125 125 120 118 121 160 140 112 118 116 122 114 110 115 137 161 132 119 119 107 124 120 pixel picture element each pixel is characterized by its position and value

image types gray scale images binary images multi-spectral images color images

topological concepts what is the neighborhood of a pixel(i,j)? neighborhood 4 N4( i, j) {( i 1, j),( i 1, j),( i, j 1),( i, j 1)} neighborhood 8 N8 ( i, j) {( i ( i, j 1),( i 1, j 1),( i 1, j),( i 1, j 1),( i 1, j 1),( i, j 1), 1, j),( i 1, j 1)}

connectivity y x are x, y connected? NO binary image conectivity: two pixels x, y of a binary image u(m,n) are connected iif (if and only if) there a sequence of points z 1, z 2,..., z n : 1 z n x, z y i i 1 z, z are neighbors i { 1, 2,..., n 1} i u( z ) 1 i 1,...,n

regions regions Region R is a set of fully connected pixels i.e., x, y R, x,y are connected A maximal set of connected pixels is called a connected component.

extraction of connected components The algorithm assigns different labels to pixels belonging to different connected components ssign the label of the previous neighbors if they are equal If the neighbors have different labels create na equivalence 12 table 1 1 2 1 1 2 1 1 1 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4

boundary The boundary of a region R is the set of R pixels whose neighborhood is not contained in R.

linear filtering

examples original blurred sharpened edge preserving blurred

noise reduction how can we remove the noise in an (homogeneous) image? idea: replace each pixel by an average g(i, j) in 1 2 ( 2N1) kin j N l j N f(k, l) N=1 2N+1 2N+1 N=2 mean filter

gaussian filter filtered image g(i, j) k, l G(k i,l j)f(k, l) 2 2 k l 2 2 (, l) C e G k f(i,j) j g(i,j) j weighted average i i

Gaussian filtering orig. =0.2 =1 =2 the gaussian filter destroys the transitions!!

linear filtering ), ( ), ( ), ( ), (, ), ( j i f j M i l k f j l i M k l k j i g ), ( j i M mask the mask/impulse response is shifted by an amount (i,j) mask / impulse response f g i j ), ( ) *, ( ), ( ), (, ), ( j i f j i h l k f l j k i h l k j i g ), ( ), ( j i M j i h impulse response 2D convolution sum 2D correlation

Separable filters Separable filters have the following property: M( i, j) M1( i) M2( j), h( i, j) h1( i) h2( j) Separable filters can be implemented in a very efficient way. Algorithm: 1. filter all the image columns using filter h 1 (1D) 2. filter all the lines of the previous image using filter h 2 (1D) original image column filtering line filtering

border effects

matrix notation Linear filtering can be written in matrix notation. g Hf g, f p IR, pp H IR g, f are column vectors with all the pixel intensities; H is a (huge) square matrix; p is the number of pixels in the image. This notation is very elegant but image filtering cannot be implemented in this way.

examples M(i,j) = M(i,j) = 1 2 1 2 4 2 1 2 1-1 -2-1 0 0 0 1 2 1 weighted average of neighboring pixels vertical difference, horizontal mean

example J( m, n) h( m, n) I( m, n) h( m, n) δ( m, n) G( m, n) original filtered

1 st order derivatives: gradient vector y f x x x f x g x g x g ) ( ) ( 2 1 ) ( ) ( ) ( gradient vector: ) ( ) ( arctan ) ( ) ( ) ( ) ( x g x g x g x g x g x g 1 2 2 2 2 1 x=(x 1,x 2 ) continuous variables f(x) continuous image length and direction

gradient discretization 1) Derivatives can be approximated by finite differences I( m 1, n) I( m 1, n) g1( m, n) 2 I( m, n 1) I( m, n 1) g2( m, n) 2-1 0 1-1 0 1 filtragem linear! 2) a better choice: Sobel masks -1 0 1-2 0 2-1 0 1-1 -2-1 0 0 0 1 2 1 High pass filtering in one direction and low pass filtering in the orthogonal direction

example

example

example: gradient g 1 g 2 g

2nd order derivatives: Laplacian filter Laplacian of a 2D image f x, y = 2 f x 2 + 2 f y 2 zero crossings are associated to transitions Since the derivatives increase noise, the image is girst filtered using a Gaussian filter G x, y f x, y = [ G x, y ] f x, y where G x, y = x2 + y 2 σ 4 2 σ2 G(x, y)

Directional filters: Gabor filters Some cells of the visual cortex are activated by directional stimula. Gabor filters approximate the behavior of these cells. Their impulse response is the multiplication of a sinusoid by a Gaussian envelope in a rotated 2D space. h 1 x, y = exp x 2 + γ 2 y 2 2σ 2 h 2 x, y = exp x 2 + γ 2 y 2 2σ 2 cos 2π x λ + ψ sin 2π x λ + ψ rotation x = x cos θ + y sin θ y = x sin θ + y cos θ

Directional analysis: difference of Gaussians Difference of Gaussians 2 4 6 8 10 12 2 4 6 8 10 12 Skin lesion dermoscopy images Barata, Transactions on Biomedical Engineering, 2012

nonlinear filtering

linear filters reduce noise but they destroy image contours. Is it possible to solve this conflict i.e., removing the noise, preserving the contours?

median filter

1d median filter f filter g g( n) median{ f ( n M),..., f ( n M)} f 1 0 1 0 2 4 5 1 g 0 1 2 non linear! example

2d median filter f filter g g( m, n) median{ f ( m M, n N),..., f ( m M, n N)}

example original image

sequence filtering video sequence time median filter can be applied in space, in time or in space-time.

example time filtering output: background image

non-linear diffusion

non linear diffusion Perona & Malik how is this possible?

heat equation u t c u u( x, t) 2 u u 2 x 2 y temperature u 2 diffusion

linear diffusion t 0 =0 t 1 >0 t 2 >t 1 Solution of heat equation: Gσ ( x) σ 2t 1 2πσ 2 x 2 e 2σ 2 (check it!)

non linear diffusion definition: g g t g(x, 0) f(x) initial condition The equation has a unique solution g( x, t) ( G f ( x) t 2t * f )( x) t 0 0 ( G * I)( x) G ( x y) f ( y) dy R 2 x 2 1 2 2 G ( ) x e 2 2 Gaussian filtering beautiful!! Linear diffusion leads to Gaussian filtering with parameter σ 2t

gaussian filtering time

Space-scale Many images contain structures with different sizes. Therefore it is useful to represent it as a family of images with increasingly less details. Space scale of an image f(x) is a family of images indexed by a parameter s { T s f, s 0} such that T T 0 f st f f T s ( T t f ) semi-group property

Gaussian space-scale The Gaussian space-scale is obtained by filtering the image using a Gaussian kernel and changing the parameter s from 0 to infinity. Ts f Gs * f The semi-group property holds. Prove it! Limitations: It destroys the contour information how can we overcome this difficulty? pode ser gerado através de um processo de difusão linear

Generalization g(x) - concentration mass flows from regions of high concentration to regions with smaller concentration taking the gradient opposite direction. Fick s law j cg Mass conservation law g t div j j(x,t) diffusion flux c(x,t) diffusion coefficient g(x,t) concentration homogeneous material: constant diffusivity. Perona & Malik: space dependent diffusivity Idea: filter homogeneous regions and not transitions

condutivity condutivity (Perona & Malik) c 1 c( x, t) 1 2 1 g( x, t) 0 1 2 3 g Condutivity depends on the concentration at a given position and time instant and changes along the time. In homogeneous regions ( f =0) condutivity is constant c=1. At the contour points, condutivity is almost zero.

non linear diffusion Diffusion equation (Perona & Malik) g t div (c(x, t) g) c( x, t) 1 1 g( x, t) 2 remark: div v A B x y v (A,B)

discretization Perona & Malik algorithm is based on a discretization of the diffusion equation in which the partial derivatives are replaced by first order differences. t c g c g c g c g 0 1/ 4 t1 t gm, n gm, n N N S S E E W W m, n N u m-1,n where u m,n-1 W u m,n E u m,n+1 N E u g m, n m, n u g m-1,n m,n1 - u - g m,n m,n S S u m, n g m, n u g m1,n m,n1 - u - g m,n m,n S u m+1,n c Nm,n g( ( g) m1/ 2,n )f m,n c Sm,n g( ( g) m1/ 2,n ) c Em,n g( ( g) m,n1/ 2 )f m,n c W m,n g( ( g) m,n1/ 2 )

example original Gaussian filter Perona-Malik

interpolation and pyramids

bilinear interpolation Data: f x, y x, y {0,1} 0 d h 1 1 f 0, δ = 1 δ f 0,0 + δf 0,1 f 1, δ = 1 δ f 1,0 + δf 1,1 f η, δ = 1 η f 0, δ + ηf 1, δ 1 0.8 0.6 0.4 0.2 Replacing f η, δ = 1 η 1 δ f 0,0 + 1 η δf 0,1 +η 1 δ f 1,0 + ηδf 1,1 0 1 0.5-0.5 0-1 -1-0.5 0 0.5 1

Interpolation at equally spaced points Sometimes we wish to increase the resolution of images. This can be done by interpolation. f(i) 1D 0 1 2 3 g(i) i g i = k f k h(i kr) 0 r 2r 3r i f(i) r d(i) h(i) g(i) 2D d i = f i r i = kr 0 otherwise g i = d i h i = d p h(i p) = f k h(i kr) p = kr k g i, j = k,l f k, l h(i kr, j lr)

Interpolation results filters bilinear bicubic (a=-1) bicubic (a=-0.5) windowed sinc extracted from Szeliski book

decimation Decimation reduces the image resolution by a factor k. It involves two steps: 1) lowpass filtering (anti-aliasing) and 2) subsampling. 1D f(i) f(i) h(i) d(i) r g(i) 0 r 2r 3r i d(i) 0 r 2r 3r i g(i) 0 1 2 3 i d i = f k h(i k) k g i = d(ri) = f k h(ri k) k 2D g i, j = f k, l h(ri k, rj l) g i, j = f k, l h(i k/r, j l/r) k,l k,l h(k,l) is the decimation kernel if h(k,l) is the interpolation kernel

Gaussian pyramid (Burt & Adelson) lowpass filter 1 16 1 4 6 4 1

Laplacian pyramid (Burt & Adelson) reconstruction reconstruction Block diagram perfect reconstruction ineficient representation Szeliski book

Credits Some slides are based on: Richard Szeliski, Computer Vision: Algorithms and Application, Springer, 2011