Hyperspectral Imaging for Food Quality Analysis and Control || Hyperspectral Image Processing Techniques

Download Hyperspectral Imaging for Food Quality Analysis and Control || Hyperspectral Image Processing Techniques

Post on 28-Feb-2017




2 download

Embed Size (px)


<ul><li><p>CHAPTER 4Hyperspectral Imaging for Food Quality Analysis an</p><p>Copyright 2010 Elsevier Inc. All rights of reproductiHyperspectral ImageProcessing TechniquesMichael O. Ngadi, Li LiuDepartment of Bioresource Engineering, McGill University, Macdonald Campus, Quebec, CanadaCONTENTS</p><p>Introduction</p><p>Image Enhancement</p><p>Image Segmentation</p><p>Object Measurement</p><p>Hyperspectral ImagingSoftware</p><p>Conclusions</p><p>Nomenclature</p><p>References4.1. INTRODUCTION</p><p>Hyperspectral imaging is the combination of two mature technologies:</p><p>spectroscopy and imaging. In this technology, an image is acquired over the</p><p>visible and near-infrared (or infrared) wavelengths to specify the complete</p><p>wavelength spectrum of a sample at each point in the imaging plane.</p><p>Hyperspectral images are composed of spectral pixels, corresponding to</p><p>a spectral signature (or spectrum) of the corresponding spatial region. A</p><p>spectral pixel is a pixel that records the entire measured spectrum of the</p><p>imaged spatial point. Here, the measured spectrum is characteristic of</p><p>a samples ability to absorb or scatter the exciting light.</p><p>The big advantage of hyperspectral imaging is the ability to characterize</p><p>the inherent chemical properties of a sample. This is achieved by measuring</p><p>the spectral response of the sample, i.e., the spectral pixels collected from the</p><p>sample. Usually, a hyperspectral image contains thousands of spectral pixels.</p><p>The image files generated are large and multidimensional, which makes</p><p>visual interpretation difficult at best. Many digital image processing tech-</p><p>niques are capable of analyzing multidimensional images. Generally, these</p><p>are adequate and relevant for hyperspectral image processing. In some</p><p>specific applications, the design of image analysis algorithms is required for</p><p>the use of both spectral and image features. In this chapter, classic image</p><p>processing techniques and methods, many of which have been widely used in</p><p>hyperspectral imaging, will be discussed, as well as some basic algorithms</p><p>that are special for hyperspectral image analysis.d Control</p><p>on in any form reserved. 99</p></li><li><p>CHAPTER 4 : Hyperspectral Image Processing Techniques1004.2. IMAGE ENHANCEMENT</p><p>The noise inherent in hyperspectral imaging and the limited capacity of</p><p>hyperspectral imaging instruments make image enhancement necessary for</p><p>many hyperspectral image processing applications. The goal of image</p><p>enhancement is to improve the visibility of certain image features for</p><p>subsequent analysis or for image display. The enhancement process does not</p><p>increase the inherent information content, but simply emphasizes certain</p><p>specified image characteristics. The design of a good image enhancement</p><p>algorithm should consider the specific features of interest in the hyper-</p><p>spectral image and the imaging process itself.</p><p>Image enhancement techniques include contrast and edge enhancement,</p><p>noise filtering, pseudocoloring, sharpening, and magnifying. Normally these</p><p>techniques can be classified into two categories: spatial domain methods and</p><p>transform domain methods. The spatial domain techniques include</p><p>methods operated on a whole image or on a local region. Examples of spatial</p><p>domain methods are the histogram equalization method and the local</p><p>neighborhood operations based on convolution. The transform domain</p><p>techniques manipulate image information in transform domains, such as</p><p>discrete Fourier and wavelet transforms. In the following sub-sections, the</p><p>classic enhancement methods used for hyperspectral images will be</p><p>discussed.4.2.1. Histogram Equalization</p><p>Image histogram gives primarily the global description of the image. The</p><p>histogram of a graylevel image is the relative frequency of occurrence of each</p><p>graylevel in the image. Histogram equalization (Stark &amp; Fitzgerald, 1996), or</p><p>histogram linearization, accomplishes the redistribution of the image gray-</p><p>levels by reassigning the brightness values of pixels based on the image</p><p>histogram. This method has been found to be a powerful method of</p><p>enhancement of low contrast images.</p><p>Mathematically, the histogram of a digital image is a discrete function</p><p>hk nk=n, where k 0,1, ., L 1 and is the kth graylevel, nk is thenumber of pixels in the image having graylevel k, and n is the total number of</p><p>pixels in the image. In the histogram equalization method, each original</p><p>graylevel k is mapped into new graylevel i by:</p><p>i Xkj0</p><p>hj Xkj0</p><p>nj=n (4.1)</p></li><li><p>a b</p><p>c d</p><p>FIGURE 4.1 Image quality enhancement using histogram equalization: (a) spectral</p><p>image of a pork sample; (b) histogram of the image in (a); (c) resulting image obtained</p><p>from image (a) by histogram equalization; (d) histogram of the image in (c). (Full color</p><p>version available on http://www.elsevierdirect.com/companions/9780123747532/)</p><p>Image Enhancement 101where the sum counts the number of pixels in the image with graylevel</p><p>equal to or less than k. Thus, the new graylevel is the cumulative distri-</p><p>bution function of the original graylevels, which is always monotonically</p><p>increasing. The resulting image will have a histogram that is flat in</p><p>a local sense, since the operation of histogram equalization spreads out the</p><p>peaks of the histogram while compressing other parts of the histogram</p><p>(see Figure 4.1).</p><p>http://www.elsevierdirect.com/companions/9780123747532/</p></li><li><p>CHAPTER 4 : Hyperspectral Image Processing Techniques102Histogram equalization is just one example of histogram shaping. Other</p><p>predetermined shapes are also used (Jain, 1989). Any of these histogram-</p><p>based methods need not be performed on an entire image. Enhancing</p><p>a portion of the original image, rather than the entire area, is also useful in</p><p>many applications. This nonlinear operation can significantly increase the</p><p>visibility of local details in the image. However, it is computationally</p><p>intensive and the complexity increases with the size of the local area used in</p><p>the operation.4.2.2. Convolution and Spatial Filtering</p><p>Spatial filtering refers to the convolution (Castleman, 1996) of an image with</p><p>a specific filter mask. The process consists simply of moving the filter mask</p><p>from point to point in an image. At each point, the response of the filter is</p><p>the weighted average of neighboring pixels which fall within the window of</p><p>the mask. In the continuous form, the output image g(x, y) is obtained as the</p><p>convolution of the image f(x, y) with the filter mask w(x, y) as follows:</p><p>gx; y fx; y)wx; y (4.2)</p><p>where the convolution is performed over all values of (x, y) in the defined</p><p>region of the image. In the discrete form, convolution denotes gi,j fi,j ) wi,j, and the spatial filter wi,j takes the form of a weight mask.Table 4.1 shows several commonly used discrete filters.</p><p> Smoothing linear filtering</p><p>A smoothing linear filter, also called a low-pass filter, is symmetric about</p><p>the filter center and has only positive weight values. The response of</p><p>a smoothing linear spatial filter is the weighted average of the pixels con-</p><p>tained in the neighborhood of the filter mask. In image processing,</p><p>smoothing filters are widely used for noise reduction and blurring. Nor-</p><p>mally, blurring is used in pre-processing to remove small details from an</p><p>image before feature/object extraction and to bridge small gaps in lines orTable 4.1 Examples of discrete filter masks for spatial filtering</p><p>Spatial filter Low-pass High-pass Laplacian</p><p>w(i,j)</p><p>19 1 1 11 1 1</p><p>1 1 1 1 1 11 9 11 1 1 11 4 11 </p></li><li><p>Image Enhancement 103curves. Noise reduction can be achieved by blurring with a linear filter or by</p><p>nonlinear filtering such as a median filter.</p><p> Median filtering</p><p>A widely used nonlinear spatial filter is the median filter that replaces the</p><p>value of a pixel by the median of the graylevels in a specified neighborhood of</p><p>that pixel. The median filter is a type of order-statistics filter, because its</p><p>response is based on ranking the pixels contained in the image area covered</p><p>by the filter. This filter is often useful because it can provide excellent noise-</p><p>reduction with considerably fewer blurring edges in the image (Jain, 1989).</p><p>The noise-reducing effect of the median filter depends on two factors: (1) the</p><p>number of noise pixels involved in the median calculation and (2) the spatial</p><p>extent of its neighborhood. Figure 4.2 shows an example of impulse noise</p><p>(also called salt-and-pepper noise) removal using median filtering.</p><p> Derivative filtering</p><p>There is often the need in many applications of image processing to highlight</p><p>fine detail (for example, edges and lines) in an image or to enhance detail that</p><p>has been blurred. Generally, an image can be enhanced by the following</p><p>sharpening operation:</p><p>zx; y fx; y lex; y (4.3)</p><p>where l &gt; 0 and e(x, y) is a high-pass filtered version of the image, which</p><p>usually corresponds to some form of the derivative of an image. One way</p><p>to accomplish the operation is by adding gradient information to the</p><p>image. An example of this is the Sobel filter pair that can be used to</p><p>estimate the gradient in both the x and the y directions. The Laplaciana b</p><p>FIGURE 4.2 Impulse noise removal by median filtering: (a) spectral image of an egg</p><p>sample with salt-and-pepper noise (0.1 variance); (b) filtered image of image (a) as</p><p>smoothed by a 3 3 median filter</p></li><li><p>CHAPTER 4 : Hyperspectral Image Processing Techniques104filter (Jain, 1989) is another commonly used derivative filter, which is</p><p>defined as:</p><p>V2fx; y </p><p>v2</p><p>vx2 v</p><p>2</p><p>vy2</p><p>fx; y (4.4)</p><p>The discrete form of the operation can be implemented as:</p><p>V2fi;j hfi1;j 2fi;j fi1;j</p><p>ihfi;j1 2fi;j fi;j1</p><p>i(4.5)</p><p>The kernel mask used in the discrete Laplacian filtering is shown in</p><p>Table 4.1.</p><p>A Laplacian of Gaussian (LoG) filter is often used to sharpen noisy</p><p>images. The LoG filter first smoothes the image with a Gaussian low-pass</p><p>filtering, followed by the high-pass Laplacian filtering. The LoG filter is</p><p>defined as:</p><p>V2gx; y </p><p>v2</p><p>vx2 v</p><p>2</p><p>vy2</p><p>gsx; y (4.6)</p><p>where:</p><p>gsx; y 1ffiffiffiffiffiffi2p</p><p>ps</p><p>exp</p><p> x</p><p>2 y22s2</p><p>is the Gaussian function with variance s, which determined the size of the</p><p>filter. Using a larger filter will improve the smoothing of noise. Figure 4.3</p><p>shows the result of sharpening an image using a LoG operation.</p><p>Image filtering operations are most commonly done over the entire</p><p>image. However, because image properties may vary throughout the</p><p>image, it is often useful to perform spatial filtering operations in local</p><p>neighborhoods.4.2.3. Fourier Transform</p><p>In many cases smoothing and sharpening techniques in frequency domain</p><p>are more effective than their spatial domain counterparts because noise can</p><p>be more easily separated from the objects in the frequency domain. When</p><p>an image is transformed into the frequency domain, low-frequency</p><p>components describe smooth regions or main structures in the image;</p><p>medium-frequency components correspond to image features; and high-</p><p>frequency components are dominated by edges and other sharp transitions</p><p>such as noise. Hence filters can be designed to sharpen the image while</p></li><li><p>a b</p><p>FIGURE 4.3 Sharpening images using a Laplacian of Gaussian operation: (a) spectral</p><p>image of a pork sample; (b) filtered image of image (a) as sharpened by a LoG operation</p><p>Image Enhancement 105suppressing noise by using the knowledge of the frequency components</p><p>(Beghdadi &amp; Negrate, 1989).</p><p> Low-pass filtering</p><p>Since edge and noise of an image are associated with high-frequency</p><p>components, a low-pass filtering in the Fourier domain can be used to</p><p>suppress noise by attenuating high-frequency components in the Fourier</p><p>transform of a given image. To accomplish this, a 2-D low-pass filter transfer</p><p>function H(u, v) is multiplied by the Fourier transform F(u,v) of the image:</p><p>Zu; v Hu; vFu; v (4.7)</p><p>where Z(u, v) is the Fourier transform of the smoothed image z(x, y) which</p><p>can be obtained by taking the inverse Fourier transform.</p><p>The simplest low-pass filter is called a 2-D ideal low-pass filter that cuts</p><p>off all high-frequency components of the Fourier transform and has the</p><p>transfer function:</p><p>Hu; v (</p><p>1 if Du; v D00 otherwise</p><p>(4.8)</p><p>where D(u, v) is the distance of a point from the origin in the Fourier</p><p>domain and D0 is a specified non-negative value. However, the ideal low-</p><p>pass filter is seldom used in real applications since its rectangular pass-</p><p>band causes ringing artifacts in the spatial domain. Usually, filters with</p></li><li><p>CHAPTER 4 : Hyperspectral Image Processing Techniques106smoother roll-off characteristics are used instead. For example, a 2-D</p><p>Gaussian low-pass filter is often used for this purpose:</p><p>Hu; v eD2u;v=2s2 eD2u;v=2D20 (4.9)</p><p>where s is the spread of the Gaussian curve, D0 s and is the cutofffrequency. The inverse Fourier transform of the Gaussian low-pass filter is</p><p>also Gaussian in the spatial domain. Hence a Gaussian low-pass filter</p><p>provides no ringing artifacts in the smoothed image.</p><p> High-pass filtering</p><p>While an image can be smoothed by a low-pass filter, image sharpening can</p><p>be achieved in the frequency domain by a high-pass filtering process which</p><p>attenuates the low-frequency components without disturbing high-frequency</p><p>information in the Fourier transform. An ideal high-pass filter with cutoff</p><p>frequency D0 is given by:</p><p>Hu; v (</p><p>1 if Du; v D00 otherwise</p><p>(4.10)</p><p>As in the case of the ideal low-pass filter, the same ringing artifacts</p><p>induced by the ideal high-pass filter can be found in the filtered image due to</p><p>the sharp cutoff characteristics of a rectangular window function in the</p><p>frequency domain. Therefore, one can also make use of a filter with smoother</p><p>roll-off characteristics, such as:</p><p>Hu; v 1 eD2u;v=2D20 (4.11)</p><p>which represents a Gaussian high-pass filter with cutoff frequency D0.</p><p>Similar to the Gaussian low-pass filter, a Gaussian high-pass filter has no</p><p>ringing property and produces smoother results. Figure 4.4 shows an</p><p>example of high-pass filtering using the Fourier transform.4.2.4. Wavelet Thresholding</p><p>Human visual perception is known to function on multiple scales. Wavelet</p><p>transform was developed for the analysis of multiscale image structures</p><p>(Knutsson et al., 1983). Rather than traditional transform domain methods</p><p>such as the Fourier transform that only dissect signals into their component</p><p>frequencies, wavelet-based methods also enable the analysis of the compo-</p><p>nent frequencies across different scales. This makes them more suitable for</p><p>such applications as noise reduction and edge detection.</p></li><li><p>a b</p><p>FIGURE 4.4 High-pass filtering using the Fourier transform: (a) spectral image of an</p><p>egg sample; (b) high-pass filtered image of image (a)</p><p>Image Enhancement 107Wavelet thresholding is a widely used wavelet-based technique for image</p><p>enhancement which performs enhancement through the operation on</p><p>wavelet transform coefficients. A nonlinear mapping such as hard-</p><p>thresholding and soft-thresholding functions (Freeman &amp; Adelson, 1991) is</p><p>used to modify wavelet transform coefficients. For example, the soft-</p><p>thresholding function can be defined as:</p><p>qx </p><p>x T if x &gt; Tx T if x &lt; T0 if jxj T</p><p>(4.12)</p><p>Coefficients with small absolute values (below threshold Tor above T)normally correspond to noise and thereby are reduced to a value ne...</p></li></ul>


View more >