Digital Images:

  • An image is a rectangular double array of integers
    • Each integer is the brightness of the image at that point

image.png

Read and display an image in OpenCV:

The programming language below is C++
image.png

Image noises:

  • due to reasons like numerical inaccuracies, we may have some entities that made images unclear.

image.png
Representative noises that usually appear are

  • Gaussian Noise
    • uniformly distributed
    • image.png
  • Impulsive Noise
    • sudden noises
    • image.png

Image Processing:

  • Definition: The input is an image, the output is an image that has been processed

    Filtering:

  • a type of Image Processing

  • it modifies the pixels in an image based on some function of the local neighbourhood of the pixels

image.png

Image Filter:

  • use a function to take neighbour pixels of each pixel
  • balance a new pixel value to replace the old one based on an algorithm

    Linear Filter / Concolution:

  • if the function in the image filter is a linear combination of these original pixels

  • we need a kernel to process image.

kernel is a matrix of size m by m
image.png

  • image.pngis for convolution, image.png is for cross correslation
  • image.png
  • results of cross correlation and convolution are the same iff kernel is both horizontally and vertically symmetric.
  • convolution is also used in neural network: http://cs231n.stanford.edu
  • If meet border pixels, we can

    • set the value of non-included pixels to zero
    • set all non-included pixels to the value of the corresponding pixel in the input image

      Box Filter:

  • smoothing images by averaging

image.png

Gaussian Filter:

  • Discreate Gaussian Kernel:

image.png

  • filter with Gaussian distribution

image.png
image.png

Noise Filtering:

  • Goal is to remove noise and still preserve image structure (edges)
  • Gaussian smoothing preserves edges better than average filter
  • Gaussian filter best at removing Gaussian noise

image.png
image.pngimage.png

  • Neither Gaussian nor average filter removes salt and pepper noise (Impulsive Noise)

Nonlinear Filtering:

Median Filter:

  • Replace each pixel value I(i, j) with the median of the values found in a local neighbourhood of (i, j).

image.png

Noise Filtering:

  • Median filter can fix salt-and-pepper noise

image.png


Reference:

  • wikipedia
  • handout of COMP4102: Introduction to Computer Vision from Carleton University School of Computer Science, 2019