티스토리 뷰

728x90

1. What is an image?

A grid (matrix) of intensity values

(common to use one byte per value: 0 = black, 255 = white)

 

Can think of a (grayscale) image as a function f from R2 to R

  • f(x,y) gives the intensity at position (x,y)
  • A digital image is a discrete (sampled, quantized) version of this function

 

Image transformations

  • As with any function, we can apply perators to an image
  • Today we'll talk about a special kind of operator, convolution (linear filtering)

 

2. Filters

  • Filtering
    • Form a new image whose pixel values are a combination of the original pixel values
  • Why?
    • To get useful information from images
      • E.g., extract edges or contours (to understand shape)
    • To enhance the image
      • E.g., to remove noise
      • E.g., to sharpen and 'enhance image' a la CSI
    • A key operator in Convolutional Neural Networks

 

Canonical Image Processing problems

 

  • Image Restoration
    • denoising
    • deblurring
  • Image Compression
    • JPEG, HEIF, MPEG,
  • Computiong Field Properties
    • optical flow
    • disparity
  • Locating Structural Features
    • corners
    • edges

 

Question: Noise reduction

  • Given a camera and a still scene, how can you reduce noise?

 

Image filtering

  • Modify the pixels in an image based on some function of a local neighborhood of each pixel

 

 

Linear filtering

  • One simple version of filtering: linear filtering (cross-correlation, convolution)
    • Replace each pixel by a lnear combination (a weighted sum) of its neighbors
  • The prescription for the linear combination is called the 'kernel' (or 'mask', 'filter')

 

 

Cross-corrleation

 

Let F be the image, H be the kernel (of size 2k+1 x 2k+1), and G be the output image

 

G[i,j]=Σku=kΣkv=kH[u,v]F[i+u,j+v]

 

This is called a **cross-correlation** operation:

 

G=HF

 

Can think of as a 'dot product' between local neighborhood and kernel for each pixel

 

Convolution

 

Same as cross-correlation, except that the kernel is 'flipped' (horizontally and vertically)

 

G[i,j]=Σku=kΣkv=kH[u,v]F[iu,jv]

 

 

This is called a convolution operation:

 

G=HF

 

Convolution is commutative and asscociative

 

 

Mean filtering

 

 

Mean filtering/Moving average

 

 

 

 

Linear filters: examples

 

identical image
Shifted left by 1 pixel
Blur (with a mean filter)
sharpening filter (accentuates edges)

 

 

 

 

Sharpening

 

 

Smoothing with box filter revisited

 

 

Gaussian kernel

 

Gσ=12πσ2ex2+y22σ2

 

 

Gaussian filters

 

 

 

Mean vs. Gaussian filtering

 

 

 

Gaussian filter

 

  • Removes 'high-frequency' components from the image (low-pass filter)
  • Convolution with self is another Gaussian

 

 

  • Convolving twice with Gaussian kernel of width σ

     = convolving once with kernel of width σ2

 

 

Shapening revisited

  • What does blurring take away?

 

 

Sharpen filter

 

F+α(FFH)=

 

 

  • F: image
  • FH: blurred image

 

unit impulse (identity kernel with single 1 in center, zeros elsewhere)

 

 

'Optical' convolution

 

Camera shake

 

Bokeh : Blur in out-of-focus regions of an image

 

 

Filters: Thresholding

 

 

g(m,n)={255,f(m,n)>A0,otherwise

 

 

Linear filters

Can thresholding be implemented with a linear filter?

 

 

 

 

 

 

 

Reference: Lecture 1: Images and image filtering

728x90
댓글