Exploring the Pixy sensor with Mathematica
Operations and Limitations
Numerous things can affect how the Pixy captures objects, such as lighting, hues, shadows, and so on. Certainly the single most important factor is lighting.
I've found that using bold primary and secondary colors for the object with strong, soft lighting gives the best results. Low light and shadows make it difficult for the Pixy to discern objects and will result in a lot of noise and false recognition.
Another program, named PixyMon [7], is helpful to see exactly what the Pixy sensor is recognizing. Sadly, my particular Raspberry Pi Model B+ would only run the program for 20-30 seconds before the desktop would freeze up and I'd have to reboot. Perhaps it was inadequate power, or maybe the interaction of the wireless USB keyboard/mousepad and the Pixy threw things off. I will have to poke around a bit to figure out the problem, but that's the nature of prototyping. Interfacing hardware with software, applications, and networking gets complicated. Getting things to work the way you want is frequently challenging and time consuming.
If you want to just gain more experience, you can always download and install the Pixy programs on your Linux or Windows notebook and use hello_pixy
and PixyMon on those platforms.
Going Further
The Pixy is a pretty slick piece of equipment. I've noticed that the web doesn't have very many practical applications yet. The Pixy team at Charmed Labs say they'll be releasing a firmware update that includes face recognition sometime in the not too distant future. Be on the lookout for that.
Mathematica is a very capable analysis and graphing package that's baked into the Raspbian operating system. It has about a billion functions – well, 5,000 anyway – and runs great on the Pi. Take advantage of it.
Also, don't let the command line on the Raspberry Pi scare you. Why write a Python or C program when you can use built-in shell commands like awk
, tail
, vi
, and redirection (| < >
) strung together to process text? It's fast and lends itself to all kinds of automation jobs.
I've already started piecing together a Pixy/Steampunk eye. I plan to put the Pixy inside an 18-inch-tall Steampunk eyeball and use servos to track myself in a brightly colored shirt as I move around the stage during one of my conference speaking sessions. That's the plan anyway. I'll be prototyping it soon, so a full rundown should appear in an upcoming edition of Raspberry Pi Geek.
Infos
- Pixy: http://charmedlabs.com/default/pixy-cmucam5/
- Mathematica: http://www.wolfram.com/mathematica/
- Raspbian OS: http://www.raspbian.org/
- Connect Pixy to a Raspberry Pi – installation instructions: http://www.cmucam.org/projects/cmucam5/wiki/Hooking_up_Pixy_to_a_Raspberry_Pi
- Connect Pixy to an Arduino using the SPI interface: http://www.cmucam.org/projects/cmucam5/wiki/Hooking_up_Pixy_to_a_Microcontroller_like_an_Arduino
- Awk: http://www.gnu.org/software/gawk/manual/gawk.html
- PixyMon: http://www.cmucam.org/projects/cmucam5/wiki/PixyMon_Overview
« Previous 1 2 Next »
Buy this article as PDF
Pages: 6
(incl. VAT)