Chapter 7 Conditioning and Labeling

7.1 Introduction
conditioning: noise removal, background normalization, ...
labeling: thresholding, edge detection, corner finding, ...

7.2 Noise Cleaning
noise cleaning: uses neighborhood spatial coherence
noise cleaning: uses neighborhood pixel value homogeneity

box filter: computes equally weighted average
box filter: separable
box filter: recursive implementation with two +, two -, one / per pixel
=====Fig. 7.2=====

Gaussian filter: linear smoother


for all 2#2, where


10#10: two or three 4#4 from the center
linear noise-cleaning filters: defocusing images, edges blurred

7.2.1 A Statistical Framework for Noise Removal
idealization: if no noise, each neighborhood the same constant

7.2.2 Determining Optimal Weight from Isotropic Covariance Matrices

7.2.3 Outlier or Peak Noise
outlier: peak noise: pixel value replaced by random noise value
neighborhood size: larger than noise, smaller than preserved detail
center-deleted neighborhood: pixel values in neighborhood except center
5#5: center-deleted neighborhood
47#47: center pixel value
6#6: mean of center-deleted neighborhood


8#8: output value of neighborhood outlier removal


47#47: not an outlier value if 47#47 reasonably close to 6#6
6#6: use mean value when outlier
118#118: threshold for outlier value
118#118 too small: edges blurred
118#118 too large: noise cleaning will not be good

10#10: center-deleted neighborhood variance


12#12: output value with contrast-dependent-threshold


6#6: use neighborhood mean if pixel value significantly far from mean

smooth replacement: instead of complete replacement or not at all
14#14: convex combination of input and mean
15#15: weighting parameter


17#17: use neighborhood mean 6#6
18#18: use input pixel value 47#47

7.2.4 19#19-Nearest Neighbor
19#19-nearest neighbor average: equally weighted average of 19#19-nearest neighbors

7.2.5 Gradient Inverse Weighted
gradient inverse weighted: reduces sum-of-squares error within regions

7.2.6 Order Statistic Neighborhood Operators
order statistic: linear combination of neighborhood sorted values
5#5: neighborhood pixel values
20#20: sorted neighborhood values from smallest to largest

Median Operator
median: most common order statistic operator
median root: fixed-point result of a median filter
median roots: comprise only constant-valued neighborhoods, sloped edges
median: effective for impulsive noise
median: distorts or loses fine detail such as thin lines


22#22: interquartile distance


Trimmed-Mean Operator
trimmed-mean: first 19#19 and last 19#19 order statistics not used
trimmed-mean: equal weighted average of central 24#24 order statistics


midrange: noise distribution with light and smooth tails


7.2.7 A Decision Theoretic Approach to Estimating Mean
=====New 3:12=====

7.2.8 Hysteresis Smoothing
hysteresis smoothing: removes minor fluctuations, preserves major transients
hysteresis smoothing: finite state machine with two states: UP, DOWN
hysteresis smoothing: applied row-by-row and then column-by-column
if state DOWN and next one larger, if next local maximum does not exceed threshold then stays current value i.e. small peak cuts flat
otherwise state changes from DOWN to UP and preserves major transients
if state UP and next one smaller, if next local minimum does not exceed threshold then stays current value i.e. small valley filled flat
otherwise state changes from UP to DOWN and preserves major transients
=====Fig. 7.9=====

7.2.9 Sigma Filter
sigma filter: average only with values within two-sigma interval


where 28#28

7.2.10 Selected-Neighborhood Averaging
selected-neighborhood averaging: assumes pixel a part of homogeneous region
noise-filtered value: mean value from lowest variance neighborhood

7.2.11 Minimum Mean Square Noise Smoothing
minimum mean square noise smoothing: additive or multiplicative noise
each pixel in true image: regarded as a random variable

7.2.12 Noise-Removal Techniques-Experiments
=====Fig. 7.10=====
types of noise

