I want to build myself an arduino based follow-focus. There is one mode intended for using a joystick for manual control of focus and zoom. This code already works a treat.

Now I want to add a solution, to track the object. Honestly it does not seem like there is a cheap and at the same time good solution to track any object. And the Face-Following autofocus in cameras is pretty... proprietary. No luck on a smart automatic solution.

What I thought of: - Ultrasonic measuring (Not precise enough - might reflect of an object that is close in angular distance. - Laser pointer based system (Also not good, since a laser is absolutely visible for the camera. And that is a no go for video.

I thought of another way. Is it maybe possible, to use an UV laser (with low power of course!)? I mean, it would not be visible to my camera. But how do I see it? I was thinking, if there is a way with fluorescence glasses?

This is absolutely hypothetical. I mean, I have no idea, if any of these parts exist in a way that I can use it in combination with an arduino.

A quick search on ebay for uv distance sensor is not revealing anything usefull at all.

So is there anyone who can help with that? All that I really need is something, to measure the distance to an object in the range of 5-50 meters (better to 100 or higher). The accuracy is not important. If 5 meters gives 5.3 it is okay. If 20 meters gives me 22m as a result, it is also okay. This would not be a problem at all.

It only needs to be accurate in angular distance. It would not help, if I measure tightly around the edge of a house and it accidentally picks up the house and not the object right next to it (at a different distance).

Any ideas?

Edit: Also a very good solution would be, to give the person to track a tiny device that sends some form of EM and the amplitude to measure at the camera is giving information about the distance. But the problem would be (i think): regardless of the frequency, the object/person to focus on will likely influence the waveform more, than the distance itself would. Or what is about very low frequency stuff like 20-200khz? Are there frequencies, which pass through basically everything and are easy to produce and detect precisely? Of course with permission.

  • \$\begingroup\$ Specifically for the visible laser concern, consider IR lasers (you can get IR filters for cameras). IR rangefinding is a common way to do it, but it doesnt help you much with rangefinding to your face \$\endgroup\$
    – BeB00
    May 26, 2020 at 22:44
  • \$\begingroup\$ cannot find those either. Only some chinese offers which are likely just bad translation. I mean, IR and Ultrasound at the same time? Very unlikely for that price even from china. And also no mentioned wavelength. Also a ready device without precise documentation will likely be to hard to implement. Remember: The code for controlling the steppers by hand was written in 10 minutes. Would not want to spent 2 weeks finding a way to implement something, that was never meant for implementation in other devices. \$\endgroup\$ May 26, 2020 at 22:52
  • \$\begingroup\$ I've seen projects like this done on a raspberry pi using OpenCV LINK. Combine that with one of the rangefinder sensors like this LINK \$\endgroup\$ May 26, 2020 at 22:59
  • \$\begingroup\$ can you use a 2nd camera, one with spot and continuous autofocus? EXIF info can include focus distance, so you could extract it from a low-rez shot obtained by face tracking or continuous focus modes. In short, the "cheap" camera takes constant low-rez snapshots while streaming out the images for your tracking system to consume the subject distance info from. \$\endgroup\$
    – dandavis
    May 27, 2020 at 7:13


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.