PCLToInventor

MLModule
genre PCLInventorAdapters
author Wolf Spindler
package FMEstable/PCL
dll MLPCLInventorAdapters
definition MLPCLInventorAdapters.def
see also PCLNormalEstimation
inherits from PCLModule
keywords points, clouds, PCL, vertex, vertices, convert

Purpose

PCLToInventor converts a point cloud from the Point Cloud Library (PCL) to an Open Inventor SoVertexProperty which is provided at the first output. Some more convenience outputs, a SoPointSet, a SoLineSet, and a SoIndexedFaceSet are also provided to easy the display of the point cloud or surfaces without the need to instantiate too many other modules.

Important: When using point sets with transparency (for example when setting Where To Store Value to ScaleToOrderedRGBA ) it is highly recommended to explicitly define the OpenGL blend mode in the OpenInventor Scene graph, otherwise the transparency settings may result in undefined visualizations. Best use a SoBlendMode with enabled SoBlendMode.enabled = TRUE before drawing anything using PCLToInventor.

Important: When rendering points of a cloud then usually the problem appears how the intensity or transparency of the drawn points shall be defined, especially if the points do not have a member defining an intensity. Therefore a value called “Intensity Replacement” can be used which uses another member if no appropriate one is available. For the listed point types the following member values are used as intensity:

  • pcl::PointXYZ: Always 0
  • pcl::PointXYZLNormal: curvature
  • pcl::PointXYZRGBNormal: curvature
  • pcl::PointXYZINormal: intensity

Note that the RGB components of the pcl::PointXYZRGBNormal are usually not used as intensity replacement, because it contains more than an intensity and also an alpha value. When rgba shall be used then set Where To Store Value to UseOnlyRGBA.

Windows

Default Panel

../../../Projects/MLPCLInventorAdapters/Modules/mhelp/Images/Screenshots/PCLToInventor._default.png

Input Fields

inputPCLObject0

name: inputPCLObject0, type: MLBase

Here the point cloud must be connected which shall be converted mainly to SoVertexProperty.

Output Fields

outputSoVertexProperty

name: outputSoVertexProperty, type: SoNode

At this output the SoVertexProperty is provided for use in other modules. On failed conversions, open inputs or empty connected point clouds the entries of the SoVertexProperty are set to zero elements.

outputSoPointSet

name: outputSoPointSet, type: SoNode

This is a convenience output of a SoPointSet module in the default state that it shows all points from the inventor state.It can be connected in the inventor scene directly after the first output to draw all coordinates as a point set.

outputSoIndexedFaceSet

name: outputSoIndexedFaceSet, type: SoNode

At this output the SoIndexedFaceSet is provided for use in other modules. It will be set with useful indexes only if the input connector contains a pcl::PolygonMesh with vertex indexes. These indexes will be set such that they reference points set in outputSoVertexProperty.

outputSoLineSet

name: outputSoLineSet, type: SoNode

This is a convenience output of a SoLineSet module. Its numVertices member is filled with as many 2’s as there are pairs from (data, data+data_n) coordinates in the SoVertexProperty.vertex member. This requires that both, the field Data Destination and Data_n Destination are set to vertex.

Parameter Fields

Visible Fields

Status

name: status, type: String, persistent: no

Displays information about the connection status. If valid data is assigned to the vertex property after the status in parentheses the number of assigned data entries, the number of assigned data_n, and the number of intensity replacement values is listed.

see also PCLModule.status

Data Destination

name: data012Destination, type: Enum, default: vertex

Data Destination controls where the values of the points[].data members are stored. Using other modes than “vertex” is rarely useful.

Values:

Title Name Description
none none The three member values are not stored at all in the SoVertexProperty.
vertex vertex The three member values are stored in the .vertex coordinates of the SoVertexProperty.
normal normal The three member values are stored in the .normal coordinates of the SoVertexProperty.
texture Normal textureNormal The first two member values are stored in the .textureNormal coordinates of the SoVertexProperty.
ordered RGBA orderedRGBA The four member values are stored in the .orderedRGBA values of the SoVertexProperty. For this purpose they are cast to unsigned integer values and packed into an RGBA value.

Normal Binding

name: normalBinding, type: Enum, default: OVERALL

For details see the documentation of the same named field in SoVertexProperty.

Data_n Destination

name: data_n012Destination, type: Enum, default: none

Data_n Destination controls where the values of the points[].data_n members are stored if they exist. If these values are not part of the connected point cloud then NULL vectors are written instead. The modes behave in the same way as they do for Data Destination, however, they are performed after them. Note that if both, Data Destination and Data_n Destination are set to vertex, then pairs of coordinates of type (point.data[x], point.data[x]+point.data_n[x]) will be added to the SoVertexProperty.vertex member, i.e. the twice as many vertices will be created. This is especially useful when the outputSoLineSet shall be used. See example network of PCLNormalEstimation for a display example of normals.

Material Binding

name: materialBinding, type: Enum, default: PER_VERTEX_INDEXED

For details see the documentation of the same named field in SoVertexProperty.

Where To Store Value

name: whereToStoreValue, type: Enum, default: SCALE_TO_ORDERED_RGB, deprecated name: whereToStoreIntensityReplacement

