Filters Materials from Prof. Klaus Mueller
Think More about Pixels What exactly a pixel is in an image or on the screen? Solid square? This cannot be implemented A dot? Yes, but size matters
Pixel Dots Monitor or printer plots pixel as particular dots with particular size The dot can be looked as an Gaussian distributed splat on screen or paper The Gaussian dots overlap and blend with neighbors Finally, smooth images visualized on screen or papers
Sampling Process
Low Pass Filtering: Fourier Domain In Fourier domain, use a box filter to cut-off the signal in frequency domain Cut-off frequency defines an frequency band Frequency filter: multiplication between box filter and Fourier-transformed original signal
Convolution vs Multiplication Multiplication in Fourier domain can be implemented by convolution in spatial domain Mathematically, convolution multiplication
Low Pass Filtering: Spatial Domain The convolution process
Popular Filters
Spatial Filters Filter Size determines computational cost Filter shape in Fourier domain determines the aliasing prevention quality: box is not good Sinc seems ideal in Fourier domain, but not good in spatial domain Consider both quality and speed: linear is the most popular
Filters For high quality, use cubic Box, linear, cubic, Gaussian filters are all separable in 2D, 3D or higher dimensions
Filter + Sample We can combine sample and filter together
Filter-base Sampling At sample position, use low pass filter Then integrate the filtered results as sample values Usually, Gaussian kernel is used Digital camera integrate the image with Gaussian kernel around each sampling point
Filter-based Reconstruction Place filter at each discrete sampling position Scale the filter by the sample value Integrate scaled filter results to reconstruct continuous function Display devices actually show each sample as a Gaussian shaped spot Blend with neighbors for smooth results
Resampling Scale, rotation and other operations may require sampling on positions off the regular grid Re-sample the continuous signal at positions not included in your origin sampling Need to reconstruct then resample
Enlarge an Image Resample frequency is larger than the original sampling rate When you enlarge an image Why?
Shrink an Image Resample frequency is smaller than the original sampling rate When you shrink an image Why? Thus, aliasing may happen
How to Improve In visualization, blurring is preferable than aliasing Blurring is more friendly to human visual system Thus, we can use low pass filter during reconstruction and perform resampling thereafter
Another Alternative? Smooth after subsampling?
Discussion Anti-aliasing before resampling! Let s study the filter used for reconstruction We assumed perfect box filter in Fourier domain This is practically impossible, since it corresponds to infinite sinc function in spatial domain Then?
Practical Filters In real life, we use non-ideal, but practical filters in spatial domain Box Bilinear, trilinear Gaussian Aliasing cannot be removed totally, but we are only looking for visually acceptable results
Practical Filters In addition, this may introduce aliasing even when enlarge an image
Practical Resampling
How to Implement Back trace from new sampling position to the corresponding position on the original image Integrate in the original image around this position with filter h1,2 This is called interpolation
Interpolation Filters Interpolation with with box filter (nearest neighbor) Interpolation with bilinear filter can give a better quality Interpolation with cubic filter can give great quality, but too costly
Example
Interpolation New sample position falls in between origin samples For interpolation, we need to estimate values at superimposed position to the center of interpolation kernel Multiply these values with kernel
Nearest Neighbor Kernel
Bilinear Kernel
Bilinear Interpolation 2D case:
Trilinear Interpolation General 3D case Can be decomposed into 7 linear interpolations
(B=1,C=0) Cubic Kernel
Discussion Nearest is the fastest with SHARP edges Cubic filter gives smooth results but with slow computation Linear filter is most popular in volume rendering