Template matching from a screenshot of a window

后端 未结 2 1300
感动是毒
感动是毒 2020-12-18 13:19

What I\'ve done

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

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 13:47

    To expand on Balaji's very useful answer, make sure that all the Mats 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.

提交回复
热议问题