Exploring Computer Vision with the Pixy2 and Pan/Tilt Kit

Pubblicato da

Read more on how you can utilize the PixyCam in executing your next computing projects.

Above: Pixy 2 assembled atop an Arduino Uno

Until recently, anyone who wanted to work with computer vision had two options:

  1. Purchase a highly capable and rugged industrial vision system.
  2. Cobble something together with a webcam and computer.

Both choices have their advantages and drawbacks. But as of 2014, builders have a third option: the PixyCam.

Pixy2 vs Pixy

This small camera can track colored objects and, with the help of its pan/ tilt kit, it can physically move to aim itself. The Pixy boasted impressive features from its debut, but the recently-released Pixy2 takes this PixyCam even further. The Pixy2 is smaller, faster, and it can do everything the original Pixy can do, plus it features line-following capabilities and a pair of bright LEDs to light its path. Best of all, it’s cheaper than the original, coming in at just under $60.

Of course, Pixy/Pixy 2 aren’t perfect. They don’t include features like facial recognition or part measurement. Charmed Labs, PixyCam’s creator, explicitly stated that the device isn’t designed to control heavy machinery. The device does have a special aptitude for following colored objects, especially using its pan/tilt kit with a pair of micro servos. I use my camera with the pan/tilt kit, and it’s fun to see it track a moving red ball across my desk.

Step 1: Programming Your PixyCam to Track Objects

Here’s a short overview of setting up your PixyCam to track objects:

  1. Download and install Pixy’s computer interface program, PixyMon v2.
  2. Plug in the camera using the included micro-USB cable.
  3. Experiment teaching the camera to “see” a colored object, using your mouse to highlight the proper color.
  4. You can also teach it using the single-button interface, but the mouse interface is easiest while you have the program up. Watch the camera track objects on the video screen, acting as a sort of intelligent webcam.

0818_pixycam2 

Fig 2: Pixy2, along with pan-tilt kit and Arduino sold separately

Visualizza prodotti correlati

Pixy 2 Camera Vision Sensor | SEN 14678

SparkFun Electronics Sensore specializzato Visualizza

Visualizza prodotti correlati

A000073 | Arduino Uno Rev3 SMD

Arduino Corporation Sistema integrato, schede e kit di sviluppo Visualizza

Step 2: Assembling the Pan/Tilt Kit

Once you enable your camera to track objects, it’s time to assemble the pan/tilt kit. This simple project only requires:

  • Pliers
  • Wire cutters
  • Phillips-head screwdriver

The build takes some attention to detail, but the pan/tilt kit will allow your Pixy2 to auto-aim at moving object. Once you’ve assembled your Pixy2 on its new 2-axis “neck,” plug it into the computer once more. This time, select “pan_tilt_demo” under the program menu. When properly selected, the Pixy will attempt to follow whatever item you programmed in on the last step, using the servos for movement. Since the base by itself doesn’t have much mass, you’ll need to hold it in your hand or attach it to something else to allow it to move properly without sliding the base around.

0818_pixycam3 

Fig 3: Pixy 2 and pan/tilt functional, staring down a small red ball

Step 3: Connecting Pixy Camera to Arduino or other Dev Boards

Once you’re familiar with the device’s functionality, the real fun begins. It’s time to attach your Pixy to an Arduino, Raspberry Pi, BeagleBone, or other dev board that communicates via SPI, I2C, UART, or USB. We used an Arduino Uno, which made things especially easy. The Arduino Uno includes a cable that connects directly to the board’s ICSP header, and the base’s bottom can screw directly into the Uno.

  1. Connect the device to the Arduino using the cable and standoffs.
  2. Set up the Arduino library for Pixy2 per PixyCam instructions found here.
  3. Load up the “ccc_hello_world” from Examples/Pixy2. Use a serial monitor to see the camera’s stats on the blocks.
  4. Next, load “ccc_pantilt” onto your dev board. Instead of tracking your object numerically, the camera physically moves around, like a person’s eye tracking a moving target.
  5. You can modify the tracking speed by adjusting the panLoop and tiltLoop PID numbers to find your preferred speed.

Once you’re satisfied with the program settings, you can disconnect the device from your computer and power it with a USB battery. Your Pixy can now track objects all on its own. It’s quite entertaining to watch it in action, though you might notice the camera wobbling slightly as it attempts to center itself on the tracked object. This is due to visual signal noise, a characteristic present in any system of this type.

Explore more of what this small CV device has to offer in your own programs. This could mean tracking colored objects with your latest robot, or following lines around a dark room using the built-in LED headlights.

 

Visualizza prodotti correlati

BeagleBone Black Wireless

BeagleBoard.org Sistema integrato, schede e kit di sviluppo Visualizza

Visualizza prodotti correlati

RASPBERRYPI3B+

Raspberry Pi Ltd Sistema integrato, schede e kit di sviluppo Visualizza

Ultime notizie

Sorry, your filter selection returned no results.

Non perderti le ultime novità sull'elettronica

Abbiamo aggiornato la nostra Politica sulla privacy. Ti preghiamo di verificare le modifiche apportate. Facendo clic su "Accetto", dichiari di accettare la Politica sulla privacy e i Termini di utilizzo di Arrow Electronics.

Il nostro sito web mette i cookies sul vostro dispositivo per migliorare la vostra esperienza e il nostro sito. Leggete altre informazioni sui cookies che usiamo e su come disabilitarli qui. I cookies e le tecnologie di tracking possono essere usati per scopi commerciali.

Con un click su “Accept”, voi consentite l'inserimento dei cookies sul vostro dispositivo e l'uso da parte nostra di tecnologie di tracking. Per avere altre informazioni e istruzioni su come disabilitare i cookies e le tecnologie di tracking, clickate su “Read More” qui sotto. Mentre l'accettazione dei cookies e delle tecnologie di tracking è volontaria, una loro disabilitazione potrebbe determinare un funzionamento non corretto del sito web, ed alcuni messaggi di allarme potrebbero essere per voi meno importanti.

Noi rispettiamo la vostra privacy. Leggete qui la nostra politica relativa alla privacy