Exploring Computer Vision with the Pixy2 and Pan/Tilt Kit

게시자

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

관련 상품 참조

Pixy 2 Camera Vision Sensor | SEN 14678

SparkFun Electronics Specialized Sensors 보기

관련 상품 참조

A000073 | Arduino Uno Rev3 SMD

Arduino S.r.l. Embedded System Development Boards and Kits 보기

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.

 

관련 상품 참조

BeagleBone Black Wireless

BeagleBoard.org Embedded System Development Boards and Kits 보기

관련 상품 참조

RASPBERRYPI3B+

Raspberry Pi Ltd Embedded System Development Boards and Kits 보기

최신 뉴스

Sorry, your filter selection returned no results.

개인정보 보호정책이 업데이트되었습니다. 잠시 시간을 내어 변경사항을 검토하시기 바랍니다. 동의를 클릭하면 Arrow Electronics 개인정보 보호정책 및 이용 조건에 동의하는 것입니다.

당사의 웹사이트에서는 사용자의 경험 향상과 사이트 개선을 위해 사용자의 기기에 쿠키를 저장합니다. 당사에서 사용하는 쿠키 및 쿠키 비활성화 방법에 대해 자세히 알아보십시오. 쿠키와 추적 기술은 마케팅 목적으로 사용될 수 있습니다. '동의'를 클릭하면 기기에 쿠키를 배치하고 추적 기술을 사용하는 데 동의하는 것입니다. 쿠키 및 추적 기술을 해제하는 방법에 대한 자세한 내용과 지침을 알아보려면 아래의 '자세히 알아보기'를 클릭하십시오. 쿠키 및 추적 기술 수락은 사용자의 자발적 선택이지만, 웹사이트가 제대로 작동하지 않을 수 있으며 사용자와 관련이 적은 광고가 표시될 수 있습니다. Arrow는 사용자의 개인정보를 존중합니다. 여기에서 당사의 개인정보 보호정책을 읽을 수 있습니다.