• Advertisement

Make a small donation to Ye Olde Inn!

Donate via Paypal

Every cent received goes toward Ye Olde Inn's maintenance and allows us to continue providing the best resources for HeroQuest and Fantasy Gaming fans.

Dice testing, Part 2

Guests may gather here for General Discussions about almost any Topic. NO BRAWLING!
Forum rules
Certain topics have become known to cause friction among passionate members. We kindly ask that topics relating to these subjects be taken outside the Inn to Websites that specialise in those subjects.

Thus far, these topics are: Recreational Drugs, Religion and Science.

Dice testing, Part 2

Postby Anderas » January 9th, 2021, 2:06 pm

Some of you might still remember that I asked for help in developing a die test.

Image

Basically, what came out was: I roll it 150 times, I do some statistics, then I decide that it is "OK" or not.

Well, I decided to go to version 2.


Image
Image
Image

... first test...


Box around it
Image

Axis through
Image

Raspberry Pi 3 with Pi Camera 2
Image

Pi cam and Pi and motor fixed to the tower
Image

I added a lamp and a reed sensor to stop it in the right place.
Now I can insert a die and it will roll it like, 160 times.


It takes a photo each time, and one photo without die.
After all, if I take the photo without die and I substract it from the photo with die, only the die should stay right?
Well, it wasn't exactly that easy; but the principle was right.
Those images are transferred via SSH to my big computer. That one is then searching the die, cuts it out and tries to read the number.

Image
Yes, reading this is not easy. Sometimes the pips are bright as a sun, sometimes they are near invisible. OpenCV wasn't up to the job in 30% of the cases; statistics couldn't do the job in 20% other cases (but 20% different from the openCV difficulties)... KMeans couldn't do the job in 15% of the cases... again 15 different per cent from the other two. Of course I could just use all three methods and add the results, it would be a 98% fit. But then it would calculate more than a second per die, which seems awkward.

So I gave in and trained a neural net instead. That's kind of cheating because it means I don't solve the problem. Also, since two weeks my computer is training on a couple of die images and it still confuses a :roll1: with a :roll2: sometimes.
But: It works now, with just about 2%-3% errors. On this image, they are marked with their respective numbers. Click on it, you can try and find the one error in this picture collection.

Image

I tested the Heroquest movement dice with it.
My suspicion came true! One of them strongly prefers to roll a 1, the other of the two strongly prefers the 3. Yes! I knew it! It was worth the work! :lol:
The third one, the one who was giving his images to this forum post prefers the 2, by the way

Image

Two months of development and I can get a result quickly now! :-)

I will upload my dataset on kaggle sometime soon, and my code on git hub. But today, I keep training it.

Image
Last edited by Anderas on January 10th, 2021, 6:28 am, edited 2 times in total.


Rewards:
Hosted a Play-by-Post game. Played a turn in a Play-by-Post game. Created a Hot Topic. Participated in four (4) Miniature Exchanges. Participated in three (3) Miniature Exchanges. Zealot Miniatures: Twisting Catacombs Kickstarter Backer Destroyed a Zombie! Encountered a menacing Chaos Warlock!
User avatar
Anderas
NOT Andreas!

Polar Warbear
Polar Warbear
 
Posts: 3397
Images: 73
Joined: September 20th, 2014, 7:02 am
Forum Language: British English
Hero:
Evil Sorcerer: Morcar
Usergroups:
Wizards of Zargon Group Member Adventurers' Guild Group Member Artists Group Member
Champion Group Member

Advertisement

Make a small donation to Ye Olde Inn!

Donate via Paypal

Every cent received goes toward Ye Olde Inn's maintenance and allows us to continue providing the best resources for HeroQuest and Fantasy Gaming fans.

Re: Dice testing, Part 2

Postby lestodante » January 10th, 2021, 5:00 am

WOW!!! AMAZING JOB!!!!
Am I wrong or number 3 is the less common result?


Rewards:
Wizard of Zargon Group MemberParticipated in four (4) Miniature Exchanges. Participated in two (2) Miniature Exchanges. Encountered a menacing Chaos Warlock!
User avatar
lestodante

Yeti
Yeti
 
Posts: 2703
Images: 5
Joined: January 7th, 2017, 9:40 am
Location: Italy
Forum Language: English (United States)
Hero:
Evil Sorcerer: Morcar
Usergroups:
Wizards of Zargon Group MemberScribes Group MemberChampion Group Member

Re: Dice testing, Part 2

Postby Anderas » January 10th, 2021, 6:24 am

Yes, on this die the 2 was too often, and the 4 too rare.
The index starts at 0 and is annoying the eye in the result table. :-)


Rewards:
Hosted a Play-by-Post game. Played a turn in a Play-by-Post game. Created a Hot Topic. Participated in four (4) Miniature Exchanges. Participated in three (3) Miniature Exchanges. Zealot Miniatures: Twisting Catacombs Kickstarter Backer Destroyed a Zombie! Encountered a menacing Chaos Warlock!
User avatar
Anderas
NOT Andreas!

Polar Warbear
Polar Warbear
 
Posts: 3397
Images: 73
Joined: September 20th, 2014, 7:02 am
Forum Language: British English
Hero:
Evil Sorcerer: Morcar
Usergroups:
Wizards of Zargon Group Member Adventurers' Guild Group Member Artists Group Member
Champion Group Member


Return to Ye Olde Pub

Who is online

Users browsing this forum: No registered users and 2 guests