DAVID4 SDK
1.8.7
|
Provides a low level C interface to 'Scanning' and 'Shape Fusion' functions. More...
Classes | |
struct | d4img_ImageFormat |
Describes the format of an image. More... | |
struct | d4calib_CalibPoint |
Point correspondence used for calibration. More... | |
struct | d4sls_CodedLightPhaseShiftParams |
Defines parameters used in structured light mode 'coded light + phase shift' ('cl+ps'). More... | |
struct | d4sls_Plane |
Defines a plane in 3D. Used for d4sls_planesToDepthImage. More... | |
struct | d4mesh_SubmeshVertexIndex |
Index to define a vertex in a submesh. More... | |
struct | d4mesh_MotionInfo |
Provides user knowledge about the motion between two scans. More... | |
struct | d4mesh_PosesWithTolerances |
A list of poses (4*4 matrices) plus tolerances for translation and rotation. More... | |
struct | d4mesh_CoarseAlignParams |
Parameter set for Coarse Alignment, see d4mesh_alignPairCoarse. More... | |
struct | d4mesh_FineAlignParams |
Parameter set for Fine Alignment, see d4mesh_alignPairFine. More... | |
struct | d4mesh_GlobalFineAlignParams |
Parameter set for Global Fine Alignment, see d4mesh_alignGlobalFine. More... | |
Library initialization and basic types | |
When you are done, call d4lib_release. | |
enum | d4error_ErrorCode { d4ok = 0, d4error_InvalidArgument = -100, d4error_FormatNotAvailable = -101, d4error_InvalidFormat = -102, d4error_NoAccess = -103, d4error_MissingObject = -104, d4error_OutOfMemory = -105, d4error_Abort = -106, d4error_Fail = -107, d4error_NotLicensed = -108, d4error_NotImplemented = -109, d4error_InvalidPath = -200, d4error_FileNotFound = -201, d4error_DirectoryNotFound = -202, d4error_MissingFilename = -203, d4error_InconsistentBuffer = -204, d4error_InvalidVersion = -205, d4error_DeviceNotAvailable = -300, d4error_NoLiveImage = -301, d4error_ActuatorStalled = -302, d4error_CameraCalibration = -400, d4error_ProjectorCalibration = -401, d4error_ScanFailed = -500, d4error_NotCalibrated = -501, d4error_AlignFailed = -600, d4error_InvalidMeshId = -601 } |
All DAVID Low Level Library functions return an error code. More... | |
typedef size_t | d4size |
Basic size type. | |
typedef struct d4img * | d4img_ptr |
Image pointer. | |
typedef struct d4fimg * | d4fimg_ptr |
Float image pointer. | |
typedef struct d4cam * | d4cam_ptr |
Camera pointer. | |
typedef struct d4projector * | d4projector_ptr |
Projector pointer. | |
typedef struct d4calib * | d4calib_ptr |
Calibration pointer. | |
typedef struct d4sls * | d4sls_ptr |
Structured light scanning pointer. | |
typedef struct d4mesh * | d4mesh_ptr |
Mesh pointer. | |
D4LIB_API int | d4lib_init (const char *licenseKey) |
Initialize DAVID Low Level Library. More... | |
D4LIB_API int | d4lib_release () |
Release DAVID Low Level Library. More... | |
D4LIB_API int | d4lib_getVersion (char *version, d4size maxLength) |
Get version of library. More... | |
Memory management | |
Objects are created and deleted by the library. In order to create new objects use the d4xxx_newXxx functions. Life time of an object is managed by reference counting: Use d4mem_decRefCount to release an object. | |
D4LIB_API int | d4mem_decRefCount (void *ptr) |
Decrement the reference count for the object identified by 'ptr'. More... | |
D4LIB_API int | d4mem_incRefCount (void *ptr) |
Increment the reference count for the object identified by 'ptr'. More... | |
Images | |
Functions and types related to images. Notes:
| |
enum | d4img_PixelFormat { d4img_UnknownPixelFormat = 0, d4img_Y800, d4img_RGB24, d4img_YUY2, d4img_BY8 } |
Supported pixel formats. More... | |
D4LIB_API d4img_ptr | d4img_newImage () |
Creates a new image. More... | |
D4LIB_API int | d4img_getImageFormat (d4img_ptr img, int *width, int *height, int *pixelFormat) |
Get format of the image. More... | |
D4LIB_API int | d4img_setImageFormat (d4img_ptr img, int width, int height, int pixelFormat) |
Set format of the image. More... | |
D4LIB_API int | d4img_getImageData (d4img_ptr img, void *data, d4size size, int pixelFormat) |
Get image data. More... | |
D4LIB_API int | d4img_setImageData (d4img_ptr img, const void *data, d4size size, int pixelFormat) |
Set the image data. More... | |
D4LIB_API int | d4img_convert (d4img_ptr destImg, int pixelFormat, d4img_ptr srcImg) |
Set the image data. More... | |
D4LIB_API int | d4img_import (d4img_ptr img, const char *filename) |
Import image from file. More... | |
D4LIB_API int | d4img_export (d4img_ptr img, const char *filename) |
Export image to file. More... | |
D4LIB_API int | d4img_computeColorImage (d4img_ptr outputColorImage, d4img_ptr *inputGrayImages, int inputImageCount) |
Compute a color image from 3 or 4 grayscale images that were capture under specific lighting conditions. More... | |
D4LIB_API int | d4img_computeWhiteBalance (d4img_ptr img, double *redFactor, double *greenFactor, double *blueFactor) |
Compute white balance parameters. More... | |
D4LIB_API int | d4img_applyWhiteBalance (d4img_ptr img, double redFactor, double greenFactor, double blueFactor) |
Apply white balance correction to 'img'. More... | |
Float images | |
Special functions and types related to scalar float images. Each pixel has a 32bit scalar float value with no special bounds on ranges. Notes:
| |
enum | d4fimg_ReplaceOp { d4fimg_ReplaceIfLess, d4fimg_ReplaceIfGreater } |
Supported replace operations. More... | |
D4LIB_API d4fimg_ptr | d4fimg_newImage () |
Creates a new 32bit float image. More... | |
D4LIB_API int | d4fimg_getImageFormat (d4fimg_ptr img, int *width, int *height) |
Get format of the float image. More... | |
D4LIB_API int | d4fimg_setImageFormat (d4fimg_ptr img, int width, int height) |
Set format of the float image. More... | |
D4LIB_API int | d4fimg_getImageData (d4fimg_ptr img, float *data, d4size size) |
Get image data. More... | |
D4LIB_API int | d4fimg_setImageData (d4fimg_ptr img, const float *data, d4size size) |
Set image data. More... | |
D4LIB_API int | d4fimg_replace (d4fimg_ptr img, float replaceValue, d4fimg_ptr compare, float threshold, int replaceOp) |
Replace pixel value by 'replaceValue', if condition is valid. More... | |
D4LIB_API int | d4fimg_setFloat (d4fimg_ptr img, float value) |
Sets all pixel values to given float value. More... | |
D4LIB_API int | d4fimg_export (d4fimg_ptr img, const char *filename) |
Export float image to file. More... | |
D4LIB_API int | d4fimg_import (d4fimg_ptr img, const char *filename) |
Import float image from file. More... | |
Camera | |
Functions and types related to camera interface.
| |
D4LIB_API d4cam_ptr | d4cam_newDirectShowCamera () |
Creates a new DirectShow camera instance. More... | |
D4LIB_API int | d4cam_getAvailableCamerasCount (d4cam_ptr cam, int *count) |
Get the number of available cameras. More... | |
D4LIB_API int | d4cam_getAvailableCamerasName (d4cam_ptr cam, char *name, d4size maxLength, int index) |
Get the name of an available camera. More... | |
D4LIB_API int | d4cam_open (d4cam_ptr cam, const char *name, int width, int height, int pixelFormat, double fps) |
Open camera. More... | |
D4LIB_API int | d4cam_check (d4cam_ptr cam) |
Check if camera is open and ok. More... | |
D4LIB_API int | d4cam_close (d4cam_ptr cam) |
Close camera. More... | |
D4LIB_API int | d4cam_pause (d4cam_ptr cam) |
Set running camera into a paused state. More... | |
D4LIB_API int | d4cam_captureImageAsync (d4cam_ptr cam, int minContentChange, double maxWaitTime, int temporalSmoothCount) |
Start a new asynchronous image capture. More... | |
D4LIB_API int | d4cam_setSkipCount (d4cam_ptr cam, int skipCount) |
Set the number of images that are skipped after a content change was detected. More... | |
D4LIB_API int | d4cam_getCapturedImage (d4cam_ptr cam, d4img_ptr img, int pixelFormat) |
Get the captured image. More... | |
D4LIB_API int | d4cam_getImageFormat (d4cam_ptr cam, int *width, int *height, int *pixelFormat, double *fps) |
Get the image format of the camera. More... | |
D4LIB_API int | d4cam_getTimestamp (d4cam_ptr cam, double *timestamp) |
Get the timestamp of the last captured image. More... | |
D4LIB_API int | d4cam_setProperty (d4cam_ptr cam, double value, const char *name) |
Set a camera property. More... | |
D4LIB_API int | d4cam_getProperty (d4cam_ptr cam, double *value, const char *name) |
Get a camera property. More... | |
D4LIB_API int | d4cam_getPropertyRange (d4cam_ptr cam, double *minValue, double *maxValue, double *defValue, double *deltaValue, const char *name) |
Get a camera property range. More... | |
D4LIB_API int | d4cam_getPropertyCount (d4cam_ptr cam, int *count, bool onlyAvailable) |
Get number of all camera property names or 'onlyAvailable' camera property names. More... | |
D4LIB_API int | d4cam_getPropertyName (d4cam_ptr cam, char *name, d4size maxLength, int propertyNameIndex, bool onlyAvailable) |
Get a camera property name. More... | |
Projector | |
Interface functions for controlling projectors. Notes:
| |
D4LIB_API d4projector_ptr | d4projector_newExtendedDisplayProjector () |
Creates a new projector using extended display. More... | |
D4LIB_API int | d4projector_close (d4projector_ptr projector) |
Closes the connection to the projector. More... | |
D4LIB_API int | d4projector_getImageFormat (d4projector_ptr projector, int *width, int *height, int *pixelFormat) |
Get image format for displaying images. More... | |
D4LIB_API int | d4projector_displayImage (d4projector_ptr projector, d4img_ptr img) |
Display an image. More... | |
D4LIB_API int | d4projector_displayUniformColor (d4projector_ptr projector, unsigned char red, unsigned char green, unsigned char blue) |
Display an image with a uniform color. More... | |
D4LIB_API int | d4projector_openByScreenID (d4projector_ptr projector, int screenID) |
Establish the connection to a projector by given 'screenID'. More... | |
D4LIB_API int | d4projector_check (d4projector_ptr projector) |
Check if projector is open and ok. More... | |
D4LIB_API int | d4projector_getScreenCount (d4projector_ptr projector, int *screenCount) |
Get the number of available screens. More... | |
D4LIB_API int | d4projector_getScreenFormat (d4projector_ptr projector, int *x, int *y, int *width, int *height, int screenID) |
Get screen dimensions and position for requested screen. More... | |
Calibration | |
Interface functions related to camera and projector calibration. Notes:
| |
enum | d4calib_CamCalibError { d4calib_CamCalibError_ok = 0, d4calib_CamCalibError_MarkerDetection = -100, d4calib_CamCalibError_MarkerMapping = -101, d4calib_CamCalibError_PlaneIntersection = -102, d4calib_CamCalibError_LeftPlane = -103, d4calib_CamCalibError_RightPlane = -104, d4calib_CamCalibError_ModelFitting = -105, d4calib_CamCalibError_ErrorValuesTooHigh = -106, d4calib_CamCalibError_Unknown = -107 } |
More detailed camera calibration error. More... | |
enum | d4calib_ProjectorCalibError { d4calib_ProjectorCalibError_ok = 0, d4calib_ProjectorCalibError_PhaseImage = -200, d4calib_ProjectorCalibError_ModelFitting = -201, d4calib_ProjectorCalibError_Unknown = -202 } |
More detailed projector calibration error. More... | |
D4LIB_API d4calib_ptr | d4calib_newCameraCalibration () |
Create a new calibration object for cameras. More... | |
D4LIB_API d4calib_ptr | d4calib_newProjectorCalibration () |
Create a new calibration object for projectors. More... | |
D4LIB_API int | d4calib_isCalibrated (d4calib_ptr calib, bool *calibrated) |
Is calibration valid? More... | |
D4LIB_API int | d4calib_importCalibration (d4calib_ptr calib, const char *filename) |
Import calibration data from file. More... | |
D4LIB_API int | d4calib_exportCalibration (d4calib_ptr calib, const char *filename) |
Export calibration data to file. More... | |
D4LIB_API int | d4calib_changeCalibrationResolution (d4calib_ptr calib, int newWidth, int newHeight) |
Change resolution of image format used for calibration. More... | |
D4LIB_API int | d4calib_getCalibrationResolution (d4calib_ptr calib, int *width, int *height) |
Get the resolution of a calibration. More... | |
D4LIB_API int | d4calib_calibrate (d4calib_ptr camCalib, d4img_ptr imgCamCalib, d4calib_ptr projectorCalib, d4sls_ptr sls, d4img_ptr *capturedImages, int imageCount, double scale, bool compensatePatternOffsets, int *calibError, d4calib_CalibPoint *calibPoints, int *calibPointCount) |
Standard calibration procedure for one camera and one projector using the corner calibration panels. More... | |
Structured Light Scanner | |
Types and functions related to Structured Light Scanning (SLS). Notes:
| |
enum | d4sls_ColorSelect { d4sls_White, d4sls_Red, d4sls_Green, d4sls_Blue } |
Selects the color used for all generated patterns. More... | |
enum | d4sls_Orientation { d4sls_HorizontalOrientation, d4sls_VerticalOrientation, d4sls_BothOrientations } |
Defines orientations for hardware setup. More... | |
D4LIB_API d4sls_ptr | d4sls_newStructuredLightScanner () |
Create new SLS object. More... | |
D4LIB_API int | d4sls_getCodedLightPhaseShiftParams (d4sls_ptr sls, d4sls_CodedLightPhaseShiftParams *params) |
Get parameters for 'cl+ps' mode. More... | |
D4LIB_API int | d4sls_setCodedLightPhaseShiftParams (d4sls_ptr sls, const d4sls_CodedLightPhaseShiftParams *params) |
Set parameters for 'cl+ps' mode. More... | |
D4LIB_API int | d4sls_getPatternCount (d4sls_ptr sls, int *patternCount) |
Get number of pattern in a scanning sequence. More... | |
D4LIB_API int | d4sls_getPatternImage (d4sls_ptr sls, d4img_ptr img, int width, int height, int pixelFormat, int patternIndex) |
Get pattern image at 'patternIndex'. More... | |
D4LIB_API int | d4sls_getSetupImage (d4sls_ptr sls, d4img_ptr img, int width, int height, int pixelFormat) |
Get special image for setup. More... | |
D4LIB_API int | d4sls_getChessboardImage (d4sls_ptr sls, d4img_ptr img, int width, int height, int pixelFormat, d4calib_ptr projectorCalib, double scale) |
Get special chessboard image that can be used to validate a calibration performed by d4calib_calibrate. More... | |
D4LIB_API int | d4sls_computeDepthImage (d4sls_ptr sls, d4fimg_ptr depthImage, d4fimg_ptr qualityImage, d4img_ptr *capturedImages, int imageCount, d4calib_ptr camCalib, d4calib_ptr projectorCalib, int minContrast) |
Compute depth image that represents the current scan. More... | |
D4LIB_API int | d4sls_planesToDepthImage (d4sls_ptr sls, d4fimg_ptr depthImage, d4calib_ptr camCalib, int numPlanes, const d4sls_Plane *planes) |
Computes a depth image from a list of planes. More... | |
Scanning | |
Notes:
| |
D4LIB_API int | d4scan_convertDepthImageToMesh (d4mesh_ptr mesh, d4fimg_ptr depthImage, d4fimg_ptr qualityImage, d4calib_ptr calib, float minDepth, float maxDepth, float depthThres, float minQuality, double outlierRemoval) |
Compute mesh from a depth image. More... | |
D4LIB_API int | d4scan_removeBackground (d4fimg_ptr depthImage, d4fimg_ptr backgroundImage, float epsilon) |
Remove background scan from current scan. More... | |
Mesh | |
A triangulated mesh represents the surface of a 3D object. More information about triangulated meshes:
Notes:
| |
enum | d4mesh_BufferType { d4mesh_VertexPositionBuffer, d4mesh_VertexNormalBuffer, d4mesh_VertexTexCoordBuffer, d4mesh_VertexColorBuffer, d4mesh_TriangleIndexBuffer, d4mesh_VertexQualityBuffer } |
Buffer selection. More... | |
D4LIB_API d4mesh_ptr | d4mesh_newMesh () |
Create new mesh object. More... | |
D4LIB_API int | d4mesh_clear (d4mesh_ptr mesh) |
Clear all data of mesh object. More... | |
D4LIB_API int | d4mesh_copy (d4mesh_ptr targetMesh, d4mesh_ptr sourceMesh) |
Copy mesh data from 'sourceMesh' to 'targetMesh'. More... | |
D4LIB_API int | d4mesh_combine (d4mesh_ptr meshGroup, d4mesh_ptr *meshesToCombine, int meshCount) |
Combine multiple meshes into submeshes of a single mesh. More... | |
D4LIB_API int | d4mesh_uncombine (d4mesh_ptr meshGroup, d4mesh_ptr *uncombinedMeshes, int meshCount) |
Uncombine submeshes of 'meshGroup' into independent meshes. More... | |
D4LIB_API int | d4mesh_getSubmeshCount (d4mesh_ptr mesh, int *count) |
Get the number of submeshes (combined meshes) in 'mesh'. More... | |
D4LIB_API int | d4mesh_setSubmeshCount (d4mesh_ptr mesh, int count) |
Set the number of submeshes (combined meshes) in 'mesh'. More... | |
D4LIB_API int | d4mesh_getBuffer (d4mesh_ptr mesh, void *data, d4size size, int bufferType, int submeshIndex) |
Copy requested buffer ('bufferType') content into 'data'. More... | |
D4LIB_API int | d4mesh_setBuffer (d4mesh_ptr mesh, const void *data, d4size size, int bufferType, int submeshIndex) |
Copy 'data' into the desired buffer ('bufferType'). More... | |
D4LIB_API int | d4mesh_hasBuffer (d4mesh_ptr mesh, bool *hasBuffer, int bufferType, int submeshIndex) |
Is the buffer 'bufferType' available? See d4mesh_BufferType for information about which buffers are optional. More... | |
D4LIB_API int | d4mesh_getBufferSize (d4mesh_ptr mesh, d4size *size, int bufferType, int submeshIndex) |
Get size of buffer 'bufferType' in bytes (for all submeshes). More... | |
D4LIB_API int | d4mesh_getVertexCount (d4mesh_ptr mesh, int *vertexCount, int submeshIndex) |
Get the number of vertices for a given submesh of a mesh. More... | |
D4LIB_API int | d4mesh_setVertexCount (d4mesh_ptr mesh, int vertexCount, int submeshIndex) |
Set the number of vertices for a given submesh of a mesh. More... | |
D4LIB_API int | d4mesh_getTriangleCount (d4mesh_ptr mesh, int *triangleCount, int submeshIndex) |
Get the number of triangles (total count for all submeshes). More... | |
D4LIB_API int | d4mesh_setTriangleCount (d4mesh_ptr mesh, int triangleCount, int submeshIndex) |
Set the number of triangles for a given submesh of a mesh. More... | |
D4LIB_API int | d4mesh_getName (d4mesh_ptr mesh, char *name, d4size maxLength) |
Get the name of a mesh. More... | |
D4LIB_API int | d4mesh_setName (d4mesh_ptr mesh, const char *name) |
Set the name of a mesh. More... | |
D4LIB_API d4img_ptr | d4mesh_getTexture (d4mesh_ptr mesh, int submeshIndex) |
Get the texture of a mesh. More... | |
D4LIB_API int | d4mesh_setTexture (d4mesh_ptr mesh, d4img_ptr image, int submeshIndex) |
Set the texture of a mesh. More... | |
D4LIB_API int | d4mesh_hasTexture (d4mesh_ptr mesh, bool *hasTexture, int submeshIndex) |
Has 'mesh' a texture? More... | |
D4LIB_API int | d4mesh_getPose (d4mesh_ptr mesh, double world_T_local[16]) |
Get the position and orientation (pose) of a mesh. More... | |
D4LIB_API int | d4mesh_setPose (d4mesh_ptr mesh, const double world_T_local[16]) |
Set the position and orientation (pose) of a mesh. More... | |
Mesh: Filtering | |
Notes:
| |
D4LIB_API int | d4mesh_smoothAverage (d4mesh_ptr mesh, int smoothing) |
Smooth mesh using an average filter. More... | |
D4LIB_API int | d4mesh_reduceMeshDensity (d4mesh_ptr mesh, float factor) |
Reduce the vertex/triangle density of mesh (simplification). More... | |
D4LIB_API int | d4mesh_removeSelectedVertices (d4mesh_ptr mesh, const d4mesh_SubmeshVertexIndex *selectedVertices, int selectedVerticesCount) |
Remove selected vertices. More... | |
D4LIB_API int | d4mesh_invertTriangleOrientation (d4mesh_ptr mesh) |
Invert orientation of all triangles in given mesh. More... | |
D4LIB_API int | d4mesh_removeVerticesByVirtualCamMask (d4mesh_ptr *meshes, int meshCount, const unsigned char *mask, int width, int height, double f, const double world_T_cam[16], bool onlyVisible) |
Remove any vertex i that when projected into a virtual camera view has a mask value of 'mask[i]==true'. More... | |
Mesh: Alignment | |
Alignment (registration) of meshes.
| |
D4LIB_API int | d4mesh_alignPairCoarse (d4mesh_ptr mesh1, d4mesh_ptr mesh2, double *quality, const d4mesh_CoarseAlignParams *params) |
Align 'mesh1' to 'mesh2' coarsely. More... | |
D4LIB_API int | d4mesh_alignPairFine (d4mesh_ptr mesh1, d4mesh_ptr mesh2, double *quality, const d4mesh_FineAlignParams *params) |
Align 'mesh1' to 'mesh2' fine. More... | |
D4LIB_API int | d4mesh_alignGlobalFine (d4mesh_ptr *meshes, int meshCount, const d4mesh_GlobalFineAlignParams *params) |
Align meshes globally fine. More... | |
Mesh: Fusion | |
Fusion of meshes and textures into one mesh and one texture. Notes:
| |
D4LIB_API int | d4mesh_fuseGeometry (d4mesh_ptr fusedGeo, d4mesh_ptr *meshes, int meshCount, int resolution, float holeSizeThresRel, int sharpness) |
Fuse multiple meshes into one triangular mesh. More... | |
D4LIB_API int | d4mesh_getFuseGeometryResolution (d4mesh_ptr *meshes, int meshCount, int *resolution, double metricResolution) |
Converts a metric resolution value into a resolution value required by d4mesh_fuseGeometry. More... | |
D4LIB_API int | d4mesh_fuseTexture (d4mesh_ptr fusedGeo, d4mesh_ptr *meshes, int meshCount) |
Fuse textures referenced by 'meshes' into one texture of 'fusedGeo'. More... | |
Mesh: Import / Export | |
See functions for supported formats. Notes:
| |
D4LIB_API int | d4mesh_export (d4mesh_ptr mesh, const char *filename) |
Export 'mesh' to file. More... | |
D4LIB_API int | d4mesh_import (d4mesh_ptr mesh, const char *filename) |
Import 'mesh' from file. More... | |
Provides a low level C interface to 'Scanning' and 'Shape Fusion' functions.
More detailed camera calibration error.
More detailed projector calibration error.
enum d4error_ErrorCode |
All DAVID Low Level Library functions return an error code.
enum d4fimg_ReplaceOp |
enum d4img_PixelFormat |
Supported pixel formats.
enum d4mesh_BufferType |
Buffer selection.
enum d4sls_ColorSelect |
enum d4sls_Orientation |
Defines orientations for hardware setup.
D4LIB_API int d4calib_calibrate | ( | d4calib_ptr | camCalib, |
d4img_ptr | imgCamCalib, | ||
d4calib_ptr | projectorCalib, | ||
d4sls_ptr | sls, | ||
d4img_ptr * | capturedImages, | ||
int | imageCount, | ||
double | scale, | ||
bool | compensatePatternOffsets, | ||
int * | calibError, | ||
d4calib_CalibPoint * | calibPoints, | ||
int * | calibPointCount | ||
) |
Standard calibration procedure for one camera and one projector using the corner calibration panels.
[out] | camCalib | Valid pointer to camera calibration object. |
[in] | imgCamCalib | Valid pointer to camera image of calibration corner. |
[out] | projectorCalib | Valid pointer to projector calibration object. |
[in,out] | sls | Valid pointer to structured light scanning object. |
[in] | capturedImages | Valid pointer to an array of image pointers. Every pointer has to be valid and of pixel format d4img_Y800. |
[in] | imageCount | Number of image pointers in 'capturedImages'. |
[in] | scale | Calibration scale from panel. |
[in] | compensatePatternOffsets | Use bundle adjustment to determine offsets of left and right patterns within their respective planes. Set to false, if calibration corner is perfect. |
[out] | calibError | Optional pointer to int that gets additional information about calibration error (d4calib_CamCalibError, d4calib_ProjectorCalibError, or d4ok). |
[out] | calibPoints | Optional pointer to array of calibration points that is filled with correspondences used for calibration. See d4calib_CalibPoint. |
[in,out] | calibPointCount | Optional pointer to int. Input: Maximum number of calibration points that fit into 'calibPoints'. Output: Number of calibration points written to 'calibPoints'. |
D4LIB_API int d4calib_changeCalibrationResolution | ( | d4calib_ptr | calib, |
int | newWidth, | ||
int | newHeight | ||
) |
Change resolution of image format used for calibration.
Intrinsics are adapted to this new resolution.
[in,out] | calib | Valid pointer to calibration object. |
[in] | newWidth | New camera image width. |
[in] | newHeight | New camera image height. |
D4LIB_API int d4calib_exportCalibration | ( | d4calib_ptr | calib, |
const char * | filename | ||
) |
Export calibration data to file.
[in,out] | calib | Valid pointer to calibration object. |
[in] | filename | Valid pointer to filename string. |
D4LIB_API int d4calib_getCalibrationResolution | ( | d4calib_ptr | calib, |
int * | width, | ||
int * | height | ||
) |
Get the resolution of a calibration.
[in] | calib | Valid pointer to calibration object. |
[out] | width | The image width. |
[out] | height | The image height. |
D4LIB_API int d4calib_importCalibration | ( | d4calib_ptr | calib, |
const char * | filename | ||
) |
Import calibration data from file.
[in,out] | calib | Valid pointer to calibration object. |
[in] | filename | Valid pointer to filename string. |
D4LIB_API int d4calib_isCalibrated | ( | d4calib_ptr | calib, |
bool * | calibrated | ||
) |
Is calibration valid?
[in,out] | calib | Valid pointer to calibration object. |
[out] | calibrated | Valid pointer to bool that gets calibration state: True, if calibrated. |
D4LIB_API d4calib_ptr d4calib_newCameraCalibration | ( | ) |
Create a new calibration object for cameras.
D4LIB_API d4calib_ptr d4calib_newProjectorCalibration | ( | ) |
Create a new calibration object for projectors.
D4LIB_API int d4cam_captureImageAsync | ( | d4cam_ptr | cam, |
int | minContentChange, | ||
double | maxWaitTime, | ||
int | temporalSmoothCount | ||
) |
Start a new asynchronous image capture.
The function returns immediately. Use d4cam_getCapturedImage to wait for the capturing to be finished. Example:
[in,out] | cam | Valid pointer to a camera. |
[in] | minContentChange | How much has the content of the new image to be different from the previous image? Range: [0,100]%. |
[in] | maxWaitTime | Maximum wait time [seconds] until an image has to be captured. 'minContentChange' will be ignored when 'maxWaitTime' has been exceeded. |
[in] | temporalSmoothCount | Temporal smoothing: Final image is average of '1+temporalSmoothCount' camera images. |
D4LIB_API int d4cam_check | ( | d4cam_ptr | cam) |
Check if camera is open and ok.
[in] | cam | Pointer to camera. |
D4LIB_API int d4cam_close | ( | d4cam_ptr | cam) |
D4LIB_API int d4cam_getAvailableCamerasCount | ( | d4cam_ptr | cam, |
int * | count | ||
) |
Get the number of available cameras.
Can be used in combination with d4cam_getAvailableCamerasName.
[in] | cam | Valid pointer to camera interface. |
[out] | count | Valid pointer to int that gets the number of available cameras. |
D4LIB_API int d4cam_getAvailableCamerasName | ( | d4cam_ptr | cam, |
char * | name, | ||
d4size | maxLength, | ||
int | index | ||
) |
Get the name of an available camera.
Can be used in combination with d4cam_getAvailableCamerasCount.
[in] | cam | Valid pointer to camera interface. |
[out] | name | Valid pointer to string that gets the camera name. |
[in] | maxLength | Maximum length of 'name'. |
[in] | index | Zero based index of available index. |
Get the captured image.
If a capturing is still in progress (started via d4cam_captureImageAsync), the function will wait until capturing is finished.
[in,out] | cam | Valid pointer to a camera. |
[out] | img | Valid pointer to an image that gets the captured image. |
[in] | pixelFormat | Desired pixel format (see d4img_PixelFormat). In case of d4img_UnknownPixelFormat, camera pixel format will be used. |
D4LIB_API int d4cam_getImageFormat | ( | d4cam_ptr | cam, |
int * | width, | ||
int * | height, | ||
int * | pixelFormat, | ||
double * | fps | ||
) |
Get the image format of the camera.
[in] | cam | Valid pointer to camera. |
[out] | width | Optional pointer to int for width of image. May be NULL. |
[out] | height | Optioal pointer to int for height of image. May be NULL. |
[out] | pixelFormat | Optional pointer to int for d4img_PixelFormat. May be NULL. |
[out] | fps | Optional pointer to double for frames per second. May be NULL. |
D4LIB_API int d4cam_getProperty | ( | d4cam_ptr | cam, |
double * | value, | ||
const char * | name | ||
) |
Get a camera property.
[in,out] | cam | Valid pointer to an open camera. |
[out] | value | Valid pointer to double that gets the value. |
[in] | name | Valid string to name of property. |
D4LIB_API int d4cam_getPropertyCount | ( | d4cam_ptr | cam, |
int * | count, | ||
bool | onlyAvailable | ||
) |
Get number of all camera property names or 'onlyAvailable' camera property names.
[in,out] | cam | Valid pointer to open camera. |
[out] | count | Valid pointer to int that gets the count of camera property names. |
[in] | onlyAvailable | List only available camera properties? |
D4LIB_API int d4cam_getPropertyName | ( | d4cam_ptr | cam, |
char * | name, | ||
d4size | maxLength, | ||
int | propertyNameIndex, | ||
bool | onlyAvailable | ||
) |
Get a camera property name.
[in,out] | cam | Valid pointer to open camera. |
[out] | name | Valid pointer to string that gets the property name. |
[in] | maxLength | Maximum length of 'name'. |
[in] | propertyNameIndex | Zero based index of a property name. Has to be in range [0, d4cam_getPropertyCount). |
[in] | onlyAvailable | List only available camera properties? |
D4LIB_API int d4cam_getPropertyRange | ( | d4cam_ptr | cam, |
double * | minValue, | ||
double * | maxValue, | ||
double * | defValue, | ||
double * | deltaValue, | ||
const char * | name | ||
) |
Get a camera property range.
[in,out] | cam | Valid pointer to an open camera. |
[out] | minValue | Valid pointer to double that gets the minimum value. |
[out] | maxValue | Valid pointer to double that gets the maximum value. |
[out] | defValue | Valid pointer to double that gets the default value. |
[out] | deltaValue | Valid pointer to double that gets the delta value. |
[in] | name | Valid string to name of property. |
D4LIB_API int d4cam_getTimestamp | ( | d4cam_ptr | cam, |
double * | timestamp | ||
) |
Get the timestamp of the last captured image.
[in,out] | cam | Valid pointer to a camera. |
[out] | timestamp | Valid pointer to a double that gets the timestamp [seconds]. |
D4LIB_API d4cam_ptr d4cam_newDirectShowCamera | ( | ) |
Creates a new DirectShow camera instance.
D4LIB_API int d4cam_open | ( | d4cam_ptr | cam, |
const char * | name, | ||
int | width, | ||
int | height, | ||
int | pixelFormat, | ||
double | fps | ||
) |
Open camera.
Example:
[in,out] | cam | Valid pointer to camera. |
[in] | name | Name of the camera. |
[in] | width | Desired with of the camera forat. Set zero to ignore. |
[in] | height | Desired height of the camera format. Set zero to ignore. |
[in] | pixelFormat | Desired pixel format. Set to d4cam_UnknownPixelFormat to ignore. |
[in] | fps | Desired frames per second of the camera format. Set zero to ignore. |
D4LIB_API int d4cam_pause | ( | d4cam_ptr | cam) |
Set running camera into a paused state.
Camera is automatically resumed when calling any capture function. Resuming a camera from paused state takes some time depeding on the camera driver.
[in,out] | cam | Valid pointer to a camera. |
D4LIB_API int d4cam_setProperty | ( | d4cam_ptr | cam, |
double | value, | ||
const char * | name | ||
) |
Set a camera property.
[in,out] | cam | Valid pointer to an open camera. |
[in] | value | Value to be set. |
[in] | name | Null terminated string of camera name. |
D4LIB_API int d4cam_setSkipCount | ( | d4cam_ptr | cam, |
int | skipCount | ||
) |
Set the number of images that are skipped after a content change was detected.
This value will be used when d4cam_captureImageAsync is called with 'minContentChange' > 0. Only set this value when there are problems (e.g. when using rolling shutter camera or image tearing).
[in,out] | cam | Valid pointer to a camera. |
[in] | skipCount | Number of images to be skipped. Default value is 1. |
D4LIB_API int d4fimg_export | ( | d4fimg_ptr | img, |
const char * | filename | ||
) |
Export float image to file.
[in] | img | Valid pointer to float image. |
[in] | filename | Filename of image. |
D4LIB_API int d4fimg_getImageData | ( | d4fimg_ptr | img, |
float * | data, | ||
d4size | size | ||
) |
Get image data.
[in] | img | Valid pointer to an image. |
[out] | data | Destination buffer for image data. |
[in] | size | Size of 'data' in bytes. |
D4LIB_API int d4fimg_getImageFormat | ( | d4fimg_ptr | img, |
int * | width, | ||
int * | height | ||
) |
Get format of the float image.
[in] | img | Valid pointer to a float image. |
[out] | width | Pointer to an int that gets the width of the image. May be NULL. |
[out] | height | Pointer to an int that gets the height of the image. May be NULL. |
D4LIB_API int d4fimg_import | ( | d4fimg_ptr | img, |
const char * | filename | ||
) |
Import float image from file.
[out] | img | Valid pointer to destination float image. |
[in] | filename | Filename of image. |
D4LIB_API d4fimg_ptr d4fimg_newImage | ( | ) |
Creates a new 32bit float image.
D4LIB_API int d4fimg_replace | ( | d4fimg_ptr | img, |
float | replaceValue, | ||
d4fimg_ptr | compare, | ||
float | threshold, | ||
int | replaceOp | ||
) |
Replace pixel value by 'replaceValue', if condition is valid.
Otherwise source value is used.
[in,out] | img | Valid source and target image. |
[in] | replaceValue | Value for replacement. |
[in] | compare | Valid image that stores mask values for each pixel. |
[in] | threshold | Threshold value that is used for comparison. |
[in] | replaceOp | Desired replace operation. |
D4LIB_API int d4fimg_setFloat | ( | d4fimg_ptr | img, |
float | value | ||
) |
Sets all pixel values to given float value.
[in,out] | img | Valid image. |
[in] | value | Value to be set. |
D4LIB_API int d4fimg_setImageData | ( | d4fimg_ptr | img, |
const float * | data, | ||
d4size | size | ||
) |
Set image data.
[out] | img | Valid pointer to an image. |
[in] | data | Source buffer for image data. |
[in] | size | Size of 'data' in bytes. |
D4LIB_API int d4fimg_setImageFormat | ( | d4fimg_ptr | img, |
int | width, | ||
int | height | ||
) |
Set format of the float image.
[in] | img | Valid pointer to a float image. |
[out] | width | Width of the image or zero. |
[out] | height | Height of the image or zero. |
D4LIB_API int d4img_applyWhiteBalance | ( | d4img_ptr | img, |
double | redFactor, | ||
double | greenFactor, | ||
double | blueFactor | ||
) |
Apply white balance correction to 'img'.
[in,out] | img | Valid pointer to image that should be corrected. |
[in] | redFactor | Red correction factor > 0. |
[in] | greenFactor | Green correction factor > 0. |
[in] | blueFactor | Blue correction factor > 0. |
D4LIB_API int d4img_computeColorImage | ( | d4img_ptr | outputColorImage, |
d4img_ptr * | inputGrayImages, | ||
int | inputImageCount | ||
) |
Compute a color image from 3 or 4 grayscale images that were capture under specific lighting conditions.
[out] | outputColorImage | Valid pointer to output image. Output pixel format will be set d4img_RGB24. Width and height will be set to width and height of input images. |
[in] | inputGrayImages | Valid pointer to an array of 3 or 4 image pointers. The following conditions have to be met:
|
[in] | inputImageCount | Number of input images. Has to be 3 or 4. |
D4LIB_API int d4img_computeWhiteBalance | ( | d4img_ptr | img, |
double * | redFactor, | ||
double * | greenFactor, | ||
double * | blueFactor | ||
) |
Compute white balance parameters.
The color image has to be captured with a white background.
[in] | img | Valid pointer to input to a color image. |
[out] | redFactor | Valid pointer to double that gets the scaling factor for red color component. |
[out] | greenFactor | Valid pointer to double that gets the scaling factor for green color component. |
[out] | blueFactor | Valid pointer to double that gets the scaling factor for blue color component. |
Set the image data.
Image data is converted, if 'pixelFormat' does not fit.
[out] | destImg | Valid pointer to destination image. |
[in] | pixelFormat | Pixel format of data array. See d4img_PixelFormat. When set to d4img_UnknownPixelFormat, image data is just copied. |
[in] | srcImg | Valid pointer to source image. |
D4LIB_API int d4img_export | ( | d4img_ptr | img, |
const char * | filename | ||
) |
Export image to file.
[in] | img | Valid pointer to destination image. |
[in] | filename | Filename of image. |
Get image data.
Image data is converted, if 'pixelFormat' does not fit.
[in] | img | Valid pointer to an image. |
[out] | data | Destination buffer for image data. |
[in] | size | Size of destination buffer in bytes. |
[in] | pixelFormat | Desired pixel format. See d4img_PixelFormat. When set to d4img_UnknownPixelFormat, pixel format of 'img' is used. |
D4LIB_API int d4img_getImageFormat | ( | d4img_ptr | img, |
int * | width, | ||
int * | height, | ||
int * | pixelFormat | ||
) |
Get format of the image.
[in] | img | Valid pointer to an image. |
[out] | width | Pointer to int for width of image. May be NULL. |
[out] | height | Pointer to int for height of image. May be NULL. |
[out] | pixelFormat | Pointer to int for d4img_PixelFormat. May be NULL. |
D4LIB_API int d4img_import | ( | d4img_ptr | img, |
const char * | filename | ||
) |
Import image from file.
[out] | img | Valid pointer to destination image. |
[in] | filename | Filename of image. |
D4LIB_API d4img_ptr d4img_newImage | ( | ) |
Creates a new image.
Set the image data.
Image data is converted, if 'pixelFormat' does not fit.
[out] | img | Valid pointer to an image. |
[in] | data | Valid pointer it image data array. |
[in] | size | Size of image data array in bytes. |
[in] | pixelFormat | Pixel format of data array. See d4img_PixelFormat. When set to d4img_UnknownPixelFormat, pixel format of 'img' is used. |
D4LIB_API int d4img_setImageFormat | ( | d4img_ptr | img, |
int | width, | ||
int | height, | ||
int | pixelFormat | ||
) |
Set format of the image.
[out] | img | Valid pointer to an image. |
[in] | width | Width of the image or zero. |
[in] | height | Height of the image or zero. |
[in] | pixelFormat | See d4img_PixelFormat. d4img_UnknownPixelFormat is allowed. |
D4LIB_API int d4lib_getVersion | ( | char * | version, |
d4size | maxLength | ||
) |
Get version of library.
[out] | version | Valid pointer to string that gets the version. |
[in] | maxLength | Maximum string length inlucing null terminator that fits into 'version'. |
D4LIB_API int d4lib_init | ( | const char * | licenseKey) |
Initialize DAVID Low Level Library.
[in] | licenseKey | License key. Only required for special/future versions - normally please use nullptr |
D4LIB_API int d4lib_release | ( | ) |
Release DAVID Low Level Library.
D4LIB_API int d4mem_decRefCount | ( | void * | ptr) |
Decrement the reference count for the object identified by 'ptr'.
[in,out] | ptr | Valid pointer to the object. |
D4LIB_API int d4mem_incRefCount | ( | void * | ptr) |
Increment the reference count for the object identified by 'ptr'.
The object is deleted when the reference count reaches zero.
[in,out] | ptr | Valid pointer to the object. |
D4LIB_API int d4mesh_alignGlobalFine | ( | d4mesh_ptr * | meshes, |
int | meshCount, | ||
const d4mesh_GlobalFineAlignParams * | params | ||
) |
Align meshes globally fine.
[in,out] | meshes | Valid pointer to an array of valid mesh pointers. |
[in] | meshCount | Number of meshes referenced by 'meshes'. |
[in] | params | Valid pointer to alignment parameter set. See d4mesh_GlobalFineAlignParams. |
D4LIB_API int d4mesh_alignPairCoarse | ( | d4mesh_ptr | mesh1, |
d4mesh_ptr | mesh2, | ||
double * | quality, | ||
const d4mesh_CoarseAlignParams * | params | ||
) |
Align 'mesh1' to 'mesh2' coarsely.
[in,out] | mesh1 | Valid pointer to mesh that is moved (aligned). |
[in] | mesh2 | Valid pointer to mesh. |
[out] | quality | Optional pointer to double that gets quality value in range [-1,1]=[bad,good]. |
[in] | params | Valid pointer to alignment parameter set. See d4mesh_CoarseAlignParams. |
D4LIB_API int d4mesh_alignPairFine | ( | d4mesh_ptr | mesh1, |
d4mesh_ptr | mesh2, | ||
double * | quality, | ||
const d4mesh_FineAlignParams * | params | ||
) |
Align 'mesh1' to 'mesh2' fine.
[in,out] | mesh1 | Valid pointer to mesh that is moved (aligned). |
[in] | mesh2 | Valid pointer to mesh. |
[out] | quality | Optional pointer to double that gets quality value in range [-1,1]=[bad,good]. |
[in] | params | Valid pointer to alignment parameter set. See d4mesh_FineAlignParams. |
D4LIB_API int d4mesh_clear | ( | d4mesh_ptr | mesh) |
Clear all data of mesh object.
[in,out] | mesh | Valid pointer to mesh object. |
D4LIB_API int d4mesh_combine | ( | d4mesh_ptr | meshGroup, |
d4mesh_ptr * | meshesToCombine, | ||
int | meshCount | ||
) |
Combine multiple meshes into submeshes of a single mesh.
[out] | meshGroup | Valid pointer to a mesh object. Must not be part of 'meshesToCombine'. |
[in] | meshesToCombine | Pointer to array of valid pointers to mesh objects that have to be combined. |
[in] | meshCount | Number of meshes referenced by 'meshesToCombine'. |
D4LIB_API int d4mesh_copy | ( | d4mesh_ptr | targetMesh, |
d4mesh_ptr | sourceMesh | ||
) |
Copy mesh data from 'sourceMesh' to 'targetMesh'.
Old content of 'targetMesh' is deleted.
[out] | targetMesh | Valid pointer to target mesh object. |
[in] | sourceMesh | Valid pointer to source mesh object. |
D4LIB_API int d4mesh_export | ( | d4mesh_ptr | mesh, |
const char * | filename | ||
) |
Export 'mesh' to file.
Supported formats: OBJ, STL, PLY
[in] | mesh | Valid pointer to mesh. |
[in] | filename | Valid pointer to string with filename. |
D4LIB_API int d4mesh_fuseGeometry | ( | d4mesh_ptr | fusedGeo, |
d4mesh_ptr * | meshes, | ||
int | meshCount, | ||
int | resolution, | ||
float | holeSizeThresRel, | ||
int | sharpness | ||
) |
Fuse multiple meshes into one triangular mesh.
[out] | fusedGeo | Valid pointer to fusion result. |
[in] | meshes | Valid pointer to an array of valid mesh pointers. |
[in] | meshCount | Number of meshes referenced by 'meshes'. |
[in] | resolution | Limits the maximum resolution and thus the required memory usage. |
[in] | holeSizeThresRel | Holes, which have a smaller area than holeSizeThresRel * size of original data surface, will be closed. 0 = open all holes. 1 = close all holes. |
[in] | sharpness | Fusion sharpness in [-3,+5]. Negative values for smoothing. Default is 1. |
D4LIB_API int d4mesh_fuseTexture | ( | d4mesh_ptr | fusedGeo, |
d4mesh_ptr * | meshes, | ||
int | meshCount | ||
) |
Fuse textures referenced by 'meshes' into one texture of 'fusedGeo'.
[in,out] | fusedGeo | Valid pointer to a mesh. |
[in] | meshes | Valid pointer to an array of valid mesh pointers. |
[in] | meshCount | Number of meshes referenced by 'meshes'. |
D4LIB_API int d4mesh_getBuffer | ( | d4mesh_ptr | mesh, |
void * | data, | ||
d4size | size, | ||
int | bufferType, | ||
int | submeshIndex | ||
) |
Copy requested buffer ('bufferType') content into 'data'.
You can use d4mesh_getVertexCount, d4mesh_getTriangleCount, and d4mesh_getBufferSize to compute the correct size of 'data'.
[in] | mesh | Valid pointer to a mesh object. |
[out] | data | Valid pointer to data buffer. |
[in] | size | Size of 'data' buffer in bytes. |
[in] | bufferType | Desired data buffer, see d4mesh_BufferType. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_getBufferSize | ( | d4mesh_ptr | mesh, |
d4size * | size, | ||
int | bufferType, | ||
int | submeshIndex | ||
) |
Get size of buffer 'bufferType' in bytes (for all submeshes).
[in] | mesh | Valid pointer to a mesh object. |
[out] | size | Valid pointer to value that gets the size of the buffer in bytes. Size will be set to zero if buffer is not available. |
[in] | bufferType | Desired data buffer, see d4mesh_BufferType. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_getFuseGeometryResolution | ( | d4mesh_ptr * | meshes, |
int | meshCount, | ||
int * | resolution, | ||
double | metricResolution | ||
) |
Converts a metric resolution value into a resolution value required by d4mesh_fuseGeometry.
It uses the maximum bounding box length of all 'meshes'.
[in] | meshes | Valid pointer to an array of valid mesh pointers. |
[in] | meshCount | Number of meshes referenced by 'meshes'. |
[out] | resolution | Valid pointer to resolution value that can be used in d4mesh_fuseGeometry. |
[in] | metricResolution | Smallest possible element size in units (e.g. 0.1 [mm]). |
D4LIB_API int d4mesh_getName | ( | d4mesh_ptr | mesh, |
char * | name, | ||
d4size | maxLength | ||
) |
Get the name of a mesh.
[in] | mesh | Valid pointer to a mesh object. |
[out] | name | Valid pointer to string that gets the name. |
[in] | maxLength | Maximum length of a string that fits into 'name'. |
D4LIB_API int d4mesh_getPose | ( | d4mesh_ptr | mesh, |
double | world_T_local[16] | ||
) |
Get the position and orientation (pose) of a mesh.
The pose is represented as a homogenenous transformation matrix:
Some notes:
This matrix transforms local coordinates into world coordinates:
[in] | mesh | Valid pointer to a mesh. |
[out] | world_T_local | Valid pointer to an array of 16 double values. |
D4LIB_API int d4mesh_getSubmeshCount | ( | d4mesh_ptr | mesh, |
int * | count | ||
) |
Get the number of submeshes (combined meshes) in 'mesh'.
A mesh has at least one submesh. This is also the standard case unless d4mesh_combine or d4mesh_setSubmeshCount was used.
[in] | mesh | Valid pointer to a mesh object. |
[out] | count | Valid pointer to int that gets number of combined meshes in 'mesh'. |
D4LIB_API d4img_ptr d4mesh_getTexture | ( | d4mesh_ptr | mesh, |
int | submeshIndex | ||
) |
Get the texture of a mesh.
Textures are optional.
[in] | mesh | Valid pointer to a mesh object. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_getTriangleCount | ( | d4mesh_ptr | mesh, |
int * | triangleCount, | ||
int | submeshIndex | ||
) |
Get the number of triangles (total count for all submeshes).
[in] | mesh | Valid pointer to a mesh object. |
[out] | triangleCount | Valid pointer to int that gets the number of triangles. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_getVertexCount | ( | d4mesh_ptr | mesh, |
int * | vertexCount, | ||
int | submeshIndex | ||
) |
Get the number of vertices for a given submesh of a mesh.
[in] | mesh | Valid pointer to a mesh object. |
[out] | vertexCount | Valid pointer to int that gets the number of vertices. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_hasBuffer | ( | d4mesh_ptr | mesh, |
bool * | hasBuffer, | ||
int | bufferType, | ||
int | submeshIndex | ||
) |
Is the buffer 'bufferType' available? See d4mesh_BufferType for information about which buffers are optional.
[in] | mesh | Valid pointer to a mesh object. |
[out] | hasBuffer | Valid pointer to bool that gets answer. |
[in] | bufferType | Desired data buffer, see d4mesh_BufferType. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_hasTexture | ( | d4mesh_ptr | mesh, |
bool * | hasTexture, | ||
int | submeshIndex | ||
) |
Has 'mesh' a texture?
[in] | mesh | Valid pointer to a mesh. |
[out] | hasTexture | Valid pointer to a bool that gets the answer. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_import | ( | d4mesh_ptr | mesh, |
const char * | filename | ||
) |
Import 'mesh' from file.
Supported formats: OBJ
[out] | mesh | Valid pointer to mesh. |
[in] | filename | Valid pointer to string with filename. |
D4LIB_API int d4mesh_invertTriangleOrientation | ( | d4mesh_ptr | mesh) |
Invert orientation of all triangles in given mesh.
[in,out] | mesh | Valid pointer to a mesh. |
D4LIB_API d4mesh_ptr d4mesh_newMesh | ( | ) |
Create new mesh object.
D4LIB_API int d4mesh_reduceMeshDensity | ( | d4mesh_ptr | mesh, |
float | factor | ||
) |
Reduce the vertex/triangle density of mesh (simplification).
[in,out] | mesh | Valid pointer to a mesh. |
[in] | factor | 0.5f for retaining 50% of all triangles, 0.1f for 10% triangles... |
D4LIB_API int d4mesh_removeSelectedVertices | ( | d4mesh_ptr | mesh, |
const d4mesh_SubmeshVertexIndex * | selectedVertices, | ||
int | selectedVerticesCount | ||
) |
Remove selected vertices.
Referenced triangles are also removed. A vertex i is selected if selected[i]==true.
[in,out] | mesh | Valid pointer to a mesh. |
[in] | selectedVertices | Valid pointer to an array of indices to vertices which should be removed. |
[in] | selectedVerticesCount | Number of indices in 'selectedVertices'. |
D4LIB_API int d4mesh_removeVerticesByVirtualCamMask | ( | d4mesh_ptr * | meshes, |
int | meshCount, | ||
const unsigned char * | mask, | ||
int | width, | ||
int | height, | ||
double | f, | ||
const double | world_T_cam[16], | ||
bool | onlyVisible | ||
) |
Remove any vertex i that when projected into a virtual camera view has a mask value of 'mask[i]==true'.
Vertices outside view or with a mask value fo 'mask[i]==false' are not removed. If a vertex is removed, its referenced triangles are also removed. The virtual camera is described by a perspective camera model:
[in,out] | meshes | Valid pointer to an array of valid mesh pointers. |
[in] | meshCount | Number of meshes referenced by 'meshes'. |
[in] | mask | Valid pointer to an boolean array of size 'width*height'. True: Vertex should be removed. False: Keep vertex. |
[in] | width | Width of the mask image [pixel]. Has to be > 0. |
[in] | height | Height of the mask image [pixel]. Has to be > 0. |
[in] | f | Focal length (distance of image plane to origin camera coordinate system). |
[in] | world_T_cam | Position and orientation (pose) of the camera with respect to world coordinates. The pose is represented as a homogenenous transformation matrix. See d4mesh_getPose for more information. |
[in] | onlyVisible | Remove only visible vertices? WARNING: At the moment, only 'onlyVisible==false' is supported. |
D4LIB_API int d4mesh_setBuffer | ( | d4mesh_ptr | mesh, |
const void * | data, | ||
d4size | size, | ||
int | bufferType, | ||
int | submeshIndex | ||
) |
Copy 'data' into the desired buffer ('bufferType').
You can use d4mesh_getVertexCount, d4mesh_getTriangleCount, and d4mesh_getBufferSize to compute the correct size of 'data'.
[out] | mesh | Valid pointer to a mesh object. |
[in] | data | Valid pointer to data buffer. |
[in] | size | Size of 'data' buffer in bytes. |
[in] | bufferType | Desired data buffer, see d4mesh_BufferType. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_setName | ( | d4mesh_ptr | mesh, |
const char * | name | ||
) |
Set the name of a mesh.
[in] | mesh | Valid pointer to a mesh object. |
[out] | name | Valid pointer to a string. |
D4LIB_API int d4mesh_setPose | ( | d4mesh_ptr | mesh, |
const double | world_T_local[16] | ||
) |
Set the position and orientation (pose) of a mesh.
The pose is represented as a homogenenous transformation matrix.
[in,out] | mesh | Valid pointer to a mesh. |
[in] | world_T_local | Valid pointer to an array of 16 double values describing the transformation matrix. |
D4LIB_API int d4mesh_setSubmeshCount | ( | d4mesh_ptr | mesh, |
int | count | ||
) |
Set the number of submeshes (combined meshes) in 'mesh'.
[in] | mesh | Valid pointer to a mesh object. |
[in] | count | New number of submeshes (>0). |
D4LIB_API int d4mesh_setTexture | ( | d4mesh_ptr | mesh, |
d4img_ptr | image, | ||
int | submeshIndex | ||
) |
Set the texture of a mesh.
Textures are optional.
[in,out] | mesh | Valid pointer to a mesh object. |
[in,out] | image | Valid pointer to an image. Reference count is incremented, no copy is made. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_setTriangleCount | ( | d4mesh_ptr | mesh, |
int | triangleCount, | ||
int | submeshIndex | ||
) |
Set the number of triangles for a given submesh of a mesh.
[in] | mesh | Valid pointer to a mesh object. |
[in] | triangleCount | New triangle count. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_setVertexCount | ( | d4mesh_ptr | mesh, |
int | vertexCount, | ||
int | submeshIndex | ||
) |
Set the number of vertices for a given submesh of a mesh.
[in] | mesh | Valid pointer to a mesh object. |
[in] | vertexCount | New vertex count. |
[in] | submeshIndex | Zero based index to a submesh of 'mesh'. Also see d4mesh_getSubmeshCount. |
D4LIB_API int d4mesh_smoothAverage | ( | d4mesh_ptr | mesh, |
int | smoothing | ||
) |
Smooth mesh using an average filter.
[in,out] | mesh | Valid pointer to a mesh. |
[in] | smoothing | Number of smoothing steps. |
D4LIB_API int d4mesh_uncombine | ( | d4mesh_ptr | meshGroup, |
d4mesh_ptr * | uncombinedMeshes, | ||
int | meshCount | ||
) |
Uncombine submeshes of 'meshGroup' into independent meshes.
'meshCount' has to be equal to the submesh count of 'mesh' (see d4mesh_getSubmeshCount).
[in] | meshGroup | Valid pointer to a mesh object that contains combined meshes. Must not be part of 'uncombinedMeshes'. |
[out] | uncombinedMeshes | Pointer to array of valid pointers to mesh objects that get the uncombined meshes. |
[in] | meshCount | Number of meshes referenced by 'uncombinedMeshes'. |
D4LIB_API int d4projector_check | ( | d4projector_ptr | projector) |
Check if projector is open and ok.
[in] | projector | Pointer to projector. |
D4LIB_API int d4projector_close | ( | d4projector_ptr | projector) |
Closes the connection to the projector.
[in,out] | projector | Valid pointer to the projector. |
D4LIB_API int d4projector_displayImage | ( | d4projector_ptr | projector, |
d4img_ptr | img | ||
) |
Display an image.
[in,out] | projector | Valid pointer to the projector. |
[in] | img | Image to be displayed. Must have same format as d4projector_getImageFormat. |
D4LIB_API int d4projector_displayUniformColor | ( | d4projector_ptr | projector, |
unsigned char | red, | ||
unsigned char | green, | ||
unsigned char | blue | ||
) |
Display an image with a uniform color.
[in,out] | projector | Valid pointer to the projector. |
[in] | red | Red color component [0,255]. |
[in] | green | Green color component [0,255]. |
[in] | blue | Blue color component [0,255]. |
D4LIB_API int d4projector_getImageFormat | ( | d4projector_ptr | projector, |
int * | width, | ||
int * | height, | ||
int * | pixelFormat | ||
) |
Get image format for displaying images.
[in,out] | projector | Valid pointer to the projector. |
[out] | width | Optional pointer to int that gets width of image [px]. |
[out] | height | Optional pointer to int that gets height of image [px]. |
[out] | pixelFormat | Optional pointer to int that gets pixel format of image (see d4img_PixelFormat). |
D4LIB_API int d4projector_getScreenCount | ( | d4projector_ptr | projector, |
int * | screenCount | ||
) |
Get the number of available screens.
Should be used in combination with d4projector_getScreenFormat.
[in,out] | projector | Valid pointer to the projector. |
[out] | screenCount | Valid pointer to int that gets the number of available screens. |
D4LIB_API int d4projector_getScreenFormat | ( | d4projector_ptr | projector, |
int * | x, | ||
int * | y, | ||
int * | width, | ||
int * | height, | ||
int | screenID | ||
) |
Get screen dimensions and position for requested screen.
Should be used in combination with d4projector_getScreenCount.
[in,out] | projector | Valid pointer to the projector. |
[out] | x | Optional pointer to int that gets x position of screen [px]. |
[out] | y | Optional pointer to int that gets x position of screen [px]. |
[out] | width | Optional pointer to int that gets width of screen [px]. |
[out] | height | Optional pointer to int that gets height of screen [px]. |
[in] | screenID | ID of the desired screen. First screen has ID 1. Use in combination with d4projector_getScreenCount. |
D4LIB_API d4projector_ptr d4projector_newExtendedDisplayProjector | ( | ) |
Creates a new projector using extended display.
D4LIB_API int d4projector_openByScreenID | ( | d4projector_ptr | projector, |
int | screenID | ||
) |
Establish the connection to a projector by given 'screenID'.
[in,out] | projector | Valid pointer to the projector. |
[in] | screenID | ID of the desired screen. First screen has ID 1. Use in combination with d4projector_getScreenCount. |
D4LIB_API int d4scan_convertDepthImageToMesh | ( | d4mesh_ptr | mesh, |
d4fimg_ptr | depthImage, | ||
d4fimg_ptr | qualityImage, | ||
d4calib_ptr | calib, | ||
float | minDepth, | ||
float | maxDepth, | ||
float | depthThres, | ||
float | minQuality, | ||
double | outlierRemoval | ||
) |
Compute mesh from a depth image.
For every pixel of the depth image with a depth value in range [minDepth, maxDepth] a vertex is generated. Neighbouring vertices are triangulated. Vertices that are not referenced by any triangle are removed.
[out] | mesh | Valid pointer to a mesh. |
[in] | depthImage | Valid pointer to a depth image. |
[in] | qualityImage | Optional pointer to a quality image with values in range [0,1]=[bad,good]. |
[in] | calib | Valid (camera) calibration. |
[in] | minDepth | Minimum depth value in [mm]. Has to be > 0. |
[in] | maxDepth | Maximum depth value in [mm]. Has to be > 'minDepth'. |
[in] | depthThres | Neighbor pixels to a triangle will not be connected, if their difference in depth is larger than this value [mm]. |
[in] | minQuality | Minimum quality value. Only used if 'qualityImage' is a valid pointer. |
[in] | outlierRemoval | Outlier filter, removing smallest fragments. 0=off. 1=remove all except the largest fragment. e.g. 0.1=remove all fragments that are smaller than 10% of the largest fragment. |
D4LIB_API int d4scan_removeBackground | ( | d4fimg_ptr | depthImage, |
d4fimg_ptr | backgroundImage, | ||
float | epsilon | ||
) |
Remove background scan from current scan.
All depth values that are farther away the the background, are set to -1:
[in,out] | depthImage | Valid pointer to depth image that represents the current scan. |
[in] | backgroundImage | Valid pointer to depth image that represents the background scan. |
[in] | epsilon | Expand background scan by this amount into the direction of the cameras origin. |
D4LIB_API int d4sls_computeDepthImage | ( | d4sls_ptr | sls, |
d4fimg_ptr | depthImage, | ||
d4fimg_ptr | qualityImage, | ||
d4img_ptr * | capturedImages, | ||
int | imageCount, | ||
d4calib_ptr | camCalib, | ||
d4calib_ptr | projectorCalib, | ||
int | minContrast | ||
) |
Compute depth image that represents the current scan.
[in,out] | sls | Valid pointer to Structured Light Scanning instance. |
[out] | depthImage | Valid pointer to float image that gets depth values for each pixel of the camera. |
[out] | qualityImage | Optional pointer to float image that gets quality values for each depth value. |
[in] | capturedImages | Valid pointer to an array of image pointers. Every pointer has to be valid and of pixel format d4img_Y800. |
[in] | imageCount | Number of image pointers in 'capturedImages'. |
[in] | camCalib | Valid pointer to camera calibration object. |
[in] | projectorCalib | Valid pointer to projector calibration object. |
[in] | minContrast | Minimum required contrast (magnitude of amplitude signal). Set to <= 0 in order to use default value (10). |
D4LIB_API int d4sls_getChessboardImage | ( | d4sls_ptr | sls, |
d4img_ptr | img, | ||
int | width, | ||
int | height, | ||
int | pixelFormat, | ||
d4calib_ptr | projectorCalib, | ||
double | scale | ||
) |
Get special chessboard image that can be used to validate a calibration performed by d4calib_calibrate.
[in,out] | sls | Valid pointer to Structured Light Scanning instance. |
[out] | img | Valid pointer to image for pattern. |
[in] | width | Desired image width [px]. |
[in] | height | Desired image height [px]. |
[in] | pixelFormat | Desired pixel format, see d4img_PixelFormat. Supported formats are:
|
[in] | projectorCalib | Valid pointer to projector calibration. |
[in] | scale | Scale used for calibration. |
D4LIB_API int d4sls_getCodedLightPhaseShiftParams | ( | d4sls_ptr | sls, |
d4sls_CodedLightPhaseShiftParams * | params | ||
) |
Get parameters for 'cl+ps' mode.
[in,out] | sls | Valid pointer to a SLS instance. |
[out] | params | Valid pointer to parameters. |
D4LIB_API int d4sls_getPatternCount | ( | d4sls_ptr | sls, |
int * | patternCount | ||
) |
Get number of pattern in a scanning sequence.
[in,out] | sls | Valid pointer to a SLS instance. |
[out] | patternCount | Valid pointer to int that gets the pattern count. |
D4LIB_API int d4sls_getPatternImage | ( | d4sls_ptr | sls, |
d4img_ptr | img, | ||
int | width, | ||
int | height, | ||
int | pixelFormat, | ||
int | patternIndex | ||
) |
Get pattern image at 'patternIndex'.
[in,out] | sls | Valid pointer to Structured Light Scanning instance. |
[out] | img | Valid pointer to image for pattern. |
[in] | width | Desired image width [px]. |
[in] | height | Desired image height [px]. |
[in] | pixelFormat | Desired pixel format, see d4img_PixelFormat. Supported formats are:
|
[in] | patternIndex | Valid zero based index of pattern. |
D4LIB_API int d4sls_getSetupImage | ( | d4sls_ptr | sls, |
d4img_ptr | img, | ||
int | width, | ||
int | height, | ||
int | pixelFormat | ||
) |
Get special image for setup.
[in,out] | sls | Valid pointer to Structured Light Scanning instance. |
[out] | img | Valid pointer to image for pattern. |
[in] | width | Desired image width [px]. |
[in] | height | Desired image height [px]. |
[in] | pixelFormat | Desired pixel format, see d4img_PixelFormat. Supported formats are:
|
D4LIB_API d4sls_ptr d4sls_newStructuredLightScanner | ( | ) |
Create new SLS object.
D4LIB_API int d4sls_planesToDepthImage | ( | d4sls_ptr | sls, |
d4fimg_ptr | depthImage, | ||
d4calib_ptr | camCalib, | ||
int | numPlanes, | ||
const d4sls_Plane * | planes | ||
) |
Computes a depth image from a list of planes.
[in] | sls | Valid pointer to Structured Light Scanning instance. |
[out] | depthImage | Valid pointer to float image that gets depth values for each pixel of the camera. |
[in] | camCalib | Valid pointer to camera calibration object. |
[in] | numPlanes | Number of planes given by parameter "planes". |
[in] | planes | Array of d4sls_Plane structs. |
D4LIB_API int d4sls_setCodedLightPhaseShiftParams | ( | d4sls_ptr | sls, |
const d4sls_CodedLightPhaseShiftParams * | params | ||
) |
Set parameters for 'cl+ps' mode.
[in,out] | sls | Valid pointer to a SLS instance. |
[out] | params | Valid pointer to parameters. |