Describes where the value of the points (see Used Value) shall be stored in the internally used SoVertexProperty.rgba field. The intensity replacement is that point member which normally can be used best in visualizations as intensity, even if the point does not have a value explicitly defined as such a value. See Purpose for the list of members used as this.

Values:

Title Name Description
To Nowhere TO_NOWHERE The value (whichever is used, see Used Value) is left unused; no value is written into the SoVertexProperty.rgba value. The Overall mode of Material Binding should be used then, because otherwise the color and transparency of the displayed points will be undefined.
Scale To Ordered Rgb SCALE_TO_ORDERED_RGB

The value selected with Used Value is scaled and clamped to [0,255] and then used for the red, the green, and the blue components of the unsigned int 32 SoVertexProperty.rgba value; the alpha value (transparency) is always set opaque. For example:

  • Used Value = USE_INTENSITY_REPLACEMENT, Map Value To = MAP_VALUE_TO_GREY: The point member most similar to an intensity value is mapped such that small values become dark and high values become bright.
  • Used Value = USE_CURVATURE, Map Value To = MAP_VALUE_TO_RAINBOW: The curvature member of points is converted to a rainbow color RGB value (such that low values become red, medium green, and high values become violet).
  • Used Value = USE_INTENSITY_REPLACEMENT, Map Value To = MAP_VALUE_TO_RAINBOW: The point member most similar to an intensity value is mapped to a rainbow color (such that low values become red, medium green, and high values become violet).
  • Used Value = USE_CURVATURE, Map Value To = MAP_VALUE_TO_GREY: The curvature member of the points is mapped such that small values become dark and high values become bright.
Scale To Ordered Rgba SCALE_TO_ORDERED_RGBA

The value selected with Used Value is scaled and clamped to [0,255] and then used for the red, the green, and the blue components of the unsigned int 32 SoVertexProperty.rgba value; the alpha value is always taken from the intensity replacement regardless of Used Value. For example:

  • Used Value = USE_INTENSITY_REPLACEMENT, Map Value To = MAP_VALUE_TO_GREY: RGBA are all determined from the point member which is the most similar one to intensity and the transparency for dark (small) values is high which bright values are opaque.
  • Used Value = USE_CURVATURE, Map Value To = MAP_VALUE_TO_RAINBOW: The curvature member of points is converted to a rainbow color RGB value while the transparency is determined from the intensity replacement.
  • Used Value = USE_INTENSITY_REPLACEMENT, Map Value To = MAP_VALUE_TO_RAINBOW: The intensity replacement is used as only input value from a point. It is mapped to a rainbow color value stored in RGB channels (low values result to red, high to violet) and the transparency for small values is high while high values are opaque.
  • Used Value = USE_CURVATURE, Map Value To = MAP_VALUE_TO_GREY: The curvature member of the points is mapped to a rainbow grey value stored in RGB channels (low values result to dark, high to bright) and the transparency for small values is high while high values are opaque.
Use Only Rgba USE_ONLY_RGBA This mode makes rgba members directly used as the SoVertexProperty.rgba values. If the input cloud does not have an rgba member, then the value 0x00000000 is used which draws the points black and transparent.

Used Value

name: usedValue, type: Enum, default: USE_INTENSITY_REPLACEMENT

If a point shall be displayed usually a value is needed which to describe the displayed intensity or color. Since not all PCL points have the same fields, here either the intensity replacement or the curvature can be selected.

Values:

Title Name Description
Intensity Replacement USE_INTENSITY_REPLACEMENT The member from the point which best can be used as intensity.
Curvature USE_CURVATURE The curvature member value from the point if the point has one; otherwise 0 is used instead.

Map Value To

name: mapValueTo, type: Enum, default: MAP_VALUE_TO_GREY

Usually a value is clamped to the range [0,1] and then mapped to an intensity or color.

Values:

Title Name Description
Grey MAP_VALUE_TO_GREY The value from the point is clamped to [0,1] and then mapped to RGB values representing a color map from black to white.
Rainbow MAP_VALUE_TO_RAINBOW The value from the point is clamped to [0,1] and then mapped to RGB values representing a rainbow map from [Red…Green…Blue…Violet].

Scale From Input Range

name: scaleFromInputRange, type: Bool, default: FALSE

If false then incoming float values (such as intensity replacement or curvature) are assumed to be from [0,1] for color mapping; if true then [Input Range Min, Input Range Max] is used for mapping the input values to the color range. Values outside will be clamped to the interval limits. RGB, RGBA, or vector data sources and destinations such none, vertex, normal and texture normal are not affected.

Input Range Min

name: inputRangeMin, type: Float, default: 0

Minimum of interval in which floating point input values (such as intensity replacement or curvature) are assumed to map them to color range, must be smaller than Input Range Max. Insensitive and not used if Scale From Input Range is off.

Input Range Max

name: inputRangeMax, type: Float, default: 1

Maximum of interval in which floating point input values (such as intensity replacement or curvature) are assumed to map them to color range, must be larger than Input Range Min. Insensitive and not used if Scale From Input Range is off.