DAVID4 SDK
1.8.7
|
Interface class for 'Structured Light Scanning'. More...
#include <IStructuredLightScanner.h>
Public Member Functions | |
virtual | ~IStructuredLightScanner () |
Destructor. | |
Internal camera and projector interface | |
virtual void | SetScreenID (int screenID)=0 |
Set the new screen ID. More... | |
virtual std::vector< std::string > | GetAvailableCameraNames ()=0 |
Returns a list of available cameras. More... | |
virtual void | SelectCamera (const std::string &cameraName, const ImageFormat &imageFormat=ImageFormat())=0 |
Select a new camera. More... | |
virtual bool | CheckCamera ()=0 |
Check state of camera. More... | |
virtual void | SetCameraProperty (const std::string &propertyName, double value, enum CamPropsUsage camPropsUsage=CamPropsForAll)=0 |
Set the camera property 'propertyName'. More... | |
virtual double | GetCameraProperty (const std::string &propertyName, enum CamPropsUsage camPropsUsage=CamPropsForScanning)=0 |
Get the camera property 'propertyName'. More... | |
virtual std::vector< std::string > | GetCameraPropertyNames (bool onlyAvailable)=0 |
Get a list of camera property names. More... | |
virtual void | GetLiveImage (std::vector< uint8_t > &pixelValues, int &width, int &height)=0 |
Get the current grayscale live image from the camera. More... | |
External camera and projector interface | |
virtual void | SelectImageSequence (const std::string &directory)=0 |
Selects a sequence of image files as "virtual camera". More... | |
virtual int | GetPatternCount ()=0 |
Get the current number of pattern for the complete sequence. More... | |
virtual void | GetPatternImage (uint8_t *data, int width, int height, PatternPixelFormat pixelFormat, int patternIndex)=0 |
Get the pattern image with the zero based index 'patternIndex'. More... | |
virtual void | SetCapturedImage (const uint8_t *data, int width, int height, CapturedPixelFormat pixelFormat, int patternIndex)=0 |
Set the captured image for given pattern with zero based index 'patternIndex'. More... | |
virtual void | SetTextureImage (const uint8_t *data, int width, int height, PixelFormat pixelFormat)=0 |
Set the texture image analog to SetCapturedImage. More... | |
Calibration | |
virtual void | ImportCalibration (const std::string &camCalibFilename, const std::string &projectorCalibFilename)=0 |
Import camera and projector calibration from XML files. More... | |
virtual void | ExportCalibration (const std::string &camCalibFilename, const std::string &projectorCalibFilename)=0 |
Export camera and projector calibration to XML files. More... | |
virtual void | ChangeCameraCalibrationResolution (int newWidth, int newHeight)=0 |
Change resolution of image format used camera calibration. More... | |
virtual std::vector< CalibPoint > | Calibrate (double scale)=0 |
Trigger automatic calibration of the Structured Light Scanner. More... | |
Scanning | |
virtual void | SetCodedLightPhaseShiftMode (const CodedLightPhaseShiftParams ¶ms)=0 |
Select scan mode Coded Light + Phase Shift (standard DAVID4 mode) and sets the parameters. More... | |
virtual CodedLightPhaseShiftParams | GetCodedLightPhaseShiftParams ()=0 |
Get current SLS params for Coded Light and Phase Shift. More... | |
virtual void | SetResultFiltering (const ResultFilteringParams ¶ms)=0 |
Set the result filtering parameters for SL scans. More... | |
virtual ResultFilteringParams | GetResultFiltering ()=0 |
Get the result filtering parameters for SL scans. More... | |
virtual int | Scan (bool grabTexture=false, bool setAsBackground=false)=0 |
Trigger a Structured Light Scan. More... | |
virtual void | GrabTexture ()=0 |
Grab a new texture. | |
virtual void | AutoWhiteBalance ()=0 |
Execute an auto white balancing procedure. | |
virtual int | AddScanToShapeFusion ()=0 |
Add the current scan to 'Shape Fusion' module. More... | |
virtual void | ExportMesh (const std::string &filename)=0 |
Export the current scan as a triangular mesh. More... | |
Background removal | |
virtual void | ExportBackgroundDepthmap (const std::string &filename)=0 |
Export the current background as a depth map file (.PFM). More... | |
virtual void | ImportBackgroundDepthmap (const std::string &filename)=0 |
Import background from a depth map file (.PFM). More... | |
virtual void | GetBackgroundDepthmap (std::vector< float > &depthValues, int &width, int &height)=0 |
Gets the currently used background scan as depth map. More... | |
virtual void | SetBackgroundDepthmap (const std::vector< float > &depthValues, int width, int height)=0 |
Sets the background scan, giving a depth map. More... | |
virtual void | SetBackgroundPlanes (const std::vector< Plane > &planes)=0 |
Sets the "background scan" from a given list of planes. More... | |
Static Public Member Functions | |
Calibration (static functions) | |
static void | GetCalibrationError (double &maxDelta, double &rmsError, const std::vector< CalibPoint > &calibPoints) |
Helper function for computing the calibration error given an array of calibration correspondences. More... | |
Interface class for 'Structured Light Scanning'.
Example:
Definition at line 172 of file IStructuredLightScanner.h.
|
pure virtual |
Add the current scan to 'Shape Fusion' module.
david::Error_MissingObject | (david::FunctionException) No scan data at hand. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Trigger automatic calibration of the Structured Light Scanner.
The function returns when calibration is finished or an error occurred.
[in] | scale | Scale of the calibration patterns. Typically in mm. |
david::Error_CameraCalibration | (david::FunctionException) Camera calibration failed. |
david::Error_ProjectorCalibration | (david::FunctionException) Projector calibration failed. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Change resolution of image format used camera calibration.
[in] | newWidth | New camera image width. |
[in] | newHeight | New camera image height. |
david::Error_NotCalibrated | (david::FunctionException) Camera is not calibrated. |
david::Error_InvalidFormat | (david::FunctionException) Requested image resolution not supported. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Check state of camera.
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Export the current background as a depth map file (.PFM).
[in] | filename | Filename of the depth map to be exported. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Export camera and projector calibration to XML files.
[in] | camCalibFilename | Filename of the camera calibration to be exported to. |
[in] | projectorCalibFilename | Filename of the projector calibration to be exported to. |
david::Error_NotCalibrated | (david::FunctionException) Scanner is not calibrated. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Export the current scan as a triangular mesh.
See documentation of DAVID software for supported file formats.
[in] | filename | Filename of the mesh to be exported. |
david::Error_NoAccess | (david::FunctionException) No access to path. |
david::Error_InvalidPath | (david::FunctionException) Export path invalid. |
david::Error_DirectoryNotFound | (david::FunctionException) Export target directory does not exist. |
david::Error_MissingFilename | (david::FunctionException) Export path misses file name. |
david::Error_InvalidMeshId | (david::FunctionException) Specified meshID does not exist. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Returns a list of available cameras.
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Gets the currently used background scan as depth map.
[out] | depthValues | The depth values, row by row, from top to bottom, each row left to right. |
[out] | width | Number of columns |
[out] | height | Number of rows |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
static |
Helper function for computing the calibration error given an array of calibration correspondences.
[out] | maxDelta | Maximum Euclidean distance [pixel] between any corresponding 'measuredPos2d' and 'projectedPos2d'. |
[out] | rmsError | Total root mean square error. |
[in] | calibPoints | Array of calibration points. See david::CalibPoint. |
|
pure virtual |
Get the camera property 'propertyName'.
[in] | propertyName | Name of property. |
[in] | camPropsUsage | For which algorithm should the camera property be queried? See david::CamPropsSelect. CamPropsForAll is not allowed here. |
david::Error_DeviceNotAvailable | (david::FunctionException) Selected camera is not available. |
david::Error_InvalidArgument | (david::FunctionException) Invalid property or property is not available. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Get a list of camera property names.
[in] | onlyAvailable | List only available camera properties? |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Get current SLS params for Coded Light and Phase Shift.
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Get the current grayscale live image from the camera.
[out] | pixelValues | 8bit gray scale pixel values are writting into this buffer. |
[out] | width | Width of the image. |
[out] | height | Height of the image. |
david::Error_NoLiveImage | (david::FunctionException) Live image is not available. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Get the current number of pattern for the complete sequence.
Implemented in david::StructuredLightScannerJsonRpc, and david::StructuredLightScannerD4Lib.
|
pure virtual |
Get the pattern image with the zero based index 'patternIndex'.
[out] | data | Pixel values are written to this buffer. |
[in] | width | Requested width of pattern image. |
[in] | height | Requested height of pattern image. |
[in] | pixelFormat | Supported pixel formats for pattern images. |
[in] | patternIndex | Zero based index of pattern image. See also GetPatternCount. |
Implemented in david::StructuredLightScannerJsonRpc, and david::StructuredLightScannerD4Lib.
|
pure virtual |
Get the result filtering parameters for SL scans.
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Import background from a depth map file (.PFM).
[in] | filename | Filename of the depth map to be imported. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Import camera and projector calibration from XML files.
[in] | camCalibFilename | Filename of the camera calibration to be imported from. |
[in] | projectorCalibFilename | Filename of the projector calibration to be imported from. |
david::Error_CameraCalibration | (david::FunctionException) Could not read camera calibration file. |
david::Error_ProjectorCalibration | (david::FunctionException) Could not read projector calibration file. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Trigger a Structured Light Scan.
The function computes a 3D scan from a sequence of captured pattern images. The captured images can be provided in two ways:
The function returns when scanning is finished or an error occurred.
[in] | grabTexture | Also grab a texture with the scan (default: false) |
[in] | setAsBackground | Define this scan as background (for Background Removal in ResultFiltering) (default: false) |
david::Error_NotCalibrated | (david::FunctionException) Cannot scan because scanner is not calibrated. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Select a new camera.
Example:
[in] | cameraName | Name of the camera. |
[in] | imageFormat | Format of the camera image. |
david::Error_DeviceNotAvailable | (david::FunctionException) Selected camera is not available. |
david::Error_FormatNotAvailable | (david::FunctionException) Selected camera image format is invalid. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Selects a sequence of image files as "virtual camera".
All images must be located in the same directory. The image file names are chosen automatically:
Image for camera calibration | File name must contain "cam_calib" |
Pattern images | File names must contain "image" and be sorted alphabetically. |
Texture image | File name must contain "texture" |
[in] | directory | Path to the image files. |
david::Error_InvalidPath | (david::FunctionException) Path invalid. |
david::Error_DirectoryNotFound | (david::FunctionException) Directory does not exist. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Sets the background scan, giving a depth map.
The resolution should be identical to the camera resolution.
[in] | depthValues | The depth values, row by row, from top to bottom, each row left to right. |
[in] | width | Number of columns |
[in] | height | Number of rows |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Sets the "background scan" from a given list of planes.
Camera must be calibrated first!
[in] | planes | The list of planes that define the background. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Set the camera property 'propertyName'.
Here are some important property names:
[in] | propertyName | Name of property. |
[in] | value | New value of the property. |
[in] | camPropsUsage | For which algorithm should the camera property be set? See david::CamPropsSelect. |
david::Error_DeviceNotAvailable | (david::FunctionException) Selected camera is not available. |
david::Error_InvalidArgument | (david::FunctionException) Invalid property or property is not available. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Set the captured image for given pattern with zero based index 'patternIndex'.
[in] | data | Valid pointer to buffer with pixel values.
|
[in] | width | Width of captured image. |
[in] | height | Height of captured image. |
[in] | pixelFormat | Pixel format of captured image. |
[in] | patternIndex | Zero based index of pattern image. See also GetPatternCount. |
Implemented in david::StructuredLightScannerJsonRpc, and david::StructuredLightScannerD4Lib.
|
pure virtual |
Select scan mode Coded Light + Phase Shift (standard DAVID4 mode) and sets the parameters.
Missing parameters will remain unchanged.
[in] | params | Parameters for this structured light mode. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Set the result filtering parameters for SL scans.
[in] | params | Parameters for result filtering. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Set the new screen ID.
The value 0 switches the projection off.
[in] | screenID | ID of the screen used for displaying structured light patterns, or 0 for OFF. |
Implemented in david::StructuredLightScannerD4Lib, and david::StructuredLightScannerJsonRpc.
|
pure virtual |
Set the texture image analog to SetCapturedImage.
[in] | data | Valid pointer to buffer with pixel values. Size of 'data' has to be equal to GetImageSize(width, height, pixelFormat). |
[in] | width | Width of texture image. |
[in] | height | Height of texture image. |
[in] | pixelFormat | Pixel format of captured image. |
Implemented in david::StructuredLightScannerJsonRpc, and david::StructuredLightScannerD4Lib.