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.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in ZDF format

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.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in PLY format

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.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in XYZ format

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/UseOrganizedFormat in the Config.yml file.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in PCD format

PointCloudExportclass

Public Types

ColorSpaceenumclass

Color space to use when saving frame.

Enum used to specify the color space of the point cloud when saving a frame to a file.

Values:

SRGBenumerator
LinearRGBenumerator
IncludeNormalsenumclass

Include normals in the exported file.

Enum used to specify if normals should be included when saving a frame to a file.

Values:

Noenumerator
Yesenumerator

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.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in ZDF format

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.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in PLY format

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.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in XYZ format

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/UseOrganizedFormat in the Config.yml file.

パラメータ:
  • frame -- Frame object to save

  • specification -- Specification for saving frame in PCD format

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

Layoutenumclass

Layout for saving point cloud.

When Layout option is not set, the exported PCD file will follow the format based on configuration option, Configuration/APIBreakingBugFixes/FileFormats/PCD/UseOrganizedFormat in the Config.yml file.

Values:

Organizedenumerator
Unorganizedenumerator

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

Layoutenumclass

Layout for saving point cloud.

Values:

Orderedenumerator
Unorderedenumerator

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.

ZDFclass

Specification for saving frame in ZDF (*.zdf) format.

ZDF is the native Zivid file format.

Public Functions

ZDF (System::String ^ fileName)

Create ZDF specification with file name.

パラメータ:

fileName -- File name

System::String ^ ToString () override

Get string representation of ZDF specification.

export_frame(
:Frameframe ,
:PCD | PLY | XYZ | ZDFfile_format ,
) → 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.

パラメータ:
  • frame -- Frame to export.

  • file_format -- File format specification.

例外:
export_unorganized_point_cloud(
:UnorganizedPointCloudunorganized_point_cloud ,
:PCD | PLY | XYZfile_format ,
) → None

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.

例外:
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.

classLayout

Layout for saving point cloud.

ordered='ordered'
unordered='unordered'
staticvalid_values() → list

Get valid values for layout.

戻り値:

List of valid layouts.

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.

classLayout

Layout for saving point cloud.

organized='organized'
unorganized='unorganized'
staticvalid_values() → list

Get valid values for layout.

戻り値:

List of valid layouts.

See also