Presentation is loading. Please wait.

Presentation is loading. Please wait.

Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to.

Similar presentations


Presentation on theme: "Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to."— Presentation transcript:

1 Filters– Chapter 6

2 Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to create a single pixel on the output image e.g. It’s known as a “multiply and accumulate” operation

3 Filters Parameters include –The size of the filter –The shape of the filter –The filter coefficients (weights) In the previous example the –The size was 3x3 –The shape was rectangular (square) –The coefficients were 1/9 (factored out for efficiency reasons)

4 Filters In matrix form Coefficients can be real numbers, positive, negative, and/or zero

5 Filters Every filter has a designated origin –The dimensions are typically odd numbers and the origin is the center coefficient –But this doesn’t have to be the case, dependant on what you are trying to accomplish

6 Filter u v 0 0 I u v I’ multiply add

7 Filter The multiply/accumulate operation is formally called convolution The ∞ is not a problem – just assume 0 valued coefficients The filter matrix is called the convolution kernel

8 Convolution Commutative – can swap the roles of the kernel and image Linear – distributive over addition (of images) and multiplication (by a scalar) Associative – order of operations is irrelevant Separable – some 2D kernels can be expressed as 2 1D kernels for implementation efficiency –The Gaussian is the most useful of the separable filters

9 Filter

10 ImageJ filters Process->Filters->Convolve…

11 ImageJ Filters Coefficients can be positive or negative, integer or real Normalize divides coefficients by the sum of the coefficients –It does something if the sum is 0, not sure what Make sure all rows are of the same length (don’t add an extra after the last row Filters can be saved as text files Filters can be read in/displayed as images or surface plots –File->Import->Text Image –Analyze->Surface Plot… for surface plot display –Filters with negative coefficients will be shifted (brightened) for display purposes (original values are retained in the image)

12 ImageJ Filters

13 Filters Can be arbitrary size and shape –Small filters are fast to run but provide only spatially local support Why might this be a problem? –May be dominated by noise –Large filters are slow to run but provide a broader spatial support Why might this be better? –Noise is averaged out over a larger region (statistics of larger samples) Dimensions are typically odd numbers to keep the origin centered Non-rectangular filters (e.g. circular) are embedded in a rectangle

14 Filters Image edges filter Image Border

15 Filters Ignore the edges Only apply the parts of the filter that land on image pixels Reflect the edges –This reduces the introduction of artifacts on the edges but is costly in terms of memory and time

16 Filters Infinitely many filters available, most are of no interest –Those of interest include Smoothing (blurring) –Average – all coefficients the same –Gaussian – coefficients create a Gaussian surface Gradient (difference) –Edge detection –Edge sharpening

17 Non-linear filters Linear filters treat all pixels the same –Smoothing out noise also smoothes out edges Nonlinear filters can avoid this situation –Min filter – replace the target pixel with the smallest value within the kernel neighborhood –Max filter – replace the target pixel with the largest value within the kernel neighborhood –Median filter – replace the target pixel with the central value of the sorted kernel neighborhood pixels (can be weighted) –Specialty filters – edge detectors, corner detectors, etc. (to be discussed later)


Download ppt "Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to."

Similar presentations


Ads by Google