logo

科研实验:OpenMV识别Tag36H11码并串口输出ID

2026-05-14 14:18
A
ajp6zkvafcj2

科研实验:OpenMV识别Tag36H11码并串口输出ID

需求概述

用户在科研实验场景中,需使用OpenMV摄像头识别标准Tag36H11二维码卡片(尺寸10×10 cm),安装于小车上,工作距离约1米,纯色无干扰背景,目标物体位置固定,单次视野内仅存在一个Tag。核心功能是准确解码并经串口实时输出对应ID值。

关键参数汇总

  • 应用目的:科研实验
  • 识别目标:Tag36H11二维码卡片
  • 卡片尺寸:10 × 10 cm
  • 识别特征:Tag ID码(整数)
  • 环境背景:纯色背景,无干扰物
  • 安装平台:小车
  • 识别距离:约1米
  • 视野内目标数量:单个,位置固定

附件

image
2026-05-18 10:40
E
eu9yn16675je

跑apriltag识别程序,报错:TypeError: 'tuple' object isn't callable OpenMV v4.8.1; MicroPython v1.26.0-77; OPENMV4P with STM32H743

2026-05-18 13:24
Z
星小瞳xs

具体的报错行

Z
星小瞳xs
# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# AprilTags Example
#
# This example shows the power of the OpenMV Cam to detect April Tags
# on the OpenMV Cam M7. The M4 versions cannot detect April Tags.

import sensor
import time
import math

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time=2000)
sensor.set_auto_gain(False)  # must turn this off to prevent image washout...
sensor.set_auto_whitebal(False)  # must turn this off to prevent image washout...
clock = time.clock()

# Note! Unlike find_qrcodes the find_apriltags method does not need lens correction on the image to work.

# Please use the TAG36H11 tag family for this script - it's the recommended tag family to use.


while True:
    clock.tick()
    img = sensor.snapshot()
    for tag in img.find_apriltags():
        img.draw_rectangle(tag.rect, color=(255, 0, 0))
        img.draw_cross(tag.cx, tag.cy, color=(0, 255, 0))
        print_args = (tag.name, tag.id, (180 * tag.rotation) / math.pi)
        print("Tag Family %s, Tag ID %d, rotation %f (degrees)" % print_args)
    print(clock.fps())