Public Member Functions | |
tlCameraTSAI () | |
tlCameraTSAI (tlSource *source) | |
tlCameraTSAI (char *filename) | |
tlCameraTSAI (char *filename, tlSource *source) | |
virtual | ~tlCameraTSAI () |
int | readConfig (char *filename) |
int | writeConfig (char *filename) |
int | calibrate (tlCameraTSAICalibData *data) |
int | setSource (tlSource *source) |
tlSource * | getSource () |
int | toWorld (tlPoint *point) |
int | toImage (tlPoint *point) |
virtual int | warp (tlPoint *point) |
virtual int | warp (tlPoint *point, tlPoint *dest) |
virtual int | dewarp (tlPoint *point) |
virtual int | dewarp (tlPoint *point, tlPoint *dest) |
virtual int | warp (tlImage *image) |
virtual int | warp (tlImage *image, tlImage *dest) |
virtual int | dewarp (tlImage *image) |
virtual int | dewarp (tlImage *image, tlImage *dest) |
virtual int | warp (tlImage *image, tlRect *rect) |
virtual int | warp (tlImage *image, tlRect *rect, tlImage *dest) |
virtual int | dewarp (tlImage *image, tlRect *rect) |
virtual int | dewarp (tlImage *image, tlRect *rect, tlImage *dest) |
virtual int | grab (tlImage *image) |
virtual int | grab (tlImage *image, tlRect *rect) |
virtual int | grabQueued (tlImage *image) |
virtual int | grabQueued (tlImage *image, tlRect *rect) |
int | setPosition (int Tx, int Ty, int Tz) |
int | setOrientation (int Rx, int Ry, int Rz) |
bool | isCalibrated () |
int | getTx () |
int | getTy () |
int | getTz () |
int | getRx () |
int | getRy () |
int | getRz () |
int | getWidth () |
int | getHeight () |
int | getID () |
tl_format | getFormat () |
tlCameraTSAI::tlCameraTSAI | ( | ) |
Default constructor. Uses the defaults file specified in TL_CAMERA_TSAI_FILENAME, or no calibration if file does not exist.
References readConfig(), TL_CAMERA_TSAI_FILENAME, and TL_NO_ERROR.
tlCameraTSAI::tlCameraTSAI | ( | tlSource * | source | ) |
Specify an image source to use with these calibration settings. The source must be valid and ready to provide images via the grab() or grabQueued() methods.
source | a valid pointer to an image source. |
References tlSource::getHeight(), tlSource::getWidth(), and TL_NO_ERROR.
tlCameraTSAI::tlCameraTSAI | ( | char * | filename | ) |
Specify a calibration configuration file to read from.
filename | calibration configuration file |
References readConfig(), and TL_NO_ERROR.
tlCameraTSAI::tlCameraTSAI | ( | char * | filename, | |
tlSource * | source | |||
) |
Read calibration data from a given file and specify an image source to use with these calibration settings. The source must be valid and ready to provide images via the grab() or grabQueued() methods.
source | a valid pointer to an image source. | |
filename | calibration configuration file. |
References tlSource::getHeight(), tlSource::getWidth(), readConfig(), and TL_NO_ERROR.
tlCameraTSAI::~tlCameraTSAI | ( | void | ) | [virtual] |
int tlCameraTSAI::readConfig | ( | char * | filename | ) |
Read calibration configuration from a given filename.
filename | calibration configuration file. |
References TL_ERRNO_MSG, TL_ERROR_FILE_NOT_FOUND_OR_CORRUPT, and TL_ERROR_NULL_POINTER.
Referenced by tlCameraTSAI().
int tlCameraTSAI::writeConfig | ( | char * | filename | ) |
Write calibration configuration to a given filename.
filename | calibration configuration file. |
References TL_ERRNO_MSG, TL_ERROR_FILE_NOT_FOUND_OR_CORRUPT, and TL_ERROR_NULL_POINTER.
int tlCameraTSAI::calibrate | ( | tlCameraTSAICalibData * | data | ) |
Perform TSAI calibration given a set of data. See TSAI calibration for more information on how to perform TSAI camera calibration.
data | a pointer to the calibration data structure |
int tlCameraTSAI::setSource | ( | tlSource * | source | ) |
Specify an image source to use with these calibration settings. The source must be valid and ready to provide images via the grab() or grabQueued() methods.
source | a valid pointer to an image source. |
References tlSource::getHeight(), and tlSource::getWidth().
tlCameraTSAI::getSource | ( | ) | [inline] |
Return a pointer to the image source connected to this camera.
int tlCameraTSAI::toWorld | ( | tlPoint * | point | ) |
This routine performs an inverse perspective projection to determine the position of a point in world coordinates that corresponds to a given position in image coordinates. To constrain the inverse projection to a single point the routine requires a Z world coordinate for the point in addition to the X and Y image coordinates.
point | the point to apply the transform to. Members x,y and wz are used as input, output is placed in members wx,wy. |
References tlLocation::wx, tlLocation::wy, tlLocation::wz, tlLocation::x, and tlLocation::y.
int tlCameraTSAI::toImage | ( | tlPoint * | point | ) |
This routine takes the position of a point in world coordinates [mm] and determines the position of its image in image coordinates [pix].
point | the point to apply the transform to. Members wx,wy,wz are used as input, output is placed in members x,y. |
References tlLocation::wx, tlLocation::wy, tlLocation::wz, tlLocation::x, and tlLocation::y.
int tlCameraTSAI::warp | ( | tlPoint * | point | ) | [virtual] |
Warp point for the given camera. That is, return the distorted coordinate for a point in a calibrated image given the calibration settings.
point | the point to project |
References TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlLocation::x, and tlLocation::y.
Warp point for the given camera. That is, return the distorted coordinate for a point in a calibrated image given the calibration settings. The result is placed in another image.
point | the point to project | |
dest | [out] the point that will contain the undistorted coordinates |
References tlPoint::copyTo(), TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlLocation::x, and tlLocation::y.
int tlCameraTSAI::dewarp | ( | tlPoint * | point | ) | [virtual] |
Unwarp point for the given camera. That is, return the undistorted coordinate for a point in the image given the calibration settings.
point | the point to project |
References TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlLocation::x, and tlLocation::y.
Unwarp point for the given camera. That is, return the undistorted coordinate for a point in the image given the calibration settings. The result is placed in another point.
point | the point to project | |
dest | [out] the point that will contain the undistorted coordinates |
References tlPoint::copyTo(), TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlLocation::x, and tlLocation::y.
int tlCameraTSAI::warp | ( | tlImage * | image | ) | [virtual] |
Warp an image for the given camera. That is, return the distorted image given the calibration settings.
image | the image to project |
References tlSize::height, tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_ALLOCATION_FAILED, TL_ERROR_NA, TL_ERROR_NULL_POINTER, and tlSize::width.
Warp an image for the given camera. That is, return the distorted image given the calibration settings. The result is placed in another image.
image | the image to project | |
dest | [out] projection result |
References tlPixelArray::copyTo(), tlPixelArray::format, tlSize::height, tlPixelArray::init(), tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, and tlSize::width.
int tlCameraTSAI::dewarp | ( | tlImage * | image | ) | [virtual] |
Unwarp an image for the given camera. That is, return the undistorted image given the calibration settings.
image | the image to project |
References tlSize::height, tlPixelArray::pixel, tlPixelArray::pixelWidth, tl_create_array(), TL_ERRNO_MSG, TL_ERROR_ALLOCATION_FAILED, TL_ERROR_NA, TL_ERROR_NULL_POINTER, and tlSize::width.
Unwarp an image for the given camera. That is, return the undistorted image given the calibration settings. The result is placed in another image.
image | the image to project | |
dest | [out] projection result |
References tlPixelArray::copyTo(), tlPixelArray::format, tlSize::height, tlPixelArray::init(), tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, and tlSize::width.
Warp a portion of an image for the given camera. That is, return the distorted image given the calibration settings.
image | the image to project | |
rect | portion of the image to project |
References tlSize::height, tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_ALLOCATION_FAILED, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlSize::width, tlLocation::x, and tlLocation::y.
Warp a portion of an image for the given camera. That is, return the distorted image given the calibration settings. The result is placed in another image.
image | the image to project | |
rect | portion of the image to project | |
dest | [out] projection result |
References tlPixelArray::copyTo(), tlPixelArray::format, tlSize::height, tlPixelArray::init(), tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlSize::width, tlLocation::x, and tlLocation::y.
Unwarp a portion of an image for the given camera. That is, return the undistorted image given the calibration settings.
image | the image to project | |
rect | portion of the image to project |
References tlSize::height, tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_ALLOCATION_FAILED, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlSize::width, tlLocation::x, and tlLocation::y.
Unwarp a portion of an image for the given camera. That is, return the undistorted image given the calibration settings. The result is placed in another image.
image | the image to project | |
rect | portion of the image to project | |
dest | [out] projection result |
References tlPixelArray::copyTo(), tlPixelArray::format, tlSize::height, tlPixelArray::init(), tlPixelArray::pixel, tlPixelArray::pixelWidth, TL_ERRNO_MSG, TL_ERROR_NA, TL_ERROR_NULL_POINTER, tlSize::width, tlLocation::x, and tlLocation::y.
int tlCameraTSAI::grab | ( | tlImage * | image | ) | [virtual] |
This call acquires a full image from an image source. The image will have the size and format the source is currently configured for.
image | [out] a valid image pointer that will receive the image. |
Implements tlCamera.
References tlSource::grab(), TL_ERRNO_MSG, and TL_ERROR_NULL_POINTER.
This call acquires a portion of an image from an image source. The image will have the size and format the source is currently configured for, but only the portion defined by the rect argument will contain valid pixel values.
image | [out] a valid image pointer that will receive the image. | |
rect | a pointer to the portion of the image to acquire. |
Implements tlCamera.
References tlSource::grab(), TL_ERRNO_MSG, and TL_ERROR_NULL_POINTER.
int tlCameraTSAI::grabQueued | ( | tlImage * | image | ) | [virtual] |
This call acquires a full image from an image source. The image will have the size and format the source is currently configured for.
image | [out] a valid image pointer that will receive the image. |
Implements tlCamera.
References tlSource::grabQueued(), TL_ERRNO_MSG, and TL_ERROR_NULL_POINTER.
This call acquires a portion of an image from an image source. The image will have the size and format the source is currently configured for, but only the portion defined by the rect argument will contain valid pixel values.
image | [out] a valid image pointer that will receive the image. | |
rect | a pointer to the portion of the image to acquire. |
Implements tlCamera.
References tlSource::grabQueued(), TL_ERRNO_MSG, and TL_ERROR_NULL_POINTER.
int tlCamera::setPosition | ( | int | Tx, | |
int | Ty, | |||
int | Tz | |||
) | [inherited] |
Set the camera position in the workspace.
Tx | camera position on the X axis. | |
Ty | camera position on the Y axis. | |
Tz | camera position on the Z axis. |
int tlCamera::setOrientation | ( | int | Rx, | |
int | Ry, | |||
int | Rz | |||
) | [inherited] |
Set the camera orientation in the workspace.
Rx | camera orientation around the X axis. | |
Ry | camera orientation around the Y axis. | |
Rz | camera orientation around the Z axis. |
tlCamera::isCalibrated | ( | ) | [inline, inherited] |
Check whether the camera returns calibrated (undistorted) images or not.
tlCamera::getTx | ( | ) | [inline, inherited] |
Get the position of the camera on the X axis of the workspace.
tlCamera::getTy | ( | ) | [inline, inherited] |
Get the position of the camera on the Y axis of the workspace.
tlCamera::getTz | ( | ) | [inline, inherited] |
Get the position of the camera on the Z axis of the workspace.
tlCamera::getRx | ( | ) | [inline, inherited] |
Get the orientation of the camera around the X axis of the workspace.
tlCamera::getRy | ( | ) | [inline, inherited] |
Get the orientation of the camera around the X axis of the workspace.
tlCamera::getRz | ( | ) | [inline, inherited] |
Get the orientation of the camera around the X axis of the workspace.
tlSource::getWidth | ( | ) | [inline, inherited] |
Returns the width of the image source. Any image acquired through this tlSource object will have the current width.
Referenced by setSource(), and tlCameraTSAI().
tlSource::getHeight | ( | ) | [inline, inherited] |
Returns the height of the image source. Any image acquired through this tlSource object will have the current height.
Referenced by setSource(), and tlCameraTSAI().
tlSource::getID | ( | ) | [inline, inherited] |
Return a unique identifier for this source. Identifiers are allocated dynamically and are only valid during application run-time.
tlSource::getFormat | ( | ) | [inline, inherited] |