|A Pi And A Kinect Autofocus A DSLR|
|Written by David Conrad|
|Sunday, 04 September 2016|
It has been a while since we had a wow Kinect project and this one isn't so much wow as just interesting. The idea is simple enough - use a Kinect to create an auto-focus for a DSLR used as a video camera. It is not until you step back for a moment and consider how insane this approach is do you realise how far we have come in so short a time.
When you think autofocus, the traditional approach is to use a rangefinder that simply brings two images taken from different positions into registration or changes the focus until they are in registration or changes the focus to maximize the contrast. What we are talking about is a simple feedback system with simple software, if any.
This is often fine for a still image, but video is more complicated and while a DSLR makes a really good video camera the autofocus generally cannot work fast enough to follow a moving subject.
Enter the Kinect which can track the movement of an object and provide a distance signal which can then be used to adjust the focus. It is easy at this point to miss that we are not talking about a simple feedback system like an ultrasonic distance sensor. The Kinect is a time of flight distance measurement tool with built in processor and AI software that will track humans and other objects. In many senses this is technological overkill, but just think how much more sophisticated it could be than a simple distance sensor.
The other intriguing aspect of this project is that it uses a Raspberry Pi as the controller. Usually the Kinect works with a PC but there is a library that works under Linux and with the help of OpenCV you can get a Kinect to do useful work on a Pi.
The final problem is how do you set the focus. The solution in this case is a stepper motor with a very ad-hoc wooden mount. The stepper motor turns the focus ring manually. A better, but more difficult, way might be to use the autofocus motor directly via the camera's USB interface.
You can see the autofocus in action in this short video, but you have to notice what is going on to make sense of it. The camera is first focused on the object on the right and as it is moved in the focus follows it.
There are lots of possibilities for taking this further. For example. you could implement a face autotracker that keep a face in focus.
Why stop at focus when you have a Kinect to give you the data. Add a pan and tilt and the camera could autotrack a subject. Add a zoom control and it should be possible to implement a traveling zoom effect where the object is kept the same size in the frame as the camera moves closer and further away.
Its just a matter of the software.
The only slightly negative aspect of the entire project is that while Microsoft seems happy publicizing the use of the Kinect with the Pi, it still doesn't have an official Linux driver for the Kinect. In the new era of Microsoft and open source this seems like a missing feature.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Sunday, 04 September 2016 )|