Leaper WaferScan Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILCameraArray Interface Reference

This interface provide functionalities of camera array generation, calibration and image stitching. More...

Inheritance diagram for ILCameraArray:
ILObjects ILObject LCameraArray

Public Member Functions

LPVErrorCode Calibrate ()
 
void ImageToWorld (double imagePointX, double imagePointY, double *worldPointX, double *worldPointY)
 
void Init (LPVCalibModel calibModel, int hCount, int vCount)
 
void InitByCopy (ILCalib *calib, int hCount, int vCount, BOOL copyCalib, double hStep, double vStep)
 
void InitByCopyN (LArray< ILCalib * > calibs, int rows, int hCount, int vCount, BOOL copyCalib, double hStep, double vStep)
 
BOOL IsCalibrated ()
 
ILCalibItem (int index)
 
LPVErrorCode StitchImage (ILImageList *images, ILImage *stitchedImage)
 
void WorldToImage (double worldPointX, double worldPointY, double *imagePointX, double *imagePointY)
 
- Public Member Functions inherited from ILObjects
int Count ()
 
BOOL Empty ()
 
ILObjectItemObject (int objIndex)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

double CalibError [get]
 The calibration error of the camera array, which is the maximum error among all calibration objects in it.
 
BOOL EnableBlend [get, set]
 Whether to do blending in the overlap region of multiple views. By default, this feature is on.
Enable it will output a more smooth image stitching result, but slower.
 
LPVInterpolationMethod InterpolationMethod [get, set]
 The interpolation method used in stitching. By default, it's LPVInterCubic.
 
BOOL UseCache [get, set]
 Whether to make use of cache which is used to speed-up the process of the image stitching (and blending), but consume more memory. By default, it's off.
 

Detailed Description

This interface provide functionalities of camera array generation, calibration and image stitching.

Camera array is a set of multiple independent cameras arranged on a known pattern, or one or multiple cameras moving along a fixed path which generate a virtual camera array. You can use this interface to create and manage the camera array, calibrate then stitch the images captured from individual cameras into a large image for preview or inspection.

To use this interface, you should create a LCameraArray object.

Example Code

Member Function Documentation

◆ Calibrate()

LPVErrorCode Calibrate ( )

Do calibration with current configuration. Make sure individual views are calibrated, before doing camera array calibration.

Return values
errorReturn error code if anything is wrong.

◆ ImageToWorld()

void ImageToWorld ( double  imagePointX,
double  imagePointY,
double *  worldPointX,
double *  worldPointY 
)

Map a point from the stitching image coordinates to the world coordinates.
The mapping works with a calibrated system, if not the output world point is the same point as the input image point.

Parameters
[in]imagePointXThe x-coordinate of the stitching image point.
[in]imagePointYThe y-coordinate of the stitching image point.
[out]worldPointXReturn the x-coordinate of the world point.
[out]worldPointYReturn the y-coordinate of the world point.

◆ Init()

void Init ( LPVCalibModel  calibModel,
int  hCount,
int  vCount 
)

Initialize the camera array by \( vCount \times hCount \) cameras calibrated with the given calibration model.

Parameters
[in]calibModelThe input camera calibration model.
[in]hCountThe horizontal count of cameras, should be \( \ge 1 \) .
[in]vCountThe vertical count of cameras, should be \( \ge 1 \) .
See also
InitByCopy(), InitByCopyN().

◆ InitByCopy()

void InitByCopy ( ILCalib calib,
int  hCount,
int  vCount,
BOOL  copyCalib,
double  hStep,
double  vStep 
)

Initialize the camera array by moving one camera multiple times horizontally and vertically.
It generates a \( vCount \times hCount \) camera array.

Parameters
[in]calibThe input camera calibration object to move.
[in]hCountThe horizontal count of cameras, should be \( \ge 1 \) .
[in]vCountThe vertical count of cameras, should be \( \ge 1 \) .
[in]copyCalibTrue to copy the calibration matrices. If the movement steps are also available, it will also help generate a post-transform matrix on each copied camera calibration object.
[in]hStepThe distance of each horizontal movement, optional, in physical unit.
[in]vStepThe distance of each vertical movement, optional, in physical unit.
See also
InitByCopyN().

◆ InitByCopyN()

void InitByCopyN ( LArray< ILCalib * >  calibs,
int  rows,
int  hCount,
int  vCount,
BOOL  copyCalib,
double  hStep,
double  vStep 
)

Similar as InitByCopy(), initialize the camera array by moving n cameras multiple times horizontally and vertically.
It generates a \( (vCount * rows) \times (hCount * n / rows) \) camera array.
For example, given 1 2 3 4 input cameras int two rows, move it 3 times horizontally and 2 times vertically, it results in a camera array as:

\( \begin{matrix}1 & 2 & 1 & 2 & 1 & 2\\3 & 4 & 3 & 4 & 3 & 4\\1 & 2 & 1 & 2 & 1 & 2\\3 & 4 & 3 & 4 & 3 & 4\end{matrix} \)

Parameters
[in]calibsThe input collection of camera calibration objects.
[in]rowsThe count of rows of the input collection.
[in]hCountThe horizontal count of cameras, should be \( \ge 1 \) .
[in]vCountThe vertical count of cameras, should be \( \ge 1 \) .
[in]copyCalibTrue to copy the calibration matrices. If the movement steps are also available, it will also help generate a post-transform matrix on each copied camera calibration object.
[in]hStepThe distance of each horizontal movement, optional, in physical unit.
[in]vStepThe distance of each vertical movement, optional, in physical unit.

◆ IsCalibrated()

BOOL IsCalibrated ( )

Check whether the camera array and all calibration objects in it is well-calibrated.

Return values
valReturn true if it's calibrated, otherwise, return false.

◆ Item()

ILCalib* Item ( int  index)

Fetch one camera calibration object with the given index.

Parameters
[in]indexInput index, it should be a 0-based number smaller than total count.
Return values
calibReturn the camera calibration object.

◆ StitchImage()

LPVErrorCode StitchImage ( ILImageList images,
ILImage stitchedImage 
)

Stitch the images from all cameras in the matrix.
The stitching works with a calibrated system, if not it returns the LPVErrCalibNotCalib error.

Parameters
[in]imagesThe input image list, in the same order as the cameras row by row.
[out]stitchedImageThe result image.
Return values
errorReturn error code if anything is wrong.

◆ WorldToImage()

void WorldToImage ( double  worldPointX,
double  worldPointY,
double *  imagePointX,
double *  imagePointY 
)

Map a point from the world coordinates to the stitching image coordinates.
The mapping works with a calibrated system, if not the output world point is the same point as the input image point.

Parameters
[in]worldPointXThe x-coordinate of the world point.
[in]worldPointYThe y-coordinate of the world point.
[out]imagePointXReturn the x-coordinate of the stitching image point.
[out]imagePointYReturn the y-coordinate of the stitching image point.