multi-template-matching/MultiTemplateMatching-Python

Jupyther Notebook Tutorial2-Template_Augmentation.ipynb throws error IndexError: invalid index to scalar variable.

Closed this issue · 1 comments

If I want to run the jupyther notebook in Google Colab I get an error when running the line
"# Then call the function matchTemplates (here a single template)
Hits = matchTemplates(listTemplate, image, N_object=4,score_threshold=0.4, method=cv2.TM_CCOEFF_NORMED, maxOverlap=0.3)"

There is probably a index error.
IndexError: invalid index to scalar variable.

Thanks for spotting and reporting the issue.
It was due to a breaking change with the latest opencv version.
I published 2 new releases of MTM. 1.6.2.post1 will work with Opencv version until 4.3.0, while MTM 1.6.3 works with opencv version from 4.5.4. In between I dont know, I havent taken the time to find out when exactly the breaking change occured.
But that should do ;)