Chapter 6 Image Enhancement Chuan-Yu Chang (張傳育)Ph.D. Dept. of Electronic Engineering National Yunlin University of Science & Technology chuanyu@yuntech.edu.tw Office: ES709 Tel: 05-5342601 Ext. 4337 Image Enhancement The purpose of image enhancement methods is to process and acquired image for better contrast and visibility of features of interest for visual examination and subsequent computer-aided analysis and diagnosis. Different medical imaging modalities provide specific characteristic information about internal organs or biological tissues. Image contrast and visibility of the features of interest depend on the imaging modality and the anatomical regions. There is no unique general theory or method for processing all kinds of medical images for feature enhancement. Specific medical imaging applications present different challenges in image processing for feature enhancement. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 2 Image Enhancement (cont.) Medical images from specific modalities need to be processed using a method that is suitable to enhance the features of interest. Chest X-ray radiographic image X-ray mammogram Required to improve the visibility of hard bony structure. Required to enhance visibility of microcalcification. A single image-enhancement method may not serve both of these applications. Image enhancement tasks and methods are very much application dependent. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 3 Image Enhancement (cont.) Image enhancement tasks are usually characterized in two categories: Spatial domain methods Frequency domain methods Manipulate image pixel values in the spatial domain based on the distribution statistics of the entire image or local regions. Histogram transformation, spatial filtering, region growing, morphological image processing and model-based image estimation… Manipulate information in the frequency domain based on the frequency characteristics of the image. Frequency filtering, homomorphic filtering and wavelet processing methods… Model-based techniques are also used to extract specific features for pattern recognition and classification. Hough transform, matched filtering, neural networks, knowledge-based systems 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 4 Spatial Domain Methods Spatial domain methods process an image with pixel-by pixel transformation based on the histogram statistics or neighbor. Faster than Fourier transform Frequency filtering methods may provide better results in some applications if a priori information about the characteristic frequency components of the noise and features of interest is available. The spike-based degradation in MRI will be remove by Wiener filtering method. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 5 Background Spatial domain The aggregate of pixels composing an image. Operate directly on these pixels Spatial domain process will be denoted by g(x,y)=T[f(x,y)] where f(x,y): input image g(x,y): processed image T: an operator mask filter kernel template windows 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 6 Background (cont.) Transformation Function s=T(r) where T is gray-level transformation function Processing technologies: Point processing Enhancement at any point in an image depends only on the gray level at that point. Mask processing or filtering thresholding Contrast stretching 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 7 Some Basic Gray Level Transforms Some basic Gray Level Transforms s = T(r) r: the gray level value before process s: the gray level value after process 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 8 Some Basic Gray Level Transforms (cont.) Image Negatives Reversing the intensity levels of an image Photographic Negative s = L-1-r Suited for enhancing white or gray detail embedded in dark regions of an image 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 9 Some Basic Gray Level Transforms (cont.) Log Transformations S = c log (1+r) Maps a narrow range of low gray-level values in the input image into a wider range of output levels. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 10 Some Basic Gray Level Transforms (cont.) Power-Law Transformations s=crr s= c (r +e )r Where c and r are positive constants Power-law curves with fractional values of r map a narrow range of dark input values into a wider range of output values, with the opposite being true for higher values of input levels. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 11 Some Basic Gray Level Transforms (cont.) Gamma Correction The process used to correct this power-law response phenomena 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 12 Some Basic Gray Level Transforms (cont.) Example 3.1 MR image of fractured human spine c=1, r=0.6 c=1, r=0.4 c=1, r=0.3 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 13 Some Basic Gray Level Transforms (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 14 Some Basic Gray Level Transforms (cont.) Picewise-Linear Transformation Function Contrast Stretching To increase the dynamic range of the gray levels in the image being processed. Linear function If r1=s1 and r2=s2 Thresholding If r1=r2, s1=0 and s2=L-1 Control points 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 15 Some Basic Gray Level Transforms (cont.) Picewise-Linear Transformation Function Gray-level Slicing Highlighting a specific range of gray levels in an image. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 16 Some Basic Gray Level Transforms (cont.) Bit-plane Slicing Highlighting the contribution made to total image appearance by specific bits. Separating a digital image into its bit planes is useful for analyzing the relative importance played each bit of the image. Determining the adequacy of the number of bits used to quantize each pixel. Image compression. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 17 Some Basic Gray Level Transforms (cont.) An 8-bit fractal image 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 18 Some Basic Gray Level Transforms (cont.) The eight bit planes of the image in Fig. 3.13 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 19 Histogram Processing Histogram h(rk)=nk rk is the k-th gray-level nk is the number of pixels in the image having gray-level k Normalized Histogram p(rk)=nk/n 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 20 Medical Images and Histograms X-ray CT image T2 weighted proton density image 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 21 Histogram Processing (cont.) Histogram Equalization s T (r ) 0 r 1 Assume that the transformation function T(r) satisfies the follows (a) T(r) is a single-valued and monotonically increasing (b) 0<=T(r)<=1 for 0<=r <=1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 22 Histogram Processing (cont.) nk pr (rk ) n k 0,1,2,...,L 1 k sk T (rk ) pr (rj ) j 0 k nj j 0 n k 0,1,2,...,L 1 Histogram equalization automatically determines a transformation function that seeks to produce an output image that has a uniform histogram. The histogram equalization method forces image intensity levels to be redistributed with an equal probability of occurrence. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 23 Histogram Equalization 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 24 Histogram Modification The histogram equalization method can cause saturation in some regions of the image resulting in loss of details and high frequency information that may be necessary for interpretation. If a desired distribution of gray values is known a priori, a histogram modification method is used to apply a transformation that changes the gray values to match the desired distribution. The target distribution can be obtained from a good contrast image that is obtained under similar imaging conditions. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 25 Histogram Modification The conventional scaling method of changing gray values from the range [a,b] to [c,d] can be given by a linear transformation as z new d c z a c ba where z and znew are the original and new gray values of a pixel in the image. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 26 Histogram Modification(cont.) Histogram modification (Specification) To specify the shape of the histogram that we wish the processed image to have. k k nj j 0 j 0 n sk T (rk ) pr (rj ) k vk G ( z k ) p z ( z i ) s k i 0 k 0,1,2,...,L 1 k 0,1,2,...,L 1 z k G 1 T (rk ) G 1 sk k 0,1,2,...,L 1 (6.5) (6.6) (6.7) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 27 Histogram Processing (cont.) 1. 計算原圖的Histogram Equalization 2. 給予特定的Histogram Equalization 形狀,求出轉換函數 G(z) 3. 對每個sk求對應的zk,其 中zk的灰階由0~L-1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 28 Procedure for histogram matching 1. 2. 3. 4. 5. Obtain the histogram of the given image Use E.q.(6.5) to precompute a mapped level sk for each level rk Obtain the transformation function G(z) from the given pz(z) using Eq.(6.6) Precompute zk for each value of sk using the scheme defined in Eq(6.7) Use the value from step (2) and step (4), mapping rk to its corresponding level sk, then map level sk into the final level zk. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 29 Histogram Processing (cont.) Example 3.4 Comparison between histogram equalization and histogram matching 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 30 Histogram Processing (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 31 Histogram Processing (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 32 Image averaging Signal averaging is a well-know method for enhancing signal-to-noise ratio. Sequence images can be averaged for noise reduction, leading to smoothing effects. Image averaging Noisy image g(x,y) g ( x, y) f ( x, y) ( x, y) Averaging K different noisy images 1 g ( x, y ) K (6.8) K g ( x, y ) i 1 i (6.9) The standard deviation at any point in the average image is g ( x, y ) 1 ( x, y) K (6.10) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 33 Enhancement using Arithmetic/Logic Operations (cont.) Example 3.8 Noise reduction by image averaging 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 34 Enhancement using Arithmetic/Logic Operations (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 35 Image Subtraction Image Subtraction If two properly registered images of the same object are obtained with different imaging conditions, a subtraction operation on the acquired image can enhance the information about the changes in imaging conditions. The enhancement of difference between images g ( x, y) f ( x, y) h( x, y) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 36 Image Subtraction (cont.) The value in a difference image can range from a minimum of -255 to a maximum of 255. How to solve this problem? Solution 1: g’(x,y)=[g(x,y)+255]/2 Solution 2: g’(x,y)=g(x,y)-min(g(x,y)) g’’(x,y)=[g’(x,y)*255]/max(g’(x,y)) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 37 Neighborhood Operations The spatial filtering methods using neighborhood operations involve the convolution of the input image with a specific mask to enhance an image. The gray value of each pixel is replaced by the new value, computed according to the mask applied in the neighborhood of the pixel. The neighborhood of a pixel may be defined in any appropriate manner based on a simple connectedness or any other adaptive criterion. f(-1,0) f(0,-1) f(0,0) f(1,0) f(0,1) f(-1,-1) f(-1,0) f(-1,0) f(0,-1) f(0,0) f(0,1) f(0,-1) f(1,0) f(1,1) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 38 Basic of spatial filtering Basic of spatial filtering R w(1,1) f ( x 1, y 1) w(1,0) f ( x 1, y) ... w(0,0) f ( x, y) ... w(1,0) f ( x 1, y) w(1,1) f ( x 1, y 1) If image size M*N, mask size m*n g ( x, y) a b w(s, t ) f ( x s, y t ) s at b where a=(m-1)/2 b=(n-1)/2 Convolving a mask with an image 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 39 Basic of spatial filtering (cont.) R w1 z1 w2 z2 ... wmn zmn mn wi zi i 1 R w1 z1 w2 z2 ... w9 z9 9 wi zi i 1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 40 Smoothing Spatial Filter Smoothing filters are used for blurring and for noise reduction. Smoothing Linear Filter Sometimes are called averaging filter , lowpass filter Box filter A spatial averaging filter in which all coefficients are equal 1 9 R zi 9 i 1 Weighted average Pixels are multiplied at different coefficient g ( x, y ) a b w(s, t ) f ( x s, y t ) s at b a b w(s, t ) s at b 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 41 Smoothing Spatial Filter (cont.) Example 3.9 Image smoothing with masks of various sizes 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 42 Smoothing Spatial Filter (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 43 Order-Statistic Filters Order-Statistic Filters (Nonlinear spatial filters) Based on ordering the pixels contained in the image area encompassed by the filter. And then replacing the value of the center pixel with the value determined by the ranking result. Median filter Particularly effective in the presence of impulse noise (saltpepper noise) Algorithm: Step 1: sort the value of the pixels encompassed by the filter. Step 2: determine their median. Step 3: assign the median to the center pixel. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 44 Order-Statistic Filters Max filter Min filter 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 45 Sharpening Spatial Filters Objectives: To highlight fine detail in an image To enhance detail that has been blurred The derivatives of a digital function are defined in terms of differences First derivative Must be zero in flat segment Must be nonzero at the onset of a gray-level step or ramp Must be nonzero along ramps f f ( x 1) f ( x) x 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 46 Sharpening Spatial Filters Second derivative Must be zero in flat areas Must be nonzero at the onset and the end of gray-level step or ramp. Must be zero along ramps of constant slope 2 f f ( x 1) f ( x) f ( x) f ( x 1) x 2 f ( x 1) f ( x 1) 2 f ( x) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 47 Sharpening Spatial Filters (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 48 Sharpening Spatial Filters (cont.) Summary First-order derivatives generally produce thicker edges in an image. Second-order derivatives have a stronger response to fine detail First-order derivatives generally have a stronger response to a gray-level step Second-order derivatives produce a double response at step changes in gray level. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 49 Use of Second Derivatives for EnhancementThe Laplacian Isotropic filter (rotation invariant) Whose response is independent of the direction of the discontinuities in the image. Laplacian 2 f 2 f f 2 2 x y 2 2 f f ( x 1, y ) f ( x 1, y ) 2 f ( x, y ) x 2 2 f f ( x, y 1) f ( x, y 1) 2 f ( x, y ) 2 y 2 f f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1) 4 f ( x, y ) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 50 Use of Second Derivatives for Enhancement- The Laplacian 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 51 Laplacian: Second Order Gradient for Edge Detection 2 2 f ( x , y ) f ( x, y) 2 f ( x, y) x2 y2 [ f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1) 4 f ( x, y)] -1 -1 -1 -1 8 -1 -1 -1 -1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 52 Image Sharpening with Laplacian -1 -1 -1 -1 9 -1 -1 -1 -1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 53 Use of Second Derivatives for Enhancement- The Laplacian Image enhancement f ( x, y) 2 f ( x, y) g ( x, y) 2 f ( x , y ) f ( x, y ) if the center coefficient is negative if the center coefficient is positive g ( x, y) f ( x, y) f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1) 4 f ( x, y) 5 f ( x, y) f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 54 Use of Second Derivatives for Enhancement- The Laplacian (cont.) Example 3.11 Imaging sharpening with the Laplacian. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 55 Use of Second Derivatives for Enhancement- The Laplacian (cont.) Example 3.12 Image enhancement using a composite Laplacian mask 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 56 Use of Second Derivatives for Enhancement- The Laplacian (cont.) Unsharp masking and high-boost filtering Used in publishing industry Unsharp masking: To sharpen images consist of subtracting a blurred version of an image from the image itself. f s ( x, y) f ( x, y) f ( x, y) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 57 Use of Second Derivatives for Enhancement- The Laplacian (cont.) Example 3.13 Image enhancement with a high-boost filter 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 58 Use of First Derivatives for Enhancement -The Gradient The gradient of f at coordinates (x,y) is defined as the two-dimensional column vector: f G x f fx G y y The magnitude of this vector is given by f m ag(f ) G x2 G 2y 1/ 2 f 2 f 2 x y 1/ 2 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 59 Use of First Derivatives for Enhancement -The Gradient (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 60 Use of First Derivatives for Enhancement -The Gradient Example 3.14 Use of the gradient for edge enhancement. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 61 Image Averaging g ( x, y) 1 p p p p w( x, y) f ( x x, y y) x p y p w ( x , y ) x p y p 1 2 1 2 4 2 1 2 1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 62 Median Filter m edian g (i, j ) f ( x, y) (i, j ) N 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 63 Feature Enhancement Using Adaptive Neighborhood Processing adaptive neighborhood-based image processing technique Using a low-level analysis and knowledge about desired features in designing a contrast enhancement function. The contrast enhancement function is then used to enhance mammographic features while suppressing the noise. An adaptive neighborhood structure is defined as a set of two neighborhoods: inner and outer 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 64 Feature Enhancement Using Adaptive Neighborhood Processing Three types of adaptive neighborhood can be defined: constant ratio: constant difference: maintains the ratio of the inner to outer neighborhood size at 1:3 allows the size of the outer neighborhood to be (c+n) x (c+n) feature adaptive: adapts the arbitrary shape and size of the local features to obtain the Center and Surround regions is defined using the pre-defined similarity and distance criteria. Center : consisting of pixels forming that feature Surround: consisting of pixels forming the background for that feature. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 65 Feature Enhancement Using Adaptive Neighborhood Processing The procedure to obtain the Center and the Surround regions: The inner and outer neighborhoods around a pixel are grow using the constant difference adaptive neighborhood criterion. To define the similarity criterion, gray-level and percentage thresholds are defined. Using these thresholds, the region around each pixel in the image is grown in all directions until the similarity criterion is violated. The region forming all pixels, which have been included in the neighborhood of the centered pixel satisfying the similarity criterion are designated as the Center region. The Surround region is composed of all pixels contiguous to the Center region. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 66 Feature Enhancement Using Adaptive Neighborhood Processing The local contrast C(x,y) fro the centered pixel is then computed as Pc ( x, y) Ps ( x, y) C ( x, y) maxPc ( x, y), Ps ( x, y) The Contrast Enhancement Function (CEF) is used as a function to modify the contrast distribution in the contrast domain of the image. The contrast histogram is analyzed and correlated to the requirements of feature enhancement. Using the CEF, a new contrast value C’(x,y) is computed. The new contrast value C’(x,y) is used to compute a new pixel value for the enhanced image g(x,y) as Ps ( x, y) if Pc ( x, y ) Ps ( x, y) 1 C ( x , y ) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. g ( x, y) Ps ( x, y)(1 C ( x, y )) if Pc ( x, y) Ps ( x, y) g ( x, y) 67 Feature Adaptive Neighborhood Region growing for a feature adaptive neighborhood Image pixel values in a 7x7 neighborhood Xc f ( x, y) ( xc 3) ( xc 3) f ( x, y) ( xc 3) Xc Center Region Surround Region f ( x, y) ( xc 3) Central and Surround regions for the feature adaptive neighborhood 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 68 Micro-calcification Enhancement 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 69 Frequency-Domain Filtering Frequency domain filtering methods process an acquired image in the Fourier domain to emphasize or de-emphasize specified frequency components. The low frequency range components usually represent shapes and blurred structures in the image. The high frequency information belongs to sharp details, edges and noise. A low-pass filter with attenuation to high-frequency components would provide image smoothing and noise removal. A high-pass filter with attenuation to low-frequency extracts edge and sharp details for image enhancement and sharpening effects. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 70 Filtering in the Frequency domain (cont.) 在空間域 g(x,y)=h(x,y)*f(x,y) 在頻率域 H(u,v) is called a filter. The Fourier transform of the output image is G(u,v)=H(u,v)F(u,v) The filtered image is obtained simply by taking the inverse Fourier transform of G(u,v) Filtered Image = F-1[G(u,v)] 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 71 Filtering in the Frequency domain (cont.) Basics of filtering in the frequency domain 1. 2. 3. 4. 5. 6. Multiply the input image by (-1)x+y to center the transform Compute F(u,v), the DFT of the image from (1) Multiply F(u,v) by a filter function H(u,v) Compute the inverse DFT of the result in (3) Obtain the real part of the result in (4) Multiply the result in (5) by (-1)x+y 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 72 Filtering in the Frequency domain (cont.) Basic steps for filtering in the frequency domain 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 73 Frequency-Domain Methods 一張影像g(x,y)可視為是物體f(x,y)經由point spread function (PSF) h(x,y)的摺積(convolution)與額外的雜 訊所組成。 g ( x, y) h( x, y) f ( x, y) n( x, y) 其Fourier transform可表示成 G(u, v) H (u, v) F (u, v) N (u, v) 物體的資訊可有由inverse filtering得到 G (u, v) N (u, v) ˆ F (u, v) H (u, v) H (u, v) 即使知道退化函數 H(u,v)也無法完全復 原無退化影像F(u,v) 。 因為N(u,v)為一個不 知其Fourier Transfor 的隨機函數,或當退 化函數H(u,v)為0或 極小值時, N(u,v)/H(u,v)將嚴重 影響F(u,v)的值 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 74 Low-pass Filtering The ideal low-pass filter suppresses noise and highfrequency information providing a smoothing effect to the image. F u, v H u, v Gu, v An ideal low-pass filter can be designed by assigning a frequency cut-off value w0. The frequency cut-off value can also be expressed as the distance D0 from the origin in the Fourier domain. 1 if Du, v D0 H u, v otherwise 0 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 75 Low-Pass Filtering (cont.) Ideal Low-pass Filter 2 D ideal lowpass filter 從點(u,v)到傅立葉轉換 中心點的距離 1 H (u, v) 0 if D(u, v) D0 (4.3-2) if D(u, v) D0 D(u, v) (u M / 2) (v N / 2) 2 2 (4.3-3) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 76 Low-Pass Filtering (cont.) 截止頻率(cutoff frequency) H(u,v)=1和H(u,v)=0之間的過渡點。 整體功率 M 1 N 1 PT P(u, v) (4.3-4) u 0 v 0 百分比功率 100 P(u, v) / PT u v (4.3-5) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 77 Example:Image power as a function of distance from the origin of the DFT 半徑為5, 15, 30, 80, and 230 功率比為92, 94.6, 96.4, 98, and 99.5 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 78 Example 4.4 Image power as a function of distance from the origin of the DFT (cont.) 存在振鈴現象 (ringing) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 79 Low-Pass Filtering (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 80 Low-Pass Filtering (cont.) 巴特沃斯特低通濾波器(Butterworth low-pass filter) 1 H (u, v) 2n 1 D(u, v) / D0 BLPF沒有銳利不連續的截止頻率 將截止頻率定義在H(u,v)降到最大值的某個比例時。 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 81 Low-Pass Filtering (cont.) 一階的BLPF沒有振鈴也 沒有負值。 二階的BLPF有輕微的振 鈴,有小負值。 高階的BLPF有明顯的振 鈴, 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 82 Chapter 4 Image Enhancement in the Frequency Domain 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 83 Low-Pass Filtering (cont.) 高斯低通濾波器(Gaussian low-pass filter) H (u, v) e D 2 u ,v / 2 2 H (u, v) e D 2 u ,v / 2 D0 2 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 84 Low-Pass Filtering Low-pass filter function H(u,v) The low-pass filtered MR brain image The Fourier transform of the filtered MR brain image The Fourier transform of the original MR brain image 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 85 High Pass Filtering The high-pass filtering is used for image sharpening and extraction of high-frequency information such as edges. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 86 High Pass Filtering (cont.) 理想高通濾波器(Ideal Highpass Filters) 0 H (u, v) 1 if D(u , v) D0 (6.33) 巴特沃斯高通濾波器(Butterworth Highpass Filters) H (u, v) if D(u, v) D0 1 2n 1 D0 / D(u, v) (6.34) 高斯高通濾波器 (Gaussian Highpass Filters) H (u, v) 1 e D2 u ,v / 2 D02 (6.35) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 87 High Pass Filtering (cont.) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 88 High Pass Filtering (cont.) Spatial representations of typical (a) ideal (b) Butterworth, and (c) Gaussian frequency domain highpass filters 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 89 High Pass Filtering (cont.) Result of ideal highpass filtering (a) with D0=15, 30, and 80 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 90 High Pass Filtering (cont.) Result of BHPF order 2 highpass filtering (a) with D0=15, 30, and 80 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 91 High Pass Filtering (cont.) Result of GHPF order 2 highpass filtering (a) with D0=15, 30, and 80 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 92 Inverse Filtering Direct inverse filtering Compute an estimate, Fˆ (u, v),of the transform of the original image simply by dividing the transform of the degraded image, G(u,v), by the degradation function: G (u , v) ˆ F (u , v) H (u , v) G (u , v) H (u , v) F (u , v) N (u , v) G (u, v) N (u, v) Fˆ (u, v) H (u, v) H (u, v) (5.7-1) (5.7-2) 即使已知degradation function,仍然無法完全回復未degraded image,因為N(u,v)是亂數函數 若degradation function為0或很小時,N(u,v)/H(u,v)會支配.Fˆ (u, v) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 93 Inverse Filtering (cont.) One way to get around the zero or small-value problem is to limit the filter frequencies to values near the origin. We know that H(0,0) is equal to the average value of h(x,y) and that this is usually the highest value of H(u,v) in the frequency domain. Thus, by limiting the analysis to frequencies near the origin, we reduce the probability of encountering zero values. In general, direct inverse filtering has poor performance. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 94 Inverse Filtering (cont.) Cutoff H(u,v) a radius of 40 直接 G(u,v)/H(u,v) Cutoff H(u,v) a radius of 70 Cutoff H(u,v) a radius of 85 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 95 Minimum Mean Square Error (Wiener) Filtering Incorporated both the degradation function and statistical characteristics of noise into the restoration process. The objective is to find an estimate f of the uncorrupted image f such that the mean square error between them is 2 minimized. (5.8-1) e 2 E f fˆ * H (u , v) S f (u, v) ˆ G (u , v) F (u, v) 2 S f (u, v) H (u , v) S (u , v) H * (u, v) G (u , v) 2 H (u , v) S (u, v) / S f (u, v) 2 H (u , v) 通常為未知,因此以 K來估計 1 G (u , v) (6.20) 2 H ( u , v ) H ( u , v ) S ( u , v ) / S ( u , v ) f 2 1 H (u , v) (6.21) G (u, v) 2 H (u, v) H (u , v) K 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 96 Example 5.12 Fig. (a) is the full inverse-filtered result shown in Fig. 5.27(a). Fig. (b) is the radially limited inverse filter result of Fig. 5.27(a). Fib. (c) shows the result obtained using Eq(5.8-3) with the degradation function used in Example 5.11. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 97 Example 5.13 From left to right, the blurred image of Fig. 5.26(b) heavily corrupted by additive Gaussian noise of zero mean and variance of 650. The result of direct inverse filtering The result of Wiener filtering. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 98 Constrained Least Squares Filtering The difficulty of the Wiener filter: The power spectra of the undegraded image and noise must be known A constant estimate of the ratio of the power spectra is not always a suitable solution. Constrained Least Squares Filtering Only the mean and variance of the noise are needed. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 99 Constrained Least Squares Filtering We can express Eq(5.5-16) in vector-matrix form, as g Hf η Suppose that g(x,y) is of size M x N, then we can form the first N elements of the vector g by using the image elements in first row of g(x,y), the next N elements from the second row, and so on. The resulting vector will have dimensions MN x 1. these are also the dimensions of f and . The matrix H then has dimensions MN x MN (5.9-1) Its elements are given by the elements of the convolution given in Eq(4.2-30). Central to the method is the issue of the sensitivity of H to noise. To alleviate the noise sensitivity problem is to base optimality of restoration on a measure of smoothness, such as the second derivation of an image. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 100 Constrained Least Squares Filtering (cont.) To find the minimum of a criterion function, C, defined as M 1 N 1 C 2 f ( x, y) 2 (5.9-2) x 0 y 0 subject to the constraint 2 g Hfˆ (5.9-3) where w w w is the Euclidean vector norm, and fˆ is the estimate of the undegraded image. The frequency domain solution to this optimization problem is given by the expression 2 2 T * H (u, v) ˆ F (u, v) G(u, v) 2 2 H (u, v) g P(u, v) (5.9-4) where g is a parameter that must be adjusted so that the constraint inEq(5.9-3) is satisfied. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 101 Constrained Least Squares Filtering (cont.) P(u,v) is the Fourier transform of the function. 0 1 0 p ( x, y ) 1 4 1 0 1 0 (5.9-5) This function is the same as the Laplacian operator. Eq.(5.9-4) reduces to inverse filtering if g is zero. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 102 Constrained Least Squares Filtering (cont.) g were selected manually to yield the best visual results. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 103 Constrained Least Squares Filtering (cont.) It is possible to adjust the parameter g interactively until acceptable results are achieved. If we are interested in optimality, the parameter g must be adjusted so that the constraint in Eq(5.9-3) is satisfied. Define a “residual” vector r as r g Hfˆ Since, from the solution in Eq(5.9-4), fˆ is a function of g, then r also is a function of this parameter. It can be shown that g r r r T (5.9-6) 2 (5.9-7) is a monotonically increasing function of g. What we want to do is adjust gamma so that r η a 2 2 (5.9-8) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 104 Constrained Least Squares Filtering (cont.) Because (g) is monotonic, finding the desired value of g is not difficult. Step 1: specify an initial value of g. Step 2: Compute ||r||2 Step 3: Stop if Eq(5.9-8) satisfied; otherwise return to Step 2 after 2 2 increasing g if r η a 2 2 r η a or decreasing g if Use the new value of g in Eq(5.9-4) to recompute the optimum estimate Fˆ u, v 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 105 Constrained Least Squares Filtering (cont.) In order to use the algorithm, we need the quantities and 2. To compute r ,2 from Eq(5.9-6) that r Ru, v Gu, v H u, vFˆ u, v 2 (5.9-9) From which we obtain r(x,y) by computing the inverse transform of R(u,v). M 1 N 1 r r 2 x, y 2 x 0 y 0 (5.9-10) Consider the variance of the noise over the entire image, which we estimate by the sample-average method: 2 M 1 N 1 1 2 x, y m (5.9-11) MN x 0 y 0 where 1 M 1 N 1 m x, y (5.9-12) MN x 0 y 0 is the sample mean. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 106 Constrained Least Squares Filtering (cont.) With reference to the form of Eq(5.9-10), the double 2 summation in Eq(5.9-11) is equal to This gives us the expression MN 2 m 2 (5.9-13) We can implement an optimum restoration algorithm by having knowledge of only the mean and variance of the noise. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 107 Constrained Least Squares Filtering (cont.) The initial value used for g was 10-5, the correction factor for adjusting g was 10-6, the value for a was 0.25. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 108 Homomorphic filter 一幅影像f(x,y)可表示成照度與反射成分的乘積 f ( x, y) i( x, y)r ( x, y) 但(6.36)無法直接作用在照度和反射的頻率成分上, f ( x, y) ix, y r x, y 若重新定義 g x, y ln f x, y ln ix, y ln r x, y (6.36) 則 (6.38) g ( x, y) ln f x, y ln ix, y ln r x, y Gu, v Fi u, v Fr u, v (6.39) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 109 Homomorphic filter 假設以濾波函數H(u,v)來處理G(u,v) ,則 S u, v H u, v Gu, v H u, v Fi u, v H u, v Fr u, v 在空間域上 sx, y 1S u, v (6.40) 令 1H u, v Fi u, v 1H u, v Fr u, v (6.41) i ' x, y 1H u, v Fi u, v r ' x, y 1H u, v Fr u, v 則(6.41)可表示成 sx, y i ' x, y r ' x, y 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 110 Homomorphic filter (cont.) 因為g(x,y)是由原始影像取對數所形成,所以需藉由反對數 運算產生所要的增強影像 fˆ x, y fˆ x, y e s x , y e i '( x , y ) e r ' ( x , y ) i0 ( x, y )r0 ( x, y ) (6.42) 其中 i0 ( x, y) e i '( x, y ) r0 ( x, y) e r '( x, y ) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 111 Homomorphic filter (cont.) 用於影像增強的同態濾波法 fˆ ( x, y) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 112 Homomorphic filter (cont.) The illumination component of an image generally is characterized by slow spatial variations. The reflectance component tends to vary abruptly The low frequencies of the Fourier transform of the logarithm of an image with illumination and the high frequencies with reflectance. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 113 Homomorphic filter (cont.) The HF requires specification of a filter function H(u,v) that affects the low-and high frequency component of the Fourier transform in different ways. The filter tends to decrease the contribution made by the low frequencies (illumination) and amplify the contribution made by high frequencies (reflectance). The net result is simultaneous dynamic range compression and contrast enhancement. 若rH>1, rL<1 則濾波器將 rH>1 減少照度, 並放大反射 所做的貢獻 rL<1 2 2 H u, v g H g L 1 e c D u ,v / D0 g L 下圖可用修改過的高 斯高通濾波器來近似 抑制低頻(照明),並放大高頻(反射) 增加影像的對比度 醫學影像處理實驗室(Medical Image Processing, Lab.) Chuan-Yu Chang Ph.D. 114 Example: 4.10 In the original image The details inside the shelter are obscured by the glare from the outside walls. Fig. (b) shows the result of processing by homomorphic filtering, with gL=0.5 and gH=2.0. A reduction of dynamic range in the brightness, together with an increase in contrast, brought out the details of objects inside the shelter. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 115 Wavelet Transform Fourier Transform only provides frequency information. Fourier Transform does not provide any information about frequency localization. It does not provide information about when a specific frequency occurred in the signal. Short-Term Fourier Transform Windowed Fourier Transform can provide time-frequency localization limited by the window size. The entire signal is split into small windows and the Fourier Transform is individually computed over each windowed signal. The STFT provide some localization depending on the size of the window, it does not provide complete time-frequency localization. Wavelet Transform is a method for complete time-frequency localization for signal analysis and characterization. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 116 Wavelet Transform The wavelet transform provides a series expansion of a signal using a set of orthonormal basis function that are generated by scaling and translation of the mother wavelet y(t), and the scaling function (t). The wavelet transform decomposes the signal as a linear combination of weighted basis functions to provide frequency localization with respect to the sampling parameter such as time or space. The multi-resolution approach (MRA) of the wavelet transform establishes a basic framework of the localization and representation of different frequencies at different scales. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 117 Wavelet Transform In MRA Scaling function is used to create a series of approximations of a function or image, each differing by a factor of a from its nearest neighboring approximations. Wavelets are then used to encode the difference in information between adjacent approximating. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 118 Wavelet Transform.. Wavelet Transform : Works like a microscope focusing on finer time resolution as the scale becomes small to see how the impulse gets better localized at higher frequency permitting a local characterization Provides Orthonormal bases while STFT does not. Provides a multi-resolution signal analysis approach. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 119 Wavelet Transform… Using scales and shifts of a prototype wavelet, a linear expansion of a signal is obtained. Lower frequencies, where the bandwidth is narrow (corresponding to a longer basis function) are sampled with a large time step. Higher frequencies corresponding to a short basis function are sampled with a smaller time step. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 120 Wavelet Transform… scaling parameter A scaling function (t) in time t can be defined as j , k (t ) 2 j / 2 (2 j t k ) (6.44) translation parameter k決定j,k(t)沿x軸的位置,j決定j,k(t)的寬度(沿x軸的寬度) The scaling and translation generates a family of functions using the following dilation equations (refinement equation) 透過此式可產生函數家族;任何 (t ) 2 hn (2t n) 子空間的展開函式,可由它們自 (6.45) nZ 己解析度加倍的複製版本建構出來。 where hn is a set of filter (low-pass filter) coefficient. To induce a multi-resolution analysis of L2(R), where R is the space of all real numbers, it is required to have a nested chain of closed suspaces defined as 2 (6.46) V1 V0 V1 V2 L 以較低尺度函數所延展之子空間被逐層包含於以較高尺度函數所延展之子空間。 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 121 Wavelet Transform… 以較低尺度之scaling function所延展之子空間 被逐層包含於以較高scaling function所延展之子空間 所有V0的展開函數都是V1的一部分 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 122 Wavelet Transform… Define a function y(t) as the “mother wavelet” y j , k (t ) 2 j / 2y (2 j t k ) The wavelet basis induces an orthogonal decomposition of L2(R) Wj is a subspace spanned by y(2jt-k) W1 W0 W1 W2 L2 (6.47) (6.48) y(t) can be expressed as a weighted sum of the shifted y(2t) as y (t ) 2 gny (2t n) (6.49) n where gn is a set of filter (high-pass filter) coefficients. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 123 Wavelet Transform… The wavelet-spanned subspace is such that it satisfies the relation Vm1 Vm Wm Since the wavelet functions span the orthogonal complement spaces, the orthogonality requires the scaling and wavelet filter coefficients to be related through the following gn (1) h1 n n (6.50) (6.51) Let x[n] be an arbitrary square summable sequence representing a signal in the time domain such that x[n] l2 (Z ) (6.52) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 124 Wavelet Transform… The series expression of a discrete signal x[n] using a set of orthonomal basis function jk[n]is given by x[n] jk (l ), x(l ) jk [n] X [k ]jk [n] k Z (6.53) k Z where X[k] = <jk (l),x(l)>=Sj*k (l)x[l]為展開函數 where X[k] is the transform of x[n] All basis function must satisfy the orthonormality condition 0 k l 1 k l j k (n), j l (n) [k 1] with (6.54) || x ||2 || X ||2 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 125 Wavelet Transform… The series expansion is considered to be complete if every signal from l2(Z) can be expressed using the expression in Eq.(6.35) Using a set of bio-orthogonal basis function, the series expansion of the signal x[n] can be expressed as ~ x[n] j k (l ), x(l ) j~k [n] X [k ]j~k [n] where and k Z k Z k Z k Z j~k (l ), x(l ) j k [n] X [k ]j k [n] 訊號x[n]可由一組 bi-orthogonal basis functions 所組成。 ~ X [k ] jk (l ), x(l ) and X [k ] j~k (l ), x(l ) 0 k l ~ j k [n], j l [n] [k 1] 1 k l (6.55) 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 126 Wavelet Transform… is a filter most commonly used to implement a filter bank that splits an input signal into two bands. Using a quadrature-mirror filter theory, the orthonormal bases jk(n) can be expressed as low-pass and highpass filters for decomposition and reconstruction of a signal. It can be shown that a discrete signal x[n] can be decomposed into X[k] as x[n] jk (l ), x(l ) jk [n] X [k ]jk [n] k Z where and k Z j2k [n] h0[2k n] g0[n 2k ] j2k 1[n] h1[2k n] g1[n 2k ] X [2k ] h0 [2k l ], x[l ] X [2k 1] h1[2k l ], x[l ] Lowpass filter (6.56) Highpass filter h0和h1用來分解訊號 g0和g1用來重建訊號 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 127 Wavelet Transform… A perfect reconstruction of the signal can be obtained if the orthonomal bases are used in decomposition and reconstruction stages as Wavelet function x[n] X [2k ]j2 k [n] X [2k 1]j2 k 1[n] k Z k Z (high-pass function) (6.57) X [2k ]g0 [n 2k ] X [2k 1]gt [n 2k ] Scaling function k Z k Z (low-pass filter) The scaling function provides low-pass filter coefficients and the wavelet function provides the high-pass filter coefficients. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 128 Wavelet Transform… A multi-resolution signal representation can be constructed based on the differences of information available at two successive resolutions 2j and 2j-1. Decomposing a signal using the wavelet transform The signal is filtered using the scaling function (low-pass filter) Sub-sampling the filtered signal (scale information) Filtering the signal with the wavelet (high-pass filter) and subsampling by a factor of two. (detail signal) The difference of information between resolution 2j and 2j-1 is called “detail” signal at resolution 2j . 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 129 Wavelet Transform… x[n] H1 X(1)[2k+1] 2 Detail signal X(1)[2k] H0 H1 2 Decomposition 2 Scale information X(2)[2k+1] X(2)[2k] H0 H1 2 2 H0 2 X(3)[2k+1] X(3)[2k] (a) X(1)[2k+1] X(2)[2k+1] X(3)[2k+1] 2 G1 X(3)[2k] 2 G0 + 2 G1 2 G0 + 2 G1 2 G0 + Reconstruction (b) Figure 6.19. (a) A multi-resolution signal decomposition using Wavelet transform and (b) the reconstruction of the signal from Wavelet transform coefficients. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 130 Wavelet Transform… The signal decomposition at the jth stage can thus be generalized as J x[n] j 1 ( j) j ( j) j X [ 2 k 1 ] g [ n 2 k ] X [ 2 k ] g [ n 2 k] 1 0 ( j) k Z ( j) k Z X ( j ) [2k ] h0 [2 j k l ], x[l ] ( j) (6.58) X ( j ) [2k 1] h1 [2 j k l ], x[l ] ( j) To decompose an image, the above method for 1D signals is applied first along the rows of the image, and then along the columns. The image at resolution 2j+1, represented by Aj+1, is first low-pass and high-pass filtered along the rows. The result of each filtering process is subsampled. Next the subsampled results are low-pass and high-pass filtered along each column. The results of these filtering processes are again subsampled. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 131 Wavelet Transform… H H H 1 2 H H H H 0 2 H Horizontal 1 2 0 1 0 2 2 2 High-Low Dj2 Low-High Dj1 Low-Low Aj Subsampling Vertical High-High Dj3 Subsampling Figure 6.20. Multiresolution decomposition of an image using the Wavelet transform. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 132 Wavelet Transform… This scheme can be iteratively applied to an image to further decompose the signal into narrower frequency bands. Each frequency band can be further decomposed into four narrower bands. Each level of decomposition reduces the resolution by a factor of two, the length of the filter limits the number of levels of decomposition. Daubechies (1992) proposed the least asymmetric wavelets Computed for different support widths as larger support widths provide more regular wavelets. See Figure 6.21 and Table 6.1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 133 Wavelet and Scaling Functions 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 134 Wavelet Transform… Table 6.1 Coefficients for the Corresponding Low-pass and High-Pass Filter for the Least Asymmetric Wavelet N High-Pass Low-Pass 0 -0.107148901418 0.045570345896 1 -0.041910965125 0.017824701442 2 0.703739068656 -0.140317624179 3 1.136658243408 - 0.421234534204 4 0.421234534204 1.136658243408 5 -0.140317624179 - 0.703739068656 6 -0.017824701442 -0.041910965125 7 0.045570345896 0.107148901418 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 135 Wavelet Decomposition Space V0 data W1 V1 V2 V3 W2 W3 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 136 Image Smoothing and Sharpening Using the Wavelet Transform The wavelet transform provides a set of coefficients representing the localized information in a number of frequency bands. For denoising and smoothing is to threshold these coefficients in those bands that have a high probability of noise and then reconstruct the image using the reconstruction filters (Eq.6.57). The reconstruction process integrates information from specific bands with successive upscaling of resolution to provide the final reconstructed image at the same resolution as of the input image. If certain coefficients related to the noise or noise-like information are not included in the reconstruction process, the reconstructed image shows a reduction of noise and smoothing effects. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 137 Image Decomposition sub-sa mple sub- sample H-L H Image H- H H L X H L-H L L-L L horizontally Level 0 ve rtically Level 1 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 138 Image Processing and Enhancemenet MR影像的三 階小波分解 排除high-high band所重建的 MR影像 僅由high-high band所重建的 MR影像 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 139 It is difficult to discriminate image features from the noise based on the spatial distribution of gray values. A useful distinction between the noise and image features may be made, if some knowledge about the processed image features and their behavior is known a prior. The need for some partial image analysis that must be performed before the image enhancement operations are performed. 醫學影像處理實驗室(Medical Image Processing Lab.) Chuan-Yu Chang Ph.D. 140