1.12k likes | 1.37k Views
Image Analysis. Manipulate an image to extract information to help solve a problem. Preprocessing - get rid of unnecessary information Data reduction - transform the image to a useable form Feature analysis - make inferences about the image. Image Analysis. Preprocessing Noise reduction
E N D
Image Analysis • Manipulate an image to extract information to help solve a problem. • Preprocessing - get rid of unnecessary information • Data reduction - transform the image to a useable form • Feature analysis - make inferences about the image.
Image Analysis • Preprocessing • Noise reduction • Gray level quantization • Spatial quantization • Finding regions of interest Reducing the number of bits
Image Analysis • Data reduction process, in which the image(s) are transformed into a more convenient form. • RGB HSL • Image subtraction • Histogram • Feature extraction
Image Analysis • Feature analysis - Specific results • Blood cell counting • Tumor size and location • 3D model
Image Analysis • Geometric • Resizing • Rotating • Noise Reduction • Image Smoothing • Median Filtering • Edge Detection • Searching for discontinuities • Histogram slicing • Blob detection
Interpolation • Interpolation to determine image values at integer pixel locations of transformed image. • Numerous interpolation schemes exist • 2 simple methods are • Nearest neighbor: assign value of nearest known point • Bilinear interpolation: example on next slide Interpolation used to simplify data for further processing
Nearest Neighbor Interpolation Interpolate this point To this value
I(x’,y’) I(x,y) I(x+1,y) I(x,y+1) I(x+1,y+1) Bi-linear Interpolation 0 (a,b) 1 I(x’,y) = (1-a)I(x,y) + (a)I(x+1,y) I(x’,y+1) = (1-a)I(x,y+1) + (a)I(x+1,y+1) I(x’,y’) = (1-b)I(x’,y) + (b)I(x’,y+1) I(x’,y’) = (1-b)(1-a)I(x,y) + (1-b)(a)I(x+1,y) + (b)(1-a)I(x,y+1) + (a)(b)I(x,y)
Bi-linear Interpolation I(x’,y’)
Objectives • Why are neighborhoods important? • What is linear convolution? • discrete • templates, masks or filters • algorithm mechanics • graphical interpretation • Describe non-linear operators • maximum • minimum • median • What is tiling?
Because… • Provide context for individual pixels. • Relationships between neighbors determine image features. • Neighborhood operations: • noise reduction • edge enhancement • zooming
Noise reduction Edge Enhancement Zooming
Neighbourhood Operations • Linear convolution (*) • A*B*C*D = B*C*D*A = …. • Non-linear operators • median, max, min, ...
Convolution versus Spectral • We learnt two methods of processing images: • Convolution • Spectral • We analyzed and demonstrated how to build a processor (systolic, pipelined, parallel, cellular automaton) for 1D convolution. • 1D convolution is used in speech processing and in polynomial multiplication. • We will use visualized animations now to show in more detail how 2D convolution works for images. • This should convince you how important it is to do convolution quickly in modern Spectral Architectures, especially for 3D etc.
2D Convolution • Consists of filtering an image A using a filter (mask, template) B. • Mask is a small image whose pixel values are called weights. • Weights modify relationships between pixels. We will show more examples of convolution now, especially for 2D data
A1,1 A3,2 A4,1 A3,4 A3,3 A2,2 A3,1 A2,4 A2,3 A4,3 A1,4 A1,3 A1,2 A4,2 A2,1 A4,4 C3,3 B2,2 C2,3 C2,2 C2,1 C3,1 C3,2 C1,2 C1,1 C1,3 B2,1 B1,2 B1,1 Input image Filter, mask or template Convolved Image A C B = 2 2 3 3 4 4
A1,1 A3,2 A1,2 A2,1 A2,2 A1,4 A2,3 A2,4 A3,1 A4,4 A1,3 A3,4 A4,1 A4,2 A4,3 A3,3 B1,1 B1,2 B2,1 B2,2 A1,1B1,1 A1,1B1,1 A1,2B1,2 A1,2B1,2 A2,1B2,1 A2,1B2,1 A2,2B2,2 A2,2B2,2 C1,1=
A1,2B1,1 A3,3 A1,2 A2,1 A2,2 A1,3 A2,3 A2,4 A3,1 A3,2 A1,4 A3,4 A4,1 A4,2 A4,3 A4,4 B1,1 B1,2 B2,1 B2,2 A1,1 A1,2B1,1 A1,3B1,2 A1,3B1,2 A2,2B2,1 A2,2B2,1 A2,3B2,2 A2,3B2,2 C1,2=
A1,3B1,1 A3,3 A1,2 A2,1 A2,2 A1,3 A2,3 A2,4 A3,1 A3,2 A1,4 A3,4 A4,1 A4,2 A4,3 A4,4 B1,1 B1,2 B2,1 B2,2 A1,1 A1,3B1,1 A1,4B1,2 A1,4B1,2 A2,3B2,1 A2,3B2,1 A2,4B2,2 A2,4B2,2 C1,3=
A2,1B1,1 A3,3 A1,2 A2,1 A2,2 A1,3 A2,3 A2,4 A3,1 A3,2 A1,4 A3,4 A4,1 A4,2 A4,3 A4,4 B1,1 B1,2 B2,1 B2,2 A1,1 A2,1B1,1 A2,2B1,2 A2,2B1,2 A3,1B2,1 A3,1B2,1 A3,2B2,2 A3,2B2,2 C2,1=
A1,1 A1,2 A2,1 A2,2 A1,3 A1,4 A2,3 A2,4 A3,1 A3,2 A3,3 A3,4 A4,1 A4,2 A4,3 A4,4 B1,1 B1,2 B2,1 B2,2 B1,1 B1,2 B2,1 B2,2 B1,1 B1,2 B2,1 B2,2
A1,1B1,1 A1,2B1,2 A2,1B2,1 A2,2B2,2 Mathematical Notation C1,1=
2 4 4 7 9 4 3 8 9 3 5 9 9 3 6 10 9 -1 2 -1 Convolution Input image Filter, mask or template Convolved Image A C B 21 6 23 = 9 26 19 16 27 17 2 2 3 3 4 4
N1 N2 N1-N2+1 Image size = M1 N1 Mask size = M2 N2 Convolution size = M1- M2 +1 N1-N2+1 Convolution size Typical Mask sizes = 33, 5 5, 77, 9 9, 1111 What is the convolved image size for a 128 128 image and 7 7 mask?
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 * = We convolve with 9*9 averaging filter
Nonlinear Neighbourhood Operations • Maximum • Minimum • Median We discussed already sorter architecture (three variants – pipelined, butterfly combinational and sequential controller). It can be used for all these operations, and also for other non-linear operators
61 62 57 60 59 65 63 58 59 55 55 56 49 59 57 63 59 63 62 45 53 60 1 1 1 1 Max and Min Operations C1,2= 63=max, 59=min
1 1 1 1 1 1 1 1 1 62 45 55 53 49 57 58 65 59 56 63 59 59 60 57 55 61 58 59 62 55 62 58 57 56 56 60 63 59 63 65 65 55 57 60 rank Median Operation 9 8 7 6 5 4 3 2 1 C1,2=
Edge Detection • What do we mean by edge detection? • What is an edge?
What is Edge Detection? • Detects large intensity transitions between pixels • Redraws the image with only the edges showing 0 0 0 33 0 0 45 78 0 45 23 33 0 0 42 76 0 0 0 38
Edge easy to find What is an Edge?
What is an Edge? Where is edge? Single pixel wide or multiple pixels?
What is an Edge? Noise is here Noise: have to distinguish noise from actual edge
What is an Edge? Is this one edge or two?
What is an Edge? Texture discontinuity
Edge Detection – so what is an edge to be detected? • What is an edge • A large change in image brightness of a short spatial distance • Edge strength = (I(x,y)-I(x+dx,y))/dx But this general definition still allows for many theories, software implementation and hardware architectures.
Now we will discuss and illustrate various kinds of filter operators
Edge Detection Filters • High - Pass Filtering Eliminates Uniform Regions (Low Frequencies) • edge “detection” or “enhancement”
Edge Detection Filters Edge Detection Continued • Sum of Kernel Coefficients = 0 • differences in signs emphasize differences in pixel values • reduces average image intensity • Negative pixel values in output?
Edge Direction vertical horizontal diagonal
Convolution Edge Detection using Sobel and similar operators
Sobel Operator Example of Sobel Operator