Multi-Template Matching for object-localisation in Fiji


I am glad to announce the release of our Fiji plugin for object-localisation using multiple template matching.


Enable the following update sites: Multi-Template-Matching and IJ-OpenCV


You can find extensive documentation on the GitHub repository.

Video tutorials

Check our serie of video tutorials on youtube :wink:


We also uploaded some test datasets on Zenodo :wink:
Medaka embryos: 10.5281/zenodo.2650146
Zebrafish larvae : 10.5281/zenodo.2650161.


We also have an equivalent KNIME implementation


Thanks to @imagejan, @ctrueden, @Wayne, @gab1one @stelfrich for supporting this project by answering the forum(s) !

Template Matching plugin issues
Template matching plugin

Can this be scripted in Fiji?


Yes it is! Check video 3 for the macro recording :wink:

1 Like

And Python is also possible?


Thanks @LThomas, this is amazing!

In testing, matching a single object in each slice of a stack to the template seems to work very very well. Using the attached stack and template, I was able to detect many vesicles throughout mystack using vert/horiz flip and 90,180,270 rotation as demonstrated in the preprint.

Multiple matching seems to fail. Any number over 1 in expected objects results in no objects being found, using the same settings as above. Any advice on why this might be happening? This is all using the plugin freshly installed from the update site this morning.

Thanks for this awesome work!

Stack.tif (13.0 MB)
Template.tif (1.1 KB)


Every command that is macro-recordable can also be called from Jython. Just use the macro recorder in Javascript or Beanshell mode to get the required command (in Python you can omit the semicolons at the end, of course).

In essence, it’s usually just instead of run().

1 Like

Hi I am glad that you found it useful :wink:
Can you check the version of imagej you are using.
There was a bug in imageJ1.52n that lead to such issue. Updating to 1.52o or daily build fixes the bug.
Help>Update ImageJ

1 Like

That was it! Thanks again for such a great tool!