Create a whitening filter for a natural image.
Create a whitening filter for a natural image.
Note that we clip this filter to 13 x 13 because normalized convolution (which we would like for whitening) isn't yet implemented for larger filters.
TODO: Stop clipping whitening filter when FFT with zero expansion is supported XXX
Shape of the image.
True if the returned filter should be in the frequency domain, false if in the space domain (default).
A natural whitening filter (spatial), that's smaller than the smallest dimension of the image.
Clip off last column of matrix m
.
Clip off last column of matrix m
.
Clip off last row of matrix m
.
Clip off last row of matrix m
.
Matlab's side-by-side matrix concatenation operator.
Matlab's side-by-side matrix concatenation operator.
Does a convolution of two matrices.
Does a convolution of two matrices.
Image to be convolved.
Convolution filter.
"full", "same", or "valid"
Matlab's fliplr operator.
Matlab's fliplr operator.
Matlab's flipup operator.
Matlab's flipup operator.
Matlab spec says this produces a "row vector", which is a matrix with a single row in Cog.
Matlab spec says this produces a "row vector", which is a matrix with a single row in Cog.
Implement Matlab's repmat.
Implement Matlab's repmat.
Matrix to be replicated.
Row replication factor.
Column replication factor.
Matlab's top-on-bottom matrix concatenation operator.
Matlab's top-on-bottom matrix concatenation operator.
Lower triangular part of (square) matrix.
Lower triangular part of (square) matrix.
A whitening filter for natural images that flattens the spectrum (on average).
This uses the fact that natural images have an amplitude spectrum of 1/f, so this is essentially a filter with the inverse spectrum. The algorithm is from Bruno Olshausen:
http://redwood.berkeley.edu/bruno/npb261b/lab2/lab2.html