This preview shows page 1-2-3-4-5-6-7-8-53-54-55-56-57-58-59-108-109-110-111-112-113-114-115 out of 115 pages.
C280 Computer VisionC280, Computer VisionProf. Trevor [email protected]@eecs.berkeley.eduLt 4Filt iGraumanLecture 4: FilteringAdminstrivia• bSpace returned…let’s keep our fingers crossed…• box.net mirror:– http://w ww.box.net/shared/9q8cdvqrco• “external homepage”pg– http://www.eecs.berkeley.edu/~trevor/CS280.html– (has lecture notes, but no assignments, etc.)• few assignments from (recently un‐)WL’ed folks?– please do upload via bSpace (but keep a backup!)• Thu 5pm‐6pm office hour canceled this week.• Pset 1 released; n.b. longer than usual, start earlyGrauman• Pset 0 solutions on bSpace resource pageLast time: Color• Measuring color– Spectral power distributions– Color mixing– Color matching experiments–Color spaces• Uniform color spaces• Perception of colorHuman photoreceptors–Human photoreceptors– Environmental eff ects, adaptationGrauman• Using color in machine vision systemsToday: Image FiltersGraumanSmooth/Sharpen Images... Find edges... Find waldo…Image neighborhoods• Q: What happens if we reshuffle all pixels within the images?images?A It hi t ’t h•A: Its histogram won’t change. Point‐wise processing unaffected.• Need to measure properties relative to small neighborhoodsof pixelsGraumanneighborhoodsof pixelsImages as functionsf( )xyf(x,y)GraumanSource: S. SeitzImages as functions• We can think of an image as a function, f, from R2toR:R2to R:• f( x, y ) gives the intensity at position ( x, y ) • Realistically, we expect the image only to be defined over a rectangle, with a finite range:– f: [a,b] x [c,d] [0, 1.0]• A color image is just three functions pasted together. We can write this as a“vector-valued”together. We can write this as a vectorvalued function: (, )() ()rxyfxy gxyGraumanSource: S. Seitz(,)(,)(, )fxy gxybxyDigital images• In computer vision we operate on digital (discrete)images:• Sample the 2D space on a regular grid• Quantize each sample (round to nearest integer)• Image thus represented as a matrix of integer values.xyf(x,y)2D1DGraumanAdapted from S. SeitzMotivation: noise reduction• We can measure noise in multiple images of the same static scene.• How could we reduce the noise, i.e., give an estimate of the true intensities?GraumanCommon types of noise– Salt and pepper noise: random occurrences ofrandom occurrences of black and white pixels– Impulse noise: ra ndom f hi iloccurrences of white pixels– Gaussian noise: variations in intensity drawn from aOriginal Salt and pepper noisein intensity drawn from a Gaussian normal distributionGraumanGaussian noiseImpulse noiseSource: S. SeitzGaussian noiseGraumanFig: M. Hebert>> noise = randn(size(im)).*sigma;>> output = im + noise;Effect ofEffect of sigma on Gaussian noise:Image shows the noise valuesvalues themselves.GraumanEffect ofEffect of sigma on Gaussian noise:Image shows the noise valuesvalues themselves.GraumanEffect ofEffect of sigma on Gaussian noise:Image shows the noise valuesvalues themselves.GraumanEffect ofEffect of sigma on Gaussian noise:sigma=1This shows the noise values addedvalues added to the raw intensities of an image.GraumanEffect ofEffect of sigma on Gaussian noisesigma=16This shows the noise values addedvalues added to the raw intensities of an image.GraumanMotivation: noise reduction•How could we reduce the noise, i.e., give an estimate ofHow could we reduce the noise, i.e., give an estimate of the true intensities?• What if there’s only one image?GraumanFirst attempt at a solutionFirst attempt at a solution•Let’s replace each pixel with an average of all•Let s replace each pixel with an average of all the values in its neighborhood•Assumptions:•Assumptions: – Expect pixels to be like their neighborsE i b id d f–Expect noise processes to be independent from pixel to pixelGraumanFirst attempt at a solutionFirst attempt at a solution•Let’s replace each pixel with an average of all•Let s replace each pixel with an average of all the values in its neighborhood•Moving average in 1D:•Moving average in 1D:GraumanSource: S. MarschnerWeighted Moving AverageWeighted Moving Average•Can add weights to our moving averageCan add weights to our moving average• Weights [1, 1, 1, 1, 1] / 5 GraumanSource: S. MarschnerWeighted Moving AverageWeighted Moving Average•Non‐uniform weights [1 4 6 4 1] / 16Nonuniform weights [1, 4, 6, 4, 1] / 16GraumanSource: S. MarschnerMoving Average In 2DMoving Average In 2D000000000000000000000000000000000000000000 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 0000900909090000 0 0 90 90 90 90 90 0 00000000000000900909090000 0 0 90 90 90 90 90 0 00000000000009000000000000000000009000000000000000000GraumanSource: S. SeitzMoving Average In 2DMoving Average In 2D00000000000000000000010000000000000000000000 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 0000900909090000 0 0 90 90 90 90 90 0 00000000000000900909090000 0 0 90 90 90 90 90 0 00000000000009000000000000000000009000000000000000000GraumanSource: S. SeitzMoving Average In 2DMoving Average In 2D0000000000000000000001020000000000000000000000 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 0000900909090000 0 0 90 90 90 90 90 0 00000000000000900909090000 0 0 90 90 90 90 90 0 00000000000009000000000000000000009000000000000000000GraumanSource: S. SeitzMoving Average In 2DMoving Average In 2D000000000000000000000102030000000000000000000000 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 0000900909090000 0 0 90 90 90 90 90 0 00000000000000900909090000 0 0 90 90 90 90 90 0 00000000000009000000000000000000009000000000000000000GraumanSource: S. SeitzMoving Average In 2D0 10203030000000000000000000000 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 0000900909090000 0 0 90 90 90 90 90 0 00000000000009000000000000000000GraumanSource: S. SeitzMoving Average In 2D000000000000000000000 102030303020100 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00 0 0 90 90 90 90 90 0 00
View Full Document