Professional Documents
Culture Documents
au/~pk/research/matlabfns/
Peter Kovesi
Centre for Exploration Targeting
School of Earth and Environment
The University of Western Australia
1 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
Octave.
Only runs under MATLAB.
Functions Supporting Not tested under Octave (yet).
Projective Geometry
Feature Matching I receive so many mail messages
Model Fitting and Robust regarding this site that I have difficulty
Estimation responding to them all. I will endeavor
to respond to mail that directly
Fingerprint Enhancement
concerns the use of individual
Interesting Synthetic Images functions. However, please note I do
ASCII Image Generation not have the time to provide an on-line
Rotation Transforms vision problem solving service!
Image Display, Image Writing Please report any bugs and/or suggest
and Miscellaneous enhancements to
Cheers,
Peter Kovesi
2 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
phase symmetry
image
phasesym.m Code for calculating phase symmetry. This can be used as a line and
blob detector. Phase symmetry is an illumination and contrast invariant measure of
symmetry in an image. (A bright circle is not more 'symmetric' than a grey circle as
can be the case with some other measures!). (Updated May 2009)
phasesymmono.m This function computes phase symmetry via monogenic filters.
Has excellent speed and much reduced memory requirements compared to
phasesym.m However you may prefer the output from phasesym's oriented filters.
gaborconvolve.m Code for convolving an image with a bank of log-Gabor filters. A
pre-processing step for texture analysis, feature detection and classification, etc.
plotgaborfilters.m A function for plotting log-Gabor filters. This function is useful for
seeing what effect the various parameter settings have on the formation of a
log-Gabor filter bank used in the functions above.
monofilt.m An implementation of Felsberg's monogenic filters. This function applies
a bank of monogenic filters to an image to obtain the 2D analytic signal over a
number of scales. As in gaborconvolve this can be used as a pre-processing step
for texture analysis, feature detection and classification, etc.
An explanation of the implementation of convolution with log-Gabor filters used in
the functions above.
References:
Peter Kovesi, "Symmetry and Asymmetry From Local Phase". AI'97, Tenth
Australian Joint Conference on Artificial Intelligence. 2 - 4 December 1997.
Proceedings - Poster Papers. pp 185-190.
Peter Kovesi, "Image Features From Phase Congruency". Videre: A Journal of
Computer Vision Research. MIT Press. Volume 1, Number 3, Summer 1999.
Peter Kovesi, "Edges Are Not Just Steps". Proceedings of ACCV2002 The Fifth
3 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
Reference:
Integral Images
Reference:
Tech report describing high speed approximate Gaussian filtering via integral
images.
4 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
edgelink.m edge linking function that forms lists of connected edge points from a
binary edge image. (Needs findendsjunctions and cleanedgelist below).
drawedgelist.m plots out a set of edge lists generated by edgelink or lineseg.
edgelist2image.m transfers edgelist data back into a 2D image array.
lineseg.m forms straight line segments fitted with a specified tolerance to the lists
of connected edge points.
maxlinedev.m is also used by lineseg.m to calculate deviations of the edge lists
from the fitted segments.
findendsjunctions.m finds line junctions and endings in a line/edge image.
cleanedgelist.m cleans up a set of edge lists generated by edgelink or lineseg so
that isolated edges and spurs that are shorter than a minimum length are removed.
Example of using these functions above.
5 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
step2line.m Generates a test image where the feature type changes from a step
edge to a line feature from top to bottom, while retaining perfect phase congruency.
This test image indicates the importance of phase congruency irrespective of the
angle at which congruency occurs at and, up to a point, irrespective of the rate at
which the amplitude spectrum decays with frequency. A gradient based edge
detector produces a double response for all features that have congruence of
phase at angles other than zero (towards the bottom of the test image). The phase
congruency detector marks features with a single response. The colour coded
image was generated by dispfeat.m
circsine.m Generates a test image consisting of a circular sine wave grating. Can
also be used to construct circular phase congruent patterns.
starsine.m Generates a test image consisting of a star like sine wave grating
radiating out from the centre. As with circsine this function can be used to construct
star like phase congruent patterns.
Image Denoising
noisecomp.m Code for denoising images. This code differs from standard wavelet
denoising techniques in that it uses non-orthogonal wavelets, and unlike existing
techniques, ensures that phase information is preserved in the image. Phase
information is of crucial importance to human visual perception. Also, this code
does have an effective way of determining threshold levels automatically.
See the example below, under grey scale transformation and enhancement, for an
example of the use of this function.
Reference:
6 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
Note that the reconstruction is only valid up to a scale factor (which can be
corrected for). However the reconstruction process is very robust to noise and to
missing data values. Reconstructions (up to positive/negative shape ambiguity) are
possible where there is an ambiguity of pi in tilt values. Low quality reconstructions
are also possible with just slant, or just tilt data alone. However, if you have full
gradient information you are better off with the Frankot Chellappa algorithm below.
Reference:
7 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
Scalogram Calculation
Anisotropic diffusion
8 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
image. However you should note that many surveillance systems are close to being
legally blind.
See Video Surveillance: Legally Blind? DICTA 2009 Melbourne.
9 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
If you are using these functions above you should look at Andrew Zisserman's
MATLAB Functions for Multiple View Geometry
Also, you must listen to The Fundamental Matrix Song by Daniel Wedge.
Feature Matching
10 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
each pixel is effectively encoded with only 3 bits. (Though this potential speed is not
realized in this implementation). See testfund below to see an example of the use
of this function.
Fingerprint Enhancement
11 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
noiseonf.m generates noise images with specified amplitude spectra. One can
create pleasing cloud pattern images this way.
cloud9.m creates a movie sequence of noise images with specified amplitude
spectra. Very relaxing.
12 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
matscii.m Function to generate ASCII images from grey scale images. A bit of retro
fun, but constant width fonts are getting hard to come by these days...
Homogeneous Transforms
Quaternions
Angle-Axis Descriptors
13 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
findimage.m Displays a file dialog box to allow you to find and load your image
interactively. Useful when you have forgotten the name of your image, or can't be
bothered typing it out.
show.m This function displays an image, automatically setting the colour map to
grey if it is a 2D image, or leaving it as colour otherwise, and setting the axes to be
'equal'. The image is also displayed as 'TrueSize', that is, pixels on the screen
match pixels in the image. Finally a title corresponding to the image variable name
is added.
showfft.m displays the amplitude spectrum of an fft.
showlogfft.m displays the log amplitude spectrum of an fft.
showsurf.m This function wraps up the commands I usually use to display a
surface. The surface is displayed using SURFL with interpolated shading, in my
favourite colormap of 'copper', with rotate3d on, and axis vis3d set.
togglefigs.m provides a convenient means of toggling the display of multiple
figures. Handy for comparing images and plots.
imwritesc.m This function combines image rescaling and writing into the one
function. If the image type is double image values are rescaled to the range 0-1
so that no overflow occurs when writing 8-bit intensity values. The image format to
use is determined by MATLAB from the file ending. If the image type is of uint8 no
rescaling is performed.
matprint.m This function prints out a matrix using a specified C style format string.
Often you find that MATLAB's default number formats are not what you want...
digipts.m Function to digitise points in an image. This function uses the cross-hair
cursor provided by GINPUT. I find this is much more useable than the cursor used
by IMPIXEL. In addition each location digitised is marked with a red '+'.
impad Pads the boundary of an image with zeros.
imtrim Trims the boundary of an image (unpads it)
imsetborder Sets border pixels of an image to a specified value.
removenan Replaces NaN values in a matrix with a specified default value. Useful
when you want to prevent NaNs from contaminating and destroying some operation
on an array, for example, an FFT.
fillnan Replaces NaN values in a matrix with the value in the closest non-Nan pixel.
implace.m Function to place an image at a specified location within a larger image.
cubicroots.m computes the real roots of a cubic.
rgb2nrgb.m RGB to normalised RGB colour conversion.
rgb2lab.m RGB to L*a*b* colour conversion.
weightedhistc.m basic equivalent to MATLAB's HISTC function for weighted data.
Geometric shapes
14 of 15 3/5/2011 10:25 PM
Peter's Functions for Computer Vision http://www.csse.uwa.edu.au/~pk/research/matlabfns/
icosahedron.
geodome.m generates the vertices, adjacency graph and face list of a geodesic
sphere. Apart from looking cool the vertices, or face centres, of a geodesic sphere
can be useful for defining the bin centres of a 3D orientation histogram.
gplot3d.m a 3D version of MATLAB's gplot function.
drawfaces.m draws triangular faces defined by a set of vertices and a
corresponding face vertex list.
superquad.m generates parametric surfaces of superquadratics.
supertorus.m generates parametric surfaces of a supertorus.
15 of 15 3/5/2011 10:25 PM