Eye Tracking on the Raspberry Pi 5
This is a record of my efforts to implement eye tracking using two cameras mounted inside a Mandalorian helmet that I 3D printed. I based my choice of cameras to use on the specs for the Project Aria glasses. According to the paper that Meta Reality Labs Research published about the first-generation Project Aria glasses, they are using "two monochrome, global-shutter inward-facing cameras for eye-tracking with a diagonal field of view of 80 degrees. They typically operate at a 320x240 pixels resolution." With the intention of using whatever I selected with a Raspberry Pi, I found this listing on Amazon: innomaker GS Camera OV7251 Sensor with Global Shutter External Trigger Stream Mode 0.3MP Frame Rate up tp 158fps 8bit 10bit rawdata Format for Raspberry Pi 5 4B 3B+ 3B 3A+ CM3+ CM3 Pi Zero W At 14 bucks a piece, I ordered two and am currently waiting for them to be delivered. In the meantime, I'm making sure my Raspberry Pi is properly configured so I'll just be able to plug in the cameras when they arrive.
The OV7251 has a global shutter, just like the Project Aria cameras. There are monochrome, outputting 8- or 10-bit RAW BW, just like the Project Aria cameras. Well, I don't know what bit-depth the Project Aria cameras actually are. However, the OV7251 is actually higher resolution, at 640x480 compared to Aria's 320x240. I wasn't trying to get higher resolution cameras; that's just what I was able to find. The final reason I selected these cameras was the "external trigger" feature. The Project Aria paper spends a bit of time explaining that they are careful to synchronize all the onboard sensors, and for eye tracking it is important to ensure each frame from the camera is synchronized with the other camera. There are single board systems with two camera modules that do this, as well as providing a single output feed, but I wanted the flexibilty to place the cameras wherever necessary inside the helmet. There are also boards made by Arducam that will synchronize the cameras connected to them, but those add even more cost, require even more space inside the helmet, and the smallest boards in stock were for up to four cameras. All the cameras connected to a board like that must be identical, so even if I wanted external cameras, I wouldn't want them to also be low-resolution global shutter black and white cameras. Expansion boards just weren't the right choice for this project. Thankfully, the OV7251 cameras can be triggered externally, or by software. So my plan is to connect both trigger signals to a single 3.3V pin on the Pi.
What's new with the Pi 5?
I am specifically using a Pi 5 I because I already had a 5 sitting around. I could have used a 4 instead, but the Pi 5 has something that was previously only available on the Raspberry Computer Modules: two camera connector ports!