Principles of 2D Image Analysis Part 2 Notes prepared by Dr. Bartek Rajwa, Prof. John Turek & Prof. J. Paul Robinson These slides are intended for use in a lecture series. Copies of the graphics are distributed and students encouraged to take their notes on these graphics. The intent is to have the student NOT try to reproduce the figures, but to LISTEN and UNDERSTAND the material. All material copyright J. Paul Robinson unless otherwise stated, however, the material may be freely used for lectures, tutorials and workshops. It may not be used for any commercial purpose. It is illegal to upload this lecture to CourseHero or any other site. www.cyto.purdue.edu UPDATED Feb 2016 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Image Processing in the Spatial Domain • Arithmetic and logic operations • Basic gray level transformations on histograms • Spatial filtering • Overview of analytical techniques 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Modifying image contrast and brightness • The easiest and most frequent method is histogram manipulation • An 8 bit gray scale image will display 28 =256 different brightness levels ranging from 0 (black) to 255 (white) (210=1024, 212=4096). An image that has pixel values throughout the entire range has a large dynamic range, and may or may not display the appropriate contrast for the features of interest. 16 bit would be 216 (or 65,536) • (Non-linear enhancements - e.g. Equalization see later) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Histogram Sliding • It is not uncommon for the histogram to display most of the pixel values clustered to one side of the histogram or distributed around a narrow range in the middle. This is where the power of digital imaging to modify contrast exceeds the capabilities of traditional photographic optical methods. • Images that are overly dark or bright may be modified by histogram sliding. •In this procedure, a constant brightness is added or subtracted from all of the pixels in the image or just to a pixel falling within a certain gray scale level ( i.e. 64 to 19:17 128). © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Histogram Operations 0.8 2e+5 0.6 1e+5 0.4 5e+4 0.2 0.0 0 0 50 100 150 Intensity 200 250 3e+5 1.2 3e+5 1.0 2e+5 0.8 2e+5 0.6 1e+5 0.4 5e+4 0.2 0.0 0 0 50 100 150 Intensity © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University 200 250 1.4 3e+5 1.2 3e+5 1.0 2e+5 0.8 2e+5 0.6 1e+5 0.4 5e+4 0.2 0.0 0 0 50 100 150 Intensity 200 250 Number of pixels (cumulative) 2e+5 1.0 1.4 Relative frequency Relative frequency 3e+5 1.2 Sliding Number of pixels (cumulative) 3e+5 1.4 Relative frequency 1.6 Number of pixels (cumulative) Sliding Histogram Stretching • A somewhat similar operation is histogram stretching in which all or a range of pixel values in the image are multiplied or divided by a constant value. The result of this operation is to have the pixels occupy a greater portion of the dynamic range between 0 and 255 and thereby increase or decrease image contrast. • It is important to emphasize that these operations do not improve the resolution in the image, but may have the appearance of enhanced resolution due to improved image contrast. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Histogram operations 1.0 2e+5 0.8 2e+5 0.6 1e+5 0.4 5e+4 0.2 0.0 0 0 50 100 150 Intensity 200 250 1.4 3e+5 1.2 2e+5 1.0 0.8 2e+5 0.6 1e+5 0.4 5e+4 0.2 0.0 0 0 50 100 150 Intensity © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University 200 250 Relative frequency 3e+5 3e+5 Number of pixels (cumulative) 1.2 1.6 Relative frequency 3e+5 Number of pixels (cumulative) Relative frequency 1.4 1.4 3e+5 1.2 3e+5 1.0 2e+5 0.8 2e+5 0.6 1e+5 0.4 5e+4 0.2 0.0 0 0 50 100 150 Intensity 200 250 Number of pixels (cumulative) Stretching Stretching Color images (RGB) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Actin - Rhodamine-phalloidin Antibody to T.cruzi - FITC DNA - Dapi © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Imaged using an MRC 1000 Confocal Microscope, 40 x 1.3 NA Fluor (Image prepared 1994) Actin - Rhodamine-phalloidin Antibody to T.cruzi - FITC DNA - Dapi © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Imaged using an MRC 1000 Confocal Microscope, 40 x 1.3 NA Fluor (Image prepared 1994) Imaged using an MRC 1000 © 1997-2016 J. Turek, B. Rajwa & Actin - Rhodamine-phalloidin Confocal Microscope, 40 x 1.3 NA Fluor Antibody to T.cruzi - FITC DNA - Dapi J. Paul Robinson, Purdue University Actin - Rhodamine-phalloidin Antibody to T.cruzi - FITC DNA - Dapi © 1994-2016 J. Paul Robinson Purdue University Cytometry Laboratories Imaged using an MRC 1000 Confocal Microscope, 40 x 1.3 NA Fluor (Image prepared 1994) Slide 12 t:/powerpnt/course/BMS524/BMS524-Lecture-10-sample prep-1.ppt Actin - Rhodamine-phalloidin Antibody to T.cruzi - FITC DNA - Dapi © 1994-2016 J. Paul Robinson Purdue University Cytometry Laboratories Imaged using an MRC 1000 Confocal Microscope, 40 x 1.3 NA Fluor (Image prepared 1994) Slide 13 t:/powerpnt/course/BMS524/BMS524-Lecture-10-sample prep-1.ppt © 1994-2016 Actin - Rhodamine-phalloidin Antibody to T.cruzi - FITC DNA - Dapi J. Paul Robinson Purdue University Cytometry Laboratories Imaged using an MRC 1000 Confocal Microscope, 40 x 1.3 NA Fluor Slide 14 t:/powerpnt/course/BMS524/BMS524-Lecture-10-sample prep-1.ppt Sensitivity of the Human Eye to Light of Different Wavelengths 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Color models RGB red green blue HSI hue saturation lightness 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University (intensity) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University • Hue is a color attribute associated with the dominant wavelength in a mixture of wavelengths (“red”, “green”, “yellow”) • Saturation refers to the relative purity, or the amount of white light mixed with a hue. • Intensity refers to the relative lightness or darkness of a color. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University intensity Color (HSL, HSV, HIS) hue 0° 19:17 Image thresholding based on RGB or HSI © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Look Up Tables (LUT) • A look up table (LUT) is an operation that uses a mathematical calculation to change the display of any pixel in an image • This usually is the basis for both the visualization (the main purpose) but also the saved image • LUTs are integer operations and can significantly improve output performance and standardize the image display manipulation • LUTs allow you to assign colors that relate to your own imaging situation 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Gamma • The gamma of a histogram curve is the slope, expressed as a ratio of the logs of the output to input values. A gamma value of 1.0 equals an output:input ratio of 1:1 and no correction is applied. In some programs, a gamma function applies a lookup table function (LUT) to compensate or correct for the bias which may be built into the video source. • A camera's light response is often set to a power function (Gamma function) to mimic the photometric response of the human eye. This may result in a non-linear response from the video source and cause errors if you are making densitometric measurements. The camera bias can be removed by applying an inverse gamma function. • This function calculates a lookup table to correct for the bias based on operator provided parameters. The gamma function for decalibrating the camera can be obtained from the camera manufacturer. © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University 1.0 The straight line at the 45 degree angle in the output lookup table indicates that no processing has been performed on the pixels - gamma = 1.0 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University In this image a gamma factor of 1.8 has been applied to the histogram of the output LUT histogram © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University In this image a gamma factor of 2.2 has been applied to the histogram of the output LUT histogram © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Inverse function applied to previous image © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Arbitrary adjustment to the output LUT histogram © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Image Processing .... is the procedure of feature enhancement prior to image analysis. Image processing is performed on pixels (smallest unit of digital image data). The various algorithms used in image processing and morphological analysis perform their operations on groups of pixels (3 X 3, 5 X 5, etc.) called kernels. These image processing kernels may also be used as structuring elements for the various image morphological analysis operations. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Basics of Spatial Filtering • The process of spatial filtering consists of moving the filter mask from point to point in an image • At each point the response of the filter at that point is calculated using a predefined relationship 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University A B C The above figure represents a series of 3 pixel x 3 pixel kernels. Many image processing procedures will perform operations on the central (black) pixel by using use information from neighboring pixels. In kernel A, information from all the neighbors is applied to the central pixel. In kernel B, only the strong neighbors, those pixels vertically or horizontally adjacent, are used. In kernel C, only the weak neighbors, or those diagonally adjacent are used in the processing. It is various permutations of these kernel operations that form the basis for digital image processing. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Low-pass filter • A spatial low-pass filter has the effect of passing, or leaving untouched, the low spatial frequency components of the image. • High frequency components are attenuated and are virtually absent in the output image 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 High-Pass Filter • The high pass filter has the opposite effect of the low-pass filter. • It accentuates high frequency spatial components while leaving low frequency components untouched 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University -1 -1 -1 -1 9 -1 -1 -1 -1 Edge Detection and Enhancement • Image edge enhancement reduces an image to show only its edges. • Edge enhancements are based on the pixel brightness slope occurring within a group of pixel 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Laplacian Edge Enhancement • Laplacian is an omnidirectional operator that highlights all edges in a image regardless of their orientation. • Laplacian is based on the second-order derivative of the image: f f ( x 1) f ( x ) x 2 2 f f 2 f 2 2 x y 2 f f ( x 1) f ( x 1) 2 f ( x ) 2 x 2 f [ f ( x 1), y ) f ( x 1, y ) f ( x , y 1) f ( x , y 1)] 4 f ( x , y ) • Useful for finding directional organelles, structural components, ETC 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Laplacian (cont.) 0 1 0 0 -1 0 1 1 1 1 -4 1 -1 4 -1 1 -8 1 0 1 0 0 -1 0 1 1 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Sobel Edge Enhancement -1 0 1 -1 -2 -1 -2 0 2 -0 0 0 -1 0 1 1 2 1 • The Sobel filter extracts all of the edges in an image, regardless of direction • It is implemented as the sum of two directional edge enhancement operators 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Unsharp Masking • The unsharp masking enhancement operation sharpens an image by subtracting a brightness-scaled, low-pass-filtered image from its original. • A further generalization of unsharp masking is called high-boost filtering: f hb A f ( x , y ) f ( x , y ) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Shape analysis • Shape measurements are physical dimensional measures that characterize the appearance of an object. • The goal is to use the fewest necessary measures to characterize an object adequately so that it may be unambiguously classified. • The shape may not be entirely reconstructable from the descriptors, but the descriptors for different shapes should be different enough that the shapes can be discriminated. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Area original image net area filled area convex area • The area is the number of pixels in a shape. • The convex area of an object is the area of the convex hull that encloses the object. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Perimeter perimeter external perimeter convex perimeter • The perimeter [length] is the number of pixels in the boundary of the object. • The convex perimeter of an object is the perimeter of the convex hull that encloses the object. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Major and minor axes • The major axis is the (x,y) endpoints of the longest line that can be drawn through the object. The major axis endpoints (x1,y1) and (x2,y2) are by computing the pixel distance between every combination of border pixels in the object boundary and finding the pair with the maximum length. • The minor axis is the (x,y) endpoints of the longest line that can be drawn through the object whilst remaining perpendicular with the major-axis. The minor axis endpoints (x1,y1) and (x2,y2) are found by computing the pixel distance between the two border pixel endpoints. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Aspect ratio • • • The major-axis length of an object is the pixel distance between the majoraxis endpoints. The minor-axis length of an object is the pixel distance between the minoraxis endpoints The aspect ratio measures the ratio of the objects height to its width: height aspect ratio width 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Compactness (formfactor) • Compactness is defined as the ratio of the area of an object to the area of a circle with the same perimeter: 4 area compactnes s perimeter 2 • A circle is used as it is the object with the most compact shape: the measure takes a maximum value of 1 for a circle 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Compactness (cont.) 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Circularity or roundness • A measure of roundness or circularity (area-toperimeter ratio) which excludes local irregularities can be obtained as the ratio of the area of an object to the area of a circle with the same convex perimeter: 4 area roundness 2 perimeter convex • Roundness equals 1 for a circular object and less than 1 for an object that departs from circularity, except that it is relatively insensitive to irregular boundaries. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Roundness (cont.) 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Convexity • Convexity is the relative amount that an object differs from a convex object. A measure of convexity can be obtained by forming the ratio of the perimeter of an object’s convex hull to the perimeter of the object itself: convexity perimeter convex perimeter external • This will take the value of 1 for a convex object, and will be less than 1 if the object is not convex, such as one having an irregular boundary. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Convexity (cont.) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Solidity • Solidity measures the density of an object. A measure of solidity can be obtained as the ratio of the area of an object to the area of a convex hull of the object: area net solidity area convex • A value of 1 signifies a solid object, and a value less than 1 will signify an object having an irregular boundary (or containing holes). 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Solidity (cont.) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Moments of shape • The evaluation of moments represents a systematic method of shape analysis. • The most commonly used region attributes are calculated from the three low-order moments. • Knowledge of the low-order moments allows the calculation of the central moments, normalized central moments, and moment invariants. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Centroid • The first-order moments in x (m10) and y (m01) normalized by the area can be used to specify the location of the centre of gravity, or centroid of an object. • Centroid It has two components, denoting the row and column positions of the point of balance of the object: m10 m 01 centroid (x , y) , m 00 m 00 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Moments of shape L. monocytogenes ATCC19113 L. innocua F4248 L. ivanovii ATCC19119 L. seeligeri LA 15 L. welshimeri ATCC35897 L. grayi LM37 L. welshimeri ATCC35897 L. innocua V58 L. ivanovi ATCC19119 L. ivanovi SE98 L. monocytogenes ATCC19113 L. monocytogenes V7 Graphical representation of radial Zernike polynomials Zn,m in 2D (image size 128 x 128 pixels), and their magnitudes: A – real part Z10,6; B – imaginary part Z10,6; C – magnitude Z10,6; D – real part Z13,5; E – imaginary part Z13,5; F – magnitude Z13,5. The larger the n-|m| difference, the more oscillations are present in the shape. Features used in this study are the magnitudes of Zernike polynomials. One may note that the values of the magnitudes do not change when arbitrary rotations are applied. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Reference: Bayraktar, B et al, J. Biomed. Opt. 11:34006, 2006 Extension Extension is a measure of how much the shape differs from the circle. It takes value of zero if the shape is circular and increases without limit as the shape become less compact E log 2 1 c ln 1 ln 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Dispersion • Dispersion is the minimum extension that can be attained by compressing the shape uniformly. There is a unique axis, the long axis of the shape, along which the shape must be compressed in order to minimize its extension. • Dispersion is invariant to stretching, compressing or shearing the shape in any direction D log 2 1 1 1 2 c ln 1 2 ln 1 2 2 2 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Elongation • Elongation is the measure how much the shape must be compressed along its long axis in order to minimize the extension • Elongation never take a value of less than zero or greater than extension L log 2 1 1 1 1 1 c ln ln 2 2 2 2 2 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Cell shape No 1 2 3 4 5 6 7 8 9 10 11 12 Extension 0.1197 0.3998 0.7575 0.8725 0.0920 0.3784 0.7411 0.8591 0.0816 0.3617 0.7243 0.8350 Dispersion 0.0542 0.0524 0.0550 0.1740 0.0262 0.0277 0.0313 0.1434 0.0138 0.0160 0.0199 0.1029 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Elongation 0.0655 0.3474 0.7025 0.6985 0.0659 0.3506 0.7099 0.7157 0.0679 0.3457 0.7044 0.7321 Fiber length perimeter perimeter 2 16 area thread length 4 • This gives an estimate as to the true length of a threadlike object. • Note that this is an estimate only. The estimate is fairly accurate on threadlike objects with a formfactor that is less than 0.25 and gets worse as the formfactor increases. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Fiber width perimeter - perimeter 2 16 area thread width 4 • This gives an estimate as to the true width of a threadlike object. • Note that this is an estimate only. The estimate is fairly accurate on threadlike objects with a formfactor that is less than 0.25 and gets worse as the formfactor increases. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Average fiber length Picture size = 3.56 in x 3.56 in Skeletonization Total length = 29.05 in Number of end-points = 14 • The number of skeleton end-points estimates the number of fibers (half the number of ends) • Average length: average fiber length total length 0.5 number of end points 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Length=4.15 in Euclidean distance mapping • Euclidean Distance Map (EDM) converts a binary image to a grey scale image in which pixel value gives the straightline distance from each originally black pixel within the features to the nearest background (white) pixel. • EDM image can be thresholded to produce erosion, which is both more isotropic and faster than iterative neighbor-based morphological erosion. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Watershed • The limitation of the watershed approach is that it applies only to features that are slightly overlapped, and which have fundamentally convex shape. • The local maxima in the distance map are the values of inscribed radii of circles that subdivide the image into features. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Distance… (cont.) 50 Relative frequency 40 30 20 10 0 0 40 80 120 160 Distance [A.U.] © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University 200 240 Thresholding • Image thresholding is a segmentation technique which classifies pixels into two categories: – Those to which some property measured from the image falls below a threshold, – and those at which the property equals or exceeds a threshold. • Thesholding creates a binary image (binarisation). 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Texture segmentation • Texture is a feature used to partition images into regions of interest and to classify those regions. • Texture provides information about the spatial arrangement of colors or intensities in an image. • Texture is characterized by the spatial distribution of intensity levels in a neighborhood. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Texture segmentation – an example thresholding Texture filters range variance 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Haralick entropy Texture segmentation variance range Original image Texture operator Gaussian Blur 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Haralick entropy Threshold EDM Open, Fill holes Image math • Image arithmetic on grayscale images (addition, subtraction, division, multiplication, minimum, maximum) • Image Boolean arithmetic (AND, OR, Ex-OR, NOT) 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University AND The pixel at location (x,y) is 1 if is 1 in both images f1(x,y) and f2(x,y): g ( x , y ) f1 ( x , y ) AND f 2 ( x , y ) 1 if f1 ( x , y ) f 2 ( x , y ) 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University AND (cont.) AND = So it’s on both….. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University OR The pixel at location (x,y) is 1 if it is 1 in either of the images f1(x,y) or f2(x,y): g ( x , y ) f1 ( x , y ) OR f 2 ( x , y ) 1 if f1 ( x , y ) 1 OR f 2 ( x , y ) 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University OR (cont.) OR = So it’s on either….. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University XOR • Exclusive OR • The pixel at location (x,y) is 1 if it is 1 in either of the images f1(x,y) or f2(x,y), but not if it is 1 in both: g ( x , y ) f1 ( x , y ) XOR f 2 ( x , y ) 1 if f1 ( x , y ) 1 AND f 2 ( x , y ) 0 or f1 ( x , y ) 0 AND f 2 ( x , y ) 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University XOR (cont.) XOR = So it’s on not on both….. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University NOT • Not requires only a single image • The pixel at location (x,y) becomes 1 if it was 0 and becomes 0 if it was 1: g ( x , y ) NOT ( f1 ( x , y )) 1 if f1 ( x , y ) 0 g ( x , y ) NOT ( f1 ( x , y )) 0 if f1 ( x , y ) 1 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University NOT (cont.) NOT = So it’s just itself….. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Non-linear filters • Non-linear filters are known collectively as order statistic filters or rank filters • How does it work? Let’s combine a list of intensity values in the neighborhood of a given pixel, sort the list into ascending order, then select a value from a particular position in the list to use as the new value for the pixel. 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Median filter Selects the middle-ranked value from a neighborhood. For a n x n neighborhood (kernel), with n odd, the middle value is at position: n median 2 2 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University 1 Median filter (cont.) + Median filter 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Periodic Noise Periodic noise in an image may be removed by editing a 2-dimensional Fourier transform (FFT). A forward FFT of the image below, will allow you to view the periodic noise (center panel) in an image. This noise, as indicated by the white box, may be edited from the image and then an inverse Fourier transform performed to restore the image without the noise (right panel next slide). 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Remove periodic noise with fast fourier transforms 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Pseudocolor image based upon gray scale or luminance Human vision more sensitive to color. Pseudocoloring makes it is possible to see slight variations in gray scales 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Manipulating Images for publication • …we teach you how to manipulate images • ….But we also know how to determine if you did cheat!!.... • To be expanded in a separate lecture! 19:17 © 1997-2016 J. Turek, B. Rajwa & J. Paul Robinson, Purdue University Conclusion & Summary • Image Collection – resolution and physical determinants of collection instrument – collect only what you actually need • Image Processing – thresholding, noise reduction, filtering, histogram manipulation, etc • Image Analysis – feature identification, segmentation, value of data, representation of image, extract arithmetic information • Must not exceed an acceptable scientific standard in modification of images • If you cheat and publish, its there for everyone to see…someone smarter than you may dig into your data and expose you!! © 1997-2016 J. Turek , B. Rajwa & J. Paul Robinson, Purdue University