ITK Filters Thresholding Edge Detection Gradients Second Order Derivatives Neighborhood Filters Smoothing Filters Distance Map Image Transforms ITCS 6010:Biomedical Imaging and Visualization 1 ITK Filters: Overview
Thresholding itk::binarythresholdimagefilter ITCS 6010:Biomedical Imaging and Visualization 2 ITK Filters: Overview
Thresholding itk::thresholdimagefilter ITCS 6010:Biomedical Imaging and Visualization 3 ITK Filters: Overview
Canny Edge Detection Performs non-maximum suppression and hysteresis thresholding Supply low and high thresholds and parameters for Gaussian Smoothing (itk:discretegaussianimagefilter) ITCS 6010:Biomedical Imaging and Visualization 4 ITK Filters: Overview
Gradient Filters itk::gradientmagnitudefilter (without smoothing) Uses Central Difference operator. itk::gradientmagnituderecursivegaussianimagefilter smoothing) (with Approximates the convolution with the derivative of Gaussian with IIR filters Separable in each dimension itk::derivativeimagefilter: smoothing. Computes image derivatives without itk::recursivegaussianimagefilter: Computes 0th, first or second partial derivatives with smoothing (can get all second derivatives - Hessian matrix). ITCS 6010:Biomedical Imaging and Visualization 5 ITK Filters: Overview
Neighborhood Filters itk::meanimagefilter (average of a local neighborhood) itk::medianimagefilter (meadian of a local neighborhood) ITCS 6010:Biomedical Imaging and Visualization 6 ITK Filters: Overview
Smoothing Filters Blurring: itk::discretegaussianimagefilter Parameters: variance, max kernel size Also itk::binomialblurimagefilter iterative, approximates a Gaussian with large number of iterations itk::recursivegaussianimagefilter: uses IIR with approximation of convolution with Gaussian and its derivatives ITCS 6010:Biomedical Imaging and Visualization 7 ITK Filters: Overview
Smoothing Filters ITCS 6010:Biomedical Imaging and Visualization 8 ITK Filters: Overview
Nonlinear Image Filtering with Partial Differential Equations Motivation: Preserve boundaries while smoothing noisy parts of image/volume Linear filters (eg., Gaussian blurring) tends to smooth out edges, that complicates segmentation and image analysis tasks Non-linear filters fall under 3 classes: Heuristics - specific rules on pixels to achieve a particular result Statistics - filters designed on statistics, eg., median filter Partial Differential Equations (PDEs) - solutions to PDEs, whose input is some value (from image, for instance) ITCS 6010:Biomedical Imaging and Visualization 9 ITK Filters: Overview
Gaussian Blurring and Heat Equation Gaussian - low pass filter, useful in denoising, as noise has more energy at higher frequencies; Given an image f(x, y) in a domain D R 2, thus f : D R, define the Gaussian and its Fourier Transform as g(x, y) = 1 x2 +y 2 2πσ 2 e 2σ 2, G(u, v) = F{g} = e (x2 +y 2 )σ 2 2 Gaussian has nice properties: smooth, no ringing and can be applied repeatedly with the same filter Relationship to PDEs is through the diffusion equation: f t = 2 f 2 x + 2 f 2 y =.c f where the solution, f(x, y, t) is a sequence of images starting with f(x, y, 0) that evolves with time, t. is the vector of partial derivatives, and c is a conductance term ITCS 6010:Biomedical Imaging and Visualization 10 ITK Filters: Overview
Gaussian Blurring and Heat Equation(contd) f t = 2 f 2 x + 2 f 2 y =.c f An example of an initial value problem, with the initial image f(x, y, 0) = I(x, y) As this PDE is linear and stationary (shift-invariant), in the frequency domain, this is f t = (u2 + v 2 )F where F{ f/ x} = juf, j 2 = 1 This is an ODE, and has the solution F (u, v, t) = e (u2 +v 2 )t F (u, v, 0) ITCS 6010:Biomedical Imaging and Visualization 11 ITK Filters: Overview
Gaussian Blurring and Heat Equation (contd) F (u, v, t) = e (u2 +v 2 )t F (u, v, 0) This becomes a convolution in the spatial domain (Inverse FT) f(x, y, t) = 1 4πt e (x2 +y 2 )/4t f(x, y, 0) Thus, the solution to the diffusion equation is equivalent to convolving the initial conditions (eg., input image) with a Gaussian with σ = (2t). ITCS 6010:Biomedical Imaging and Visualization 12 ITK Filters: Overview
Solving the Heat Equation: Boundary Conditions Preferable to solve the diffusion equation due to boundary conditions (above relationship holds only for proper boundary conditions). By defining boundary conditions appropriate to images, a more useful solution without artifacts can be obtained. For second order PDEs, we use the Von Neumann conditions, by specifying value of derivatives of the solution across the boundary. If n represents a direction orthogonal to the boundary, choose f/ n = 0 for all points on boundaries, i.e. zero flow (diffusion) across the boundaries. ITCS 6010:Biomedical Imaging and Visualization 13 ITK Filters: Overview
Anisotropic Diffusion In image analysis, need to preserve edges (high frequencies) and reduce noise artifiacts (also high frequencies) Filtering with the diffusion equation, we can impact edge smoothing through a variable conductance term: f t =.c f The diffusion equation models the flow of material or energy from areas of high concentration to those of low concentration, controlled by the conductance c(x, y). Idea: Lower the conductance near interesting image features, like edges, to reduce blurring. ITCS 6010:Biomedical Imaging and Visualization 14 ITK Filters: Overview
Anisotropic Diffusion Perona and Malik proposed a non-linear form for c, anisotropic diffusion that depends on f: termed f t =.c( f ) f with c( f ) = e f 2 2K 2 where K is a free parameter that controls the degree to which the gradient of f controls conductance. ITCS 6010:Biomedical Imaging and Visualization 15 ITK Filters: Overview
Anisotropic Diffusion:Examples (Left to Right) (a) Original (b) Image with Gaussian noise, σ = 20 (c) Isotropic diffusion, MSE = 43.8 (d) Anisotropic Diffusion, MSE = 39. ITCS 6010:Biomedical Imaging and Visualization 16 ITK Filters: Overview
Edge Preserving Smoothing: ITK Filters itk::gradientanisotropicdiffusionfilter: n-dimensional version Uses the classic Perona-Malik formulation for scalar-valued images with conductance: C( x) = e ( U(x) K ) 2 More robust method used for estimating gradient magnitude. itk::curvatureanisotropicfilter : Uses a modified curvature diffusion equation, preserves finer details of structures. itk::curvatureflowimagefilter : based on evolving level sets under the control of a diffusion equation, with speed proportional to curvature. Analogous filters for vector images (eg., RGB images) ITCS 6010:Biomedical Imaging and Visualization 17 ITK Filters: Overview