This page contains an overview of the COSFIRE operator and an example concerning the corresponding Matlab scripts.
With this implementation you can configure a COSFIRE filter by a given prototype pattern and apply the resulting COSFIRE filter to a given testing image for the detection of patterns that are similar to the prototype pattern.
The COSFIRE filters are inspired by shape-selective neurons in area V4 of visual cortex of the brain.
A COSFIRE filter is conceptually simple and easy to implement: they involve convolutions, blurring, shifting and a pixel-wise function evaluation.
They are versatile keypoint detectors as they can be automatically configured by any single prototype pattern. A COSFIRE filter achieves
tolerance to rotation, scale and reflection.
For further details we refer to the concerned publication .
Configuration of a COSFIRE filter
function operator = configureCOSFIRE(prototypePattern, keypoint)
prototypePattern is an intensity image that contains a prototype pattern.
keypoint is the pair [row,col] coordinates of the point of interest that characterizes the prototype pattern
operator is a structure containing two parameters, namely tuples and params. The parameter operator.tuples is a matrix of 4 rows and n columns,
where each column of 4 values (lambda, theta, rho, phi) characterizes the properties of a contour part from the prototype pattern, The parameter operator.params is another
structure that contains all the parameter values required by a COSFIRE filter, such as a list of radii values of a number of concentric cirlces.
proto = imread('pattern.bmp');
operator = configureCOSFIRE(proto,[116,132]);
The red spot indicates the specified point of interest [116,132] and the red frame indicates the prototype pattern
Enlarged prototype pattern
Structure of the configured COSFIRE operator. This illustration is achieved by the third statement above.
Application of a COSFIRE filter
function output = configureCOSFIRE(testingImage, operator)
testingImage is an intensity image to which we apply the given operator
operator is a structure that represents a COSFIRE filter
output is the response matrix of the COSFIRE operator whose elements vary between 0 and 1.
I = imread('pattern.bmp');
output = applyCOSFIRE(I, operator);
The marked red spots illustrate the locations of the local maxima values of the COSFIRE output
 G. Azzopardi and N. Petkov, "Trainable COSFIRE filters for keypoint detection and pattern recognition", IEEE Transactions on Pattern Analysis and Machine Intelligence, 2012, DOI: 10.1109/TPAMI.2012.106. [pdf],[bib]