TYCamport3  3
TYCoordinateMapper.h File Reference

Coordinate Conversion API. More...

#include <stdlib.h>
#include "TYApi.h"
Include dependency graph for TYCoordinateMapper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TY_PIXEL_DESC
 
struct  TY_PIXEL_COLOR_DESC
 

Macros

#define TYMAP_CHECKRET(f, bufToFree)
 

Typedefs

typedef struct TY_PIXEL_DESC TY_PIXEL_DESC
 
typedef struct TY_PIXEL_COLOR_DESC TY_PIXEL_COLOR_DESC
 

Functions

TY_CAPI TYInvertExtrinsic (const TY_CAMERA_EXTRINSIC *orgExtrinsic, TY_CAMERA_EXTRINSIC *invExtrinsic)
 Calculate 4x4 extrinsic matrix's inverse matrix. More...
 
TY_CAPI TYMapDepthToPoint3d (const TY_CAMERA_CALIB_INFO *src_calib, uint32_t depthW, uint32_t depthH, const TY_PIXEL_DESC *depthPixels, uint32_t count, TY_VECT_3F *point3d, float f_scale_unit=1.0f)
 Map pixels on depth image to 3D points. More...
 
TY_CAPI TYMapPoint3dToDepth (const TY_CAMERA_CALIB_INFO *dst_calib, const TY_VECT_3F *point3d, uint32_t count, uint32_t depthW, uint32_t depthH, TY_PIXEL_DESC *depth, float f_scale_unit=1.0f)
 Map 3D points to pixels on depth image. Reverse operation of TYMapDepthToPoint3d. More...
 
TY_CAPI TYMapDepthImageToPoint3d (const TY_CAMERA_CALIB_INFO *src_calib, int32_t imageW, int32_t imageH, const uint16_t *depth, TY_VECT_3F *point3d, float f_scale_unit=1.0f)
 Map depth image to 3D points. 0 depth pixels maps to (NAN, NAN, NAN). More...
 
TY_CAPI TYMapPoint3dToDepthImage (const TY_CAMERA_CALIB_INFO *dst_calib, const TY_VECT_3F *point3d, uint32_t count, uint32_t depthW, uint32_t depthH, uint16_t *depth, float f_target_scale=1.0f)
 Map 3D points to depth image. (NAN, NAN, NAN) will be skipped. More...
 
TY_CAPI TYMapPoint3dToPoint3d (const TY_CAMERA_EXTRINSIC *extrinsic, const TY_VECT_3F *point3dFrom, int32_t count, TY_VECT_3F *point3dTo)
 Map 3D points to another coordinate. More...
 

Detailed Description

Coordinate Conversion API.

Note
Considering performance, we leave the responsibility of parameters check to users.

Definition in file TYCoordinateMapper.h.

Macro Definition Documentation

◆ TYMAP_CHECKRET

#define TYMAP_CHECKRET (   f,
  bufToFree 
)
Value:
do{ \
TY_STATUS err = (f); \
if(err){ \
if(bufToFree) \
free(bufToFree); \
return err; \
} \
} while(0)

Definition at line 268 of file TYCoordinateMapper.h.

Function Documentation

◆ TYInvertExtrinsic()

TY_CAPI TYInvertExtrinsic ( const TY_CAMERA_EXTRINSIC orgExtrinsic,
TY_CAMERA_EXTRINSIC invExtrinsic 
)

Calculate 4x4 extrinsic matrix's inverse matrix.

Parameters
[in]orgExtrinsicInput extrinsic matrix.
[out]invExtrinsicInverse matrix.
Return values
TY_STATUS_OKSucceed.
TY_STATUS_ERRORCalculation failed.

◆ TYMapDepthImageToPoint3d()

TY_CAPI TYMapDepthImageToPoint3d ( const TY_CAMERA_CALIB_INFO src_calib,
int32_t  imageW,
int32_t  imageH,
const uint16_t *  depth,
TY_VECT_3F point3d,
float  f_scale_unit = 1.0f 
)

Map depth image to 3D points. 0 depth pixels maps to (NAN, NAN, NAN).

Parameters
[in]src_calibDepth image's calibration data.
[in]depthWWidth of depth image.
[in]depthHHeight of depth image.
[in]depthDepth image.
[out]point3dOutput point3D image.
Return values
TY_STATUS_OKSucceed.

◆ TYMapDepthToPoint3d()

TY_CAPI TYMapDepthToPoint3d ( const TY_CAMERA_CALIB_INFO src_calib,
uint32_t  depthW,
uint32_t  depthH,
const TY_PIXEL_DESC depthPixels,
uint32_t  count,
TY_VECT_3F point3d,
float  f_scale_unit = 1.0f 
)

Map pixels on depth image to 3D points.

Parameters
[in]src_calibDepth image's calibration data.
[in]depthWWidth of depth image.
[in]depthHHeight of depth image.
[in]depthPixelsPixels on depth image.
[in]countNumber of depth pixels.
[out]point3dOutput point3D.
Return values
TY_STATUS_OKSucceed.

◆ TYMapPoint3dToDepth()

TY_CAPI TYMapPoint3dToDepth ( const TY_CAMERA_CALIB_INFO dst_calib,
const TY_VECT_3F point3d,
uint32_t  count,
uint32_t  depthW,
uint32_t  depthH,
TY_PIXEL_DESC depth,
float  f_scale_unit = 1.0f 
)

Map 3D points to pixels on depth image. Reverse operation of TYMapDepthToPoint3d.

Parameters
[in]dst_calibTarget depth image's calibration data.
[in]point3dInput 3D points.
[in]countNumber of points.
[in]depthWWidth of target depth image.
[in]depthHHeight of target depth image.
[out]depthOutput depth pixels.
Return values
TY_STATUS_OKSucceed.

◆ TYMapPoint3dToDepthImage()

TY_CAPI TYMapPoint3dToDepthImage ( const TY_CAMERA_CALIB_INFO dst_calib,
const TY_VECT_3F point3d,
uint32_t  count,
uint32_t  depthW,
uint32_t  depthH,
uint16_t *  depth,
float  f_target_scale = 1.0f 
)

Map 3D points to depth image. (NAN, NAN, NAN) will be skipped.

Parameters
[in]dst_calibTarget depth image's calibration data.
[in]point3dInput 3D points.
[in]countNumber of points.
[in]depthWWidth of target depth image.
[in]depthHHeight of target depth image.
[in,out]depthDepth image buffer.
Return values
TY_STATUS_OKSucceed.

◆ TYMapPoint3dToPoint3d()

TY_CAPI TYMapPoint3dToPoint3d ( const TY_CAMERA_EXTRINSIC extrinsic,
const TY_VECT_3F point3dFrom,
int32_t  count,
TY_VECT_3F point3dTo 
)

Map 3D points to another coordinate.

Parameters
[in]extrinsicExtrinsic matrix.
[in]point3dFromSource 3D points.
[in]countNumber of source 3D points.
[out]point3dToTarget 3D points.
Return values
TY_STATUS_OKSucceed.