TM_CCOEFF_NORMED
时间: 2023-08-06 10:09:57 浏览: 177
TM_CCOEFF_NORMED是一种模板匹配方法,用于计算归一化相关系数。在使用这种方法时,通过计算模板与目标图像的相关性系数来确定匹配程度。相关性系数的取值范围在-1到1之间,值越接近1表示匹配程度越高。\[3\]
在代码中,使用cv2.matchTemplate函数进行模板匹配,并将方法参数设置为cv2.TM_CCOEFF_NORMED。然后使用cv2.minMaxLoc函数找到结果的最小值和最大值的位置,通过判断方法是否为cv2.TM_SQDIFF或cv2.TM_SQDIFF_NORMED来确定最小值的位置。最后,使用cv2.rectangle函数在目标图像上绘制矩形框来标记匹配的位置。\[3\]
#### 引用[.reference_title]
- *1* [OpenCV笔记(模板匹配)](https://blog.csdn.net/m0_50635229/article/details/110956147)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [OpenCV图像处理—— 模板匹配](https://blog.csdn.net/ziyonghong/article/details/88773485)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [模板匹配&直方图均衡化](https://blog.csdn.net/m0_59310933/article/details/122600245)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文