Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
LocalNeighborhoodin ImageProcessing
Manyimageprocessingoperations (p (particularly,spatialdomainfiltering)are y p g) reducedtolocalneighborhoodprocessing
LocalNeighborhoodin ImageProcessing
S xy Letbethesetofcoordinatesofa g yp neighborhoodcenteredonanarbitrarypixel (x,y)inanimagef. Neighborhood processing generates a Neighborhoodprocessinggeneratesa correspondingpixelatthesamecoordinates inanoutputimageg,suchthatthevalueof thatthevalueofthatpixelisdeterminedbya specifiedoperationinvolvingthepixelsinthe inputimagewithcoordinatesin input image with coordinates in S xy
4
LocalNeighborhoodin ImageProcessing
LocalNeighborhoodin SpatialDomainImageProcessing
Thespatialdomainprocessescanbe p y g p representedbythefollowingexpression
g ( x, y ) = T ( f ( x, y ) )
wheref(x,y)istheinputimage,g(x,y)isthe f( ,y) p g , ( ,y) outputimageandT isanoperatordefined overalocalneighborhoodofpixelwiththe over a local neighborhood of pixel with the coordinates(x,y)
6
hS xy rk = nk ; k = 0,1,..., L 1 S xy
7
Filtering
Filtering insignalprocessingistheprocessof p g (p g) j g accepting(passing)orrejectingcertain frequencycomponents Lowpass filters preserve low frequencies filterspreservelowfrequencies rejectingthehighones Highpass filterspreservehighfrequencies rejectingthelowones rejecting the low ones
10
Filtering
Lowpass filtersareusedforremovalor reductionofnoise Highpass filtersareused,forexample,for edgedetection edge detection
11
f ( x, y ) f Thelargerisk,thecloseristo ( x, y )
14
15
)
16
19
21
w ( s, t ) g ( x + s, y + t )
whereg(x,y)istheimagetobeprocessed, a=(m1)/2,b=(n1)/2,andw(s,t)formthefilter a=(m1)/2 b=(n1)/2 and w(s t) form the filter kernel
22
23
BorderEffectsin SpatialDomainFiltering
Toprocessimageborders,itisnecessaryto g extendanimageinalldirections,otherwiseit willnotbepossibletobuildlocal neighborhoodsfortheborderpixels neighborhoods for the border pixels Thesimplestwayofsuchanextensioniszero padding.However,thismethodalways h h l createsablackframealongtheimage borders.
24
BorderEffectsin SpatialDomainFiltering
Totakecareofbordereffects,mirroring g shouldbeused.AnN xM image,beforeitis processedbyaspatialdomainfilterwithan n m N + M + n x m kernel should be extended to 2 xm kernel,shouldbeextendedto 2 imageasfollows
f f ( x, y ) = f f f
( ( N 1) ( x N + 1), y ) ; x = N ,..., N + n / 2 1, y = 0,1,..., M 1 f ( x, y ) ; x = 0 1 N 1 y = 1,..., m / 2 0,1,..., 1, 1 ( x, ( N 1) ( y N + 1) ) ; x = 0,1,..., N 1, y = N ,..., N + m / 2 1 1 2 ( x, y ) ; x, y = 1, 2,... ( ( N 1) ( x N + 1), ( N 1) ( y N + 1) ) ; x, y = N , N + 1,... 25
-1st col.
BorderEffectsin SpatialDomainFiltering
0th col. 1st col. -1th row 0th row
M-1 M 1th row Mth row Mirroring for 3x3 local neighborhood window
26
g ( x + s, y + t ) nm
s = a t = b
1 nm 1 nm ... 1 nm ... ... ... ... 1 nm 1 nm ... 1 nm
Thiscorrespondstothefilterkernel(mask)
27