Apriltag标记检测

apriltag的Python项目详细描述


四月塔格

Apriltag标记检测 基于https://github.com/swatbotics/apriltag

依赖关系

  • opencv(可选)

示例

importapriltagimportcv2img=cv2.imread('apriltag_foto.jpg'.cv2.IMREAD_GRAYSCALE)detector=apriltag.Detector()result=detector.detect(img)

结果的形式为

[DetectionBase(tag_family='tag36h11', tag_id=2, hamming=0, goodness=0.0, decision_margin=98.58241271972656, homography=array([[ -1.41302664e-01,   1.08428082e+00,   1.67512900e+01],
   [ -8.75899366e-01,   1.50245469e-01,   1.70532040e+00],
   [ -4.89183533e-04,   2.12210247e-03,   6.02052342e-02]]), center=array([ 278.23643912,   28.32511859]), corners=array([[ 269.8939209 ,   41.50381088],
   [ 269.57183838,   11.79248142],
   [ 286.1383667 ,   15.84242821],
   [ 286.18066406,   43.48323059]])),
DetectionBase(tag_family='tag36h11', ... etc

可以指定多个选项来调整检测性能:

options=apriltag.Detectoroptions(families='tag36h11',border=1,nthreads=4,quad_decimate=1.0,quad_blur=0.0,refine_edges=True,refine_decode=False,refine_pose=False,debug=False,quad_contours=True)detector=apriltag.Detector()result=detector.detect(img)

访问值

tf=result[0].tag_familycx=result[0].center[0].

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用哪种数据结构通过两个ID之一搜索对象?   为什么IIOImageException java显示   java为什么Scanner#nextInt inside for循环不断抛出异常?   类如何在Java中比较参数和对象?   雅加达ee如何在Java/JavaEE环境中实现Basecamp风格的URL?例如<username>。主机名。通用域名格式   安卓javaexeutor框架的异常处理   java JDK 1.8到JDK 1.5 Web应用部署潜在问题   多线程如何杀死java线程?   探查器如何分析在java、eclipse和junit中哪个方法消耗的时间更多?   java如何在数组数据类型的元素上添加外键约束   java在Eclipse中更改外部浏览器[Linux、GWT、Tomcat6]   如何通过函数编程计算Java中的元音?   使用json负载netty上传java文件