Qu’est-ce que JeVois?*

One of the best things about embedded electronics is that it seems to always be Christmastime. Inventive engineers are constantly coming up with devices to make previously complex tasks routine and previously impossible tasks merely challenging. Problems that you thought were next to impossible are solved by a new magic component. Arduinos made programming a breeze. NeoPixels let us offload RGB LED duty cycle loops basically onto the LEDs themselves. Cheap optical TOF sensors made distance sensing into a science rather than an art.

One of the hardest problems to solve, traditionally, has been that of Computer Vision. Capturing good images has recently become easier, with decent CMOS sensors allowing image capture and playback. Analysis of these images, however, has generally required a powerful PC with GPU as well as specialized software.

The JeVois A33 computer vision camera (Image: JeVois.org)

The JeVois (French for “I see”) A33 computer vision camera changes that. It consists of a quad-core processor with GPU combined with an onboard camera, with console and video streaming access via a Mini USB connector.

The quad-core processor is the key. The JeVois, as small as it is, actually has enough processing speed to analyze and modify its video feed in real time. It can be programmed to identify objects, for example, or count the dots on dice, or read QR codes and barcodes, or serve as a lanekeeping device when driving.

A screenshot of the JeVois detecting multiple
QR codes (which it can do at ~60fps!)

The neat part is, there’s enough processing power onboard to analyze the images as they’re captured and distill out the important information. The contents of QR codes can be sent as plain, easy-to-parse text to a PC, Raspberry Pi, or even a simple 8-bit microcontroller via a 4-pin serial port. The JeVois does all the heavy lifting.

In other words, Arduinos just learned how to see the world — and understand much of what they see. (And it’s all open source!)

I love living in the future.

* French pun: “Qu’est-ce que je vois?” means “What do I see?,” whereas “Qu’est-ce que JeVois?” means “What is JeVois?” It’s a clever name for a clever device.

Posted in Arduino, Current Events, Digital, Tools, Toys | Tagged , , | Leave a comment

Darwin’s Polyhedra

Evolution by natural selection is a powerful algorithm that has come up with all of the variety of life we see on Earth. By keeping what works and discarding the ideas that don’t, populations can evolve over time to better fit their environment.

The same idea can be used to find solutions to given computational problems, as well. The field of Genetic Algorithms / Genetic Programming uses Darwinian evolution to search for solutions to various problems. Candidate solutions are encoded as gene sequences — perhaps a series of bytes, with each byte representing some parameter of the candidate solution. Each generation, the solutions are all tested and ranked, with better solutions having a higher chance to be selected to produce the next generation. Selected parent genomes are combined via crossover (with some mutation) to produce new genomes to be evaluated in the next generation.

One good way to test how well such an approach works is to try it out on problems for which you already know at least some solutions. For example, the Tammes Problem asks what is the greatest size disc for which you can fit N such discs on the surface of a sphere. Equivalently, what is the maximum, minimum distance possible between any two of N points on the surface of a sphere?

Solutions to such a problem can be expressed in genetic form, suitable for being acted upon by evolutionary forces. The position of each point is expressed in altitude and azimuth angles, sufficient to cover the surface of the unit sphere. (Note to self: explore using quaternions.) The simulation is then run, with the function that determines evolutionary fitness being the minimum distance between any two points. Solutions can then be visualized as polyhedra, where the unit sphere is cut by planes normal to the vector from the origin to each point. This results in an N-sided polyhedron — although sometimes a rather weird, lumpy one at first.

The best “cube” of generation 1.
Not very impressive at some 19.3% error — but that quickly improves!

For “easy” problems such as N=6, this approach quickly produces a nearly-optimal solution. Six equally-spaced points on the unit sphere will be farthest apart when they are in the form of a cube. For example, points at (1,0,0) and (0,1,0) could be two such points, 90 degrees apart. The optimal Tammes distance for N=6, then, is sqrt(2).

For N=6, the genetic approach described above very quickly converges to the expected cube solution, with point positions very nearly the expected distance apart. (A typical result differs from sqrt(2) by well under one part per million, if left to run for a while.)

