Cog3DRangeImageVolumeCalculator Execute Method (CogImage16Range, ICogRegion, Cog3DPlane)Cognex VisionPro 9.5
Computes the volume between the range image surface and a specified base plane.

Namespace: Cognex.VisionPro3D
Assembly: Cognex.VisionPro3D (in Cognex.VisionPro3D.dll) Version: 69.0.0.0
Syntax

public Cog3DRangeImageVolumeCalculatorResult Execute(
	CogImage16Range rangeImage,
	ICogRegion region,
	Cog3DPlane basePlane
)

Parameters

rangeImage
Type: Cognex.VisionPro CogImage16Range
The range image surface data reletive which the volume is calculated
region
Type: Cognex.VisionPro ICogRegion
The 2D region within which to calculate the volume. The region can be null to use the entire range image.
basePlane
Type: Cognex.VisionPro3D Cog3DPlane
The calculated volume is the volume bounded by the range image surface and the base plane (on the PlaneSide). The basePlane can be null to use a hoizontal plane at z = 0.

Return Value

Type: Cog3DRangeImageVolumeCalculatorResult
Exceptions

ExceptionCondition
CogOperatorNoInputImageException
  • Thrown if rangeImage is null.
ArgumentException
  • Thrown if rangeImage is is not allocated.
  • Thrown if rangeImage has a transform that is singular (i.e., not invertible).
  • Thrown if basePlane is degenerate.
  • Thrown if basePlane is vertical in pixel space.
[CogSpaceTreeNotInTreeException] if the SelectedSpaceName3D of the range image is not in the tree, or if the SelectedSpaceName3D of the plane is not in the tree.
Remarks

A range image pixel is "used" to calculate the volume if:

  • it is inside the 2D input [P:Cognex::VisionPro3D::Cog3DRangeImageVolumeCalculatorTool::Region] of the tool.
  • it is marked as "care" in the optional InputImageMask provided as part of the [P:Cognex::VisionPro3D::Cog3DRangeImageVolumeCalculatorTool::RunParams].
  • it is marked as a "visible pixel" in the visible pixel mask of the [P:Cognex::VisionPro3D::Cog3DRangeImageVolumeCalculatorTool::InputImage]. The visible pixel mask can be accessed by calling GetMaskData  on the range image.
  • its height (relative to the base plane) is greater than or equal to the MinimumHeightThreshold.

Pixels that meet these conditions contribute to the volume computation and are marked as "used" in the PixelCountsDiagImage.

Note that the height of an individual range image pixel is defined as the signed distance from the center of the range image pixel to the nearest point on the base plane (measured in selected space 3D units).

Note, however, that the volume is calculated by summing the contribution of the range image pixels within the [P:Cognex::VisionPro3D::Cog3DRangeImageVolumeCalculatorTool::Region] projected along the pixel coordinate z axis until they intersect the base plane.

See Also