multi-template-matching/MultiTemplateMatching-Python

Feature request: Support 3D images

Closed this issue · 1 comments

I may be mistaken, but it seems this package supports only 2D images, is that correct?

Hi, you are right, currently the computation is implemented for 2D grayscale images only.
Scikit image has a similar function that allows to search 3D images if I'm not wrong. But Im not sure that the template can also be 3D.

One reason for that might that the computation does not scale up well in terms of computation time as we do a 1-to-1 pixel comparison for every location of the template.
Also with a 3D template if you think of rotations now you have more degrees of freedom so not sure template matching is optimal for that.

The idea here is more to have a simple alternative to object recognition algorithm like yolo which are 2D only too.
As an alternative you can either run the 2D template matching on each slices or a subset of slices and pick slices with the best score, or project your 3D volume to a 2D slice like when you convert RGB to gray.