Automatic scoring system for steel darts using OpenCV, a Raspberry Pi 3 Model B and two webcams.
This software is under heavy development. It is not ready to work out of the box...(has to be cleaned up and further improved)!
Main entry point is DartsScorer_1.py (DartsScorer.py is an older version with one camera only).
Watch a demo of the setup here: https://www.youtube.com/playlist?list=PLqymqC7nbI7an1dZW1kxbPPd-v0t5l6lF
Detected darts with score mapping and a Test-GUI to play simple 501:
I would like to point to this project as well. Two camera system but placed at the side of the board using triangulation: https://github.com/vassdoki/opencv-darts
We have created a Facebook Group, where we discuss our current progress and try to help each other: https://www.facebook.com/groups/281778298914107/
Short description of the method:
The lines are found using HoughLines and then filtered in a specific angle range (axis of ellipse).
Image Pre-processing:
imCalHSV = cv2.cvtColor(image_proc_img, cv2.COLOR_BGR2HSV)
kernel = np.ones((5, 5), np.float32) / 25
blur = cv2.filter2D(imCalHSV, -1, kernel)
h, s, imCal = cv2.split(blur)
ret, thresh = cv2.threshold(imCal, 140, 255, cv2.THRESH_BINARY_INV)
# removes border wire outside the outerellipse
kernel = np.ones((5, 5), np.uint8)
thresh2 = cv2.morphologyEx(thresh, cv2.MORPH_CLOSE,kernel)
# find enclosing ellipse
Ellipse, image_proc_img = findEllipse(thresh2,image_proc_img)
The transformation works like that (reading from right to left):
M=T2⋅R2⋅D⋅R1⋅T1
(https://math.stackexchange.com/questions/619037/circle-affine-transformation)
The same procedure applies for the left camera!
*insert text here (short version: To detect the dart I use the diff between images and then the goodfeaturestotrack method from opencv with some pre-and post-processing methods + score merging of both cameras).
To remove all shadows from the board I made a cabinet with a 360 degree surrounding LED stripe. I will add more pictures of the construction plan or a instruction on how to build the cabinet later.
GNU General Public License v3.0