• Bocce Labs
  • Posts
  • Introducing Bocce Analysis Tool (BAT)

Introducing Bocce Analysis Tool (BAT)

The best ideas are born on napkins

Howdy šŸ‘‹

Digital Dave here with another issue of Bocce Labs.

Welcome to the 3 new subscribers.

Last time, I shared about three topics:

  1. BBN-Midwestā€™s first livestream ā€” ABCā€™s Annual Womenā€™s Tournament

  2. Wiral ā€” A cable cam rig that seems just about perfect for bocce and at a good price too

  3. My planned trip to Waterside Club in Phoenix, NY

To get up to speed, you can read it here:

Well, Alex and I are back from Waterside. There, I came up with some immediate ideas for my software and now that it has been a couple weeks, Iā€™ve had time for further reflection.

šŸ™ Huge thanks to Dino, Gabe, and everyone at Waterside for being such great hosts. I canā€™t wait to go back (especially for Dinoā€™s homemade sausage and vino).

šŸŖž Reflections from my trip to Waterside

Alex and I dropped into Waterside Club in Phoenix, NY for less than 48 hours.

That was enough time to:

  1. Have a meeting with Dino about growing bocce in New York state and beyond

  2. Help Michael stream over 17 hours of Bocce on YouTube (Day 1 stream link & Day 2 stream link)

  3. Play in a 2v2 Unified Sports exhibition match with two Special Olympics Athletes

  4. Rig the Wiral cable cam and use it during the live stream as well as for testing computer vision algorithms

I learned a lot ā€” far too much to share in this newsletter, but here are the highlights.

BBN

  • Thereā€™s a huge appetite from tournament players to expose the sport of bocce to a wider audience

  • Lotā€™s of positive livestream viewer feedback came in via comments, DMs, texts, emails, and more

  • For me, commentating on the mic can be scary, especially since it is hard for me to associate player names to faces; while we had a good roster for each team, it didnā€™t have a headshot next to the name (that would make things immensely easier)

  • Before hopping on the mic, it is best to designate a primary and secondary speaker / controls person

  • It takes work to get folks from Facebook/Instagram over to YouTube. A steady feed of content stating that weā€™re going live soon, we are live, and hereā€™s the link is helpful.

  • I learned a bunch of technical stuff about the equipment connectivity and controls as well; Iā€™ll be sharing that knowledge in the BBN Midwest

Wiral

  • The easy setup only takes 5-10 minutes assuming you already have anchors on the wall, which we did because Dino put them up for us a month before we arrived. šŸ™ Thanks Dino!!!

  • The cable didnā€™t sag nearly as much as I thought it would. We were on a 70 foot court (Iā€™m not sure of the exact dimensions, but maybe Dino can share in a comment below)

  • Wiral was not distracting to players. In general when a player is rolling, they are looking down at their hand or down the court at their target. They arenā€™t looking up. The device is black and the ceiling is black at Waterside, so that made it even better. Had we been in an environment with a white ceiling, the device would have been more distracting.

  • We didnā€™t run the Wiral at max speed. At medium speed it was usually not fast enough to keep pace with a moving ball. I didnā€™t realize that there are three speeds until I looked closer at the remote.

  • As expected, the Wiral swings a little bit, but for me it wasnā€™t too noticeable on the video feed (especially since we had digital stabilization turned on)

Streaming from a phone to the computer:

  • The ā€œOBS Cameraā€ app for iPhone works great for using the wide angle lens of an iPhone (I used an iPhone 13-mini). Unfortunately the battery life wasnā€™t great with this app. Unfortunately the app was laggy (and I donā€™t think it was the wifiā€¦.continue reading). We abandoned this app for this reason.

  • iPhoneā€™s built in ā€œContinuity Camā€ worked great (no lag, solid battery life that lasted about 2-3 games worth). The problem? It doesnā€™t allow access to the wide angle camera + lens on the iPhone. So we couldnā€™t see the entire width of the court while connecting this way unfortunately.

  • We could have streamed directly into Michaelā€™s laptop running OBS (with the OBS app, not the Continuity Camera since his computer runs Windows). Instead, we streamed into my Mac laptop and used a USB HDMI input receiver into Michaelā€™s computer from mine effectively allowing us to share my screen.

  • Streaming into my computer had the added benefit that I could operate Python and OpenCV without impacting streaming operations. If the folks in the booth wanted to share my screen with the feed, it was just a click away.