The best cube of Generation 2941 (and the previous thousand or so) —
a cube with a measurement error of ~12.293 parts per million.)

Some values of N produce interesting results. For N=8, the most typical result is an anti-prism, similar to the platonic octohedron, but with four of the points rotated by 45 degrees. (When you think about it, it makes sense; the points are farther apart that way.)

An antiprism octahedron. It’s not the Platonic solid, but it would be a fair die.

Larger values seem to pose greater challenges to this approach; N=12 sometimes produces the expected Platonic regular dodecahedron, but more often will get stuck in a local minimum, producing a somewhat symmetrical shape. (Like in nature, Darwinian evolution doesn’t always produce a *perfect* solution — just whatever seems to get the job done best. )

Various somewhat-symmetric “grown” polyhedra.
All except for the 8-gon are irregular, but with striking symmetries.
From left to right: Irregular 10-sider; antiprism 8-sider; 7-hedron; 9-hedron.

The next goal: try to grow a regular icosahedron.

Posted in 3D Printing, Algorithms, Coding, Genetic Algorithms, Math, Science | Tagged , , , , , , , | Leave a comment

Hot Stuff

When diagnosing something, make sure you know what failure looks like.

Recently, my gas oven decided it didn’t want to heat up. This makes baking rather difficult, so (after waiting the usual while to see if the problem went away on its own), I investigated.

Gas ovens are lit by a Hot Surface Igniter (HSI), much like how gas furnaces work. According to Dr. Google, this is the most common mode of failure for gas ovens without pilot lights. It’s also a relatively easy part to replace, as well, so I figured I ought to start there.

Peeking into the drawer under the oven, I could see the ignitor glowing. Oh, well, I thought — they can’t all be easy. I put the problem off for a while, since replacing the gas safety valve (really the only other possible culprit) would mean turning off the gas and disconnecting the gas supply. Low Priority.

What I didn’t know then was that the igniter had actually failed, even though it was visibly glowing. Gas ovens, as I eventually found out, have the igniter and safety valve wired in series. As the igniter heats up, its resistance decreases — and once it is hot enough, it allows enough current to pass that it opens the safety valve, allowing the gas to flow. The original one was still glowing, but not brightly enough to get hot enough to open the gas valve.

A $25 replacement igniter later, the oven is working once again. I even found a helpful video detailing the exact steps to replace it.

And I didn’t even have to mess with the gas line.

Posted in Troubleshooting | Tagged , , , , | Leave a comment

It Belongs In A Museum

There’s an open-source solution for just about any problem out there — but getting it up and running can more often than not turn into a nightmare of chasing down one rabbit hole after another for dependencies, drivers, sample configuration files, and so on. (Ever tried configuring a mail server?)

So it’s especially nice to come across a purpose-made open-source solution to a problem that’s not only Free, but actually easy to use.

MP4Museum is such a solution. With absolutely zero setup other than downloading and flashing an image file, it turns a Raspberry Pi into a preconfigured, kiosk-style video player that’s ridiculously easy to use.

By “ridiculously easy to use,” I mean you load one or more mp4 files onto a thumb drive, plug it into the Pi, and connect the HDMI and power cables. It boots up and does its thing automagically.

There’s even a custom 3D printable RPi case (for a Pi A+).
Or, as always, Thingiverse can hook you up with a few hundred options.

MP4Museum, along with similar “appliance” images like OctoPrint/Octopi, represents a new way of looking at small computers like the Raspberry Pi. They run from downloadable images and boot up as essentially completely configured systems. (OctoPrint, being a server, does require you to set up a few things.) Instead of downloading an app and using a multi-purpose PC, tablet, or smartphone to do a task, you can pull a $25 Pi off the shelf, throw the appropriate image on it (using the almost-as-easy-to-use BalenaEtcher), and you have an information appliance up and running.

Now if only getting the monitor mounted to the wall were this easy…

Posted in HOW-TO, Reviews, System Administration, Tools | Tagged , , , , , , , , , | Leave a comment