View Full Version : Getting Focus based on Zoom and distance

March 3, 2003, 18:54:26
This is about Focus seting with the Sony DFW-VL500 camera

I've mapped a non linear relationship of Zoom number to Focus number to distance for this camera. In the application that I'm working on I know the distance and I will be using different zoom factors. I could establish a curve table to determine the Focus number based on the zoom number and distance from the camera to the object. This approach is not clean but do-able.

Is there a simple sample of code that I could experiment with using the following concept: Vary the focus number in order to find the maximum brightness (for a small rectangular area in the image) which infers the best focus.

Stefan Geissler
March 6, 2003, 10:03:38

The "Advanced Image Processing" example shows how to access the image data of an previoulsy determined region. This examples uses ICY8 as sinktype, so that every pixel is represented as a grayscale. This makes it easy to determine the average brightness of the region. Just add all pixel grayscales and divide them by the number of the pisels in the region.