Back to Aurora Vision Library website

You are here: Start » Function Reference » Point3DGrid » Point3DGrid Basics » CreatePoint3DGridFromImage

CreatePoint3DGridFromImage


Header: AVL.h
Namespace: avl
Module: Vision3DStandard

Creates a Point3DGrid structure from coordinates encoded in pixels of image.

Applications: Creating a Point3DGrid structure out of an image obtained from a 3D camera or other external sources that encodes point cloud XYZ coordinates as pixel components of 2D image.

Syntax

C++
C#
 
void avl::CreatePoint3DGridFromImage
(
	const avl::Image& inImage,
	atl::Optional<const avl::Region&> inRoi,
	const avl::PointCloudCoordinateTransform& inXCoordinateTransform,
	const avl::PointCloudCoordinateTransform& inYCoordinateTransform,
	const avl::PointCloudCoordinateTransform& inZCoordinateTransform,
	avl::Point3DGrid& outPoint3DGrid
)

Parameters

Name Type Default Description
Input value inImage const Image& Source image with per pixel encoded XYZ coordinates
Input value inRoi Optional<const Region&> NIL Region determining valid points in resulting point grid
Input value inXCoordinateTransform const PointCloudCoordinateTransform& PointCloudCoordinateTransform ( Offset: 0.000000D ValueCoordinateTransform: ImageValueCoordinateTransform( ChannelIndex: 0 Scale: 1.0D InvalidValues: Nil ) LocationCoordinateTransform: Nil Limits: ValueLimits_f64( MinValue: Nil, MaxValue: Nil ) ) Description of the creation of the X coordinate
Input value inYCoordinateTransform const PointCloudCoordinateTransform& PointCloudCoordinateTransform ( Offset: 0.000000D ValueCoordinateTransform: ImageValueCoordinateTransform( ChannelIndex: 1 Scale: 1.0D InvalidValues: Nil ) LocationCoordinateTransform: Nil Limits: ValueLimits_f64( MinValue: Nil, MaxValue: Nil ) ) Description of the creation of the Y coordinate
Input value inZCoordinateTransform const PointCloudCoordinateTransform& PointCloudCoordinateTransform ( Offset: 0.000000D ValueCoordinateTransform: ImageValueCoordinateTransform( ChannelIndex: 2 Scale: 1.0D InvalidValues: Nil ) LocationCoordinateTransform: Nil Limits: ValueLimits_f64( MinValue: Nil, MaxValue: Nil ) ) Description of the creation of the Z coordinate
Output value outPoint3DGrid Point3DGrid&

Description

The operation creates a point cloud object based on the input point image. Coordinates of points included in the cloud are created based on inXCoordinateTransform, inYCoordinateTransform and inYCoordinateTransform. The listed structures describe the transformation of pixel values and their indexes to a given coordinate. At least one of the transforms based on pixel location or value must be present in PointCloudCoordinateTransform.

Example for the coordination of x. We assume that inXCoordinateTransform.locationCoordinateTransform and inXCoordinateTransform.valueCoordinateTransform are not empty. Empty transformation will be skipped.

New value of pixel is given by:

\[ P_{x} = scale_{value} * value_{channel} + scale_{row} * i + scale_{column} * j + offset \]

where

  • \(scale_{value}\) is inXCoordinateTransform.valueCoordinateTransform.scale
  • \(value_{channel}\) is image pixel channel value, when channel is inXCoordinateTransform.valueCoordinateTransform.channelIndex
  • \(scale_{row}\) is inXCoordinateTransform.locationCoordinateTransform.rowScale
  • \(scale_{column}\) is inXCoordinateTransform.locationCoordinateTransform.columnScale
  • \(i\) is pixel row index
  • \(j\) is pixel column index
  • \(offset\) is inXCoordinateTransform.offset

InvalidValues are checked based on direct pixel value.

Limits are applied to the final, transformed 3D point.

Errors

List of possible exceptions:

Error type Description
DomainError Channel index from inXCoordinateTransform is bigger than image channel count in CreatePoint3DGridFromImage.
DomainError Channel index from inYCoordinateTransform is bigger than image channel count in CreatePoint3DGridFromImage.
DomainError Channel index from inZCoordinateTransform is bigger than image channel count in CreatePoint3DGridFromImage.
DomainError PointCloudCoordinateTransform requires at least one non-empty X coordinate transform in CreatePoint3DGridFromImage.
DomainError PointCloudCoordinateTransform requires at least one non-empty Y coordinate transform in CreatePoint3DGridFromImage.
DomainError PointCloudCoordinateTransform requires at least one non-empty Z coordinate transform in CreatePoint3DGridFromImage.

See Also

  • ArrangePoint3DArray – Creates a surface structure from Point3D array taking into account X and Y coordinates.