Point Cloud Export
Experimental API for exporting frames to common 3D file formats with control over color space, layout, and whether to include normals.
Resides in Zivid::Experimental::PointCloudExport and may change without prior notice.
%%{init: {'themeVariables': {'fontSize': '18px'}, 'flowchart': {'nodeSpacing': 30, 'rankSpacing': 35}}}%%
flowchart LR
Frame
FileFormat["FileFormat (ZDF/PLY/XYZ/PCD)"]
exportOp(["exportFrame()"])
File["file on disk"]
Frame -.-> exportOp --> File
FileFormat -.-> exportOp
classDef zividClass fill:#4A8FA4,stroke:#34323D,color:#FFFFFF
classDef api fill:#91D2C8,stroke:#4A8FA4,color:#000000
class Frame,FileFormat,File zividClass
class exportOp api
exportFrame
Exports a Frame to a file on disk.
The file format is determined by the second argument: ZDF, PLY, XYZ, or PCD.
Each format type carries its own options (color space, normals, etc.).
-
exportFrame( ZividFrame&const:: frame, FileFormatZDF&const:: specification)void
Save frame to ZDF file.
Saves frame object to a ZDF file.
-
exportFrame( ZividFrame&const:: frame, FileFormatPLY&const:: specification)void
Save frame to PLY file.
Saves frame object to a PLY file. Specify the layout, color space and whether to include normal data of the point cloud data in specification parameter.
-
exportFrame( ZividFrame&const:: frame, FileFormatXYZ&const:: specification)void
Save frame to XYZ file.
Saves frame object to a XYZ file. XYZ (position) and RGB (color) values are separated with white space. Each new point is separated by the newline character. Specify the color space of the point cloud data in specification parameter.
-
exportFrame( ZividFrame&const:: frame, FileFormatPCD&const:: specification)void
Save frame to PCD file.
Saves frame object to a PCD file. Specify the layout, color space and whether to include normal data of the point cloud data in specification parameter. When Layout option is not set, exported data is organized but with incorrect header. The correct header can be set in the exported PCD file by setting
Configuration/APIBreakingBugFixes/FileFormats/PCD/UseOrganizedFormatin the Config.yml file.
-
PointCloudExportclass
Public Types
Public Static Functions
- static void ExportFrame (Zivid::NET::Frame ^ frame, FileFormat::ZDF ^ specification)
Save frame to ZDF file.
Saves frame object to a ZDF file.
- static void ExportFrame (Zivid::NET::Frame ^ frame, FileFormat::PLY ^ specification)
Save frame to PLY file.
Saves frame object to a PLY file. Specify the layout, color space and whether to include normal data of the point cloud data in specification parameter.
- static void ExportFrame (Zivid::NET::Frame ^ frame, FileFormat::XYZ ^ specification)
Save frame to XYZ file.
Saves frame object to a XYZ file. XYZ (position) and RGB (color) values are separated with white space. Each new point is separated by the newline character. Specify the color space of the point cloud data in specification parameter.
- static void ExportFrame (Zivid::NET::Frame ^ frame, FileFormat::PCD ^ specification)
Save frame to PCD file.
Saves frame object to a PCD file. Specify the layout, color space and whether to include normal data of the point cloud data in specification parameter. When Layout option is not set, exported data is organized but with incorrect header. The correct header can be set in the exported PCD file by setting
Configuration/APIBreakingBugFixes/FileFormats/PCD/UseOrganizedFormatin the Config.yml file.
- static void ExportUnorganizedPointCloud (Zivid::NET::UnorganizedPointCloud ^ pointCloud, FileFormat::PLY ^ specification)
Save unorganized pointcloud to PLY file.
Saves unorganized point cloud to a PLY file. Specify the color space for RGB data in the specification. The layout in the specification object must be
unordered. Cannot include normal data in the exported PLY file from an unorganized point cloud.- パラメータ:
pointCloud -- Unorganized point cloud to save
specification -- Specification for saving unorganized point cloud in PLY format
- static void ExportUnorganizedPointCloud (Zivid::NET::UnorganizedPointCloud ^ pointCloud, FileFormat::XYZ ^ specification)
Save unorganized pointcloud to XYZ file.
Saves unorganized point cloud to a XYZ file. XYZ (position) and RGB (color) values are separated with white space. Each new point is separated by the newline character. Specify the color space of the point cloud data in specification parameter.
- パラメータ:
pointCloud -- Unorganized point cloud to save
specification -- Specification for saving unorganized point cloud in XYZ format
- static void ExportUnorganizedPointCloud (Zivid::NET::UnorganizedPointCloud ^ pointCloud, FileFormat::PCD ^ specification)
Save unorganized pointcloud to PCD file.
Saves unorganized point cloud to a PCD file. Specify the color space for RGB data in the specification. The layout in the specification object must be
unorganized. Cannot include normal data in the exported PCD file from an unorganized point cloud.- パラメータ:
pointCloud -- Unorganized point cloud to save
specification -- Specification for saving unorganized point cloud in PCD format
-
FileFormatclass
-
PCDclass
Specification for saving frame in PCD (*.pcd) format.
PCD is a file format native to the Point Cloud Library (PCL). To learn more about the PCD file format, see https://pcl.readthedocs.io/projects/tutorials/en/latest/pcd_file_format.html#pcd-file-format.
Public Types
Public Functions
- PCD (System::String ^ fileName)
Create PCD specification with file name.
Sets color space to sRGB.
- パラメータ:
fileName -- File name
- PCD (System::String ^ fileName, ColorSpace colorSpace)
Create PCD specification with file name and color space.
Does not save normal data in the PCD file.
- パラメータ:
fileName -- File name
colorSpace -- Color space
- PCD (System::String ^ fileName, ColorSpace colorSpace, IncludeNormals includeNormals)
Create PCD specification with file name, color space and normals.
- パラメータ:
fileName -- File name
colorSpace -- Color space
includeNormals -- Include normals
- PCD (System::String ^ fileName, ColorSpace colorSpace, IncludeNormals includeNormals, Layout layout)
Create PCD specification with file name, color space, normals and layout.
- パラメータ:
fileName -- File name
colorSpace -- Color space
includeNormals -- Include normals
layout -- Layout
- System::String ^ ToString () override
Get string representation of PCD specification.
-
PLYclass
Specification for saving frame in PLY (*.ply) format.
PLY is a file format developed at Stanford. To learn more about the PLY file format, see https://paulbourke.net/dataformats/ply/.
Public Types
Public Functions
- PLY (System::String ^ fileName)
Create PLY specification with file name.
Sets layout to Ordered and color space to sRGB.
- パラメータ:
fileName -- File name
- PLY (System::String ^ fileName, Layout layout, ColorSpace colorSpace)
Create PLY specification with file name, layout, and color space.
Does not save normal data in the PLY file.
- パラメータ:
fileName -- File name
layout -- Layout
colorSpace -- Color space
- PLY (System::String ^ fileName, Layout layout, ColorSpace colorSpace, IncludeNormals includeNormals)
Create PLY specification with file name, layout, color space and normals.
- パラメータ:
fileName -- File name
layout -- Layout
colorSpace -- Color space
includeNormals -- Include normals
- System::String ^ ToString () override
Get string representation of ZDF specification.
-
XYZclass
Specification for saving frame in ASCII (*.xyz) format.
ASCII characters are used to store cartesian coordinates of XYZ points and RGB color values.
Public Functions
- XYZ (System::String ^ fileName)
Create XYZ specification with file name.
Sets color space to sRGB.
- パラメータ:
fileName -- File name
- XYZ (System::String ^ fileName, ColorSpace colorSpace)
Create XYZ specification with file name and color space.
- パラメータ:
fileName -- File name
colorSpace -- Color space
- System::String ^ ToString () override
Get string representation of XYZ specification.
-
PCDclass
- export_frame( ) None
Save frame to a file.
The file format is specified by the file_format argument. The file format can be ZDF, PLY, XYZ, or PCD.
- export_unorganized_point_cloud(
- :UnorganizedPointCloudunorganized_point_cloud ,
- :PCD | PLY | XYZfile_format ,
Save UnorganizedPointCloud to a file.
The file format is specified by the file_format argument. The file format can be PLY, XYZ, or PCD.
The layout for PLY file format must be unordered and layout for PCD file format must be unorganized.
- パラメータ:
unorganized_point_cloud -- Unorganized point cloud to export.
file_format -- File format specification.
- 例外:
TypeError -- If unorganized_point_cloud is not a UnorganizedPointCloud.
TypeError -- If file_format is not a file format specification.
- classZDF(:strfile_name )
Specification for saving frame in ZDF (*.zdf) format.
Initialization
Create a ZDF file format specification with file name.
- パラメータ:
file_name -- File name.
- 例外:
TypeError -- If file_name is not a string.
- classPLY(
- :strfile_name ,
- :str=Layout.orderedlayout ,
- :str=ColorSpace.srgbcolor_space ,
- :str=IncludeNormals.noinclude_normals ,
Specification for saving frame in PLY (*.ply) format.
PLY is a file format developed at Stanford. To learn more about the PLY file format, see https://paulbourke.net/dataformats/ply/.
Initialization
Create a PLY file format specification with file name.
- パラメータ:
file_name -- File name.
layout -- Layout of point cloud. Default is ordered.
color_space -- Color space of point cloud. Default is sRGB.
include_normals -- Include normals in point cloud. Default is no.
- 例外:
TypeError -- If file_name, layout, or color_space are not strings.
- classXYZ(:strfile_name , :str=ColorSpace.srgbcolor_space )
Specification for saving frame in ASCII (*.xyz) format.
ASCII characters are used to store cartesian coordinates of XYZ points and RGB color values.
Initialization
Create a XYZ file format specification with file name.
Sets color space to linear RGB.
- パラメータ:
file_name -- File name.
color_space -- Color space of point cloud. Default is sRGB.
- 例外:
TypeError -- If file_name or color_space are not strings.
- classPCD(
- :strfile_name ,
- :str=ColorSpace.srgbcolor_space ,
- :str=IncludeNormals.noinclude_normals ,
- :str=Layout.organizedlayout ,
Specification for saving frame in PCD (*.pcd) format.
PCD is a file format native to the Point Cloud Library (PCL). To learn more about the PCD file format, see https://pcl.readthedocs.io/projects/tutorials/en/latest/pcd_file_format.html#pcd-file-format.
Initialization
Create a PCD file format specification with file name.
- パラメータ:
file_name -- File name. color_space: Color space of point cloud. Default is sRGB.
color_space -- Color space of point cloud. Default is sRGB.
include_normals -- Include normals in point cloud. Default is no.
layout -- Layout of point cloud. Default is organized.
- 例外:
TypeError -- If file_name or color_space are not strings.
See also