Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Would you please post a dice counting tutorial?

+1 vote
Hello fellow JeVois programmers!

I'm a backer and I've used my JeVois a few times but Friday I thought of a fantistic use for mine. I play a role playing game called Champions and there are tons of 6 sided dice (d6) to roll. Searching today I see folks have used a Raspberry Pi but I think Jevois would be better!

Does anyone want to try to get the JeVois to do this?




Over time I could but if any of you are getting your feet wet with JeVois I would greatly appreciate some help.

asked May 8, 2017 in Programmer Questions by mapembert (130 points)

2 Answers

0 votes
Can you specify a couple of things?

Where is the existing code for that youtube video?

Do you only want the sum of pits as in the video or also the dice outlines as in the picture?

Looks like this could be a great application for a python opencv jevois tutorial once we get python support in jevois!
answered May 12, 2017 by JeVois (46,580 points)
Great news! I have contacted the original author of the dice counter video and he stated he would be happy to help and has given us his code. He really admires the JeVois project and would like to see his code progress into the camera, too. Please contact me via email and I will send you the C++ code and file attachments.

To answer your questions:
1) I have the code from the author in email and it has attachments.
2) The count is most important, the outline is less important. Ideally, I would like to hook up a simple LCD screen via arduino or similar board to display the count. This could look really cool!
Great, please send us the link to jevois.org@gmail.com and we will check it out soon!
+1 vote
Now that we are done with adding Python support to JeVois, I took the opportunity to use the dice counting application to write two new tutorials:

http://jevois.org/tutorials/ProgrammerPythonDice.html for the Python version

http://jevois.org/tutorials/ProgrammerDice.html for the C++ version

The C++ version has been included into JeVoisBase:


get the latest (1.3.0 or later) microSD image from http://jevois.org/start and select YUYV 640x480 @ 7.5fps to try it out (beware that some other vision modules are already using 640x480 at different frame rates, you need to get the 7.5fps one).

Just ordered some 0.96 inch SPI OLED display and will try to make a standalone version one of these days (JeVois + Arduino + OLED + LiPo battery, no computer needed).

Thanks for suggesting this nice application scenario, it makes for a couple of fun new tutorials!
answered Jul 12, 2017 by JeVois (46,580 points)
> Given that anyone is unlikely to be needing any kind of fast frame rate for this application (since dice will not get thrown too often), here no further optimization is necessary. The low frame rate will allow the camera sensor to perform well even in low light conditions.

I'm building a silly machine that rolls dice perpetually and hope to use JeVois to read the values in. Has there been any attempt to get the individual values rather than the sum of all pips? Given that in my application the dice will all be in a neat row and have a solid black background and good lighting conditions, is there a way to optimize and speed up the code for faster frame rate? Thanks!