Gray-Level Interpolation (1) • Gray levels in f are defined only at integral values of x and y . The spatial transformation will generally dictate that g be taken at fractional coordinate positions • Implementation using the inverse of the transformation 21 IIP Gray-Level Interpolation (2) – Nearest Neighbor (NN) Interpolation (1) • Nearest Neighbor (Zero-order) Interpolation � Assign gray level according to the pixel nearest to the mapped pixel � Simplest � Artifacts due to fine structure whose gray level changes significantly from one pixel to the next 22 IIP 1
Gray-Level Interpolation (3) – Bilinear Interpolation (1) • Bilinear (First order ) Interpolation � Better than zero order with moderate increase in programming complexity � f x y ( , ) is known at the vertices of the unit square and we wish to interpolate the value of at an f x y ( , ) arbitrary point inside the square � We do that by fitting a hyperbolic paraboloid defined by the bilinear equation = + + + f ( x , y ) ax by cxy d through the four known values at the vertices. The coefficients are chosen so that fits the f x y ( , ) values at the vertices 23 IIP Gray-Level Interpolation (4) – Bilinear Interpolation (2) • A simple algorithm for bilinear interpolation: linearly interpolate between upper two points [ ] = + − f x ( ,0) f (0,0) x f (1,0) f (0,0) and similarly for lower two points [ ] = + − f x ( ,1) f (0,1) x f (1,1) f (0,1) and then vertically [ ] = + − f x y ( , ) f x ( ,0) y f x ( ,1) f x ( ,0) yielding = [ ] [ ] − + − f x y ( , ) f (1 ,0) f (0,0) x f (0,1) f (0,0) y [ ] + + − − + f (1,1) f (0,0) f (0,1) f (1,0) xy f (0,0) bilinear 24 IIP 2
Castleman, 1996 Gray-Level Interpolation (5) • Zero (NN) vs. first order interpolation first zero 25 IIP Geometric Operations – Applications • Geometric calibration (removal of camera- induced geometric distortion, e.g., airborne & satellite) • Image registration (of similar images before comparison due, e.g., to different viewing angles) • Image rectification (transformation of non- rectangular pixel coordinates to rectangular coordinates) • Image morphing (transform one object gradually into another) • … 26 IIP 3
Castleman, 1996 Image Rectification – Example • Fish-eye lens for robots 27 IIP Castleman, 1996 Image Morphing – Example (a) initial (b) 40% points (c) 70% points (d) final 28 IIP 4
Image Enhancement in the Spatial Domain by Filtering • Reminder: procedures (operators) operating on pixels • Performed by moving a mask (also called window , filter , template ), centered at the current pixel, over the image and applying the operator on mask’s pixels to obtain the operator value at the current pixel. Practically, the operator is specified by the mask coefficients 29 IIP Image Enhancement by Filtering – The Mechanism (1) = + = + m n x mask and m 2 a 1, n 2 b 1, a b , nonnegative integers (i.e., mask of odd size) = − − − − + R w ( 1, 1) ( f x 1, y 1) − − + + ( 1,0) ( w f x 1, ) y ... + + (0,0) ( , ) w f x y ... + + (1,0) ( 1, ) w f x y + + (1,1) ( w f x 1, y 1) and linear filtering of an image of size f M N x with a filter mask of size x is m n a b ∑ ∑ = + + g x ( , ) y w s t f x ( , ) ( s y , t ) =− =− s a t b also called "convolution of a mask with an image" 30 IIP 5
Image Enhancement by Filtering – The Mechanism (2) • Or for 3x3 mask, the response is = ∑ 9 R w z i i = i 1 • What about the edges? 1) Limit range 2) Partial mask 3) Padding 31 IIP Smoothing (1) • Used for: � Blurring (removal of small details or bridging small gaps in lines or curves) � Noise reduction (however affects also edges) • Implemented by averaging gray levels within the mask a b = ∑ ∑ + + w s t f x ( , ) ( s y , t ) =− =− s a t b g x y ( , ) a b ∑ ∑ w s t ( , ) =− =− s a t b 32 IIP 6
Smoothing (or Low-Pass Filter) (2) • 1D image example edge~0.55 [ ] [ ] 1 low-pass = = a 3,4,4,3,3, 4,9,9,8,9 b 1,1,1 * 3 filter [ ] 3 1 = a * b 3,7,11,11, 10,16,22,2 6,26,8,9 * smoothed edge~0.09 33 IIP Smoothing (3) average mask weighted average mask 34 IIP 7
Gonzalez & Woods, 2002 Smoothing (4) 35 IIP Gonzalez & Woods, 2002 Smoothing (5) 36 IIP 8
Median Filter (1) � One of order-statistics filter � Neighborhood (local) operation � Nonlinear � Slow process due to ranking 37 IIP Median Filter (2) • Simple example 10 20 5 5 10 10 15 15 20 20 20 250 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 15 250 20 ^ ^ ^ 15 10 20 min. median max. brightness values brightness values in ascending order in a 3x3 image section (in comparison to average of 40) 38 IIP 9
Median Filter (3) 5 4 • Example 3 1D image 2 (edge + 1 sinusoid) 0 0 1 2 3 4 5 6 7 8 9 10 4 3 filtered with 2 3x1 median 1 0 0 1 2 3 4 5 6 7 8 9 10 39 IIP Gonzalez & Woods, 2002 Median Filter (4) 40 IIP 10
Recommend
More recommend