When I returned to Chicago, I purchased an Android Pixel 6 and an extended battery case (thanks for the idea, Elizabeth) for it. Hopefully that makes streaming from the Wiral rig to the computer a bit easier/better. I tested the OBS app on the Android and it worked flawlessly on my home Ubiquiti WiFi network. Having a second smartphone also has the added benefit that Iā€™ll still have my day-to-day use iPhone in my pocket for snapping pictures and videos to amplify the event on social media.

Bocce Labs Software

Finding balls

  • I knew Iā€™d need to update the ball radius (in pixels) in my software config.

  • What I missed was that I also needed to update the camera resolution in the config. My iPhone camera is a different resolution (higher) than my Allied Vision cameras that I use at home for this project.

  • Once I had both the camera resolution and ball radius correct, the software picked up the bocce balls quite well.

  • Unfortunately, finding the pallino was very challenging for the software. This is because the floor of Waterside is gray and the pallinos were also gray (metallic) and small. This made it all but impossible for my algorithm (Read about my Computer Vision Bocce Ball Algorithm here).

This led me to an idea ā€” manual intervention. If a ball isnā€™t recognized and you still need its coordinates or a measurement, you should be able to click it and use your mouse/stylus or finger on a tablet.

Being able to click on balls has another benefit ā€” you can train team ball color/patterns on the fly during a game. Assuming the color/patterns are disparate enough, Iā€™m hoping that an operator could train the AI by the end of the 2nd frame (i.e., just when the game is getting interesting) or maybe even during the practice rolls.

I maintain a file called config.py with a bunch of constants and settings for the app. At home my settings are very static, but on the road, settings need to be tuned. So at Waterside, I discovered that I need to be able to change any config settings on the fly without restarting the app. This will be straightforward, but I didnā€™t take the time to do it on site.

šŸ¦‡ Next step: Build the BAT

Iā€™m planning out a FREE and OPEN SOURCE app called Bocce Analysis Tool (BAT).

Okay, maybe it needs a better name.

Anyways, the app will essentially be an upgrade to what Iā€™ve already built, but with all those manual controls, measurement tools, ability to annotate, take screenshots, and more.

Think of it like what the NFL does when you watch on TV. Those annotations are called ā€œTelestrations.ā€

Telestrations and manual intervention (not relying 100% on AI) will (A) Simplify and (B) Add immediate value to BBN streams.

Plus, when you click/tap on a ball that isnā€™t automatically recognized, a cropped photo will be taken of the ball to serve as future AI training data. This will be super helpful to have.

Iā€™m going to work with a new Bocce Labs contributor, Gina, on this project. Weā€™ll have more to share soon. Welcome to the team, Gina!

šŸ¦œ Comments activated!

My newsletter platform, Beehiiv, recently added a long overdue commenting feature.

So far it is working great and Iā€™m eager to make this newsletter more interactive.

Please donā€™t be a stranger!

If you have a question, idea, or something to share I encourage you to leave a comment at the bottom of the article. Iā€™ll reply to each and every comment.

Hint: if youā€™re reading this in your inbox, scroll to the top and press ā€œRead Onlineā€. When your browser opens the article, scroll to the bottom and you can leave a comment.

Thanks for reading!

A couple closing notes:

(1) Iā€™ve partnered with @s.and.p.tees in Chicago to make Bocce Labs t-shirts. So if you want one, you have two options:

  • FREE: Use the share link above to earn one and help me grow this blog.

  • $25: Click the link below to order a shirt.

(2) Where do you play bocce? If you play bocce, Iā€™m interested to know which club youā€™re associated with and how long youā€™ve been playing bocce. But most importantly Iā€™m looking for writers and coders as this blog is not about me ā€” it is about growing the sport of bocce. Consider sharing that with me here:

šŸ„‚ Cin cin!

~ Dave

Join the conversation

or to participate.