{"id":4662,"date":"2018-10-19T15:13:07","date_gmt":"2018-10-19T19:13:07","guid":{"rendered":"https:\/\/dronebotworkshop.com\/?p=4662"},"modified":"2023-04-12T12:37:47","modified_gmt":"2023-04-12T16:37:47","slug":"pixy2-camera","status":"publish","type":"post","link":"https:\/\/dronebotworkshop.com\/pixy2-camera\/","title":{"rendered":"Pixy2 Camera – Object Recognition with Arduino & Raspberry Pi"},"content":{"rendered":"\n

\"Download \"Parts<\/a> \"View<\/a><\/p>\n

Introduction <\/span><\/h2>\n

The ability to recognize objects has been a goal of computer scientists and AI researchers for decades. In the past, this has required large computers running sophisticated software which has kept the technologies involved confined to labs and research departments with large budgets.<\/span><\/p>\n

<\/div>\n

Flash forward to today and object recognition has become mainstream. Google and Facebook can identify faces from photographs and tag the pictures, advertising billboards can (in a somewhat controversial fashion) <\/span>identify a person’s gender and age to cater ads to them based upon the results<\/span><\/a> and <\/span>solve Rubik\u2019s Cubes<\/span><\/a>.<\/span><\/p>\n

Object recognition and computer vision technology is now available for experimenters as well, with several kits and cameras with various capabilities available.<\/span><\/p>\n

Today we will examine one of these offerings, the Pixy2 Camera.<\/span><\/p>\n

The Pixy2 Camera<\/span><\/h2>\n

The <\/span>Pixy2<\/span><\/a> is a small camera designed for object recognition, line tracking, and simple barcode reading. \u00a0The device I used for this article and the video was supplied courtesy of <\/span>DFRobot<\/span><\/a>.<\/span><\/p>\n

\"Pixy2<\/p>\n

The Pixy2 is capable of recognizing seven distinct objects based upon their shape and color (or hue). \u00a0Each of these objects is assigned a unique \u201csignature\u201d.<\/span><\/p>\n

The camera also has algorithms for line following. Unlike traditional line followers, the Pixy2 can \u201clook ahead\u201d to determine when the line it is following (called a \u201cvector\u201d) is going to turn or cross another line (i.e. an \u201cintersection\u201d). \u00a0This is similar to the method you use when you walk, bike or drive down the street – you look ahead to anticipate any turns or stops you\u2019ll need to make.<\/span><\/p>\n

\"Pixy2<\/p>\n

The Pixy2 can also detect 16 simple barcodes. You can use these as visual indicators for your robot project.<\/span><\/p>\n

The Pixy2 is a self-contained unit, it\u2019s onboard processor takes care of all the \u201cheavy lifting\u201d – recognizing specific objects and filtering out extraneous objects. \u00a0This frees up your microcomputer or microcontroller to perform other operations, using the Pixy2 as an \u201cintelligent sensor\u201d.<\/span><\/p>\n

Pixy2 History<\/span><\/h3>\n

The origin of the Pixy2 can be traced back to the CMUcam, a device developed at the <\/span>Robotics Institute at Carnegie Mellon University<\/span><\/a> in 1999. \u00a0This device was one of the world’s first affordable vision sensors and over the years it has gone through <\/span>several different iterations<\/span><\/a>.<\/span><\/p>\n

\"Pixy2<\/p>\n

The fifth version of the camera (CMUcam5) was a joint effort of the robotics team at CMU and <\/span>Charmed Labs<\/span><\/a>. The device was funded in 2014 by a successful Kickstarter campaign under the name Pixy Cam.<\/span><\/p>\n

The original Pixy Cam was a breakthrough in both capability and price. \u00a0It could be used with an Arduino, Raspberry Pi or on its own as a computer peripheral. <\/span><\/p>\n

The Pixy2 is an improvement on the original. It is smaller, faster and has a fixed focus lens. It is also much more powerful. Unlike the original Pixy Cam, the Pixy2 was not a crowdfunded project, Charmed Labs designed and built the Pixy2 using the profits made from sales of the original Pixy Cam.<\/span><\/p>\n

Pixy2 Features<\/span><\/h3>\n

The Pixy2 is the latest (as of this writing) version of the Pixy Cam. <\/span><\/p>\n

\"Pixy2<\/p>\n

In addition to having all of the features of the original Pixy Cam the Pixy2 has these additional functions:<\/span><\/p>\n