AO SERIES | INSTRUCTIONS MANUAL
28
4.2.2 AutoFocus DLL
4.2.2.1 Basic Data Structure
struct
oeImage
{
int
w=-1;
int
h=-1;
unsigned char
* data;
int
type=-1;
int
channels=-1;
};
• int w - width (required field)
• int h - height (required field)
• unsigned char* data - (required field)
• int type - data type (required field)
0
8 bit unsigned
1
8 bit signed
2
16 bit unsigned
3
16 bit signed
4
32 bit integer
5
32 bit float
• int channels - 1 (grayscale) or 3 (color)
struct
oeRoi
{
int
x =-1;
int
y =-1;
int
w =-1;
int
h =-1;
};
Data structure of Rectangular ROI:
• int x - x coordinate of upper-left pixel (required field)
• int y - y coordinate of upper-left pixel (required field)
• int w - width (required field)
• int h - height (required field)
4.2.2.2 Functions
DLL_EXTERN_C DLL_API
int
calculateBestFocusRoi(
oeImage
inputImages[],
oeRoi
inputRoi,
unsigned int
size,
int
&index,
float
&value);
Parameters:
• inputImages – input parameter, array of oeRoi structures
• inputRoi – input parameter, oeRoi Structure
• size – input value, size of inputImages array
• index – output value, index of best focused image
• value – output value, merit function output