Skip to content

Latest commit

 

History

History
355 lines (200 loc) · 5.04 KB

RoboticVision.md

File metadata and controls

355 lines (200 loc) · 5.04 KB
bot
<table>
	<tr><td><img src="images/logo.jpg" alt="logo" width="110" height="110" /></td></tr>
	<tr><td><h5>Guru Nanak Dev Engineering College<h5></td></tr>
	<tr><td><h6>Ludhiana, Punjab, India</h6></td></tr>
	<tr><td><h2>SPATIAL OPERATORS</h2></td></tr>
</table>

Spatial Operators


Monadic Processing

  • Each output pixel is a function of the corresponding input pixel
  • The function is the same for all pixels

Spatial Operators

  • The function can capture something about the uniformity or variation over the local pixel window W

f(.) is an average

  • The average over the window
    • can reduce noise
    • reduces the resolution

Moving Window Processes


Effect of Window Size

  • Features smaller than the window size will be strongly attenuated
    • we say the image is blurry, fuzzy, lower resolution etc.

Code screenshots Note: speaker notes FTW!


Moving Window Issues


The edge problem

  • Some solutions:
    • don't compute the output value when the window "falls off the edge"
    • assume the image is surrounded by zero pixels
    • assume the edge pixels are replicated outward

code


Window size is always odd

  • The window is:
    • square
    • always centred on the input pixel
    • edge is integer h pixels from the centre
  • The window width is 2h + 1
    • always odd

Introducing Kernels


Artefacts of averaging

  • Can lead to ringing
    • faint vertical & horizontal lines are introduced

Averaging over a square is not isotropic

  • Not all values used in the average are the same distance away
    • Undue influence by distant values

Going isotropic

  • Ideally we'd like to extract a circular region
    • but that would involve taking fractions of pixels

Apply a weighting

  • Circle of diameter 2.5 pixels

Weighted kernel


Scaling the kernel

  • The scale factor is
    • Typically make S = 1 to keep grey levels the same as the input image

Simple averaging is also a kernel


Gaussian kernel


Gaussian width

  • Choose the size of the square kernel to fit the Gaussian
  • Rule of thumb h=3sigma

code


Correlation and Convolution


Applying the kernel

  • This is the definition of 2-dimensional correlation

2D convolution

  • Correlation is closely related to convolution ????
  • Convolution is the same as correlation if the kernel is symmetric
  • Often written in operator form ????

Properties of convolution

  • Commutative ???
  • Associative ???
  • Distributive ???
  • Linear ???

Advantages of associativity

  • Convolving an image with a Gaussian kernel twice ???
  • Is the same as convolving the image with a kernel that is the Gaussian convolved with itself

Edges


The intensity function


Expressed as correlation with a kernel


Convolution for edge detection


Horizontal gradient image


Vertical gradient as correlation with a kernel


Vertical gradient image


The Sobel kernel


Sobel edge operator


Image gradient direction


Sobel Edge operator


Kernels


Gaussian kernel


Derivative with smoothing

  • Convolve image with the derivative kernel D
  • If we smooth the image then ???

Second Derivative

  • The Laplacian is an isotropic second derivative
    • gives the gradient maxima in both the u- and v- directions

Second derivative with smoothing


Template matching


image


image2


Spatial operators


Tempate matching

  • image
  • image2

Image Similarity


picture


code


Rank Filtering


Image noise removal


Rank filtering

  • image

Image noise removal

  • output image

Mathematical Morphology


image 1

  • Morphology is about shape
  • Output image contains shapes compatible with a structuring element S

Erosion

  • Output is true if all pixels in S are true (white)

Dilation

  • Output is true if any pixels in S are true (white)

Erode then dilate

  • Opening operation
  • Only compatible shapes remain

Dilation then Erosion

  • Closing Operation

Compatible structuring elements


Lecture 5