The lecture presents the contents: Using a simpler operation to generate a higher order operation, Multiple summations, General formula, Doing the same with functions, Multiplication and addition of two functions, Operation that uses addition and multiplication...
Chapter – Linear Filters 6-1 Chapter Linear Filters Prof Fei Fei Li, Stanford University Department of Mechatronics Chapter – Linear Filters 6-2 Contents • 2D Filter – Convolution – Linear Systems Department of Mechatronics Chapter – Linear Filters 6-3 Multiplication • Using a simpler operat ion to generate a higher order operation • Mult iple summat ions • General form ula 3 21 x x y y k 1 Department of Mechatronics Chapter – Linear Filters 6-4 Doing the same with functions • Applying the operations on each value separated • The result is a function Department of Mechatronics Chapter – Linear Filters 6-5 Multiplication and addition of two functions Department of Mechatronics Chapter – Linear Filters 6-6 Convolution • Operation that uses addition and multiplication • Result is a function • It is a way to combine to functions • It is like weighting one function with the other • Flipping one function and then summing up the products for each positions for a given offset n g (n) k f1 (k ) f (n k ) Discrete Convolution Department of Mechatronics Chapter – Linear Filters 6-7 Flipping the function Department of Mechatronics Chapter – Linear Filters 6-8 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-9 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-10 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-56 Convolution in 2D - Examples Original Department of Mechatronics Filtered (no change) Chapter – Linear Filters 6-57 Convolution in 2D - Examples Original Department of Mechatronics Chapter – Linear Filters 6-58 Convolution in 2D - Examples Original Department of Mechatronics Shifted left By pixel Chapter – Linear Filters 6-59 Convolution in 2D - Examples Original Department of Mechatronics Chapter – Linear Filters 6-60 Convolution in 2D - Examples Original Blur (wvith a box filter) Department of Mechatronics Chapter – Linear Filters 6-61 Convolution in 2D - Examples Original Department of Mechatronics Chapter – Linear Filters 6-62 Convolution in 2D – Sharpening Filter Original Sharpening filter: Accentuates differences with local average Department of Mechatronics 6-63 Department of Mechatronics Chapter – Linear Filters 6-64 Department of Mechatronics Chapter – Linear Filters Chapter – Linear Filters 6-65 Image support and edge effect • A computer w ill only convolve finite support signals That is: images t hat are zero f or n,m out side some rect a ngula r region • MATLAB's conv2 performs D DS convolut ion of finit e support signa Is Department of Mechatronics Chapter – Linear Filters 6-66 Image support and edge effect • A computer will only convolve finite support signals • What happens at the edge? Department of Mechatronics Chapter – Linear Filters 6-67 Boundary Padding Options Zero-Padding Replicated Boundary Pixels See the reference page for imfilter for details Department of Mechatronics Chapter – Linear Filters 6-68 Cross correlation Department of Mechatronics 6-69 Chapter – Linear Filters Matlab: conv2 Matlab: filter2 imfilter Department of Mechatronics Chapter – Linear Filters 6-70 Filtering: Boundary Issues • What is the size of the output? • MATLAB: filter2(g,f,shape) – shape = ‘full’: output size is sum of sizes of f and g – shape = ‘same’: output size is same as f – shape = ‘valid’: output size is difference of sizes of f and g g full g same g f g Department of Mechatronics valid g f g g g g f g g g ... Mechatronics Chapter – Linear Filters 6-7 Flipping the function Department of Mechatronics Chapter – Linear Filters 6-8 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-9... Mechatronics Chapter – Linear Filters 6-10 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-11 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-12... Mechatronics Chapter – Linear Filters 6-13 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-14 Multiply and add Department of Mechatronics Chapter – Linear Filters 6-15