DIGITAL IMAGE PROCESSING
DIGITAL IMAGE PROCESSING ECE 618
U of L
Popular in Course
Popular in Electronics and Computer Technology
This 126 page Class Notes was uploaded by Wade Davis PhD on Friday October 23, 2015. The Class Notes belongs to ECE 618 at University of Louisville taught by Staff in Fall. Since its upload, it has received 16 views. For similar materials see /class/228374/ece-618-university-of-louisville in Electronics and Computer Technology at University of Louisville.
Reviews for DIGITAL IMAGE PROCESSING
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/23/15
Digital Image Fundamentals and Image Enhancement in the Spatial Domain Mohamed N Ahmed PhD 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Introduction An image may be defined as 2D function fxy where x and y are spatial coordinates The amplitude of f at any pair x y is called the intensity at that point When x y and f are all finite discrete quantities we call the image a digital image So a digital image is composed of nite nu of elements called picture elements or pixel 82820 04 Image fxi y Digital Processing Introduction 0 The eld of image processing is related to two other elds image analysis and computer vision Image Processing Computer Vision 32320 o4 UnlverSIty of LOUISVIIIe Digital Processing Introduction 0 There are three of processes in the continuum Low Level Processes gtgt Preprocessing ltering enhancement gtgt sharpenlng image image Low Level 32320 o4 UnlverSIty of LOUISVIIIe Introduction 0 There are three of processes in the continuum 82820 04 Low Level Processes gtgt Preprocessing ltering enhancement gtgt sharpening Mid Level Processes gtgt segmentation image image image Low Level gt attributes 1 id LeVel gt University of Louisville Introduction 0 There are three of processes in the continuum 82820 04 Low Level Processes gtgt Preprocessing ltering enhancement gtgt sharpening Mid Level Processes gtgt segmentation High Level Processes gtgt Recognition image image Low Level gt attributes image Mid Level gt recognition attributes High Level University of Louisville Digital Image Processing Origins of DIP Newspaper Industry pictures were sent by Bartlane cable picture between London and New York in early 1920 The introduction of the Bartlane Cable reduced the transmission time from a week to three hours 1921 Specialized printing equipment coded pictures for transmission and then reconstructed them at the receiving end Visual Quality problems 82820 o4 UnlverSIty of Lounswlle Digital ptoCQSSEWl Origins of DIP In 1922 a technique based on photographic reproduction made from tapes perforated at the telegraph receiving terminal was used This method had better tonal quality and Resolution Had only five gray levels 1922 Mai20 University of Louisville Digital Image Processing Origins of DIP Unretouched cable picture of Generals Pershing and Foch transmitted Between London and New York in 1929 Using 15t0ne equipment 82820 04 University of Louisville Digital Image Processing Origins of DIP The first picture of the moon by a US Spacecraft Ranger 7 took this image On July 3lst in 1964 This saw the first use ofa digital computer to correct for various types of image distortions inherent in the onboard television camera 82820 04 University of Louisville Digital Image Processing Applications Xray Imaging Xrays are among the oldest sources of EM radiation used for imaging Main usage is in medical imaging X rays CAT scans angiography The gure shows some of the applications of Xray imaging 32320 o4 UnlverSIty of LouISVIIIe Digital Image Processing Applications Inspection Systems Some examples of manufactured goods often checked using digital image processing 82820 04 University of Louisville Digital Image Processing Applications Finger Prints Counterfeiting License Plate Reading 82820 04 University of Louisville 82820 04 Components of an Image Processing System Nu work T Imago displays 39unl pu lur Mass slurASE I u rtlcupy 5pc 39 lizcd i gt processing hardware Imago IVruutSN lng sol lw an Image scnwrs Huh I cm dun 21in University of Louisville Steps in Digital Image Processing ulpulw of these processes generally um images 39nlur im39 1U pmcua 39 M u rphulugical pmuuss umnrvssiun rvrmmslng E3 3 E 33 L3 chmunlulinn I m WICdgquot M x llupmsunlulion duscriplion ll nklgl rcsln m li un Im cnlmnuu mu m Problem 1 I 39 L domuln ulpuls ul39 these pmt esscs generally are image almibules 9 I1j L39L39l rumgn i liun 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing 2 Digital Image Fundamentals 32320 o4 UnlverSIty of LOUISVIIIe Structure of the Human Eye The eye is nearly a sphere with an 5quot quot quot quot 39quot 39 Average diameter of 20mm 39 quot cumy Liburs Three membranes enclose the eye ComeaSclera choroid and retina 1 Visual axis The Cornea is a tough transparent tissue Covering the anterior part of the eye Sclera is an opaque membrane that Covers the rest of the eye 5m 39Iinroid Vilwuus humor eye 82820 04 The Choroid has the blood supply to the an amp 739439511 University of Louisville Mortal Ema Structure of the Human Eye Continuous with the choroid is the iris which contracts or expands to control the amount of light entering the eye The lens contains 60 to 70 water 6 fat and protein The lens is colored slightly yellow that increases with age The Lens absorbs 8 of the Visible light The lens also absorbs high amount of infrared and ultra Violet of which excessive amounts can adamage the eye 04 iliarymusclu 39 quot I cum3 Lilwrs I i Visual Ixi Villcnus humor University of Louisville Digital Processing The Retina The innermost membrane is the retina When light is properly focused the image of an outside object is imaged on the retina There are discrete light receptors that line the retina cones and rods 82820 04 Y 1 liar muscle cum lihurs Visual axis K Viucnus humur l l l l Sulcru IL 39lmruid University of Louisville Procession Digital 1m Rods and Cones I 139 I l I I l The cones 7 million are H mm 51 33 located in the central portion 1350007 1 the retina fovea They are 1H x sensitive to color 911mm I i 3 x m 1 x l 430017 H r The rods are much larger 75 31 150 million They are i i 8 6D 40 20 D 20 4U ll SI a Degrccifrom Visual axisccmcr ol39rnvea overall picture of the eld of view They are not involved in color vision 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Procrassmg Image Formation in the Eye 39r 100 m r 17 mm 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Electromagnetic Spectrum Energy of one photon electron volts 039 IrI IU ItrI Itquot Itr5 10 l0 7 Ilrquot 10439 I l I I I I I I l I It IuS 104 19 101 I l ml 01 1010 mts I017 mm I015 I I I I I I I Frequency HZ n In In12 In mm 109 In8 I07 I0 105 I I l I avelengtlt I meters 7 111 10 10quot Hrquot IU 10 7 IU Itr ll 10quot IUquot llquot 1 10 I03 103 l l l l l l Hard Xrays Ultraviolet Radio waves Gamsz rays Suit Xrays 04 x Hr 05 x Hrquot 06 x 1 5 07 x 10396 Ultraviolet Violet Blue Green Yellow Orange Red Infrared 82820 o4 UnIverSIty of Lomswlle Digital Image Processing Image Acquisition Illumination energy m 4 i i y y Oulpui Lligiiized image 39 l Imaging system L Inlernal image plane Scene clement 82820 o4 Unwersnty of LOUISVIIIe Digital Image Processing Image Sensors FilterT l Single Imaging Sensor Sonsin material iner m g Housing Qmm Voltage wavetmm out Line sensor Array of Sensors iiiiii gliui iiiiii iiii iiiiiju i i iiiiil i i i IIIIIIHIIIII IIIIIIHIIIHI 82820 04 University of Louisville Digital Image Processing Image Sensors Energy S e 1 aglng SCLI l l l l g F I181 X Sensing malerial Housing UUW Voltage wavetorm out Photo Diode Sensor University of Louisville r 1 Digital Image Processing Image Sensors Line sensor 82820 04 University of Louisville r 1 Digital Image Processing Image Sensors Line sensor University of Louisville r 1 Digital Image Processing Image Sensors Line sensor University of Louisville r 1 Digital Image Processing Image Sensors Line sensor University of Louisville r 1 Digital Image Processing Image Sensors Line sensor University of Louisville Digital Image Processing Image Sensors Array of Sensors CCD Camera 82820 o4 Unwersnty of Lomsvnlle Digita Image Procegsmg Image Formation Model fx yix rx y H Lffirij where 1 may the amount ofillumination O lt lt 00 incident to the scene 2 rxy the re ectance from the objects 0 lt rx9 lt 1 32320 o4 UnlverSIty of LouISVIIIe Image Formation Model For Monochrome Images Z fx y where 17min lt l lt limax 17min gt 0 limax should be finite The Interval 17min limax is called the gray scale In practice the gray scale is from 0 to Ll where L is the of gray levels 0 gt Black Ll gt White moi20 University of Louisville Digital Protaming Image Sampling and Quantization Continuous D Sampling amp Quantization Discrete gt Sampling is the quantization of coordinates Quantization is the quantization of gray levels 82820 04 University of Louisville Digital image Processing Image Sampling and Quantization 82820 04 Unwersnty of Lomswlle Digital Image Processing Sampling and Quantization Continuous Image projected Results of Sampling and onto a sensor array Quantization 82820 04 Unwersnty of LOUISVIIIe Effect of Sampling QJ a 2 125 3 6 Images up sampled to 1024x1024 Starting from 1024 51225612864 and 32 A 1024x1024 image is subsampled to 32x32 Number of gray levels is the same 82820 04 University of Louisville Digital Image Processing Effect of Quantization An Xray Image represented by different number of gray levels 256 128 64 32 16 8 4 and 2 82820 04 Unwersnty of Loulswlle Digital Processing Representing Digital Images Origin 0 1 2 i A l39 9 v 9 gt l n u a a n a a n a n The result of Sampling and Quantization is a matrix of real i s 39 Numbers Here we have an image fxy that was sampled 39 39 39 39 39 39 39 39 To produce M rows and N columns M i l o I a n v a u I l a One pch 11x y f00 f01 f0N 1 1 1 fM 10 fM 1N 1 32320 o4 UnlverSIty of LOUISVIIIe Representing Digital Images There is no requirements about M and N Usually L 2quot Dynamic Range 39 0 LI The number of bits required to store an image b Mx Nx k where k is the number of bitspixel Example The size ofa 1024 X 1024 8bitspixel image is 220 bytes 1 MBytes 32320 o4 UnlverSIty of LOUISVIIIe in Digital Image Precegsin Image Storage The number of bits required to store an image b MxNx k where k is the number of bitspixel 6L64 7I128 8L256 Nk 1L2 2L4 3L8 4L16 SL32 32 024 2048 3072 4096 5120 6144 7168 5192 64 400 5102 12258 16354 20480 24576 28672 32768 128 16384 32768 49152 65556 81920 98301 I 4688 31072 256 65536 131072 196608 262144 327630 5052 I 6 458752 524288 39 1310720 1 1564 835008 2007 2 SS 786432 10 5 3145728 4104304 12582912 16777216 7340032 8388608 4 12 7 6291456 25165824 29369 28 3 100665296 1 7440512 134217728 402653184 460762048 536870912 4 1024 1145576 2007152 2048 4194304 8338608 4006 16777216 33554432 50331648 67108564 8192 674082864 134217728 201526592 268435456 The number of storage bits depending on width and height NxN and the number Of bitspixel k 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing File Formats PGMPPM RAW J PEG GIF TIFF PDF EPS 82820 04 TNT JPEE E University of Louisville uidity in File Formats The TIFF File 82820 04 TIFF or Tag Image File Format was developed by Aldus Corporation in 1986 speci cally for saving images from scanners frame grabbers and paintphotoretouching programs Today it is probably the most versatile reliable and widely supported bitmapped format It is capable of describing bilevel grayscale palettecolor and fullcolor image data in several color spaces It includes a number of compression schemes and is not tied to speci c scanners printers or computer display hardware The TIFF format does have several variations however which means that occasionally an application may have trouble opening a TIFF le created by another application or on a different platform University of Louisville Digital Prot File Formats The GIF File GIF or Graphics Interchange Format les de ne a protocol intended for the online transmission and interchange of raster graphic data in a way that is independent of the hardware used in their creation or display The GIF format was developed in 1987 by CompuServe for compressing eightbit images that could be telecommunicated through their service and exchanged among users The GIF le is de ned in terms of blocks and subblocks which contain relevant parameters and data used in the reproduction of a graphic A GIF data stream is a sequence of protocol blocks and subblocks representing a collection of graphics 32320 o4 UnlverSIty of LOUISVIIIe File Formats The JPEG File JPEG is a standardized image compression mechanism The name derives from the Joint Photographic Experts Group the original name of the committee that wrote the standard In reality JPEG is not a le format but rather a method of data encoding used to reduce the size of a data le It is most commonly used within le formats such as JFIF and TIFF JPEG File Interchange Format JFIF is a minimal le format which enables JPEG bitstreams to be exchanged between a wide variety of platforms and applications This minimal format does not include any of the advanced features found in the TIFF JPEG speci cation or any application speci c le format JPEG is designed for compressing either fullcolor or grayscale images of natural real world scenes It works well on photographs naturalistic artwork and similar material but not so well on lettering or simple line art It is also commonly used for online displaytransmission such as on web sites A 24bit image saved in JPEG format can be reduced to about onetwentieth of its 191739 inal size 094g University of Louisville Neighbors of a Pixel A pixel p at coordinates x y has 4 neighbors xIy x1y xyI xy1 These pixels are called N409 O O o a O 0 8p are the eight immediate neighbors of 19 32320 o4 UnlverSIty of LOUISVIIIe Adjacency and Connectivity Two pixels are connected if 0 They are neighbors 0 Their gray levels satisfy certain conditions e g g1 g2 gtIltTwo pixels p q are 4 adjacent if q 6 N4 19 Two pixels p q are 8 adjacent if q 6 N8 19 32320 o4 UnlverSIty of LOUISVIIIe Adjacency and Connectivity Path A digital path from p to q is the set of pixel coordinates linking p and q Region A region is a connected set of pixels 32320 o4 UnlverSIty of LOUISVIIIe Distance Measures Assume we have 3 pixels p x y q st and z vw A distance function D is a metric that satis es the following conditions aDp61 20 Dp61 0 11719 61 19 Mn 61 Dq p 6 Dp 2 S Mn 61 Dq 2 Example Euclidean Distance 01 q Vx s2 y I2 232320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Distance Measures City Block Distance D4pqXSyt Chess Board Distance DgpqmaXxSyt 32320 o4 UnlverSIty of LOUISVIIIe Image Sealing Pixel Replication Bilinear Interpolation Bicubic Interpolation 82820 04 A University of Louisville Dig ital magi Image Interpolation 0 Pixel Replication Use the nearest neighbor to construct the zoomed image Useful in doubling the image size 82820 04 University of Louisville Image Interpolation 13 13v 13139 1 Bilinear Interpolation uv Use 4 nearest neighbors to calculate the image value itld itlyv 141141 fu3V fl39V1 u i fl39 13Vu l39 fl39V fi1 V J39fi1V fi1V fi11 V J39fi11V 82820 04 University of Louisville 39 Image Interpolation Cubic Interpolation Use 16 nearest neighbors The contribution of each pixel depends on its distance from the output pixel Usually we use spline curve to give smoother output fuv PTvF Pu p1 I720 P 0 mu I740 Where 0ltuvltl 32320 o4 UnlverSIty of LOUISVIIIe Image Interpolation Cubic Interpolation 82820 04 fH 13971 fHj fw39 fi2j fi1j2 p1t t32t2 t2 p20 2 33 512 22 p3t 3t3 4t2t2 p4lI3lz2 University of Louisville Digital Image Processing Image Interpolation 4X Bilinear Interpolation 4X Bicubic Interpolation 82820 o4 Unwersnty of Lounsvnlle Digital Image Processing Image Interpolation 4X BiCubic Interpolation 4X Edge Directed Interpolation 82820 o4 Unlver5ty of Lomsvnlle Digital Image Processing Image Interpolation 82820 I o4 Unwersnty of Loulswlle Dir v tal Processing 3 Image Enhancement in the Spatial Domain 32320 o4 UnlverSIty of LOUISVIIIe Digital Protaming Image Enhancement The objective of Image Enhancement is to process image data so that the result is more suitable than the original image Enhanced Image O ginal Image Enhancement Operator 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Image Enhancement Image Enhancement Spatial Domain Frequency Domain 82820 04 University of Louisville Digital Spatial Domain Enhancement Let fx y be the original image and gx y be the processed image Then 8 06 y T f x y Origin image f y Emu y where T is an operator over a certain neighborhood of the image centered at x y Usually we operate on a small rectangular region around x y 82820 04 University of Louisville Intensity Mapping The simplest form of T is when the neighborhood is l X 1 pixel single pixel In this case g depends only on the gray level at xy 8 06 y T f 3WD Intensity Mapping szT In t Gra 1e e1 Output Gray level pu y V 82820 o4 UnlverSIty of LOUISVIIIe DiIgItal Processing Intensity Mapping Intensity mapping is used to aIncrease Contrast bVary range of gray Levels 5 l39r 5 Tr H i I a i E i I I quot Tr quot r Tr 1 i I l I I 1 I 4 I g I I E I Q I a I I I 1 quot 1 r r Dark I Light Dark 4 Light 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Image Mapping A Image Negative SL 1 r Example L256 s255 r This operation enhances details in dark regions 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Procrassmg Image Mapping L i 1 I B Log Transformations Negative nthrool 3L4 s c 10g1 r 7 Log 5 quotm LZ 7 7 g 44 7 Identity InVchc log n 0 LM Ll 3L4 1 7 1 Input gray Iccr 32320 o4 UnlverSIty of LOUISVIIIe mum Preteseimg v Image Mapping Fou er Spectrum and Result of applying 10 g transformation 0 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Image Mapping L i 1 C Power Transformation 4 y 010 3L4 7 020 7 S C I w m h 5 L47 250 U L H I Eli4 L l LZ Input gray Icvclr 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Gamma Correction Image as viewed on monitor gt My Image as viewed on munilor gt KK 32320 o4 UnlverSIty of LOUISVIIIe Digital Procegsmg Gamma Correction 32320 o4 ilty of LOUISVIIIe Digital Image Processing Gamma Correction 82820 04 Digital Image Processing Contrast Stretching L I I I a 3L4 Contrast T5 s 39hing L5 arm of l L Tr 7 triiiisiiwrliizil0n EL p Iunclmn h A a owcnnlmsl O 7 mugs 1L Ruuil 14 of canlm t V W xirelching I I I dr Result 0 Lji L2 3L4 I 1 thresholding rig a imngc murlosy 0 Dr Rnch Heady Rusearch School of Biulugicul i cc Input gray ieveLr Australian Funhcrm Ausimlin 82820 o4 UnlverSIty of Lounswlle mThis lransfurmhliun K highhghh rangu T A B nl gmy Icvulx 21ml ruducrx all others 10 a mnsmnl lm39cl This lransfnmmliun highlights rangu M B but prcwrvcx uh other 10 915 1C An image 1d Result hf llxing Ihu lmnsfnrmulinn in u a l I w 3 a unqn vgpq h 32320 o4 UnlverSIty of LOUISVIIIe Workshop Using Photoshop 1 Image gtAdjustmentsgt perform a Image negative b Approx gamma03 gamma24 c Clipping at 200 2 Use the Brightness and Contrast curves to increase the level of brightness of the image 4 Threshold Image ImagegtAdjustmentsgtThreshold 32320 o4 UnlverSIty of LOUISVIIIe Digital Processing Histogram The Histogram of a digital image is a function hm quotk where rk is the kth gray level nk is the number of pixels having gray level rk 32320 o4 UnlverSIty of LOUISVIIIe Histogram Example 2 32320 o4 UnlverSIty of LOUISVIIIe Digital Protagsmm Normalized Histogram Nonnally we normalize km by mm Q So we have L l L l l l k 2PM Z 1 k0 k0 7 prk can be sought of as the probability of a pixel to have a certain value rk 32320 o4 UnlverSIty of LOUISVIIIe Digitai Protassimg Normalized Histogram Example n16 2 5 4 4 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Histogram Inrk irn u niHiIii i any image Luuhuunlrzvd imagc I 7 Note Images with uniformly 39 39 Distributed histograms have higher Contrast and high dynamic range fiiglvon39llrdsl inhlgc I u w mm mi I 82820 o4 UnlverSIty of Lounswlle Histogram Equalization De ne atransformation S T r With T0quot JP Wdw s Tm nr 0 Where pr is the probability histogram of image r 32320 o4 UnlverSIty of LOUISVIIIe Histogram Equalization NOW lets calculate pss p5 s 12mg ds d d T d dr dr r drmw w ds 1 dr 1M 32320 o4 UnlverSIty of LOUISVIIIe Digital Prowssim Histogram Equalization So 1 ds prr Then 1 psSprr 1 prr Which means that using the transformation T 1 I pr WWW the resulting probability is uniform independent 0 of the original image 32320 o4 UnlverSIty of LOUISVIIIe Histogram Equalization In discrete form k sk Zprrj j0 J 32320 o4 UnlverSIty of LOUISVIIIe Digitai image Processing Histogram Equalization i i 128 192 Transformation Functions University of Louisville 7 I39m I I I 7 535 7 3 3 350 g E 2 175 7 2 II I I I 64 123 192 25 Gray luvs a 1 FIGURE 320 a magm nl Ilw Marx mmm I hmm lukcn by NASA s Marx Glulml Surveyor h Hislngmm Original image murmsy of NASA 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Histogram Equalization a b 0 FIGURE 31 a Transformation l on for Output gray levels n I I I out appearance 128 192 3 Histogram Input gray levels of b 7 m E x 525 E m a E 350 5 3 L75 E 5 l n I I iiillllllllllhmaJIlIlm 64 128 192 2 5 Gray level 82820 o4 UnIversIty of Lomsvnlle Digital ProLiaising Workshop 1 Obtain the histogram equalization curve for the following example Using PhotoShop 2 Calculate the Histogram ImagegtHistogram 3 Perform Histogram Equalization 32320 o4 UnlverSIty of LOUISVIIIe Digital Processing Local Enhancement Instead of calculating the histogram for the Whole image and then do histogram equalization First divide the image into blocks Perform histogram equalization on each block 32320 o4 UnlverSIty of LOUISVIIIe 82820 04 Digital Image Processing Local Histogram Equalization abc Fl UK 323 a Original image 11 Result of global histogram equalization c Result of local histogram equalization usuiga 7 X 7 neighlmrhnml about each pixcl University of Louisville Local Statistics 0 From the local histogram we can compute the nth moment where 82820 04 nrLZln mquot pm L71 m I 170 10 0 Z 1 1 0 L4 Variance 2 i m2 p iO 2 10 University of Louisville Enhancement By Local Statistics Assume we want to change only dark areas in the image and leave light areas unchanged 05fx9y if mxySm axysTh gx y fx9 y Otherw1se 82320 University of Louisville Digital Image Processing Enhancement By Local Statistics 82820 04 University of Louisville FIGURE 327 an Original image b AND in gr male c1 Resull ul the AND npurulinn mi112gu u and 1h 1d riginul i3 opuralion R an imqu Ll and u University of Louisville Digital Image Processing Image Averaging gltxygtmygt Flaunuao a 39 mh m39 quot izln noise mm mm mean and a standard deviation of 54 gray lcvclx cm Results ofzu39 enigng 7 166Jan Enoisyimag1 0riginalimagecourleayofNASAJ University of Louisville Digital Protaming Spatial Filtering Spatial ltering is performed by convolVing the image with a mask or a kernel Spatial lters include sharpening smoothing edge detection noise removal etc 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Procrassmg Basics of Spatial Filtering lmy any 32320 o4 erSIty of LOUISVIIIe Basics of Spatial Filtering In general linear filtering of an image f of size M x N with filter size m x n is given by the expression gm 2 Zwltsrgtfltxsyrgt s a t b am l2 bn l2 82820 o4 UnlverSIty of Lomsvnlle Digital Processing Smoothing Spatial Filters The output of a smoothing spatial lter is simply the average of the pixels contained in the neighborhood of the lter mask These lters are sometimes called averaging llers and also lowpass llers By replacing the value of the pixel with the average of a window around it the result is a 11 image with reduced sharp transitions 32320 o4 UnlverSIty of LOUISVIIIe Dimitai Processim Smoothing Spatial Filters l l l l 2 l x 1 1 1 flax o 4 v 1 1 l 1 1 In general a b 2 Zwsrgtfxsyrgt gxy 3 a b 2 wsl 3711 t7b 82820 04 University of Louisville 82820 04 Digital image PU QCESSin Smoothing Spatial Filters mnn ana ll aaaaaaaa ll 39 aaaaaaaa l aaaaaaaa Manuaaa wool a Hill IJJJJJIH I 2 llllllll cl p um I Ul up n squares at the top are of sizes 3 5 9 1 ers are 15 pixels 3 art The lelt increments of 2 points the large letter at lie to is 60 min 39 and 100 pixels hi it h 39 39 i g 5 ts The vertical liars a e g l eirseparation is 20 ixe i ie diameter f FIGURE 335 3 Original image of size 500 x lt00 pixels th Results afsmuuthing 39 39 39 39 i I H 1an 1i re39nerriw l The black 3M 3 an ixels respectively their top ers at the bottom range in size ram 10 lo 24 oin u the circles is 3 pixelsan t ieir borders an 1 pixels apart their gray levels range mm 0 to 1 black in increments orzorxmie backgmund or the image is in black The noisy rec rty Of LOUISVI i Ie tangles are ot39size 50 x 120 pixels 11 a he FIGURE 336 1 Image mm the l39lubhh SPLK39CTGICSCUPC in Image pmccssud hy u 15 X 15 averaging mask L Result of thresholdng b Original image courlcsy of NASA 32320 o4 UnlverSIty of LOUISVIIIe Digital Processing Order Statistics Filters Order statistics lters are nonlinear spatial lters whose response is based on ordering ranking the pixels contained in an area covered by the lter The best known example in this category in median ller Median lters replace the value of the pixel by the median of the gray levels in the neighborhood of that pixel 32320 o4 UnlverSIty of LOUISVIIIe Median Filter Example 10 2O 2O 10 2O 2O 2O 15 2O 2O 2O 2O 2O 25 100 320quot 25 100 Order o a gt 10 15 20 zog zo 20 25 100 1 Median value 82820 04 University of Louisville Digital Image Processing Median Filter a b 0 FIGURE 337 1 Xray image ni39circuil hoard corrupted by sali andpcppcr noise b Noise ruduclion with a 3 X 3 averaging mask c Noise reduction Willi a 1 X 3 median filter Original image courtesy of Mr Joseph E Pascenle Lixn Inc University of Louisville 82820 04 82820 04 Digital Image Processing Multi Pass Median Filter FIGURE 5 1 Image Cnmlpted hy sallv and 6 wer isc cs villi pmhnhilni PD 01 median ller 0 size X 1 Result of processing hl will lllis l39illcr will Um same l iller University of Louisville Digital Image Processing Other Order Statistics Filters ImagePepper Noise ImageSa1t Noise 82820 o4 Unlver5ty of Lomsvnlle Digital Image Processing Other Order Statistics Filters Max Filter Min Filter 82820 o4 Unlver5ty of Lomsvnlle Digital Procession Adaptive Median Filter We want to preserve the detail while smoothing non impulse noise Vary the size of the window Algon39thm Let Z in min graylevel in Sxy m Z ax max graylevel in Sxy m zmed medzan graylevel m Sxy 32320 o4 UnlverSIty of LOUISVIIIe 82820 04 Digital Protagsmn Adaptive Median Filter A A1 Zmed Zmin A2 Zmed Zmax ifAlgt0ANDA2lt0 GotoB Else increase window size If window size lt S Goto A Else output zxy Bl ny 2mIl BZ ny Zmax if Bl gt 0 AND 82 lt 0 output zxy Else output zmed University of Louisville Digital Image Processing Adaptive Median Filter abc FIGURE 5 21 Image corrupted bysalIanclpepper noise with probabilities B P 025 1 Result offil tering with a 7 X 7 median lter 9 Result of adaptive median filtering with Smx 7 82820 o4 Universny of Lomsvnlle Digital Prot Sharpening Spatial Filters The principal objective of sharpening is to highlight ne details in an image or to to enhance details that has been blurred We saw before that image blurring could be accomplished by pixel averaging which is analogous to integration Sharpening could be accomplished by spatial di erentiation In this section we will de ne operators for sharpening by digital differentiation Fundamentally the strength of the response of the operator should be proportional to the degree of discontinuity presence of edges moi20 University of Louisville Digita Procession Digital Differentiation A basic definition of the firstorder derivative at one dimensional function fx is the difference a i fx 1 fx fix The second order derivative 62f 6x2 fx12fxfx1 32320 o4 UnlverSIty of LOUISVIIIe Digital Differentiation a h c FIGURE 338 n A simplc inmgarh ll huriynnlul gm im39c prm ilc nlnng he cunlcr 01 the image NHL including he isnlnmd nniso point c Sim Jiil39ied profile the mints are jnincd by dashed lines 0 s inmliry inlcrprclzninn 7 G r lsomted pount ll 5 39 I quott t Tiliniine S39W x iFIul gegmenl xk cxuwa Image stripl 5 Fm Derivatch I n I Second Derivative l l U U 7 77 U U 232320 o4 UnlverSIty of LOUISVIIIe The Laplacian V2 f The Laplacian of an image is define as 52f 52f V2f2 2 2 6x 6y 62f 6x2 fx13y2fx3yfx13y 62 a 2 fxy12fxyfxy1 y V2ffx1yfx Lyfxy1fxy14fxy 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Procrassmg The Laplacian V2 f o 1 o 1 1 1 1 4 1 1 s 1 u 1 o 1 1 1 o 71 o 1 1 1 71 4 71 1 s 1 o 1 0 1 1 1 32320 o4 UnlverSIty of LOUISVIIIe Digital Proceggmg Sharpening Mask 0 1 0 1 S 1 l 1 1 0 71 0 1 9 1 1 1 1 szfxy m y V2ffxy 82820 04 University of Louisville n h c L1 FIGURE 340 3 Image 01 he Nurm l nlc mm mmm h Luplnciu 1 l39illvnd in r Lxmlamun in mgu cwlcd fur displu purvawx d mugc cnhunccd by 39 H 75 ul Image 1 32320 o4 SVI I la Digital Image Processing Sharpening Spatial Filters p 7 41 FIGURE 34 n Cumposile Laplm iilli mask MA wwnd mmposilc mask c Scanning 32320 I c electron micrnscopc image d and 10 Results of llerng wilh the masks in a and h 04 respecih 39 39 Mi r 39 39 quot Ul Mnlvlirhaci of Louisville slyquot 1 Ann marpur I Shaffer Dcparlmcnl uichlngicul Sciencux University of Dragon Eugene Unsharp Masking A process used for many years in the publishing industry to sharpen images It consists of subtracting a blurred version of the image from the image itself fs x y my x y 32320 o4 UnlverSIty of LOUISVIIIe High Boost Filters A slight generalization of unsharp masking is called high boost filters Mm A my my l l U l l l l A 4 l l A 1 U l 0 l l l 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing High Boost Filters a b c d FIGURE 343 a Saint as Fig 341m hul darker a Laplacianof al computed with he mm in Fig 342m using A I c Laplzu ian enhanced image using the mask in r x will A di Same as c hul using A 17 82 04 Digital Image Processing Edge Detection 21 h c d e I L1 NS FIGURE 344 A A X 3 rcgiun of V V an im39 lhc z39s quot4 5 q are gm cw values um nusks used In compute 7 q a the gradient at point labeled 1 AI n S muff um sum 1 0 U 1 U Um HS expected ul39 a derivative npcralor 0 l 1 U 1 2 1 1 0 l O 0 0 2 0 2 1 2 I 39l 0 l University of Louisville a h FIGURE 345 pticm imch ut cunlm l lens nute defects on he boundary 11 4 and r 1 n 0 clot In thul grmlicnl riginu mm c I imugc of Pcrccpucx 39nrpnrulinn 32320 o4 UnlverSIty of LOUISVIIIe Anisotropic Diffusion Filter The idea is to filter within the object not across boundaries Therefore image details remain unblurred while achieving Smoothness within objects The filtering is modeled as a diffusion process that stops at image boundaries 32320 o4 UnlverSIty of LOUISVIIIe Anisotropic Diffusion Filter divcxvff 2 32320 o4 UnlverSIty of LOUISVIIIe Digital Image Processing Thank You 32320 o4 UnlverSIty of LOUISVIIIe