williamfzc / findit

find target icon on your picture, and get its position
https://williamfzc.github.io/findit/
MIT License
109 stars 36 forks source link

希望可以支持带有蒙版的template匹配(opencv3支持) #1

Closed codeskyblue closed 5 years ago

codeskyblue commented 5 years ago

做好好高产,非常好的项目

williamfzc commented 5 years ago

谢谢~

这里的蒙版指的是模糊模板匹配吗?我理解的蒙版应该是类似图层遮罩之类的东西?

codeskyblue commented 5 years ago

恩,遮罩

williamfzc commented 5 years ago

我搞定啦,基本上是参照这个来的:https://stackoverflow.com/questions/35658323/python-opencv-matchtemplate-is-mask-feature-implemented ,不知道是不是你要的效果。

我这边不是很清楚使用场景是啥,所以就没有加入sample图片了,可以自己试试看效果哈。代码还没有release到pypi上,所以还是 clone 到本地直接安装吧~

sample里更新了使用方式,大概如下:

result = fi.find(
    'wechat_screen.png',
    scale=(1, 3, 10),
    mask_pic_path='mask.png',
)
williamfzc commented 5 years ago

已支持,用法参考:https://github.com/williamfzc/findit/blob/master/sample/demo.py