Template Matching Using OpenCV in Python

前端 未结 2 1143
感情败类
感情败类 2021-01-21 05:59

I am a newbie in Image Processing and learning about Template Matching by getting some help from OpenCV documentation, but I didn\'t understand some lines of the code.
Here

2条回答
  •  臣服心动
    2021-01-21 06:00

    The threshold 0.8 means the match should be at least 80% of template image and the source region of interest. Thus if it is greater than 80%, it is a coin. If you reduce the threshold the false positive results would increase even if it is not a coin.

    for pt in zip(*loc[::-1]): is for the points which have values greater than threshold. zip is a container of all such points and it will iterate to all such points and draw rectangle around this closed entity i.e. coins here.

提交回复
热议问题