Color Space : RGB Color Space Color Space 2: HSV RGB Cube Easy for devices But not perceptual Where do the grays live? Where is hue and saturation? Hue, Saturation, Value (Intensity) RBG cube on its vertex Decouples the 3 components (a bit) How do you convert from one to the other? Wikipedia Use rgb2hsv() and hsv2rgb() in Matlab 2 RGB XYZ Color Similarity in Different Color Spaces 3 4
CIE XYZ Color Space 4: CIE LAB Space (x,y) = (X/(X+Y+Z), Y/(X+Y+Z)) Color Space 5: YUV CIE LAB Difference in this space is more close to human color space 5 6 Color Calibration Histogram Averaging of region of interest Goal: Obtain a range of (u,v) to represent color Binary Morphological Operations Dilation, Erosion Opening, Closing Labeling Connected Components 7 8 2
Visual Servoing Navigation based on visual cues Open-Loop vs. Feedback Control Objective: Follow the color blob Visual Cue: Color Blob Navigation: Follow the Blob! PURELY reactive 9 0 Mechanical Speed Control Proportional Controller Let e(t) = y(t) r(t), then, P = K p e(t) Prone to overshooting the reference 2 3
Proportional Controller High K p results in large change in output Steady-state error depends on magnitude of K p Integral Controller t I = K I e( )d 0 I Note: Integral term makes adjustments based on BOTH magnitude and duration of the error 3 4 Integral Controller K I (w/ K p ) speeds up movement towards reference Possibility of overshooting Why? Can add instability to the system D = K d de(t)/dt Derivative Controller D Note: Integral term makes adjustments based on BOTH magnitude and duration of the error 5 6 4
Derivative Controller K d slows down movement towards reference In conjunction with K I can limit overshoot caused by K I Sensitive to noise in the signal Controller operates on the ERROR between reference & output Proportional Reduces disturbance error Non-zero steady-state error Integral Ensures zero steady-state error Can be destabilizing Derivative Adds artificial damping Slows response In Summary P I D 7 8 How this relates to following color blobs? What is the input? What is the output? Given an image 9 20 5
Convolution Graphical Explanation of Convolution Definition Continuous Discrete 2 22 Applying Masks to Images Convolution of the Image w/ another Signal Masks have origins Symmetric masks origins are the center pixels 2 2 4 2 2 23 24 6
Linear Functions Simple Neural Network Simplest: Linear filters Key Idea: Replace each pixel by a linear combination of its neighbors The prescription for the linear combination is called the convolution kernel 25 26 The Retina: Up-Close 27 28 7
29 30 Linear Filtering: Warm Up Exercise I Linear Filtering: Warm Up Exercise II 3 32 8
Linear Filtering: Warm Up Exercise III Blur Examples 33 34 Linear Filtering: Warm Up Exercise IV Linear Filtering: Warm Up Exercise V 35 36 9
Remember Blurring Linear Filtering: Warm Up Exercise V 37 38 Sharpening Examples Sharpening Examples 39 40 0
Convolution Let I be a Signal (image), g be the convolution kernel then the convolution of I and g is given by Image Convolution f[m,n] = I g = I[m-k,n-l]g[k,l] k,l Note: Discrete! Can think of it as a form of running average. 4 42 Note the Following Image Operations as Convolution Average Filter Masks w/ positive entries that sum to ; Replaces each pixel w/ an ave of its neighborhood; If all weights are equal called BOX filter (Camps) 43 44
Smoothing by Averaging Rotationally symmetric Weights nearby pixels more than distant ones This makes sense for probabilistic inference Gaussian Averaging 45 46 Other 2-D Filters An Isotropic Gaussian The picture shows a smoothing kernel proportional to Reasonable model for a fuzzy blob 47 48 2
Smoothing with a Gaussian The Effects of Smoothing Each row shows smoothing with Gaussians of different width; Each column shows different realizations of an image Gaussian noise. 49 50 5 52 3
Image Smoothing Can Remove Noise And also 53 54 Computing Gradient as a Convolution Operation 55 56 4
Can also compute gradient as a filtering operation! Can also compute gradient as a filtering operation! 57 58 Edge is Where Change Occurs In -D, change is measured by the derivative Derivatives can have maxes (Biggest Change) and mins (No Change) Computing Gradients: st Order Derivatives Compute the gradient in the X-direction: ) Take the image intensity difference in the X-direction 2) Average the difference in the Y-direction (smoothing) 59 60 5
Some Matlab Code An Example 6 62 63 64 6
Recall We can compute gradient as:. Convolution Operation 2. Filtering Operation First Order Derivatives 65 66 Computing Gradients Derivative in X-Direction 67 68 7
Computing Gradients: Y-Direction Matlab s Conv2 Function 69 70 7 8