I have a small template image which is meant to be used to find coordinates of matching subimages within a larger screenshot image. The screenshot
To expand on Balaji's very useful answer, make sure that all the Mat
s being passed to the function are of the same type with the .type()
function. You can change src.create(height,width,CV_8UC4);
to the same type as template (or vice versa) and the error should be gone. Here's another version of the solution.