MATLAB and Octave Functions
for Computer Vision and Image Processing


Peter Kovesi

 


Index to Code Sections


The complete set of these functions is available as a zip file MatlabFns.zip

MATLAB

To use these functions you will need MATLAB and the MATLAB Image Processing Toolbox.
You may also want to refer to the MATLAB documentation and the Image Processing Toolbox documentation

Octave

Alternatively you can use Octave which is a very good open source alternative to MATLAB. Almost all the functions on this page run under Octave. See my Notes on using Octave.

An advantage of using Octave is that you can run it on your Android device. (I can compute phase congruency on my mobile phone!) Get Corbin Champion's port of Octave at Google play here.

MATLAB/Octave compatibility of individual function is indicated as follows

  • Runs under MATLAB and Octave.
  • Only runs under MATLAB.
  • Not tested under Octave.

These days I am working almost entirely in Julia. This is a very exciting language that is certainly worth a look. At this stage the language is still young and the image processing and computer vision packages are very much a work in progress. However, watch this space! Julia may well become the dominant language for scientific programming.

Collections of functions that I have ported to Julia are indicated in the code sections below.




I receive so many mail messages regarding this site that I have difficulty responding to them all. I will endeavor to respond to mail that directly concerns the use of individual functions. However, please note I do not have the time to provide an on-line vision problem solving service!

Please report any bugs and/or suggest enhancements to
pk@peterkovesi.com

Cheers,
Peter Kovesi


Perceptually Uniform Colour Maps

Many widely used colour maps have perceptual flat spots that can hide features as large as 10% of your total data range. They may also have points of locally high colour contrast leading to the perception of false features in your data when there are none. MATLAB's 'hot', 'jet', and 'hsv' colour maps suffer from these problems. Use the perceptually uniform colorcet maps instead! For an overview of this work and the theory behind it please visit this page.

Generation and correction of colour maps

If you want to experiment with the generation of your own perceptually uniform colour maps...

Rendering of images with colour maps

Test images

Visualization of colour map paths and colour spaces

Functions for reading and writing colour maps in various formats

Colour conversion convenience functions.

Additional supporting functions that are required.


Julia Code

Python Colour Maps

R Colour Maps

Reference:


Interactive Image Blending

These functions provide a set of interactive tools for visualizing multiple images. Some videos of their use can be seen here.

The functions above also require: normalise.m, histtruncate.m, circle.m, circularstruct.m and namenpath.m.

Demo package: Download BlendDemo.zip. This contains all the functions above and some sample data sets. Within the expanded folder in MATLAB run blenddemo.m. A series of windows will open, each demonstrating a different blending interface. Click in any of them and play!

Reference:


Phase Based Feature Detection and Phase Congruency


References:


Spatial Feature Detection

Reference:

    For those working in Julia the package ImageProjectiveGeometry.jl implements most of the functions above.


Segmentation


Integral Images

Reference:


Non-Maxima Suppression and Hysteresis Thresholding



Edge Linking and Line Segment Fitting


image

edges

labeled edges

fitted line segments


Test Grating for Edge Detection


Test image

Canny edge image

Phase congruency

Colour coded for feature type


Image Denoising

 

Reference:


Surface Normals to Surfaces


Surface Normals
     
Surface Reconstruction

Reference:


Scalogram Calculation



Anisotropic diffusion

 


Grey Scale Transformation and Enhancement


Frequency Domain Transformations


Functions Supporting Projective Geometry


image of beach

rectified beach

    For those working in Julia the package ImageProjectiveGeometry.jl implements most of the functions above.


Feature Matching


Model Fitting and Robust Estimation


Putative matches obtained
by matchbycorrelation.m
   
Inlying matches consistent
with fundamental matrix

References:

    For those working in Julia the package ImageProjectiveGeometry.jl implements most of the functions above.


Fingerprint Enhancement

   

Geoscientific Functions

   

Reference:


Interesting Synthetic and Test Images






ASCII Image Generation



Homogeneous Transforms

Quaternions

Angle-Axis Descriptors

    For those working in Julia the package ImageProjectiveGeometry.jl implements most of the functions above.


Image Display, Image Writing and Miscellaneous

Geometric shapes

String handling convenience functions