SightLine Applications Command, Control, and Script API  v3.5
List of all members
SLASetLensParameters_t Struct Reference

Description

Deprecated, use SLALensParameters_t Set the current parameters for controlling the lens/focus.

typedef struct {
u8 lensType;
u8 afMetricRegionSize;
u8 zoomTrackFocus;
u8 autofocusMethod;
u16 autofocusRateAdjust;
u8 autofocusChangePct;
u8 zoomSpeed;
u8 focusSpeed;
u8 comPortNum;
u8 colRoiFrac;
u8 rowRoiFrac;
u8 wideRoiFrac;
u8 highRoiFrac;

Lens Type

A set of known lenses or cameras with integrated lenses for which command and control has been implemented. Assumes the lens is connected to a known serial port (e.g. Tamron SC001 is connected to Serial 1 on 1500-OEM), but can be overridden using the comPortNum parameter. This serial port will be automatically configured to the correct baud rate, etc. Command passthrough and similar commands will not be available. Corresponding serial port must be set to Port not used via SLASetPortConfiguration_t.

See also
LUA lens driver examples as well

Auto Focus Method

Scan

Start by moving the focus to the far focus limit. Scan the full range to the near focus limit. Look for the peak focus metric over the entire range. This method may be problematic due to defocused imagery at the limits of the focus travel being noisy. Depending on the focus metric chosen, this noise can produce high metric values.

Seek

Searches near current focus. Start by moving the focus in the far direction until the focus metric changes more than the value set in autofocusChangePct.

Set the focus metric algorithm using SLASetSystemValue_t. Focus metrics are reported using SLAFocusStats_t.

See also
SLASetOverlayMode_t.graphics to enable the onscreen Overlays for the region of interest.

Message ID 0x6E

Byte Offset Name Description
4lensType
Value Device Serial Port
0 None N/A
1 Tamron SC001 1
2 Sony 2
3 Hitachi 2
128 and above Custom Lens Driver Any
5afMetricRegionSizeDeprecated, use Roi controls below. AutoFocus Metric Region Size % of screen (0 to 100)
6zoomTrackFocusZoom Track Focus (0= disabled, 1= enabled). Stops when focus metric reaches peak threshold.
7autofocusMethodAutofocus method (0=scan far to near, 1=seek, 128 and above reserved for customer use)
8-9autofocusRateAdjustAutofocus Rate Adjust (0 to 65535) 100 = default speed of motion
10autofocusChangePctAutofocus Change Percent (0 to 255) in 1/10ths of a percent. 40 (default) = 4%
When using Seek in AutoFocus Method, this value (0 to 100) is the percentage of
change in the focus metric that is considered significant enough to indicate that the
focus metric is going in the right (or wrong) direction.
11zoomSpeedZoom speed (1-255 with 0 being the default)
12focusSpeedFocus speed (1-255 with 0 being the default)
13comPortNumSerial port number for lens control see SLASetPortConfiguration_t
14colRoiFracRow ROI for focus stats. Row Offset in % of image width (255=100%); Full image(default) = 0
15rowRoiFracCol ROI for focus stats. Column Offset in % of image height (255=100%); Full image(default) = 0
16wideRoiFracHigh ROI for focus stats. Height in % of image height (255=100%); Full image(default) = 255
17highRoiFracWide ROI for focus stats. Width in % of image width (255=100%); Full image(default) = 255