### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Class Note for COSC 4393 at UH

### View Full Document

## 29

## 0

## Popular in Course

## Popular in Department

This 60 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Houston taught by a professor in Fall. Since its upload, it has received 29 views.

## Reviews for Class Note for COSC 4393 at UH

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 02/06/15

Nonlinear Ima etFthering W I Median and Morphological Filters I Digital Noise Probability Models I Order Statistic Filters I Homomorphic Filtering Reading Ch 45 51511 from Gonzalez and Woods Second Edition WHY NONWLIaNEAR FILTEFRING I Objec ves ofi lteringf o processsamp e images to transform them into I images of better quality by some criteria I images With certain features enhanced I images With certain features deemphasized or eradicated I We have addressed some of these goals using the rich approach generally called linear ltering I However linear ltering does have important limitations Limitations of Linear Filterin I The basis of linear ltering is frequency or spectrum Shaping I reduce attenuate certain unwanted frequencies I enhance preserve or amplify certain desired frequencies I Consider enhancement of an image contaminated by White noise I The goal of ltering is twofold I Smoothing reduce noise from bit errors transmission I Preservation of important features edges and detail Smoothin JVs Preservation I Enhancement contains con icting goals Smoothing usually means that high frequencies are attenuated Images are broadband preservation usually means that both low frequencies and important high frequencies be preserved Linear ltering cannot differentiate between desirable high frequencies and undesirable high frequencies I Thus a linear low pass smoothing lter Will always Reduce high frequency noise Blur the image Motivationer Nonlinear Filtering A nonlinear image lter cannot be expressed as a Linear convolution operation nor a Predictable shaping of the frequencies Obviously nonlinear ltering covers a lot of possibilities Many nonlinear ltering approaches have been proposed usually based on heuristics Here we explore welldeveloped classes of nonlinear lters for Which a meaningful theory exists No DFTs or frequency analysis can be used The common theme nonlinear lters give you capabilities that linear lters don t have General Nonlinear Filter I Recall Given image I and Window B the Windowed set at i j is B 0 Iij Ii mj n m 11 TB I A nonlinear lter F on a Windowed set of image pixels is a nonlinear function of the pixels covered by the Window I We Will denote the nonlinear lter F on B 0 Ii j by M FB 1a FIltimj ngt m n TB I Performing this at every pixel gives a ltered image J FI B Jij 0 lt ij lt N l PseudoCode intl N NJ N NB M d0 Jij FIi mj n for m n B While 0 lt ij lt Nl I As With binary morphological lters when a Window is centered so that it overlaps quotempty spacequot I we Will use the convention of replication ll the empty Window slots by the nearest image pixel I The average lter is linear it can be de ned using Windows I De ne the ltered image J AVEI B I by Jij AVEB 0 Iij AVEIi mj n m n TB I Performing this at every pixel gives the average ltered image J I The shorthand J AVEI B allows us to de ne the operation for any window B MEDIAN FILTER I De nition Given a set of numbers X X1 XZM1 the order statistics or OS of the set are the same elements reordered from smallest to largest I The OS of X are denoted XOS Xm XQM 1 such that Xu lt2 39 39 lt2 X2M1 I In particular MAXX1 X2M1 XQMH MINX1 wa X2M1 2 X0 MEDX1 ama X2M1 XM1 I The median MED is the middle value in algebraic rank De n the eian itr e e I Given image I and Window B the median lter is simply J MEDI B I Each output pixel is the median of the local Windowed pixels Ji j M3DB 11 j MiEDIi m j n m n TB I Performing this at every pixel gives the median ltered image J Properties of the Median Filter Ir The median lter smooths additive White noise fhe median lter does not degrade edges Ir ihe median lter is particularly effective for removing large amplitude noise impulses Why the Median Filter Doesn t Degrade Ed es I Consider the Window con gurations below Where an ideal straight edge is covered by the Window m dark Why the Median Filter Doesn t Degade E I Notice that the median is contained in the majority set in every case and so is the center pixel I The center pixel is replaced by a member of the majority set Which resembles the center pixel value No blur I By contrast the average lter averages together members of the minority and majority sets creating blur Exam le 1D Median Filter a I A single scan line row of an image H Hquot 39 6 u s m 15 an 25 39 39 39 39 l 5 l0 I5 30 35 I AVEI B Where B ROW3 I is overlaid I Notice the overall smoothing effect Now for the median lter I MEDE B WhereT BTERO IU quot quot1s over 31 A3 l 5 I0 15 3t 35 I This is a very different effect I The quotnoisequot is smoothed effectively I Large noise spikes are completely eradicated instead of being blurrrrrrrrred I The important signal structure is effectively maintained the edges are sharp MEDIAN e These nice properties of the median lter still hold when 2 D Windows B are applied to noisy images Comments on Window Sha o e I Using B SQUARE produces lots of noise smoothing but can also eliminate certain quotimpulse likequot details of interest I Using a B CROSS Window can reduce these effects if it is known beforehand that the image will contain a lot of these types of structures I EXAMPLE Images of dot matrix characters Comments on Window Sha e I Howeyer if Othe imaigecontams cum 1nearquot eta1 s t a are diagonally oriented then B CROSS can perform poorly I A lot of variations suggest various combinations of CROSS X SHAPED oriented cross ROW COL etc windows I These quotdetailpreserving ltersquot work well although the theory is somewhat heuristic MORPHOLOGICAL FILTERS Graylevel morphological lters extend binary morphological lters As before everything comes from two basic operations DILATE and ERODE Given an image I and a Window B the DILATE and ERODE lters are de ned by J DILATEI B if Ji j MAXB 0 Ii j local maximum and J ERODEI B if Ji j MINB 0 Ii j local minimum The DILATE ERODE lters have the following properties Increase the size of peaks valleys Decrease the size of or eliminate valleys peaks EMMPLES I DILATEI B Where B ROW3 I Notice the elimination of most valleysIf we do it again to the 39 I 39 l t 39 same image row 39 395 39 I DILATEDILATEI B B B ROW3 I Now all of the valleys or negative going impulses are 3 39 11 g gone EXAMPLES e I ERODEH B Where B ROW3 m I This time the positive going impulse spikes are reduced or eliminated If we do it again to the same image row 2 I ERODEERODEI B B B ROW3 w I Much more pronounced now Usually it s 3 r not useful to iterate ERODE or DILATE quot j many times 39 l 39 I 39 l 39 I 39 I CLOSE and OPEN Filters I As in the caseiof binary processing tlle CLOSE and OPEN lters are de ned by I J CLOSEI B ERODE DILATE I B B and I J OPENI B DILATE ERODE I B B I These are effective smoothing lters similar to the median lter CLOSE and OPEN Filters I In fact the CLOSE OPEN lter has the following properties I smoothes noise I preserves edges I eradicates negative going positive going impulses I leaves the signal in its approximate form ERODE and DILATE do not EXAM P LES I CLOSEI B Where B if ROW3 I Preserves the signal except tha I the negative going impulses a gone i I OPENI B Where B ROW 39 39 I Preserves the signal except the positive going impulses are 39 gone I H I 15 OPENCLOS and CLOSOPEN Filters 3 I The OPEN CLOS and CLOS OPEN lters are de ned by I J OPEN CLOS LB OPEN CLOSE I B B and I J CLOS OPEN I B CLOSE OPEN 1 B B I These are effective smoothing lters very similar to the median lter I They are also very similar to each another OPENCLOS and CLOSOPEN Filters 3 I The CLOS OPEN and OPEN CLOS lters obey the following I doth smooth noise I doth preserve edges I doth eradicate positive and negative impulses I in 1 D both equivalent to applying MED I B multiple times EMPL e I OPENSCISBT7vha 1 r 3 Note the intense smoothing of noise especially impulses and the retention of the global image structure 1 CLOS OPENI B Where B ROW3 Note the different possible interpretations of quotcorrect image structurequot under CLOS OPEN and OPEN CLOS It 39 1 l J ll 5 III l I 25 MOr thO I DILATE and ERODE are true morphological lters I CLOSE OPEN CLOS OPEN and OPEN CLOS are as well i1 Itercttion I In fact they have the identical interpretation if we regard I as a 3D binary image with value 1 below its quotplotquot and 0 above its quotplotquot B as a 2D structuring element EXAMPLES e I Leads to fast all Bo lean a1 go ttharchitectures structuring element image function I I When the structuring element B lies completely above the image function the AND of all values Within its span is 0 I When the structuring element B lies completely below the image function the AND of all values Within its span is l I Whenever the structuring element B crosses the boundary of the image function the AND of all values is 0 DILATE I When the structuring element B lies completely above the image function the OR of all values Within its span is 0 I When the structuring element B lies completely below the image function the OR of all values Within its span is l I Whenever the structuring element B crosses the boundary of the image function the OR of all values is l Application PealdValley Detection f g I Impulses are notaluvajs ue 0 noise somet1rnest ey ar1se from a bright target or a dark object that is being sought I Suppose that we consider the images resulting from differencing the OPEN and CLOSE operations with the original image I J I OPENI B peak Jvalley I I As we d expect these operations highlight the peaks and valleys that occur EXAMPLE I I I OPENI B Where B ROW3 I CLOSEI B I Where B 2 M ROW3 I Simple thresholding m binarization of these could be used to determine the peak and valley locations h Drawbacks of MED OPEN CLOS Band CLQSOPEN I These three lters are the most suitable nonlinear lters that we have studied so far for noise smoothing image enhancement I They have the desirable property of retaining important image structures I However they must be used With care using a too large Window can produce streaking and blotching effects Which can appear as artifacts I While these lters are capable of smoothing most types of White noise there are other lters that do a better job depending on the speci c noise statistics ORDER STATISTIC FILTERS I Recall the de nition of the of a set X RX1 XZM1 Xos X1 am X2M1 I If we de ne the linear combination of order statistics 2Ml Z Aer ATXtm il I where A A1 AZM1 F then we have the basis for a new set of nonlinear lters called order statistic lters or OS lters ORDER STATISTIC FILTERS I The lter vyeights areyalways clehned so that they sum to 13 21I 1 2 A A e I i1 I Recall that e 1 1 1T I This way if X ce is constant then ATXOS c I The OS coef cients that we will use are symmetric I Ai A2M2i for 1 lt i lt 2M1 Q ltes w I Given an image I a Window B and a coef cient set A the OS lter With coef cients A is de ned by J OSAI B if Jij ATB 0 IijOS Where B 0 IijOS are the OS of B 0 Iij I These are just the ordered values of the pixels covered by the Window B When it s centered at i j General Pro erties of OS FioltSBI S I The behavior of an OS AI B lter is largely determined by its coef cients or weights A I The OS lters OS AI B include some important members I A 00 0 10 OT is the median lter I A 12M1 12M1 T is the average lter General Pro erties of OS Fi lters I Generally if the coef cients A are concentrated near the 7 middle I then OSAI B Will act much like a median lter I preserve edges well 05 I smooth noise Ai quot394 03 I reduce impulses I 1 Ilnl39l39l39l39l39l39l39l39 123456Ht i I BUT I Will not quotstreakquot or quotblotchquot as much I Will suppress non impulse noise better more later Geeal PI0I e of S Filters H5 I then OS AI B Will act much like an average lter I preserve edges poorly better than AVE I smooth noise I blur impulses not as badly as AVE DIGITAL NOISE PROBABILITY MODELS s I Any channel electrical wire airwaves optical ber is imperfect Images sent over a channel always suffer a degradation of information I a static hi gh frequency noise or thermal noise I b bit errors I c blurring defocusing I These errors degrade I Visual interpretation I computer image analysis I With nonlinear lters of the types we ll consider here the concern is usually a and b since linear ltering is well suited for deconvolution c White Noise is Inde endentNoise I We will assume thela 1t1ve W 391te nmse mo 6 JIN I Where I is an original image and N a digital White nmse Image I In linear ltering white noise suggests an average frequency description a at spectrum I An equivalent meaning is that the elements of N are independent WhiteNoise I This means that as they randomly occur any two noise elements m n p q I Nm n and Np q do not affect one another39s values I They occur independently Digital Gaussian I Also called the normal distribution nl2 I II HUN pVq 006 INN quot uni CH I I I 39 I 39 I 39 I 39 I Commentson Gaus ianPMFc Gaussian noise is the most common type of noise that occurs in nature It is found in nature extensively It is the usual type of noise found in electrical circuits Thermal noise is usually Gaussian Digital La lacian PMF I Also known as the doubleexponential or also twosided exponential PMF H3 H0 WK pN q HAW HM 003 Comments on Laplacian PMF Laplacian noise is usually used to model impulsive noise True impulse noise occurrences take a large number of small amplitude values and a relatively large number of high amplitude values but not so many in between Digital EX onential PMF I Also called the onesided exnonential PMF v r V v 1 r t r v I 1 v I r T r T r 1 Comments on Exponential PMF Exponential noise is usually used to model multiplicative noise SaltandPe I We Will consider one other type of noise known as saltandpepper noise I It is a model for signi cant bit errors I In the transmission of digital image data individual signi cant bit errors can randomly occur 1 to 0 light to dark 0 to 1 dark to light I This may be due to thermal effects or even gamma rays I Salt and pepper noise is not additive 156 0 n r e e m p P p m e I on m 1m m gt m om m k m a m S e e n m 0 w s m t m n n e a p m e w m 5 my 0m m 3 CN m S Avera 3 Filter I The average lter is best at reducing Gaussian noise variance I If B contains 2Ml elements then AVEJ B Will reduce divide the variance of Gaussian noise by a factor of 2M1 I In fact AVEJ B Will reduce the noise variance of any kind of White noise by a factor of 2M1 I This may seem pretty good but for non Gaussian PMFs other OS lters can do much better I Also too large a Window B Will severely blur the image so the noise variance can only be reduced a certain amount Medan llte The median l ED JTB iquot esquot or r a cngquot If B contains 2M1 elements then MED J B Will reduce the variance of Laplacian noise by a factor of approximately 22M1 e varance 039 ap ac 39 Quite an improvement MED J B is fantastic for removing salt and pepper noise There is no better lter However if the noise is Gaussian then MEDJ B Will reduce the variance by a factor of approximately 0752M1 This is also quite a difference We can claim based on this and on the edge preserving property that MEDJ B is generally superior to AVEJ B or any other linear lter for reducing White noise in images HOOMQHIC F RIN it w v i Vi L We Wil l n e a m n J I AN Where I is the original image and N is a White noise image With multiplicative noise there is no hope of using linear ltering directly since the noise and image spectra are not added I Multiplicative noise is always positive since the sensed image intensities must be I Multiplicative noise often has an exponential PMF in practical applications such as radar laserbased imaging electron microscopy etc I Multiplicative noise appears much worse in bright image regions since it multiplies the gray levels and can be hardly noticeable in dark regions The Homomor hic A I Homomorphic ltering is succinctly expressed by the following diagram noisy logarithmic linear or exponential smoothed Image I point operation I nonlinear Fpoinl operation Igt Image J logtl filter expll K Logarithmic Pomt O V I Theidea is siniilarkticithie logarit mic pomt opErations use in 1stogram improvement de emphasize the dominant bright image pixels More than that Since log a b log a log b we have that log Jij log Iij log Nij for O lt ij lt N l So the point operation converts the problem into that of smoothing J I N Where 1 ij 10g 1i jl N ij 10g Nijl J iaj 10g Ji jl Importantly N is still a White noise image This is just the additive White noise problem studied earlier Filterin I The ltering problem here is very similar to the linear and nonlinear ones studied earlier I Depending on the noise statistics AVEJ B MEDJ B OSAJ B OPEN CLOSU B CLOS OPENU B or other linear or nonlinear lter may be used I The theoretical performance of these various lters in homomorphic systems still remains an open question I Most Will work reasonably well in particular MEDJ B has been Observed to be effective if the noise is eXponential The objective is of course to produce a ltered result Exponential Point Operation f Assuming that the ltering operation succeeds ie F J B I then the nal output image K Will approximate Kij Xp1 ij1ij COSC 43936380 DIGITAL IMAGE PROCESSING Image Filtering II Notes by Prof A C Bovik

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.