I have a modified video projector that I need to add an autofocus to. The focusing ring already has a fast stepper motor added to it. If the focus had to be done on the middle of the projection frame I suppose I could just put a laser distance sensor in the optical path of the projection by having a 45 degree IR reflect, visible spectrum pass dichro attached after and maybe before the final focusing and zooming lens. But I want the ability to focus to any point in the frame. This requires the sensor to be able to be rotated, or if it goes through lenses, tilted in two axis. I could do that with a small gantry system with stepper motors and the distance sensor attached to it, or galvonometer mirrors that would reflect the distance sensor beam to a given point/angle, but there may be a better way or a better sensor for this I am not aware of which wouldn't require so many parts. Having a camera and software which focuses until software finds the sharpest result would work if it was fast enough (200 ms). As I understand with this method the lens is focused until the sharpest image is detected which is slow. This is a pretty unique use case and normally you don't need such a complex feature in video projectors, I know. Requirements are ability to measure distance up to 3 meters, accuracy about at least +-5cm up to 1 meter, +-10cm after that, which I believe is not much. Measuring on shiny or reflective surfaces don't need to be supported. Any ideas are welcome. Been brainstorming with friends but we couldn't come up with a better option to what I already have, yet.