# Pixy2 Camera Setup with Raspberry Pi

### What is a Pixy2 Camera?&#x20;

The PixyCam2 has an integrated filtering system which allows it to be trained to identify specific color hues and color patterns. It then returns the central coordinate position of the object that it identifies to the computer using the coordinate system depicted below.

![Pixy 2 Camera Coordinate System](/files/FQdZUmbXz5SPTmVQXCUR)

The Pixy2 Camera will identify objects it has been trained to see and view them as seen below by placing a square over the identified color signature then return the coordinate position of the center of that square.

![Pixy 2 Camera Object Identification](/files/sF911Yi6UDyJAFFLhJ0G)

The pixy2 cameras have a field of view of approximatly 87º and can identify objects reliably up to 90 centimeters away.  &#x20;

### Pixy2 and Raspberry Pi Setup&#x20;

When setting up your pixy2 camera with a Raspberry Pi you need to install the libpixyusb2 software library. Instructions to install this on a Raspberry Pi are available in the link below:&#x20;

{% embed url="<https://docs.pixycam.com/wiki/doku.php?id=wiki%3Av2%3Ahooking_up_pixy_to_a_raspberry_pi>" %}
How to install libpixyusb2
{% endembed %}

It is highly encouraged that you utilize the examples described in the above link, as they are easy, simple ways to learn about the capabilites of the pixy2 camera. These examples are also a great starting point for making your own custom program.&#x20;

### Teaching Pixy2 Camera an Object&#x20;

The whole point of the Pixy2 Camera is to identify objects so make sure you pay attention to this step. That being said, it is a super simple process, and if you follow the link below you will be able to track objects of interest with ease.&#x20;

{% embed url="<https://docs.pixycam.com/wiki/doku.php?id=wiki%3Av2%3Ateach_pixy_an_object_2>" %}
How to teach Pixy2 Camera an object
{% endembed %}

### Notes

* We have not yet figured out [how to run two pixy2 cameras on simultaneously on a single raspberry pi](https://forum.pixycam.com/t/using-multiple-pixys-via-usb/5392/3), but this link may be you a good place to start. I tried most if not all of the tips on this page without success, but that's not to say it won't help you. Godspeed.
* If the pixy2 cam is having trouble identifying the specified color, use the color tuning described in the "How to teach Pixy2 Camera an object" link. The lower you make the signature range, the more stringent the Pixy2 Camera is when identifying a hue.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wvu-neuromint.gitbook.io/neuromint-resources/technical-guides/raspberry-pi-+-zumo-+-pixy-setup/pixy2-camera-setup-with-raspberry-pi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
