The Dar Es Salaam Hacker Scene And Gamut Detection

admin

We’re on a sort of vacation in Tanzania at the moment and staying in a modest hotel away from the tourist and government district. It’s a district of small shops selling the same things and guys repairing washing machines out on the sidewalk. The washing machine repairmen are always happy to speak. Everybody’s amazingly friendly here, the hotel guy grilled us for an hour about our home state. But I really didn’t expect to end up in a conversation about computer vision.

We took a short walk from the hotel in search of some yogurt or perhaps something cool to wear. A robotics shop was just a few streets away. Mecktonix has a store about 2 meters long, with Arduinos robots electronics components servos random computer gear. [Yohanna “Joe” Harembo]. Another space nearby has a 3D printer and laser engraver. The tiny space doesn’t stop them from being busy. Students from the National Institute of Transport, a nearby automotive technology school, are constantly coming in to ask for parts and advice for their class projects.

In between students, Joe demos an autonomous car he’s working on. In classic hacker fashion, he first has to reattach the motor driver board and various sensors, but then he demos the car and its problem –  the video frame rate is very slow. We try to do some profiling with him. time.monotonic_ns(). He’s never done profiling before, so this is a big eye opener. He’s only processing one video frame every 4.3 seconds, using YOLO on a Pi 3, and yup, that’s the problem.  I suggest he use gamut detection on a Pi 4 or switch to YOLO.

Gamut Detection

If you’re not familiar with gamut detection, it’s one of the simplest of all computer vision techniques, so it’s easy to implement on slow processors and almost trivial to code. Basically, it’s “look for a color”.  Wear a lime green shirt to get your robot following you. Now, the robot only has to look out for lime-green. It’s the same for catching or following lines, or catching balls. The algorithm is simple – convert each pixel to HSV, where hue corresponds to the direction around the color wheel,  saturation corresponds to how concentrated the color is, and value how bright. As brightness depends on the lighting conditions, we can just limit H and S. Everything within these limits will be part of our goal. The box formed by those limits is our “gamut”.

There are also a couple of speedups that you can use. You should first ask yourself what kind of resolution you want from your camera. If you only want to track a green T shirt that’s never less than 24 pixels on screen, turn the resolution down by a factor of six each way and look for four-pixel T shirts. Your algorithm will run 36 times faster because you only have to process 1/36th of the data. If you can’t control the camera resolution, you can shrink the image or just sample every nth pixel. You can also ask the camera for a YUV image or YIQ. Set your limits using IQ or UV instead of Y. It’s about the same as HSV.

Joe’s eating this up – he’s had limited chances to talk with somebody else who is into computer vision. As we write this, he’s still trying with YOLO, but at lower resolution. If it doesn’t work he’ll try gamut detection. And it’s not his only project. Pikipikis, or motorcycles that carry passengers, are very common in this country. A student has a project to enforce passengers wearing a helmet, and we fiddle with the student’s project.

Dar es Salaam Scene

There’s other tech happening in Tanzania too. Only a few streets away is [Ruta Electronics], a similar sugar cube sized shop developing smart meters. In this tiny shop, everything from PCBs to cases is produced. In the center of town, there are several startups. There’s a fab lab, mostly oriented towards children. And on a quiet side street off the main drag, there’s a tiny shop with three guys who are hacking like crazy.

For us, we’ve had a chance to make a friend from a different culture and play with a robot car together — what could be better?  When you’re traveling, are you on the lookout for other hackers or hackerspaces? It’s worth the effort and brings our community together in a way that even the internet can’t.

Next Post

Soap Opera Digest to Discontinue Its Weekly Print Edition; Special Issues Will Be Four Times a Year

This week was a busy one for the earliest part of this week. Dark Shadows The news that Lara Parker had passed away was shocking to fans of ABC’s gothic soap opera. The actress known for her role as the ‘witch’ Angelique Bouchard died at the age of 84.  Her […]