SPATIAL FILTERING g h * h g FREQUENCY DOMAIN FILTERING G H. F F H G Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens LOW PASS FILTERING attenuate or eliminate high-requenc components edges and other sharp details results in image bluring HIGH PASS FILTERING attenuate or eliminate low-requenc components slowl varing characteristics such as overall contrast and average intensit results in reduction o overall contrast and average intensit and a correspondingl apparent sharpening o edges and other sharp details Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens
Frequenc domain ilters G H. F Spatial domain ilters g h * Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 3 SMOOTHING FILTERS - LOWPASS SPATIAL FILTERING With the assumption that image piel values within a small neighborhood are highl correlated and that the noise components are not correlated noise ma be reduced b replacing each piel with the mean over a certain neighborhood o : g n m µ. M n m S where M is the number o piels in the neighborhood S. This is useul when onl one version o the image is available. I this operation is perormed over a 3 3 neighborhood we have g 9 i j + i + Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 4 j.
CONVOLUTION BY MASK OPERATION: The 33 mean ilter ma be epressed b the convolution mask 9 Unortunatel the mean ilter operation blurs edges and sharp eatures. g h * Convolution mask or kernel Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 5 Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 6 3
a Original image; b- results o spatial lowpass iltering with masks size o 33 55 77 55 55. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 7 Blurring o edges ma be controlled b selective mean iltering: µ i µ > T g otherwise. where T is a threshold this is useul in salt and pepper noise in this applications the central piel at is usuall let out to use onl the eight neighboring piel in computing the mean. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 4
SMOOTHING FILTERS - MEDIAN FILTERING non-linear ilter perorms better noise removal with less blurring in most cases. 5 5 5 5 5 5 sorting: 5 5 median Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 9 a Original image; b image corrupted b impulse noise; c result o 55 mean; d result o 55 median iltering. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 5
6 Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens SHARPENING FILTERS - HIGHPASS SPATIAL FILTERING Edge Enhancement and Etraction The gradient operator gives a measure o change in the image values in the direction speciied: For digital dierentiation is approimated b dierences: j i G +. + G [ ] [ ]. + + G or G Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens Dierentiation leads to removal o constant values in the direction o the operation; etraction o edges in the orthogonal direction; and removal o the average intensit DC component. Roberts gradient uses cross-dierences This operator computes diagonal edge gradients.the advantage o this operator is that the resulting image piel values ma be written in the same arra as the input image. [ ] [ ]. G + + + + +
7 Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 3 3 3 MASKS FOR GRADIENT OPERATIONS Prewitt operators: Sobel operators: 3 ; 3 4 ; 4 Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 4 33 MASK FOR IMAGE SHARPENING Laplacian: Subtracting Laplacian: Unsharp Masking: 4 / / / / / / / / 5
Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 5 3X3 MASK FOR DIRECTIONAL GRADIENTS. : 9 ; : o o. : 35 ; : 45 o o Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 6 EXAMPLES OF 3X3 MASK OPERATIONS: 4 * 3 3 3 3 5 *
9 Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 7 9 Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 9 w Where w 9A - with A a original image; b A.; c A.5; d A..
a original image; b magnitude o Prewitt gradient; c setting to 55 an gradient value over 5; d setting to 55 an gradient value over 5 and setting to an gradient value under or equal 5. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 9 a original image; b vertical edge detector; c horizontal edge detector; d Sobel edge detector; e Roberts edge detector. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens
FREQUENCY DOMAIN FILTERING High-requenc components are associated with sharp eatures in the image as well as noise. To achieve smoothing o images and/or noise removal we ma remove or attenuate a certain portion o the highrequenc components b lowpass iltering. G H. F F H G Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens LOWPASS FILTER FUNCTIONS: ideal: H i D D o otherwise Note : D u + v i. e. the radial requenc. G H. F Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens
a 55 image; b its Fourier spectrum with superimposed circles which radii equal to 43 7 and 5 enclose 9 93 95 99 and 99.5% o the image power respectivel. P T N N u v P P F Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 3 a original image; b- results o ideal lowpass iltering with the cuto requenc set at the radii equal to 43 7 and 5 respectivel. Ideal losspass ilters results in blurring and ringing removing edge and sharp detail inormation o the image Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 4
h G H. F g h * Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 5 While "ideal" iltering is possible on computers it is not desirable as it results in ringing artiacts around edges in the image. Eponential and Butterworth ilters provide a smoother roll o and produce smooth images with no ringing artiacts. Eponential: D H ep D o n. D + u v Butterworth: H u D u + D o n. Note: n is the order o the ilter; higher-order ilters provide aster roll-o. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 6 3
a original image; b- results o Butterworth lowpass iltering with the cuto requenc set at the radii equal to 43 7 and 5 respectivel. Less blurring and no ringing Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 7 a image digitized with onl 6 gra levels ehibits alse contours; b result o smothing a with a lowpass ilter o order ; c nois image; d results o appling Butterworth lowpass iltering to the nois image. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 4
HIGHPASS FILTER FUNCTIONS: Highpass ilters are useul in edge etraction applications. Ideal: H i D D otherwise. o Eponential: n D o H ep. D u v Butterworth: H. n Do + D Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 9 a original image; b result ater a highpass Butterworth ilter > lowrequenc components were severel attenuated thus making dierent gra-level regions appear the same c result ater high-requenc emphasis high-requenc emphasis ilter highpass ilter + a constant; d results o appling highrequenc emphasis and histogram equalization. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 3 5
Directional "sector" ilters ma be designed to enhance etract or remove eatures at preerred orientations b virtue o the rotational propert o the Fourier transorm. While space domain operations aect local piel values and eatures requenc domain operations aect the image globall. While normall we are concerned with the magnitude spectrum to a large etent the phase spectrum is also important. Phase has been shown to be associated with edge inormation to a larger etent than the magnitude o the requenc components. Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 3 HOMOMORPHIC FILTERING i. r F I. R i: illumination component ver low requenc; r: relectance component medium-to-high requenc. To separate the two components or iltering take the logarithm: [. ] ln[ i ] ln[ r ] z ln + Z I + R u. S H. Z [ s ] g ep ln FFT H FFT - ep g Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 3 6
a original image; b image processed b homomorphic iltering to achieve simultaneous dnamic range compression and contrast enhancement. b enhancing r and suppressing i Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 33 Color Image Processing Slide projector Copright RMR / RDL - 999. PEE53 - Processamento Digital de Imagens 34 7