# Create2dHeightMapFromPointCloud

The Create2dHeightMapFromPointCloud function allows you to create a relative height map of all points within a Region of Interest (RoI) in the point cloud. The height map translates the relative height of each point in the RoI to a greyscale value between 0 and 255, allowing you to visualize the differences in height between the points. The function returns an Image structure containing a 2D height map image.

The Create2dHeightMapFromPointCloud function is particularly useful in OCR applications, as it is capable of clearly highlighting the small features of embossed or engraved characters.

Input Point Cloud | Output Height Map

## Create2dHeightMapFromPointCloud Inputs

The Create2dHeightMapFromPointCloud function has the following syntax:

Create2dHeightMapFromPointCloud(PointCloud,Fixture3D,ExternalFixture,Region3D,ExternalRegion,FeatureWidth,FeatureHeight,BackgroundShape,AutoAdjustBoxZRange,MatchInputResolution,RequestedPixelResolutionX,RequestedPixelResolutionY,DefaultMissingPixelHeight,Show)

Parameter | Description
PointCloud | Reference to a cell containing a point cloud. The default value is $A$0.
Fixture3D | Specifies the point cloud coordinate system in which the 3D fixture is defined. It is offset from the PointCloud origin in the following format with the following arguments: {X, Y, Z, Rotation, Tilt, TiltDirection}
X | Offset on the X-axis from the PointCloud origin.
Y | Offset on the Y-axis from the PointCloud origin.
Z | Offset on the Z-axis from the PointCloud origin.
Rotation | Specifies the in-plane rotation in degrees around the PointCloud Z-axis. The value range is -360 to 360. The tool normalizes external references with values outside the allowed range to the allowed range.
Tilt | Specifies the tilt angle in degrees from the PointCloud Z-axis after rotation. The value range is 0-180. External references with values outside the allowed range result in an error.
Tilt Direction | Specifies the direction of tilt in degrees from the rotated PointCloud X-axis of the tool, around the PointCloud Z-axis of the tool. The value range is -360 to 360. The tool normalizes external references with values outside the allowed range to the allowed range.
Note: This parameter is only available if you set External Fixture to 0.
External Fixture | Specifies a reference to a Fixture3D structure defined in another cell. The function uses the referenced cell as the fixture of the function. Set to 0 (OFF) to use the internal fixture of the function instead.
Region3D | Specifies the dimensions, offset and angle for 3D region of interest (ROI) of the function. It is offset from the Fixture3D origin in the following format with the following arguments: {SizeX, SizeY, SizeZ, X, Y, Z, Rotation, Tilt, TiltDirection}
SizeX | The size of the ROI along the Fixture3D X-axis.
SizeY | The size of the ROI along the Fixture3D Y-axis.
SizeZ | The size of the ROI along the Fixture3D Z-axis.
X | Offset on the X-axis from the Fixture3D origin.
Y | Offset on the Y-axis from the Fixture3D origin.
Z | Offset on the Z-axis from the Fixture3D origin.
Rotation | Specifies the in-plane rotation in degrees around the Fixture3D Z-axis of the tool. The value range is -360 to 360. The tool normalizes external references with values outside the allowed range to the allowed range.
Tilt | Specifies the tilt angle in degrees from the Fixture3D Z-axis of the tool after rotation. The value range is 0-180. External references with values outside the allowed range result in an error.
Tilt Direction | Specifies the direction of tilt in degrees from the rotated Fixture3D X-axis of the tool, around the Fixture3D Z-axis of the tool . The value range is -360 to 360. The tool normalizes external references with values outside the allowed range to the allowed range.
Note: This setting is only available if you set External Region to 0.
External Region | Specifies a reference to 3D region defined in another cell. The function uses the referenced cell as the Region of Interest of the function. Set to 0 (OFF) to use the internal Box3D structure of the function as the ROI.
Background Shape | Specifies the method of calculating the relative height of the points in the point cloud. The available values are the following: FreeForm Surface - calculates the height of points relative to the surrounding points in the point cloud. This setting is useful when extracting characters on an uneven surface. Planar Surface - calculates the height of points relative to a local plane using the surrounding planar points in the point cloud. Planar points will have a height value of 0. This setting is useful when extracting characters on a flat surface, such as VIN characters on an engine block. Curved Surface - calculates the height of points relative to a curved surface. The function calculates an expected curve from the point cloud data, using that curve as a reference for point height calculation. This setting is useful when extracting characters on a curved surface, such as characters on a tire for TireDOT reading. Bottom of Region - calculates the height of points relative to the bottom plane of the Region of Interest.
Feature Width | Specifies the expected width in millimeters of a typical feature of interest. The Feature Width parameter defines the resolution of the height map. Note: For OCR applications, the character stroke width defines the Feature Width setting. For example, if the character stroke is 1 mm, set the Feature Width to at least 0.25 mm in order to get good character resolution in the height map.
Feature Height | Specifies the expected height in millimeters of a typical feature of interest. The Feature Height parameter defines the sensitivity of the height map.
Auto Adjust Box Z Range | Specifies whether to automatically adjust the Z range of the RoI box to start with the height of the lowest point. This setting only applies when using Bottom of Region as the value for Background Shape.
Match Input Resolution | Specifies whether to match the height map pixel size to the native resolution of the point cloud. Enabling this setting disables the Requested Pixel Resolution X and Requested Pixel Resolution Y settings.
Requested Pixel Resolution X | Specifies the number of pixels corresponding to the Feature Width value on the X axis. For example, if Feature Width is defined as 1 mm, and Requested Pixel Resolution X is defined as 5, then the output height map will have 5 pixels for 1 mm on the X axis. Note: If you change the value for Requested Pixel Resolution X, make sure to adjust the Requested Pixel Resolution Y parameter as well. Otherwise, the aspect ratio of the image is distorted.
Requested Pixel Resolution Y | Specifies the number of pixels corresponding to the Feature Width value on the Y axis. For example, if Feature Width is defined as 1 mm, and Requested Pixel Resolution Y is defined as 5, then the output height map will have 5 pixels for 1 mm on the Y axis. Note: If you change the value for Requested Pixel Resolution Y, make sure to adjust the Requested Pixel Resolution X parameter as well. Otherwise, the aspect ratio of the image is distorted.
Default Missing Pixel Value | Specifies the default height map value for pixels without any point cloud data. For example, if the Default Missing Pixel Value is 0, any pixels that do not contain point cloud data are shown as black.
Show | Selects the type of graphics to overlay on the image.
0 = hide all (default) | All graphics are hidden, except when the cell containing the function is highlighted in the spreadsheet.
1 = result graphics only | The result graphics of the function are displayed at all times.
2 = input and result graphics | The region of interest, the input data and the results are displayed at all times.

## Create2dHeightMapFromPointCloud Outputs

The Create2dHeightMapFromPointCloud function returns an Image structure containing a 2D height map image.