Exploring Computer Vision with the Pixy2 and Pan/Tilt Kit

Publicado por

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

Ver Productos relacionados

Pixy 2 Camera Vision Sensor | SEN 14678

SparkFun Electronics Sensor especializado Ver

Ver Productos relacionados

A000073 | Arduino Uno Rev3 SMD

Arduino Corporation Placas y kits de desarrollo del sistema integrado Ver

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.

 

Ver Productos relacionados

BeagleBone Black Wireless

BeagleBoard.org Placas y kits de desarrollo del sistema integrado Ver

Ver Productos relacionados

RASPBERRYPI3B+

Raspberry Pi Ltd Placas y kits de desarrollo del sistema integrado Ver

Últimas noticias

Lo sentimos, pero su selección de filtros no devolvió resultados.

Hemos actualizado nuestra política de privacidad. Por favor tome un momento para revisar estos cambios. Al hacer clic en Acepto, usted está de acuerdo con la Politica de Privacidad de Arrow Electronics y sus condiciones de uso.

Nuestro sitio Web coloca cookies en su dispositivo para mejorar su experiencia y nuestro sitio. Lea más sobre las cookies que utilizamos y cómo desactivarlas aquió. Es posible que se utilicen las cookies y tecnologías de seguimiento con fines de marketing.
Al hacer clic en "Aceptar", usted está consintiendo la colocación de cookies en su dispositivo y el uso de tecnologías de seguimiento. Haga clic en "Leer más" a continuación para obtener más información e instrucciones sobre cómo desactivar las cookies y tecnologías de seguimiento. Si bien la aceptación de cookies y tecnologías de seguimiento es voluntaria, la desactivación de estos puede resultar en que el sitio web no funcione correctamente, y es posible que ciertos anuncios sean menos relevantes para usted.
Respetamos su privacidad. Lea nuestra política de privacidad aquió