S/N ratio: signal to noise ratio: 36#36
37#37: image gray level variance
38#38: noise variance
=====Fig. 7.11=====
contrast-dependent noise removal ( 12#12, 39#39, 40#40)
=====Fig. 7.12=====
smooth replacement ( 14#14, 39#39, 41#41, 42#42)
=====Fig. 7.13=====
default peak noise removal ( 8#8, 39#39, 43#43)
=====Fig. 7.14=====
hysteresis smoothing
=====Fig. 7.15=====
interquartile mean filter ( 44#44, 45#45, 46#46)
=====Fig. 7.16=====
neighborhood midrange filter ( 47#47, 45#45)
=====Fig. 7.17=====
neighborhood running-mean filter (box filter, 45#45)
=====Fig. 7.18=====
sigma filter (Eq. 7.18, 39#39, 48#48)
=====Fig. 7.19=====
neighborhood weighted median filter (45#45)


=====Fig. 7.20=====
gain in S/N ratio
=====Table 7.5=====

7.3 Sharpening
unsharp masking: subtract fraction of neighborhood mean and scale result


where 51#51 is neighborhood mean
47#47: center pixel value
32#32: scaling constant
19#19: fraction, reasonable between 52#52
possible to replace neighborhood mean with neighborhood median

7.3.1 Extremum Sharpening
extremum-sharpening: output closer of neighborhood maximum or minimum




10#10: neighborhood, (value 0 in gray scale morphology)
=====Oldie 34:14=====

7.4 Edge Detection
digital edge: boundary where brightness values significantly different
edge: brightness value appears to jump
The Archer, working model, by Henry Moore, 1964
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.1=====
profiles of various types of image-intensity edges
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.2=====
physical events in a scene that may lead to intensity edges
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.3=====

7.4.1 Gradient Edge Detectors
Roberts operators: two 56#56 masks to calculate gradient
=====Fig. 7.21=====
gradient magnitude: 57#57
where 58#58 are values from first, second masks respectively

Prewitt edge detector: two 11#11 masks in row, column direction
=====Fig. 7.22=====
gradient magnitude: 59#59
gradient direction: 60#60 clockwise w.r.t. column axis
where 61#61 are values from first, second masks respectively

Sobel edge detector: two 11#11 masks in row, column direction
=====Fig. 7.23=====
gradient magnitude: 62#62
gradient direction: 63#63 clockwise w.r.t. column axis
where 64#64 are values from first, second masks respectively
Sobel edge detector: 56#56 smoothing followed by 56#56 gradient



Frei and Chen edge detector: two in a set of nine orthogonal masks (11#11)
=====Fig. 7.24=====
gradient magnitude: 67#67
gradient direction: 68#68 clockwise w.r.t. column axis
where 69#69 are values from first, second masks respectively

Kirsch: set of eight compass template edge masks
=====Fig. 7.25=====
gradient magnitude


gradient direction: 71#71

Robinson: compass template mask set with only 72#72
=====Fig. 7.26=====
done by only four masks: since negation of each mask is also a mask
gradient magnitude and direction same as Kirsch operator

Nevatia and Babu: set of six 12#12 compass template masks
=====Fig. 7.27=====
Robinson and Kirsch compass operator: detect lineal edges
=====Fig. 7.28=====
edge contour direction: along edge, right side bright, left side dark
edge contour direction: 73#73 more than gradient direction

four important properties an edge operator might have

  1. accuracy in estimating gradient magnitude
  2. accuracy in estimating gradient direction
  3. accuracy in estimating step edge contrast
  4. accuracy in estimating step edge direction

gradient direction: used for edge organization, selection, linking
=====Fig. 7.31=====

7.4.2 Zero-Crossing Edge Detectors
first derivative maximum: exactly where second derivative zero crossing
=====D. Marr, Vision, Fig. 2.8=====
Laplacian of a function 33#33


two common 11#11 masks to calculate digital Laplacian
=====Fig. 7.33=====
the 11#11 neighborhood values of an image function
=====Fig. 7.34=====
11#11 mask computing a digital Laplacian 75#75
=====Fig. 7.35=====
11#11 mask for computing minimum-variance digital Laplacian
=====Fig. 7.36=====
Laplacian of the Gaussian kernel
=====Fig. 7.37=====

A pixel is declared to have a zero crossing if it is less than 76#76 and one of its eight neighbors is greater than 41#41, or if it is greater than 41#41 and one of its eight neighbors is less than 76#76, for some fixed threshold 41#41
=====Fig. 7.38=====
=====D. Marr, Vision, Fig. 2.12=====
=====D. Marr, Vision, Fig. 2.13=====
=====D. Marr, Vision, Fig. 2.14=====

7.4.3 Edge Operator Performance
edge detector performance characteristics: misdetection/false-alarm rate
the Canny edge operator applied to a parts image
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.8=====
edges at two different scales detected by the Canny operator
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.9=====
the Nalwa-Binford and Marr-Hildreth edge operators
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.16=====
improvement of the resolution of an edge detector by image interpolation
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.17=====
edgel aggregation and edge description
=====Nalwa, A Guided Tour of Computer Vision, Fig. 3.18=====

7.5 Line Detection
A line segment on an image can be characterized as an elongated rectangular region having a homogeneous gray level bounded on both its longer sides by homogeneous regions of a different gray level
one-pixel-wide lines can be detected by compass line detectors
=====Fig. 7.39=====
semilinear line detector by step edge on either side of the line
=====Fig. 7.40=====
detecting lines of one to three pixels in width
=====Fig. 7.41=====

Project due Dec. 11
Write the following programs:
1. Generate additive white Gaussian noise:
78#78: Gaussian random variable with zero mean and st. dev. 1
79#79 determines signal-to-noise ratio, try 10, 30
2. Generate salt-and-pepper noise:
80#80 if 81#81
82#82 if 83#83
84#84 otherwise
85#85: random variable uniformly distributed over [0,1]
try both 0.05 and 0.1
3. Run box filter (11#11, 12#12) on all noisy images
4. Run median filter (11#11, 12#12) on all noisy images
5. Run opening followed by closing or closing followed by opening

Project due Dec. 18
Write programs to generate the following gradient magnitude images and choose proper thresholds to get the binary edge images:
1. Roberts operator
2. Prewitt edge detector
3. Sobel edge detector
4. Frei and Chen gradient operator
5. Kirsch compass operator
6. Robinson compass operator
7. Nevatia-Babu 5X5 operator


FastCounter by bCentral