mage Vsualzaton
mage Vsualzaton
mage Representaton & Vsualzaton Basc magng Algorthms Shape Representaton and Analyss outlne
mage Representaton & Vsualzaton Basc magng Algorthms Shape Representaton and Analyss outlne
mage Data Representaton What s an mage? An mage s a well-behaved unform dataset. An mage s a two-dmensonal array, or matrx of pxels, e.g., btmaps, pxmaps, RGB mages A pxel s square-shaped A pxel has a constant value over the entre pxel surface The value s typcally encoded n 8 bts nteger D s ({ p }, {C }, {f },{Φ })
mage Data Representaton Pxel values typcally represent gray levels, colours, heghts, opactes etc Remember dgtzaton mples that a dgtal mage s an approxmaton of a real scene
mage Processng and Vsualzaton mage processng follows the vsualzaton ppelne, e.g., mage contrast enhancement followng the renderng operaton mage processng may also follow every step of the vsualzaton ppelne
mage Representaton & Vsualzaton Basc magng Algorthms Shape Representaton and Analyss outlne
Basc mage Processng mage enhancement operaton s to apply a transfer functon on the pxel lumnance values Transfer functon s usually based on mage hstogram analyss Hgh-slope functon enhance mage contrast Low-slope functon attenuate the contrast.
Basc mage Processng The basc mage processng s the contrast enhancement through applyng a transfer functon Transfer functon The orgnal mage: f(x) = x Lnear normalzaton f(x) = (x l mn ) / ( l max l mn ) Nonlnear transfer
mage Enhancement Lnear Transfer Non-lnear Transfer
Frequences mage Hstograms The hstogram of an mage shows us the dstrbuton of grey levels n the mage Massvely useful n mage processng, especally n segmentaton Grey Levels
Hstogram Equalzaton All lumnance values covers the same number of pxels Hstogram equalzaton method s to compute a transfer functon such as the resulted mage has a near-constant hstogram (sze-1 ) f(x) x 0 h[]
Hstogram Equalzaton Orgnal mage After equalzaton
Nose and mages Nose can be descrbed as rapd varaton of hgh ampltude Or regons where hgh-order dervatves of f have large values Nose s usually the hgh frequency components n the Fourer seres expanson of the nput sgnal
Nose Model We can consder a nosy mage to be modeled as follows: g( x, y) f( x, y) ( x, y) where f(x, y) s the orgnal mage pxel, η(x, y) s the nose term and g(x, y) s the resultng nosy pxel f we can estmate the model the nose n an mage s based on ths wll help us to fgure out how to restore the mage
Nose Model There are many dfferent models for the mage nose term η(x, y): Gaussan Most common model Raylegh Erlang Exponental Unform mpulse Salt and pepper nose Erlang Gaussan Unform Raylegh Exponental mpulse
Flterng to Remove Nose We can use spatal flters of dfferent knds to remove dfferent knds of nose The arthmetc mean flter s a very smple one and s calculated as follows: 1 fˆ( x, y) g( s, t) mn 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 ( s, t) S xy Ths s mplemented as the smple smoothng flter Blurs the mage to remove nose
Smoothng Nose mage After flterng
Fourer Seres For any contnuous functon f(x) wth perod T (or x=[0,t]), the Fourer seres expanson are: T n n T n n n n n n n n n dt w t t f T b dt w t t f T a T n w x w b x w a a f(x) 0 0 1 1 0 ) )cos( ( 2 ) )sn( ( 2 2 ) cos( ) sn( The hgher the order n or the frequency, the smaller the ampltudes a n and b n
Fourer Seres
Fourer Transform When T, w s contnuous, ampltudes are also contnuous. A(w) B( w) F( w) 0 0 f(t) sn(wt)dt f(t) cos(wt)dtb ( A( w), B( w))
Fourer Transform
Dscrete Fourer Transform (DFT) The Dscrete Fourer Transform of f(x, y), for x = 0, 1, 2 M-1 and y = 0,1,2 N-1, denoted by F(u, v), s gven by the equaton: for u = 0, 1, 2 M-1 and v = 0, 1, 2 N-1. 1 0 1 0 ) / / ( 2 ), ( ), ( M x N y N vy M ux e y x f v u F
Dscrete Fourer Transform (DFT) The DFT of a two dmensonal mage can be vsualzed by showng the spectrum of the mages component frequences DFT Scannng electron mcroscope mage of an ntegrated crcut magnfed ~2500 tmes Fourer spectrum of the mage
Convoluton Theorem Frequency flterng s equvalent to the convoluton wth a flter functon g(x) N k k N k g f g f G F x g x f dt t x g t f x g x f 0 ) ( )) ( ) ( ( ) ( ) ( )) ( ) ( (
Frequency Flterng 1. Compute the Fourer transform F(w x,w y ) of f(x,y) 2. Multply F by the transfer functon Φ to obtan a new functon G, e.g., hgh frequency components are removed or attenuated. 3. Compute the nverse Fourer transform G -1 to get the fltered verson of f f F G F Φ f -1 G
Frequency Flterng Frequency flter functon Φ can be classfed nto three dfferent types: 1. Low-pass flter: ncreasngly damp frequences above some maxmum w max 2. Hgh-pass flter: ncreasngly damp frequences below some mnmal w mn 3. Band-pass flter: damp frequences wth some band [w mn,w max ] To remove nose, low-pass flter s used
Smoothng Frequency Doman Flters Smoothng s acheved n the frequency doman by droppng out the hgh frequency components The basc model for flterng s: G(u,v) = H(u,v)F(u,v) where F(u,v) s the Fourer transform of the mage beng fltered and H(u,v) s the flter transform functon Low pass flters only pass the low frequences, drop the hgh ones
Gaussan smoothng The most-used low-pass flter s the Gaussan functon F(e -ax 2 ) π e π 2 ω 2 /a a
Gaussan Lowpass Flters The transfer functon of a Gaussan lowpass flter s defned as H( u, v) e D 2 ( u, v)/2d 2 0
Edge Detecton Orgnal mage Edge Detecton
Edge Detecton Edges are curves that separate mage regons of dfferent lumnance Edges are locatons that have hgh gradent y x y x (x,y), 1,, 1, 2 2 ), ( ), ( ) ( ) (
Edges detecton usng dervatves Edge Detecton
Edge Detecton Operators 1 1, 1, 1 1, 1 1, 1, 1 1, 1 1, 1, 1 1, 1 1, 1, 1 1, 2 1, 1, 2, 1 1, 2 2 ), ( 2 2 ), ( ) ( ) ( ), ( y x R Roberts Operator Sobel Operator: good on nose These are the frst-order dervatve. Fndng edge s to fnd the hgh value through thresholdng segmentaton
Edge Detecton Operators 1, 1, 1, 1,, 2 2 2 2 4 ), ( ), ( y x y x Laplacan-based operator: good on producng thn edge Second-order dervatve. Fndng edge s to fnd the zerocrossng or mnmum.
Edge Detecton Dervatve based edge detectors are extremely senstve to nose
Laplacan Of Gaussan The Laplacan of Gaussan flter uses the Gaussan for nose removal and the Laplacan for edge detecton
mage Representaton & Vsualzaton Basc magng Algorthms Shape Representaton and Analyss outlne
Shape Representaton and Analyss Shape Analyss Ppelne
Shape Representaton and Analyss Flterng hgh-volume, low level datasets nto low volume dataset contanng hgh amounts of nformaton Shape s defned as a compact subset of a gven mage Shape s characterzed by a boundary and an nteror Shape propertes nclude geometry (form, aspect rato, roundness, or squareness) Topology (genus, number) Texture (lumnance, shadng)
Segmentaton Segment or classfy the mage pxels nto those belongng to the shape of nterest, called foreground pxels, and the remander, also called background pxels. Segmentaton results n a bnary mage Segmentaton s related to the operaton of selecton,.e., thresholdng
Segmentaton Fnd soft tssue Fnd hard tssue
Connected Components Fnd non-local propertes Algorthm: start from a gven foreground pxels, fnd all foreground pxels that are drectly or ndrectly neghbored
Morphologcal Operatons Morphologcal mage processng (or morphology) descrbes a range of mage processng technques that deal wth the shape (or morphology) of features n an mage Morphologcal operatons are typcally appled to remove mperfectons ntroduced durng segmentaton, and so typcally operate on b-level mages
Morphologcal Operatons To close holes and remove slands n segmented mages a: orgnal mage b: segmentaton c: close holes d: remove sland
Morphologcal Operatons Dlaton: translate a structurng element (e.g., dsc, square) over each foreground pxel of the segmented mage Dlaton thckens thn foreground regons, and fll holes and close background gaps that have a sze smaller than the structurng element R Eroson: the opposte operaton of dlaton. Eroson s to thn the foreground components, remove sland smaller than the structurng element R
Morphologcal Operatons Orgnal mage Dlaton by 3*3 square structurng element Dlaton by 5*5 square structurng element Orgnal mage Eroson by 3*3 square structurng element Eroson by 5*5 square structurng element
Morphologcal Operatons Compound Operatons More nterestng morphologcal operatons can be performed by performng combnatons of erosons and dlatons Morphologcal closng dlaton followed by an eroson Morphologcal openng eroson followed by a dlaton operaton
Examples Orgnal mage mage After Openng mage After Closng
Dstance Transform
Dstance Transform The dstance transform DT of a bnary mage s a scalar feld that contans, at every pxel of, the mnmal dstance to the boundary Ω of the foreground of DT(p) mnp q Ω q
Dstance Transform Dstance transform can be used for morphologcal operaton Consder a contour lne C(δ) of DT C( ) { p DT( p) } 2 δ = 0 δ > 0 δ < 0
Dstance Transform The contour lnes of DT are also called level sets Shape Level Sets Elevaton plot
Feature Transform Fnd the closest boundary ponts, so called feature ponts Gven a: Feature pont s b Gven p: Feature ponts are q1 and q2
Skeletonzaton
Skeletonzaton: the Goals Geometrc analyss: aspect rato, eccentrcty, curvature and elongaton Topologcal analyss: genus Retreval: fnd the shape matchng a source shape Classfcaton: partton the shape nto classes Matchng: fnd the smlarty between two shapes
Skeletonzaton Skeletons are the medal axes Or skeleton S( Ω) was the set of ponts that are centers of maxmally nscrbed dsks n Ω Or skeletons are the set of ponts stuated at equal dstance from at least two boundary feature ponts of the gven shape S( ) { p q, r, p q p r
Skeletonzaton
Skeleton Computaton Feature Transform Method: Select those ponts whose feature transform contans more than two boundary ponts. Works well on contnuous data Fals on dscreate data
Skeleton Computaton Usng dstance feld sngulartes: Skeleton ponts are local maxma of dstance transform
Summary Basc magng Algorthms mage Enhancement Hstogram Equalzaton Nose and mages Spatal Flterng Fourer Transform Frequency Flterng Edge Detecton Shape Representaton and Analyss Segmentaton Connected Components Morphologcal Operatons Dstance Transform Feature Transform Skeletonzaton