Lecture 001

Image: a function f(x, y) to some value.

Classical Image Processing

Matching Image Histogram: adjust contrast

Matching Image Histogram: adjust contrast

Style Transfer: match mean and std for each channel

Style Transfer: match mean and std for each channel

Above methods are point-processing method, no awareness of structure. What if I want to turn a white cat into a black cat?

Simple region-based transfer for color mapping

Simple region-based transfer for color mapping

Antialiasing methods:

Cross-Correlation Kernel is a cross-correlation operation

Cross-Correlation Kernel is a cross-correlation operation

Image Filtering: average filter

Image Filtering: average filter

Average Filter

Average Filter

Identity Filter

Identity Filter

Left Shift Filter

Left Shift Filter

Gaussian Filter

Gaussian Filter

Compared to Average Filter, Gaussian Filter get rid of more high frequency stuff

klzzwxh:0010 in Gaussian Filter

\sigma in Gaussian Filter

Higher klzzwxh:0012 removes more high-frequency details

Higher \sigma removes more high-frequency details

Convolution and Cross-Correlation are similar. Convolution flips the kernel by 180^\circ (or time-inverse if it is 1D) before performing the elementwise multiplication.

Convolution

Convolution

Properties of Convolution

Properties of Convolution

Convolution is commutative and associative.

Also, a gaussian kernel convolute with itself is another gaussian kernel but with sigma becomes \sigma \sqrt{2}

Downsample without pre-gaussian filtering

Downsample without pre-gaussian filtering

Downsample with pre-gaussian filtering

Downsample with pre-gaussian filtering

When applied pre-filtering to convolution layers in neural nets, the classification is more stable (smaller variance) against image translation. (ICML 2019 "Making Convolutional Networks Shift-Invariant Again")

Many libraries implement gaussian filtering wrong for >2x downsampling. This is because they don't change kernel size for different resizing ratio. (Downsampling more should have a larger kernel size)

Many libraries implement gaussian filtering wrong for >2x downsampling. This is because they don't change kernel size for different resizing ratio. (Downsampling more should have a larger kernel size)

For tasks like classification, you need diverse pre-processing artifact to make the classifier robust. However, for generative model, you need to avoid artifact to get the best quality of generated result.

Gaussian Pyamid: store different down-sampled version of the same image together.

Convolution for calculating derivative

Convolution for calculating derivative

Apply filter then take derivative of image is the same as first taking derivative then apply filter

Apply filter then take derivative of image is the same as first taking derivative then apply filter

Padding:

Table of Content