Image Capture and Problems A reasonable capture IVR Vision: Flat Part Recognition Fisher lecture 4 slide 1
Image Capture: Focus problems Focus set to one distance. Nearby distances in focus (depth of focus). Further not so well focused. Compare identical lines. IVR Vision: Flat Part Recognition Fisher lecture 4 slide 2
Image Capture: Shadow problems False color to emphasize the shadow location. Often hard to separate from part. IVR Vision: Flat Part Recognition Fisher lecture 4 slide 3
Image Capture: Saturation problems Pixels clip at 255. IVR Vision: Flat Part Recognition Fisher lecture 4 slide 4
Image Capture: Specularities/highlights Saturated pixels set to red. IVR Vision: Flat Part Recognition Fisher lecture 4 slide 5
Image Capture: Non-uniform illumination Contrast on background enhanced: may cause analysis problems. IVR Vision: Flat Part Recognition Fisher lecture 4 slide 6
Image Capture: Radial lens distortion Note straight lines at image edge. May make accurate measurements hard. IVR Vision: Flat Part Recognition Fisher lecture 4 slide 7
Image Capture: Overcoming Problems Shadows, specularities, non-uniform illumination: increase ambient lighting by using light diffusing panels or lots of point lights Depth of Focus: use smaller aperture and brighter light Motion Blur: use shorter capture time and brighter light Saturation: use smaller aperture, reduce gain and adjust gamma IVR Vision: Flat Part Recognition Fisher lecture 4 slide 8
Lens Distortion: more expensive lenses, view from further away Aliasing: use incandescent lights IVR Vision: Flat Part Recognition Fisher lecture 4 slide 9
Illumination control techniques Main cause of problem: point light sources Brightness = B / (surface distance from source) 2 Sharp shadows: Strong illumination variations IVR Vision: Flat Part Recognition Fisher lecture 4 slide 10
Shadow Example Figure and shadow at bottom left emphasized IVR Vision: Flat Part Recognition Fisher lecture 4 slide 11
Lighting control To reduce complications arising from illumination: Increase ambient (all direction) light with light diffuser panels Illumination by camera to move shadows to non-visible places Backlighting panel IVR Vision: Flat Part Recognition Fisher lecture 4 slide 12
LIGHTS NEAR CAMERA DIFFUSER PANEL MUCH LESS SHADOW IVR Vision: Flat Part Recognition Fisher lecture 4 slide 13
Isolating flat parts Isolate parts, then characterise later Assume Dark part Light background Reasonably uniform illumination > distinguishable parts IVR Vision: Flat Part Recognition Fisher lecture 4 slide 14
Midlecture Problem Given this image, how might we label pixels as object and background? IVR Vision: Flat Part Recognition Fisher lecture 4 slide 15
Thresholding Introduction Key technique: thresholding Assume pixel values are separable Part and typical distribution 10000 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 0 50 100 150 200 250 Spread: not quite uniform illumination + part color variations + sensor noise IVR Vision: Flat Part Recognition Fisher lecture 4 slide 16
Thresholding Thresholding: central technique for row = 1 : height for col = 1 : width if value(row,col) < ThreshHigh % inside high bnd % & value(row,col) > ThreshLow % optional low bnd output(row,col) = 1; else output(row,col) = 0; end IVR Vision: Flat Part Recognition Fisher lecture 4 slide 17
10000 9000 OBJECT BACKGROUND 8000 7000 6000 5000 THRESHOLD 4000 3000 2000 1000 0 0 50 100 150 200 250 IVR Vision: Flat Part Recognition Fisher lecture 4 slide 18
Threshold Selection Exploit bimodal distribution 10000 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 0 50 100 150 200 250 But: Distributions broad and some overlap > misclassified pixels Shadows dark so might be classified with object Distribution has more than 2 peaks So: smooth histogram to improve shape for selection IVR Vision: Flat Part Recognition Fisher lecture 4 slide 19
Convolution General purpose image (and signal) processing function Computed by a weighted sum of image data and a fixed mask Linear operator: conv(a*b,c) = a*conv(b,c) Used in different processes: noise removal, smoothing, feature detection, differentiation,... IVR Vision: Flat Part Recognition Fisher lecture 4 slide 20
2 1.5 1 0.5 0 0.5 1 50 100 150 200 250 300 School of Informatics, University of Edinburgh Convolution in 1D Output(x) = N i= N weight(i) input(x i) Input: 0 Gaussian Mask and Output: 0.12 2 0.1 1.5 0.08 1 0.06 0.5 0.04 0 0.02 0.5 0 0 5 10 15 20 25 30 35 40 45 50 1 0 50 100 150 200 250 300 Derivative of Gaussian Mask and Output: 0.1 0 0 0 50 100 150 200 250 300 0.1 0 5 10 15 20 25 30 35 40 45 IVR Vision: Flat Part Recognition Fisher lecture 4 slide 21
2D Convolution - Smoothing Output(x, y) = N i= N N j= N weight(i,j) input(x i,y j) * = IVR Vision: Flat Part Recognition Fisher lecture 4 slide 22
Convolution for Edge Detection IVR Vision: Flat Part Recognition Fisher lecture 4 slide 23
Convolution Explains Illusions IVR Vision: Flat Part Recognition Fisher lecture 4 slide 24
Histogram Smoothing for threshold selection Histogram Smoothing (in findthresh.m) Convolve with a Gaussian smoothing window filterlen = 50; % filter length thefilter = gausswin(filterlen,sizeparam); % size=4 thefilter = thefilter/sum(thefilter); % unit norm tmp2=conv(thefilter,thehist); % makes longer output % select corresponding portion offset = floor((filterlen+1)/2); tmp1=tmp2(offset:len+offset-1); IVR Vision: Flat Part Recognition Fisher lecture 4 slide 25
0.08 8000 0.07 7000 0.06 6000 0.05 5000 0.04 4000 0.03 3000 0.02 2000 0.01 1000 0 0 5 10 15 20 25 30 35 40 45 50 FILTER SHAPE 0 0 50 100 150 200 250 300 SMOOTHED HISTOGRAM IVR Vision: Flat Part Recognition Fisher lecture 4 slide 26
What We Have Learned 1. Image Capture Problems and Fixes 2. Differentiating object from background 3. Convolution 4. Histogram smoothing & threshold selection IVR Vision: Flat Part Recognition Fisher lecture 4 slide 27