项目介绍

LarsG21/Darts_Project 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,目前获得 96 个 Star、20 次 Fork。

仓库全名
LarsG21/Darts_Project
Star 数
96
Fork 数
20
未关闭 Issue
2

README 摘要

Dart Master Description This Project was part of the VR/AR course at my university TU Darmstadt. The aim of the Project was to crate an automatic dart scorer application, where two players can play a game of dart without focusing on the point counting. The application uses OpenCV for the computer vision part and Pyside2 for the GUI.\ We use a calibrated webcam to capture a video stream and process it with OpenCV to…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Darts_Project 用什么语言开发?

主要使用 Python 编写,目前有 96 个 Star。

如何获取 Darts_Project 的源码?

可以直接克隆仓库:git clone https://github.com/LarsG21/Darts_Project.git,默认分支为 master;安装与运行步骤见仓库 README。

Darts_Project 最近还在维护吗?

仓库最近一次更新为 2024年12月27日,当前有 2 个未关闭 Issue;Star 数为 96,可作为社区活跃度的参考。

关于

This Project is used for automatic dart scoring using computer vision/

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
141
价值分
63
活跃状态
活跃

README

Dart Master

Description

This Project was part of the VR/AR course at my university TU Darmstadt. The aim of the Project was to crate an automatic dart scorer application, where two players can play a game of dart without focusing on the point counting. The application uses OpenCV for the computer vision part and Pyside2 for the GUI.
We use a calibrated webcam to capture a video stream and process it with OpenCV to extract the darts on the board and keep track of the players.

Demo Video

Link to demo video

How it works

The complete detection pipline looks something like this:

  • First detect the aruco markers
  • detect the dart board with a circle detector
  • fit a polar coordinate system to the dart board

  • take the reference image
  • some filters to remove noise and improve the detection
  • calculate the difference image between the reference image and the current image
  • contour detection on the difference image
  • contour > minimum area filter

  • fit triangle to the contour
  • find the tip of the dart by using the corner opposite of the shortest side
  • correct the tip position by moving it to the center of the triangle relative to its size

  • getting the position of the tip relative to the polar coordinate system
  • Evaluation of the score with DartScorer()

The overall pipeline is summarized in this flowchart:

Setup

Hardware

You will need:

  • a webcam
  • something to mount the webcam
  • a computer
  • a dartboard
  • the 4 aruco markers that can be found in Resources/Doku/

Place the Markers around the dartboard like in the image below and make sure they are visible. Place the webcam in front of the dartboard approximately 1 meter away and slightly to the right, so it doesn’t get in the way with throwing the darts.

Marker Positions

Important: You need good lighting to get good results. Only Lighting from directly above the dartboard is bad. Optimal would be a ring light with a diffusor like this:

We had some problems with shaking of the board wich induced noise in the detection. We solved this by 3D printed mounts for the board:

Software

Just clone the repository and run the following command:

pip install -r requirements.txt

First you need to calibrate the camera. This can be done with the Calibration Script. Then you can start main_with_gui.py. The GUI looks like this:

Short Instructions

  • First select your starting Points (501, 301 or 101) for your dart game.
  • Then set the default image with the button “Set Default”.
  • After that you can start the detection with “Start”
  • If the darts are detected badly you can adjust the threshold with the slider.

评论

暂无评论