Trainable COSFIRE filters for keypoint detection and pattern recognition

N. Petkov and G. Azzopardi, University of Groningen,
Department of Computing Science, Intelligent Systems

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 [1].

Configuration of a COSFIRE filter

function operator = configureCOSFIRE(prototypePattern, keypoint)


proto = imread('pattern.bmp');
operator = configureCOSFIRE(proto,[116,132]);
pattern.bmp 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)


I = imread('pattern.bmp');
output = applyCOSFIRE(I, operator);
I output The marked red spots illustrate
the locations of the local maxima
values of the COSFIRE output


[1] 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]

Last changed: 2012-07-01