Blade-runner-inspired VK-Pocket camera
By Rosemary Hattersley. Posted
There’s “something wonderfully unsettling” about being stared at by your own disembodied eye, comments master of understatement James Brown.
James came up with the idea for his VK-Pocket Camcorder while working on the face-tracking feature for an interactive exhibit, and realised one of the debug tools was showing parts of his face as it detected them. “I had a little viewfinder CRT salvaged from a junk shop camcorder, so I decided to wrap up that experience in a little self-contained gizmo, and style it after the Voight-Kampff machine from Blade Runner.”
Advertisement
Head to head: Raspberry Pi + Raspberry Pi Zero + Raspberry Pi Pico.
“In the movie, there’s a camera on a stalk which is aimed at the subject’s eyeball, and a monitor showing that eye isolated and magnified. My concept was to have a high-resolution, wide-angle camera, and use the face tracking code to crop and zoom in to any eye it detected. Anyone approaching the machine to look at it would be stared back at by their own eye.”

Animated response
James knew immediately that he wanted to use Raspberry Pi Pico for his VK-Pocket camera project. Moreover, composite video out, which Pico supports, was essential for driving the CRT (cathode ray tube) display he culled from an old video camera. “Raspberry Pi Pico was my first choice for this build. I love these things”, he exclaims! “They’re a full Linux PC in a microcontroller form factor. I’ve put them in all sorts of builds, from animatronic heads to robotic insects.” [Yes, we want to hear more about these projects, too – Ed].
James is a stickler for details so, as well as accommodating the mini screen, camera, and Pico, it was vital that the case for the homebrew VK machine looked like the original film prop. Illustrating this is the “little servo” he added “to push some cosmetic bellows up and down,” as a nod to those in the film. There are two versions of the VK machine in Blade Runner, he explains; “the device I ended up building is a bit of a mix of both of those, in order to fit everything in.”

The servo is controlled using the pigpio library directly from a GPIO pin. Both servo and display draw less than 500 mA, and are powered from the same USB connection so they can be powered from the Pico, with no extra power source needed.
Since it was 3D-printed, James was able to experiment with a few iterations before settling on a design in which everything fits comfortably in place. Even so, he says, the control board for the display ended up at a bit of an odd angle. Putting the camera on a stalk turned out to be tricky, too, “so I put it inside the main case, looking out through a hole.”
The eyes have it
James wrote “a quite minimal” amount of Python code (magpi.cc/pieyepy) “to keep the high-res live video updated via the GPU while the CPU does the eye tracking.” He used OpenCV to detect faces with five facial ‘landmarks’, from which eye locations are taken. Although the eye-tracker appears to work in real-time, James realised it would be sufficient to have second-by-second updates. “If you wanted to get clever, you could use motion vectors from the compression hardware to improve tracking between detections, but it seemed good enough just updating every second or so.” This reduces the processor overheads and works nicely on a Pi Zero.

The Pico CPU outputs 320 × 240 images at “maybe a couple of frames per second”, while the picamera library keeps the screen updated with the live image. “The video hardware can handle 2592 × 1944 at 15 fps, and crop, scale, and display it without touching the CPU, James explains. As a result, the eye region is still reasonably detailed, even though it’s only a tiny portion of the camera’s view. “If you sit still, it locks on to your eye in less than a second, and stays well centred.”
There’s no word yet from James on whether his VK-Pocket machine actively analyses its subjects’ eyes to check whether or not they may actually be a replicant.

Rosie has worked for consumer tech titles such as PC Advisor, Computeractive, CNET and Macworld and written For Dummies books on using iPads, Androids and tablets
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Raspberry Pi vs Raspberry Pi Zero 2 vs Raspberry Pi Pico in Raspberry Pi Official Magazine 159
Without an operating system, any computer – including your Raspberry Pi – is just a dumb lump of sand. Put Raspberry Pi OS on it however, and you’ve got yourself a working system that can handle games, web browsers, emails, programming and everything else we bang on about here all day every day. The latest […]
Read more →
Win one of ten M.2 HAT+ Compact
The ability to connect NVME SSD drives to Raspberry Pi 5 is very cool, although it does slightly limit the cases you can use. With the M.2 HAT+ Compact, you can even fit an SSD-powered Raspberry Pi into the official case – and we have ten to give away below. Win one of ten M.2 […]
Read more →
Raspberry Pi 500+ in Raspberry Pi Official Magazine issue 158
We’re quite taken with Raspberry Pi 500+. But when you don’t need all that processing power, and just want a board that will make a plastic skeleton jump around in a terrifying manner, you’ll find Raspberry Pi Pico more than up to the job. There’s more terror in the magazine (which is only right as […]
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.