chapter 5 digital image processing fundamentals. learning goals the human visual system digitizing...
TRANSCRIPT
![Page 1: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/1.jpg)
Chapter 5
Digital Image Processing Fundamentals
![Page 2: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/2.jpg)
Learning Goals
• The human visual system
• Digitizing images
• Display of Images
![Page 3: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/3.jpg)
Trading an eye for an ear
opticalaxiscornea
lensopticdisk
opticnerveretina
foveacentralis
iris
![Page 4: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/4.jpg)
An eye is a Multi-mega pixel camera
• It has a lens (adjustable zoom)
• It has an automatic f-stop (iris 2-8 mm)
• It has a sensor plane (100 million pixels)
• The sensor has a transfer function senstive to mesopic range; 380 to about 700 nm
![Page 5: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/5.jpg)
The eyes have a USB2 data rate!
• 250,000 neurons in the optic nerve
• variable voltage output on EACH nerve
• 17.5 million neural samples per second
• 12.8 bits per sample
• 224 Mbps, per eye (a 1/2 G bps system!).
• Compression using lateral inhibition between the retinal neurons
![Page 6: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/6.jpg)
Response curves
• Eye has Gaussian response to light.
• Gives rise to biologically motivated image processing
![Page 7: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/7.jpg)
Quantization of an Image
• Computers use digital cameras -> quantizationSNR ≤6b+ 4.8
SNR =10 log3×22 b( ) =20blog2 +10log3
![Page 8: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/8.jpg)
Delta-function
⎩⎨⎧ =
=⋅ else 0
0 )0()()(
nxnnx δ
![Page 9: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/9.jpg)
Sampling an Image
f s
f (x) Anti-aliasingFilter
![Page 10: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/10.jpg)
Sampling=convolution w pulse train
F(u) * P(u) ≡ F(γ)P(u−γ)dγ−∞
∞
∫
F(u) * P(u) = f(x) δ(x−n / fs)n=−∞
∞
∑ e−j 2πux ⎡ ⎣ ⎢
⎤ ⎦ ⎥dx
−∞
∞
∫
![Page 11: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/11.jpg)
Quantization Error is visible
![Page 12: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/12.jpg)
Displays
• Color Monitors are made for people
![Page 13: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/13.jpg)
Chapter 6-7
• Opening and Saving Images
![Page 14: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/14.jpg)
Chapter 8 Convolutionwith a kernel, g(x)
h(x) = f(x) * g(x)= f(u)g(x−u)du−∞
∞
∫
h(x) = f(x) * g(x)= f (u)g(−∞
∞
∑ x−u)
![Page 15: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/15.jpg)
Convolution
1D and 2D signal processing
![Page 16: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/16.jpg)
Consider the delta function
⎩⎨⎧ =
=⋅ else 0
0 )0()()(
nxnnx δ
δ(t)− ε
ε
∫ dt = 1
![Page 17: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/17.jpg)
Time-shift delta
)( knk −=δδ
kk kxx δδ ⋅=⋅ )(δ( t − td )
![Page 18: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/18.jpg)
Sample the input (it’s a convolution!)
][][][])[*( nxkxknnxk∑∞
−∞=
=−= δδ
s(t) = δ(t−n / fs)n=−∞
∞
∑
vs (t) =v(t)s(t) =v(t) δ(t−n/ fs)n=−∞
∞
∑
![Page 19: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/19.jpg)
What does sampling do to spectrum?
![Page 20: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/20.jpg)
What is the spectrum? v(t) =a0 + (a1 cost+b1sint) + (a2 cos2t+b2sin2t)+K
![Page 21: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/21.jpg)
Fourier Coefficients
a0 ,a1,b1, a2 ,b2K
v(t) =a0 + (a1 cost+b1sint) + (a2 cos2t+b2sin2t)+K
![Page 22: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/22.jpg)
CTFT
V( f ) =F [v(t)] = v(t)e−2 πiftdt−∞
∞
∫
v(t) =F−1 V( f )[ ] = V( f)e2πiftdt−∞
∞
∫e iθ =cosθ + i sinθ
![Page 23: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/23.jpg)
Euler’s identity
e iθ =cosθ + i sinθ
![Page 24: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/24.jpg)
Sine-cos Rep
x(t) = an cos(2πnf0t) + bn sin(2πnf0t)n=1
∞
∑n=0
∞
∑
v(t) =a0 + (a1 cost+b1sint) + (a2 cos2t+b2sin2t)+K
![Page 25: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/25.jpg)
Harmonic Analysisa0 =1
Tx(t)dt
0
T
∫
an =2T
x(t)cos(2πnf0t)dt0
T
∫
bn =2T
x(t)sin(2πnf0t)dt0
T
∫
![Page 26: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/26.jpg)
Convolution=time-shift&multi
V * W( f ) ≡ V(λ )W( f −λ)dλ−∞
∞
∫
![Page 27: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/27.jpg)
Convolution ThmV * W( f ) =F(v(t)w(t))
multiplication in the time domain =convolution in the frequency domain
![Page 28: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/28.jpg)
Sample
vs (t) =v(t)s(t) =v(t) δ(t−n/ fs)n=−∞
∞
∑
Vs ( f ) =V(F) * fsδ( f −nfs )n=−∞
∞
∑
Vs ( f ) = fs V( f −nfs)n=−∞
∞
∑
![Page 29: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/29.jpg)
Spectrum reproduced
Vs ( f ) = fs V( f −nfs)n=−∞
∞
∑
spectrum to be reproduced at intervalsf s
![Page 30: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/30.jpg)
Summary
h(x) = f(x) * g(x)= f(u)g(x−u)du−∞
∞
∫
h(x) = f(x) * g(x)= f (u)g(−∞
∞
∑ x−u)
![Page 31: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/31.jpg)
Example of 1D convoln
![Page 32: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/32.jpg)
2D Convolution
h(x, y) = f * g= f (u,v)g(x−u,y−v)dudv−∞
∞
∫−∞
∞
∫
h(x,y) = f * g= f(u,v)g([x−u],[y−v])v=0
vmax−1
∑u=0
umax−1
∑
![Page 33: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/33.jpg)
Region of Support
• The region of support is defined as that area of the .kernel which is non-zero
• linear convolution:=signal has infinite extent but kernel has finite support
• If function has finite region of support we have compact support
![Page 34: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/34.jpg)
Real images have finite region of support
• But we treat them as periodic and infinite!
• We repeat kernels so that they have the same period as the images.
• We call this cyclic convolution.
![Page 35: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/35.jpg)
Convolution in 2D
h(x, y) = f * g= f (u,v)g(x−u,y−v)dudv−∞
∞
∫−∞
∞
∫
h(x,y) = f * g= f(u,v)g([x−u],[y−v])v=0
vmax−1
∑u=0
umax−1
∑
[x −u] =(x−u)modumax
[y−v] =(y−v)modvmax
![Page 36: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/36.jpg)
Avoid the Mod op
h(x,y) = f * g= f (x−u,y−v)g(u+uc ,v+vc)v=−vc
vc
∑u=−uc
uc
∑
![Page 37: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/37.jpg)
What is wrong with avoiding the mod op?
• How do I find the center of the kernel?
![Page 38: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/38.jpg)
Cyclic Convolution
![Page 39: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/39.jpg)
Implementing Convolution for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { sum = 0.0; for(int v = -vc; v <= vc; v++) for(int u = -uc; u <= uc; u++) sum += f[cx(x-u) ][cy(y-v)] * k[ u+uc][v+vc]; if (sum < 0) sum = 0; if (sum > 255) sum = 255; h[x][y] = (short)sum; } }
![Page 40: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/40.jpg)
What happens to the image if you ignore the wrap?
![Page 41: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/41.jpg)
Cyclic Convolution keeps the edges
![Page 42: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/42.jpg)
Can you think of a better way to implement convolution?
• Keep the edges!
• Don’t use the mod operation.
• How about growing the image by the size of the kernel*2?
![Page 43: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/43.jpg)
Convolution is slow, how can I speed it up?
• JAI!
• FFT!?
• Other ideas?
![Page 44: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/44.jpg)
Chapter 9
• Spatial Filters
• Blurring
• Median Filtering
• Hi-pass filtering
• SpatialFilterFrame and JAI
![Page 45: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/45.jpg)
Blurring=Low-pass Filters
![Page 46: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/46.jpg)
Why Blur an Image?
• Remove Noise
• Other ideas?
![Page 47: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/47.jpg)
Average=low-pass
public void average() { float k[][] = { {1, 1, 1}, {1, 1, 1}, {1, 1, 1} }; Mat.scale(k,1/9.0); convolve(k); }
![Page 48: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/48.jpg)
Want Unity Gain
G = kijj=0
H−1
∑i=0
W−1
∑
![Page 49: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/49.jpg)
Many variations on LP filters
public void lp3() { float k[][] = { {1, 1, 1}, {1, 12, 1}, {1, 1, 1} }; Mat.scale(k,1/20.0); convolve(k); }
![Page 50: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/50.jpg)
Gaussian Blur
gaussian(x,y, xc, yc,σ ) =1
2πσ 2 e−
x−xc( )2− y−yc( )
2( )
2σ 2
gmax =1
2πσ 2
![Page 51: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/51.jpg)
Why use Gaussian Blur?
• How the eye works
• Symmetric
• Differentiable
• Smooth
![Page 52: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/52.jpg)
Classic bell curve
![Page 53: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/53.jpg)
Larger Kernels=more blur
![Page 54: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/54.jpg)
Median Filtering
• Middle of a list of samples listed in ascending order.
• Sort samples, return n/2
![Page 55: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/55.jpg)
Why use median filtering?
• Discard outliers
• 0, 85, 90, 87 and 100. The mean is 72
• Median is 87.
• {0, 85, 87, 90, and 100}=87
![Page 56: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/56.jpg)
How do I implement the median?
public static int median(int a[]) { quickSort(a); int mid = a.length/2-1; if ((a.length & 1) == 1) return a[mid]; return (int )((a[mid]+ a[mid+1]+0.5)/2); }
![Page 57: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/57.jpg)
Salt and Pepperpublic void saltAndPepper(int n) { for (int i=0;i < n; i++) { int rx = rand(0,width-1); int ry = rand(0,height-1); r[rx][ry] = 255; g[rx][ry] = 255; b[rx][ry] = 255; rx = rand(0,width-1); ry = rand(0,height-1); r[rx][ry] = 0; g[rx][ry] = 0; b[rx][ry] = 0; } short2Image(); }
![Page 58: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/58.jpg)
Median 3x3
public void medianCross3x3() { short k[][] = {
{0, 1, 0},{1, 1, 1},{0, 1, 0}};median(k);
}
![Page 59: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/59.jpg)
Median on any kernel
public void median (short k[] []) { printMedian(k,"color median"); Timer t = new Timer(); t.start();
r = median(r,k);g = median(g,k);b = median(b,k);t.print("Median filter time");
short2Image();}
![Page 60: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/60.jpg)
Median result
![Page 61: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/61.jpg)
Median Octagon, less aggressive
public void medianOctagon5x5() {short k[][] = {{ 0, 1, 1, 1, 0},{ 1, 1, 1, 1, 1},{ 1, 1, 1, 1, 1},{ 1, 1, 1, 1, 1},{ 0, 1, 1, 1, 0}};median(k);
}
![Page 62: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/62.jpg)
Median Octagon results
![Page 63: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/63.jpg)
Median Filtering is not FREE!
• Image degradation
• Selective median filtering.
• How do you know when to apply it?
![Page 64: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/64.jpg)
Use Sample Variance
σ 2 =1
n(ai − a )2
i= 0
n-1
∑
a =mean
ai = ith sample
σ 2 = sample variance and
n= number of samples
![Page 65: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/65.jpg)
Coefficient of variationˆ C = σ / a
public static boolean outlierHere(int a[]) {return ( coefficientOfVariation(a) > .4);
}
![Page 66: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/66.jpg)
Before and After 3x3 Median Filtering with Outlier Detection
![Page 67: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/67.jpg)
High-pass Filters
![Page 68: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/68.jpg)
Defining HP Kernels
public void hp1() { float k[][] = {
{ 0, -1, 0},{-1, 10, -1},{ 0, -1, 0}};Mat.normalize(k);
convolve(k); }
![Page 69: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/69.jpg)
Lower Center Number, GREATER edge enhancement!
510
![Page 70: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/70.jpg)
Project ideasAdd an interface that allows the user to outline a rectangular region of interest. Then perform processing only in that region.
![Page 71: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/71.jpg)
10. Convolution-based Edge Detection
Why do edge detection?What is an edge?What is a good edge?How do you find an edge?
![Page 72: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/72.jpg)
Laplacian
∇2 f (x, y) =∂ 2 f
∂x2 +∂ 2 f
∂y2
![Page 73: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/73.jpg)
Why Laplacian?
because it is zero when the rate of intensity change in the image plane is zero or linear.
![Page 74: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/74.jpg)
Log filters=prefilter+laplacian
−∇2 1
2πσ 2 ex 2 + y 2
2σ2
=1
πσ 4 1 −x2 + y2
2σ 2
⎡
⎣ ⎢ ⎤
⎦ ⎥e−
x 2 + y 2
2σ2
∇2 f (x, y) =∂ 2 f
∂x2 +∂ 2 f
∂y2
![Page 75: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/75.jpg)
Mexican Hat (LoG Kernel)
![Page 76: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/76.jpg)
The Log kernel
![Page 77: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/77.jpg)
Oriented Filters are steerable
![Page 78: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/78.jpg)
Changing Scale at 0 Degrees
![Page 79: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/79.jpg)
Changing Phase at 0 degrees
![Page 80: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/80.jpg)
Interactive Heuristic Edge Detection
Douglas A. Lyon, Ph.D.Chair, Computer Engineering Dept. Fairfield
University, CT, USA
[email protected], http://www.DocJava.com
CGIM, 2002
Copyright 2002 © DocJava, Inc.
![Page 81: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/81.jpg)
Background
• It is easy to find a bad edge!• We know a good edge when we see it!
![Page 82: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/82.jpg)
The Problem
• Given an expert + an image.
• The expert places markers on a good edge.
• Find a way to connect the markers.
![Page 83: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/83.jpg)
Motivation
• Experts find/define good edges
• Knowledge is hard to encode.
![Page 84: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/84.jpg)
Approach
• Mark an important edge
• Pixels=graph nodes
• Search in pixel space using a heuristic
• A* is faster than DP
![Page 85: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/85.jpg)
Assumptions
• User is a domain expert
• Knowledge rep=heuristics+markers
![Page 86: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/86.jpg)
Applications
• Photo interpretation
• Path planning (source+destination)
• Medical imaging
![Page 87: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/87.jpg)
Photo Interpretation
![Page 88: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/88.jpg)
Echocardiogram
•3D-multi-scale analysis
![Page 89: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/89.jpg)
Path Plans, the idea
![Page 90: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/90.jpg)
Path Planning-pre proc.•hist+thresh
•Dil+Skel
![Page 91: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/91.jpg)
Path Planning - Search
![Page 92: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/92.jpg)
The Idea
• The mind selects from filter banks
• The mind tunes the filters
![Page 93: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/93.jpg)
Gabor filter w/threshold
• The Strong edge is the wrong edge!
![Page 94: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/94.jpg)
Sub bands for 3x3 Robinson
![Page 95: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/95.jpg)
Sub Bands 7x7 Gabor
![Page 96: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/96.jpg)
Gabor-biologically motivated
![Page 97: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/97.jpg)
Summary
• Heuristics+markers= knowledge• Low-level image processing still needed• Global optimization is not appropriate for
all applications• Sometimes we only want a single, good
edge
![Page 98: Chapter 5 Digital Image Processing Fundamentals. Learning Goals The human visual system Digitizing images Display of Images](https://reader031.vdocument.in/reader031/viewer/2022032612/56649f035503460f94c1735e/html5/thumbnails/98.jpg)
http://www.DocJava.com