Add support for 3-D template matching