April tag
April tag安装
April tag应用
静态图片识别
识别图像中tag个数,对其四个角点位置记录。对其后做单应性矩阵计算提供四个点。
#!/usr/bin/env python
# coding: UTF-8
# import apriltag
import pupil_apriltags as apriltag # for windows
import cv2
import numpy as np
import sys
def tag_H(img):
cols, rows, ch = img.shape
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# 创建一个apriltag检测器
# at_detector = apriltag.Detector(apriltag.DetectorOptions(families='tag36h11 tag25h9'))
at_detector = apriltag.Detector(families='tag36h11 tag25h9') #for windows
# 进行apriltag检测,得到检测到的apriltag的列表
tags = at_detector.detect(gray)
print("%d apriltags have been detected." % len(tags))
for tag in tags:
cv2.circle(img, tuple(tag.corners[3].astype(int)), 2, (255, 0, 0), 2) # left-top
cv2.circle(img, tuple(tag.corners[2].astype(int)), 2, (255, 0, 0

本文介绍了如何在Windows系统中使用Apriltag库进行静态图片中Apriltag的识别,包括计数和角点定位,并演示了如何在动态视频中实时检测。还讲解了如何利用检测到的tag角点计算单应性矩阵,用于图像变换。
&spm=1001.2101.3001.5002&articleId=115234263&d=1&t=3&u=7cf2dddb26d54939abcf1e3a1b1b04fa)
5102

被折叠的 条评论
为什么被折叠?



