MATLAB and Octave Functions
for Computer Vision and Image Processing
Phase Based Feature Detection and Phase Congruency
Phase congruency is an illumination and contrast invariant measure
of feature significance. Unlike gradient based feature detectors,
which can only detect step features, phase congruency correctly
detects features at all kind of phase angle, and not just step
features having a phase angle of 0 or 180 degrees.
function computes phase congruency via monogenic filters. It has
excellent speed and much reduced memory requirements compared to the
other phase congruency functions below. Requires
phasecong3.m This function
supersedes phasecong2.m and phasecong.m being faster and requiring less
memory. Computes corner features in addition to edges. Requires
- Deprecated: phasecong.m
Original code for calculating phase congruency in an image. This function also
returns a feature type image. Note this function is superseded by
phasecong2.m and phasecong3.m and is only here for reference.
phasecong2.m Phase congruency
code that combines edge and corner detection, and provides better
localization. Note this function is superseded by phasecong3.m and
phasecongmono.m and is only here for reference.
- dispfeat.m This
function provides visualisation and statistics of the different
feature types found in an image by phasecong. Typically you will find
a broad distribution of all feature types between step edges and
lines. This function needs edgelink.m (see below).
- odot.m Demonstrates
the actions of the 'Odot' and 'Oslash' operators on a 1D signal.
These operators allow one to decompose and combine signals in a way
that is consistent with the Local Energy model of feature perception.
- spatialgabor.m applies
a single oriented Gabor filter to an image.
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
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
- 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
Applies highpassfilter and computes phase and amplitude via monogenic filters.
- filtergrid.m Generates grid
for constructing frequency domain filters. Used by some of the functions above.
- An explanation of
the implementation of convolution with log-Gabor filters used in the
- 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.
Electronic publishing, even with a reputable publisher, can be
problematic. For some reason the MIT Press has chosen to no longer
maintain an archive of Videre. Fortunately an archive of the
journal can be found at the University of Rochester at
- Peter Kovesi,
"Edges Are Not Just Steps". Proceedings of ACCV2002 The
Fifth Asian Conference on Computer Vision, Melbourne Jan
22-25, 2002. pp 822-827.
- Peter Kovesi, "Phase Congruency Detects Corners and Edges".
The Australian Pattern Recognition Society Conference:
Digital Image Computing: Techniques and Applications DICTA 2003.
December 2003. Sydney. pp 309-318.
Spatial Feature Detection
- canny.m Canny edge
- harris.m Harris corner
- fastradial.m An
implementation of Loy and Zelinski's fast radial feature
- gaussfilt.m Wrapper
function for convenient Gaussian filtering.
computes 1st and 2nd derivatives of an image using the 5-tap
coefficients given by Farid and Simoncelli. Use this function
instead of MATLAB's GRADIENT function for much more accurate results.
computes derivatives using the 7-tap
coefficients given by Farid and Simoncelli.
Filters regions on their property's values. Allows you to select
blobs within a specified size or major axis orientation range etc
images of my photocopy of Harris and Stephens' paper 'A Combined
Corner and Edge Detector'.
- slic.m Implementation of
Achanta et al's SLIC Superpixels.
- spdbscan.m Clustering
of superpixels using the DBSCAN algorithm.
Computes adjacency matrix for an image of labeled regions, as
might be produced by a superpixel or graph cut algorithm.
Cleans up small regions in a segmented image. (slow and a bit flakey,
use mcleanupregions.m below)
Morphological clean up of small regions in a segmented image. (needs
Finds groupings of disconnected labeled regions. Used by
mcleanupregions.m to reduce execution time.
Ensures labeled regions are distinct.
Renumbers regions in a labeled image so that they range from 1:maxRegions.
Draw boundaries of labeled regions in an image.
- maskimage.m Apply mask
to an image.
- dbscan.m Basic
implementation of DBSCAN clustering
- testdbscan.m Function
to test/demonstrate dbscan.m
illustrating how you can use the functions above to perform basic
segmentation using SLIC superpixels and DBSCAN clustering.
- integralimage.m computes
integral image of an image.
performs filtering using an integral image.
transposes an integral image filter specification.
performs averaging filtering using an integral image. Computation
cost is independent of averaging filter size.
This function approximates Gaussian filtering by repeatedly applying
integaverag.m . This allows smoothing at a very low computational cost
that is independent of the Gaussian size.
This function is used by integgausfilt.m to solve for the multiple averaging
filter widths needed to approximate a Gaussian of desired standard deviation.
Fast Almost-Gaussian Filtering The Australian Pattern
Recognition Society Conference: DICTA 2010. December
This paper describes how to obtain high speed
approximate Gaussian filtering via integral images. There is no
computational justification for using crude box filters to approximate
Gaussians and their derivatives as is done, for example, by the SURF feature
Non-Maxima Suppression and Hysteresis Thresholding
- nonmaxsup.m Code for
performing non-maxima suppression for edge images.
- nonmaxsuppts.m Code
for performing non-maxima suppression and thresholding of points
generated by a feature/corner detector. It optionally returns
sub-pixel feature locations.
- subpix2d.m Sub-pixel
locations in a 2D image.
- subpix3d.m Sub-pixel
locations in a 3D volume or in 2D + scale space data.
- hysthresh.m code for
performing hysteresis thresholding.
computes orientations on a feature image prior to nonmaximal
suppression in the case where no orientation information is available
from the feature detection process.
applies smoothing to an orientation field which can be useful before
applying nonmaximal suppression.
an implementation of Wellner's adaptive thresholding method.
Edge Linking and Line Segment Fitting
fitted line segments
edge linking function that forms lists of connected edge points from a
binary edge image. Needs findendsjunctions below.
plots out a set of edge lists generated by edgelink or lineseg.
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.
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.
There are some issues with this code and it can be memory intensive.
Should be fine on small images (< 500 x 500).
- Example of using these
Test Grating for Edge Detection
Canny edge image
Colour coded for feature type
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
Generates a test image consisting of a circular sine wave grating.
Can also be used to construct circular phase congruent patterns.
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.
Surface Normals to Surfaces
Function reconstructs an estimate of a surface from its surface
normals by correlating the surface normals with that those of a bank
of shapelet basis functions. The correlation results are summed to
produce the reconstruction. The sumation of shapelet basis functions
results in an implicit integration of the surface while enforcing
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.
- frankotchellappa.m An
implementation of Frankot and Chellappa's algorithm for constructing
an integrable surface from gradient information. If you have full
gradient information in x and y this is probably the best algorithm to
use. It is very simple, very fast and highly robust to noise. If you
have surface normal information in the form of slant and tilt, and you
have an ambiguity of pi in your tilt data, or only have slant, then
try using shapeltsurf.m above.
Converts gradient values over a surface to slant and tilt angles.
Converts slant and tilt angles over a surface to gradients.
Generates a needle plot given surface gradients over a surface.
- needleplotst.m Generates a
needle plot given slant and tilt values over a surface.
- testp.m Generates a
synthetic test surface along with its surface normals for testing
Function to calculate the phase and amplitude scalograms of a 1D
signal. The analysis is done using quadrature pairs of log Gabor
- anisodiff.m Function
to perform anisotropic diffusion of an image following Perona and
Malik's algorithm. This process smoothes regions while preserving,
and enhancing, the contrast at sharp intensity gradients.
Grey Scale Transformation and Enhancement
separates fields from a video frame, and optionally interpolates
interpolates lines on a field extracted from a video frame.
- normalise.m rescales
image values to 0-1.
adjusts image contrast using sigmoid function.
- adjgamma.m adjusts
- greytrans.m allows
you to interactively remap intensity values in a colour or greyscale
image via a mapping function defined by a series of spline points. A
feeble attempt at replicating xv's intensity mapping tool. It
is not as fast but it does operate on floating point images allowing
you to better preserve image fidelity. (Needs remapim.m).
- remapim.m is a non-interactive
version of greytrans that allows you to apply an intensity mapping to
a colour or greyscale image using a mapping function determined
experimentally with greytrans. Useful if you want to apply the same
mapping function to a sequence of images.
truncates ends of an image histogram. Useful for enhancing images
with outlying values.
- histeqfloat.m This function
differs from classical histogram equalisation functions in that the
cumulative histogram treated as a function rather than as a
lookup table for mapping input grey values to their output values.
Under this approach, for images containing floating point values, the
number of distinct values in the output image will be the same as the
number of distinct values in the input. This can make a significant
- Example of using some of
these functions above to enhance a video surveillance image. However
you should note that many surveillance systems are close to being
Surveillance: Legally Blind? DICTA 2009 Melbourne.
Frequency Domain Transformations
Fourier transform of the periodic component of Moisan's "Periodic plus
Smooth Image Decomposition". I think this will become my default fft
function for images.
- lowpassfilter.m constructs
low-pass Butterworth filter.
- highpassfilter.m constructs
high-pass Butterworth filter.
- highboostfilter.m constructs
high-boost Butterworth filter.
- bandpassfilter.m constructs
band-pass Butterworth filter.
performs homomorphic filtering on an image. One of my favourite image
enhancement techniques. (needs histtruncate.m and normalise.m)
- psf.m generates a
variety of point-spread functions. This function can be useful when
manually specifying point-spread functions for Wiener filtering or
with deconvolution functions such as the Richardson-Lucy algorithm
(see the MATLAB Image Processing Toolbox function deconvlucy.m).
- psf2.m is identical
to psf, it just has a different way of specifying the function shape
which may be more convenient for some applications.
- imspect.m plots
image amplitude spectrum averaged over all orientations.
demonstrates image reconstruction from its Fourier components.
Generates grid for constructing frequency domain filters. Used by
some of the functions above.
Functions Supporting Projective Geometry
image of beach
computes the 2x2 1D homography of 3 or more points along a line.
computes the 3x3 2D homography of 4 or more points in a plane. This
code follows the normalised direct linear transformation algorithm
given by Hartley and Zisserman.
computes the fundamental matrix from 8 or more matching points in a
stereo pair of images using the normalised 8 point algorithm.
- affinefundmatrix.m computes the
affine fundamental matrix from 4 or more matching points in a stereo
pair of images.
- fundfromcameras.m computes fundamental matrix
given two camera projection matrices.
camera projection matrix into intrinsic and extrinsic parameters.
- rq3.m RQ decomposition of 3 x 3 matrix.
- normalise2dpts.m translates and
normalises a set of 2D homogeneous points so that their centroid is at
the origin and their mean distance from the origin is sqrt(2). This
is used to improve the conditioning of any equations used to solve
homographies, fundamental matrices etc.
normalises an array of homogeneous coordinates so that their scale
parameter is 1. Points at infinity are unchanged.
makehomogeneous.m converts an
N x npts array of inhomogeneous points to homogeneous points with
normalises an N x npts array of homogeneous points to a scale of 1 and
returns the inhomogeneous coordinates.
- imTrans.m applies a homogeneous
transform to an image. The output image origin and size is adjusted
to contain the transformed image. (Note I wrote this code before
version 3 of the Image Processing Toolbox was released with the
function IMTRANSFORM. You are probably better off using MATLAB's
- imTransD.m applies a
homogeneous transform to an image. No origin shift is applied to the
transformed image. I use this function for registering images etc.
- digiplane.m allows
you to digitise and transform points within a planar region in an
- equalAngleConstraint.m Affine
transform constraints given two equal angles.
- knownAngleConstraint.m Affine
transform constraints given a known angle.
- lengthRatioConstraint Affine
transform constraints given a length ratio.
- circleintersect.m Finds
intersection of two circles. Use this function to solve for affine
- hcross.m Homogeneous
cross product, result normalised to s = 1.
- hline.m Plot 2D lines
defined in homogeneous coordinates.
- homoTrans 2D homogeneous
transformation of points/lines.
- plotPoint.m Plots
point with specified mark and optional text label.
- If you are using these functions above you should look at
MATLAB Functions for Multiple View Geometry
Also, you must
listen to The Fundamental
Matrix Song by Daniel Wedge.
- matchbycorrelation.m generates
putative matches between previously detected feature points in two
images by looking for points that are maximally correlated with each
other within windows surrounding each point. Only points that
correlate most strongly with each other in both directions are
returned. This is a simple-minded N2 comparison.
- matchbymonogenicphase.m is
similar to matchbycorrelation, but instead matches on oriented phase
values rather than greyscale values. This matcher performs rather
well relative to normalised greyscale correlation. Typically there
are more putative matches found and fewer outliers. There is a
greater computational cost in the pre-filtering stage but potentially
the matching stage is much faster as 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.
Model Fitting and Robust Estimation
- ransac.m a general purpose
implementation of the RANSAC algorithm.
robustly fits a homography to a set of putatively matched image points.
- ransacfitfundmatrix.m robustly
fits a fundamental matrix to a set of putatively matched image points.
This function uses an 8 point fundamental matrix solution.
- ransacfitfundmatrix7.m robustly
fits a fundamental matrix to a set of putatively matched image points.
This function requires Andrew Zisserman's 7 point fundamental matrix code
MATLAB Functions for Multiple View Geometry
- ransacfitaffinefund.m robustly
fits an affine fundamental matrix to a set of putatively matched image
robustly fits a plane to 3D data points.
robustly fits a line to 3D data points.
- iscolinear.m tests if
3 points are colinear, used by ransacfitplane and ransacfithomography.
- fitline.m least squares
fit of a line to 2D data points.
- fitline3d.m least squares
fit of a line to 3D data points. Contributed by Felix Duvallet.
- fitplane.m least squares
fit of a plane to 3D data points.
example of using ransacfitplane.m
example of using ransacfitline.m
example of using ransacfitfundmatrix.m
example of using ransacfithoography.m
- randomsample a basic
replacement for randsample to be used with ransac.m
should you not have the MATLAB Statistics Toolbox, or are using Octave.
- Example of using these
functions above to find the fundamental matrix.
- ridgesegment.m identifies
ridge-like regions of a fingerprint image. It also normalises the
intensity values of the image.
- ridgeorient.m estimates the
local orientation of ridges in a fingerprint.
- plotridgeorient.m plots
ridge orientations calculated by ridgeorient.
- ridgefreq.m estimates the
local ridge frequency across a fingerprint image.
- freqest.m estimates the ridge
frequency within a small block of an image. This is used by
- ridgefilter.m enhances
a fingerprint image using oriented filters.
- Example of using these functions above.
- irelief.m Function for interactive
relief shading of a dataset. Requires
- relief.m Non-interactive version
of the function above.
Generates upward continuation of magnetic or gravity potential field data.
- ppdrc.m Phase Preserving
Dynamic Range Compression. A frequency based tonemapping algorithm
suited to scientific, non-photographic images. Try using this
function instead of histogram equalization. Very good on aeromagentic
- agc.m This function implements
Rajagopalan's Automatic Gain Control algorithm. The original
application was for displaying geoscientific vertical magnetic
gradient data but it can be useful for any kind of high dynamic range
Generates orientation selective filterings of an image. Use for
highlighting structures with dominant orientations in your data.
- Peter Kovesi, "Phase Preserving Tone Mapping of Non-Photographic
High Dynamic Range Images". Proceedings: The Australian Pattern
Recognition Society Conference: Digital Image Computing: Techniques
and Applications DICTA 2012.
Interactive Image Blending
These functions provide a set of interactive tools for visualizing
multiple images. Some videos of their use can be seen
Generates an interactive image for blending between a sequence of images.
Generates an interactive image for blending between a 2D grid of images.
Interactive ternary image for blending 3 images.
- cliquemix.m Allows
blending between any pair within a collection of images.
- cyclemix.m Allows
blending between a sequence of images in a cyclic manner.
Adaptation of the generalised logistics function for use as a
weighting function for blending images.
- swipe.m Don't just swipe between two
images when you can interactively swipe between 2, 3 or 4 images!
Collects and checks images prior to blending.
The functions above also require:
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!
Peter Kovesi, Eun-Jung Holden and Jason Wong, 2014. "Interactive
Multi-Image Blending for Visualization and
Interpretation," Computers & Geosciences 72 (2014) 147-155.
Free access to this paper is available until 21st
Interesting Synthetic and Test Images
- 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
- chirpexp.m creates an
exponential chirp test image. The amplitude of the chirp is modulated
from 1 at the top of the image to 0 at the bottom. I have used this
test image to evaluate the effectiveness of different colourmaps, and
sections of colourmaps, over varying spatial frequencies and contrast.
- chirplin.m similar to
chirpexp.m but with a linear chirp signal.
- sineramp.m Generates a
test image consisting of a sine wave superimposed on a ramp function
The amplitude of the sine wave is modulated from its full value at the
top of the image to 0 at the bottom. A useful test image for
highlighting problems in colour maps.
Generates a test image representing a cyclic version of sineramp.m for
testing of cyclic colour maps. It consists of a sine wave
superimposed on a spiral ramp function.
- derespolar.m Generates
deresolved images in polar coordinates.
- polartrans.m Generates a polar
transformation of an image. A linear or logarithmic radius
transformation can be specified.
Generates an image where the phase values are quantized to a desired
number of levels. Phase values in an image are important. However,
despite this, they can be quantized very heavily with relatively little
ASCII Image Generation
- 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...
- plotframe.m plots a
coordinate frame specified by a homogeneous transform.
- trans.m homogeneous
- rotx.m homogeneous matrix
for rotation about x-axis.
- roty.m homogeneous matrix
for rotation about y-axis.
- rotz.m homogeneous matrix
for rotation about z-axis.
homogeneous transformation of points/lines
- invht.m optimized
inverse of homogeneous transformation matrix
- inveuler.m solves for
euler angles given a homogeneous transform.
- invrpy.m solves for
roll, pitch, yaw angles given a homogeneous transform.
- dhtrans.m calculates
the 4x4 homogeneous Denavit Hartenberg matrix given link parameters of
joint angle, length, joint offset, and twist.
Image Display, Image Writing and Miscellaneous
- findimage.m Displays a
file dialog box to allow you to find and load an image interactively.
Useful when you have forgotten the name of your image, or can't be
bothered typing it out.
- findimages.m Allows you
to select and load multiple images. These are returned in a cell array.
- show.m This function displays
an image, automatically setting the colour map to grey(256) 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.
- showangularim.m This function
displays an image of angular data with a specified colour map. For
angular data to be rendered correctly it is important that the data
values are respected so that data values are correctly assigned to
specific entries in a cyclic colour map. The assignment of values to
colours also depends on whether the data is cyclic over pi, or 2*pi.
This function also allows the colour map encoding of the angular
information to be modulated to represent the
amplitude/reliability/coherence of the angular data.
- showdivim.m This function is intended
for displaying an image with a diverging colour map. To do this
correctly requires that the desired reference value in the data is
correctly associated with the centre entry of the diverging colour map.
- 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
- 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.
- weightedhistc.m basic equivalent
to MATLAB's HISTC function for weighted data.
- geoseries.m convenience function for
generating geometric series.
- circle.m Draws a circle.
- circularstruct.m generates a
circular structuring element for morphological operations. You can
use MATLAB's strel('disk',R,0) instead. However occasionally I like
being able to tweak the shape by using floating point values for the
- polyfit2d.m Fits 2D
polynomial surface to data. Basic equivalent of MATLAB's polyfit for
1D data. Incorporates some normalisation to reduce numerical problems.
- polyval2d.m Evaluates 2D
polynomial surface generated by polyfit2d.m
Colourmaps and colour conversions
- rgb2lab.m RGB to L*a*b* colour conversion.
- rgb2cmyk.m RGB to cmyk colour conversion.
- cmyk2rgb.m cmyk to RGB colour conversion.
- rgb2nrgb.m RGB to
normalised RGB colour conversion.
- viewlabspace.m Interactive
visualisation of CIELAB colour space.
- viewlabspace2.m Another
interactive visualisation of CIELAB colour space that provides
vertical slices through the colour space.
- labmap.m Generates a L*a*b* colourmap
over a specified range of lightness values and angles in the a*b*
plane. L*a*b* space is more perceptually uniform than, say, HSV
space. Indeed, HSV and other rainbow-like colourmaps can be quite
- hsvmap.m Generates an HSV colourmap over
a specified range of hues.
- graymap.m Generates a gray colourmap over
a specified range of levels.
- randmap.m Generates a colourmap of
random colours. Useful for displaying a labeled segmented image
- bilteralmap.m This colourmap is
useful where your data has a clear origin. The hue indicates the
polarity of your data, and saturation indicate amplitude.
- map2geosofttbl.m Converts a RGB
colourmap to KCMY and writes it out as a .tbl file that can be loaded
into Geosoft Oasis Montaj
- geosofttbl2map.m Reads a Geosoft
KCMY colour table file and converts it RGB.
- applycolourmap.m Applies a
colourmap to a single channel image to obtain an RGB result.
generates the vertices, adjacency graph and face list of an
- 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
- gplot3d.m a 3D version of MATLAB's
- 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.
String handling convenience functions
- strstartswith.m tests if a string
starts with a specified substring.
- strendswith.m tests if a string
ends with a specified substring.
- namenpath.m returns filename and its
path from a full filename that may include a directory path
- basename.m trims off the suffix ending
from a filename.
- pathlist.m produces a cell array of
directories along a directory path