# Template Matching Example - Normalized Cross Correlation (NCC)
#
# This example shows off how to use the NCC feature of your OpenMV Cam to match
# image patches to parts of an image... expect for extremely controlled enviorments
# NCC is not all to useful.
#
# WARNING: NCC supports needs to be reworked! As of right now this feature needs
# a lot of work to be made into somethin useful. This script will reamin to show
# that the functionality exists, but, in its current state is inadequate.
import time, sensor, image
from image import SEARCH_EX, SEARCH_DS
from pyb import Pin, Timer
sensor.reset() # 初始化摄像头
sensor.set_contrast(1)
sensor.set_gainceiling(16)
sensor.set_framesize(sensor.QQVGA)
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.skip_frames(10) # 跳过10帧,使新设置生效
template1_1 = image.Image("/1_1.pgm")
template1_2 = image.Image("/1_2.pgm")
template1_3 = image.Image("/1_3.pgm")
template1_4 = image.Image("/1_4.pgm")
template1_5 = image.Image("/1_5.pgm")
template1_6 = image.Image("/1_6.pgm")
template1_7 = image.Image("/1_7.pgm")
template1_8 = image.Image("/1_8.pgm")
template2_1 = image.Image("/2_1.pgm")
template2_2 = image.Image("/2_2.pgm")
template2_3 = image.Image("/2_3.pgm")
template2_4 = image.Image("/2_4.pgm")
template2_5 = image.Image("/2_5.pgm")
template2_6 = image.Image("/2_6.pgm")
template2_7 = image.Image("/2_7.pgm")
template2_8 = image.Image("/2_8.pgm")
template3_1 = image.Image("/3_1.pgm")
template3_2 = image.Image("/3_2.pgm")
template3_3 = image.Image("/3_3.pgm")
template3_4 = image.Image("/3_4.pgm")
template3_5 = image.Image("/3_5.pgm")
template3_6 = image.Image("/3_6.pgm")
template3_7 = image.Image("/3_7.pgm")
template3_8 = image.Image("/3_8.pgm")
template3_9 = image.Image("/3_9.pgm")
template3_10 = image.Image("/3_10.pgm")
template3_11 = image.Image("/3_11.pgm")
template3_12 = image.Image("/3_12.pgm")
template3_13 = image.Image("/3_13.pgm")
template3_14 = image.Image("/3_14.pgm")
template3_15 = image.Image("/3_15.pgm")
template3_16 = image.Image("/3_16.pgm")
template3_17 = image.Image("/3_17.pgm")
template3_18 = image.Image("/3_18.pgm")
template3_19 = image.Image("/3_19.pgm")
template3_20 = image.Image("/3_20.pgm")
template3_21 = image.Image("/3_21.pgm")
template3_22 = image.Image("/3_22.pgm")
template3_23 = image.Image("/3_23.pgm")
template3_24 = image.Image("/3_24.pgm")
template4_1 = image.Image("/4_1.pgm")
template4_2 = image.Image("/4_2.pgm")
template4_4 = image.Image("/4_4.pgm")
template4_5 = image.Image("/4_5.pgm")
template4_6 = image.Image("/4_6.pgm")
template4_7 = image.Image("/4_7.pgm")
template4_8 = image.Image("/4_8.pgm")
template4_9 = image.Image("/4_9.pgm")
template4_10 = image.Image("/4_10.pgm")
template4_11 = image.Image("/4_11.pgm")
template4_12 = image.Image("/4_12.pgm")
template4_13 = image.Image("/4_13.pgm")
template4_14 = image.Image("/4_14.pgm")
template4_15 = image.Image("/4_15.pgm")
template4_16 = image.Image("/4_16.pgm")
template4_17 = image.Image("/4_17.pgm")
template4_18 = image.Image("/4_18.pgm")
template4_19 = image.Image("/4_19.pgm")
template4_20 = image.Image("/4_20.pgm")
template4_21 = image.Image("/4_21.pgm")
template4_22 = image.Image("/4_22.pgm")
template4_23 = image.Image("/4_23.pgm")
template4_24 = image.Image("/4_24.pgm")
template5_1 = image.Image("/5_1.pgm")
template5_2 = image.Image("/5_2.pgm")
template5_3 = image.Image("/5_4.pgm")
template5_5 = image.Image("/5_5.pgm")
template5_6 = image.Image("/5_6.pgm")
template5_7 = image.Image("/5_7.pgm")
template5_8 = image.Image("/5_8.pgm")
template5_9 = image.Image("/5_9.pgm")
template5_10 = image.Image("/5_10.pgm")
template5_11 = image.Image("/5_11.pgm")
template5_12 = image.Image("/5_12.pgm")
template5_13 = image.Image("/5_13.pgm")
template5_14 = image.Image("/5_14.pgm")
template5_15 = image.Image("/5_15.pgm")
template5_16 = image.Image("/5_16.pgm")
template5_17 = image.Image("/5_17.pgm")
template5_18 = image.Image("/5_18.pgm")
template5_19 = image.Image("/5_19.pgm")
template5_20 = image.Image("/5_20.pgm")
template5_21 = image.Image("/5_21.pgm")
template5_22 = image.Image("/5_22.pgm")
template5_23 = image.Image("/5_23.pgm")
template5_24 = image.Image("/5_24.pgm")
template6_1 = image.Image("/6_1.pgm")
template6_2 = image.Image("/6_2.pgm")
template6_3 = image.Image("/6_4.pgm")
template6_5 = image.Image("/6_5.pgm")
template6_6 = image.Image("/6_6.pgm")
template6_7 = image.Image("/6_7.pgm")
template6_8 = image.Image("/6_8.pgm")
template6_9 = image.Image("/6_9.pgm")
template6_10 = image.Image("/6_10.pgm")
template6_11 = image.Image("/6_11.pgm")
template6_12 = image.Image("/6_12.pgm")
template6_13 = image.Image("/6_13.pgm")
template6_14 = image.Image("/6_14.pgm")
template6_15 = image.Image("/6_15.pgm")
template6_16 = image.Image("/6_16.pgm")
template6_17 = image.Image("/6_17.pgm")
template6_18 = image.Image("/6_18.pgm")
template6_19 = image.Image("/6_19.pgm")
template6_20 = image.Image("/6_20.pgm")
template6_21 = image.Image("/6_21.pgm")
template6_22 = image.Image("/6_22.pgm")
template6_23 = image.Image("/6_23.pgm")
template6_24 = image.Image("/6_24.pgm")
template7_1 = image.Image("/7_1.pgm")
template7_2 = image.Image("/7_2.pgm")
template7_3 = image.Image("/7_4.pgm")
template7_5 = image.Image("/7_5.pgm")
template7_6 = image.Image("/7_6.pgm")
template7_7 = image.Image("/7_7.pgm")
template7_8 = image.Image("/7_8.pgm")
template7_9 = image.Image("/7_9.pgm")
template7_10 = image.Image("/7_10.pgm")
template7_11 = image.Image("/7_11.pgm")
template7_12 = image.Image("/7_12.pgm")
template7_13 = image.Image("/7_13.pgm")
template7_14 = image.Image("/7_14.pgm")
template7_15 = image.Image("/7_15.pgm")
template7_16 = image.Image("/7_16.pgm")
template7_17 = image.Image("/7_17.pgm")
template7_18 = image.Image("/7_18.pgm")
template7_19 = image.Image("/7_19.pgm")
template7_20 = image.Image("/7_20.pgm")
template7_21 = image.Image("/7_21.pgm")
template7_22 = image.Image("/7_22.pgm")
template7_23 = image.Image("/7_23.pgm")
template7_24 = image.Image("/7_24.pgm")
template8_1 = image.Image("/8_1.pgm")
template8_2 = image.Image("/8_2.pgm")
template8_3 = image.Image("/8_4.pgm")
template8_5 = image.Image("/8_5.pgm")
template8_6 = image.Image("/8_6.pgm")
template8_7 = image.Image("/8_7.pgm")
template8_8 = image.Image("/8_8.pgm")
template8_9 = image.Image("/8_9.pgm")
template8_10 = image.Image("/8_10.pgm")
template8_11 = image.Image("/8_11.pgm")
template8_12 = image.Image("/8_12.pgm")
template8_13 = image.Image("/8_13.pgm")
template8_14 = image.Image("/8_14.pgm")
template8_15 = image.Image("/8_15.pgm")
template8_16 = image.Image("/8_16.pgm")
template8_17 = image.Image("/8_17.pgm")
template8_18 = image.Image("/8_18.pgm")
template8_19 = image.Image("/8_19.pgm")
template8_20 = image.Image("/8_20.pgm")
template8_21 = image.Image("/8_21.pgm")
template8_22 = image.Image("/8_22.pgm")
template8_23 = image.Image("/8_23.pgm")
template8_24 = image.Image("/8_24.pgm")
clock = time.clock()
# Run template matching
while (True):
clock.tick()
img = sensor.snapshot()
r1 = img.find_template(template1_1, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r1:
img.draw_rectangle(r1)
img.draw_string(10,10, "1")
r1 = img.find_template(template1_2, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r1:
img.draw_rectangle(r1)
img.draw_string(10,10, "1")
r1 = img.find_template(template1_3, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r1:
img.draw_rectangle(r1)
img.draw_string(10,10, "1")
r1 = img.find_template(template1_4, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r1:
img.draw_rectangle(r1)
img.draw_string(10,10, "1")
r1 = img.find_template(template1_5, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
if r1:
没有合适的资源?快使用搜索试试~ 我知道了~
openmv数字识别之多数字识别 1~8
共162个文件
pgm:160个
py:1个
openmv_disk:1个
需积分: 5 1 下载量 193 浏览量
2024-05-01
20:27:27
上传
评论 1
收藏 159KB RAR 举报
温馨提示
openmv数字识别之多数字识别 1~8
资源推荐
资源详情
资源评论
收起资源包目录
openmv数字识别之多数字识别 1~8 (162个子文件)
.openmv_disk 0B
5_2.pgm 1KB
5_8.pgm 1KB
5_4.pgm 1KB
5_5.pgm 1KB
5_3.pgm 1KB
5_7.pgm 1KB
3_7.pgm 1KB
5_1.pgm 1KB
5_6.pgm 1KB
7_3.pgm 1KB
7_2.pgm 1KB
7_1.pgm 1KB
7_8.pgm 1KB
7_6.pgm 1KB
7_7.pgm 1KB
7_4.pgm 1KB
7_5.pgm 1KB
7_18.pgm 1KB
3_13.pgm 1KB
8_12.pgm 1KB
3_10.pgm 1KB
6_24.pgm 1KB
7_9.pgm 1KB
6_9.pgm 1KB
7_22.pgm 1KB
6_16.pgm 1KB
7_17.pgm 1KB
8_22.pgm 1KB
6_21.pgm 1KB
7_12.pgm 1KB
8_20.pgm 1KB
7_11.pgm 1KB
8_9.pgm 1KB
8_15.pgm 1KB
3_9.pgm 1KB
7_19.pgm 1KB
3_12.pgm 1KB
3_19.pgm 1KB
6_14.pgm 1KB
8_23.pgm 1KB
7_20.pgm 1KB
8_24.pgm 1KB
3_24.pgm 1KB
6_20.pgm 1KB
6_17.pgm 1KB
3_23.pgm 1KB
6_23.pgm 1KB
6_19.pgm 1KB
8_13.pgm 1KB
3_21.pgm 1KB
8_10.pgm 1KB
8_17.pgm 1KB
6_10.pgm 1KB
3_22.pgm 1KB
8_14.pgm 1KB
8_11.pgm 1KB
3_20.pgm 1KB
8_21.pgm 1KB
7_21.pgm 1KB
3_17.pgm 1KB
3_18.pgm 1KB
6_12.pgm 1KB
7_14.pgm 1KB
7_10.pgm 1KB
3_16.pgm 1KB
7_15.pgm 1KB
7_24.pgm 1KB
6_22.pgm 1KB
3_15.pgm 1KB
8_19.pgm 1KB
6_15.pgm 1KB
7_23.pgm 1KB
8_18.pgm 1KB
7_16.pgm 1KB
3_11.pgm 1KB
7_13.pgm 1KB
3_14.pgm 1KB
8_16.pgm 1KB
6_13.pgm 1KB
6_18.pgm 1KB
6_11.pgm 1KB
8_4.pgm 1021B
3_1.pgm 1021B
5_23.pgm 1021B
4_14.pgm 1021B
5_24.pgm 1021B
4_17.pgm 1021B
4_10.pgm 1021B
4_9.pgm 1021B
5_22.pgm 1021B
6_8.pgm 1021B
5_14.pgm 1021B
5_21.pgm 1021B
4_16.pgm 1021B
5_16.pgm 1021B
5_12.pgm 1021B
2_3.pgm 1021B
6_3.pgm 1021B
5_18.pgm 1021B
共 162 条
- 1
- 2
资源评论
温柔-的-女汉子
- 粉丝: 902
- 资源: 4012
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Vue的电商购物网站设计源码
- 基于Java的elasticsearch视频教程配套Maven工程eshelloword设计源码
- 基于Typescript的兔子饭店经营类游戏源码设计免费送cocoscreator
- 基于Java的web快速开发数据权限管理脚手架wonder-server设计源码
- 基于Apache Log4cxx的C++日志库设计源码
- 基于Vue3的likeadmin免费任意商用管理后台设计源码
- 基于JavaScript的Chrome扩展WeNote分享插件设计源码
- 基于C++的中泰EM9108S动态库开发示例源码
- gxlx2-p291-1g.dts和gxlx2-p291-1g.dtb
- STM32WBxx Keil芯片包
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功