LidarHistogramConversion#
Enumerations#
- PvaLidarDataPackingType
LiDAR data packing type.
Functions#
- NVCVStatus pvaLidarHistogramConversionCreate(NVCVOperatorHandle *handle, NVCVTensorRequirements const *const histogramRequirements, PvaLidarHistogramSpec const *const histogramSpec)
Constructs an instance of the LidarHistogramConversion operator.
- NVCVStatus pvaLidarHistogramConversionSubmit(NVCVOperatorHandle const handle, cupvaStream_t const stream, PvaLidarHistogramParams const *const params, NVCVTensorHandle const histogram, NVCVTensorHandle const rangeBias, NVCVTensorHandle const xyzCalibration, NVCVTensorHandle range, NVCVTensorHandle xyz, NVCVTensorHandle reflectance)
Executes the conversion of LiDAR histograms to XYZ, range and/or reflectance.
- NVCVStatus pvaLidarHistogramConversionSubmit(NVCVOperatorHandle const handle, cudaStream_t const stream, PvaLidarHistogramParams const *const params, NVCVTensorHandle const histogram, NVCVTensorHandle const rangeBias, NVCVTensorHandle const xyzCalibration, NVCVTensorHandle range, NVCVTensorHandle xyz, NVCVTensorHandle reflectance)
Submits the LidarHistogramConversion operator to a CUDA stream.
Structs#
- PvaLidarHistogramParamsRec
LiDAR histogram parameters.
- PvaLidarHistogramSpecRec
LiDAR histogram specification.
Enumerations#
-
enum PvaLidarDataPackingType#
LiDAR data packing type.
LiDAR histogram data may be packed in one of the following ways:
NONE: The data is not packed. Each element in the C dimension has the data type of the input tensor.
RAW12: Each element is 12 bits, with every pair of elements (A,B) packed together in 24 bits (3 bytes): {[A4:11], [B4:11], [A0:3, B0:3]} (The input tensor data type is ignored other than to understand the storage size)
Values:
-
enumerator PVA_LIDAR_DATA_PACKING_TYPE_NONE#
LiDAR histogram data is not packed.
-
enumerator PVA_LIDAR_DATA_PACKING_TYPE_RAW12#
LiDAR histogram data is packed as 12 bits per element, 2 elements per 3 bytes.
Functions#
- NVCVStatus pvaLidarHistogramConversionCreate(
- NVCVOperatorHandle *handle,
- NVCVTensorRequirements const *const histogramRequirements,
- PvaLidarHistogramSpec const *const histogramSpec,
Constructs an instance of the LidarHistogramConversion operator.
This operator converts LiDAR histograms to XYZ, range and/or reflectance maps.
Input Limitations:
Histogram tensor requirements:
Layout: NHWC
Data type (T) if packingType is PVA_LIDAR_DATA_PACKING_TYPE_NONE: U16
Data type (T) if packingType is PVA_LIDAR_DATA_PACKING_TYPE_RAW12: U8, U16, or U32
N == 1
H >= 1
W >= 1
C must be chosen such that there is enough space for the histogram data. See PvaLidarHistogramSpec.
Parameters:
- Parameters:
handle – [out] Where the operator instance handle will be written to.
Must not be NULL.
histogramRequirements – [in] Pointer to the NVCVTensorRequirements structure that defines the histogram tensor shape.
histogramSpec – [in] Pointer to the PvaLidarHistogramSpec defining the histogram metadata.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – A pointer is null or the tensor requirements and/or specification are incompatible.
NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaLidarHistogramConversionSubmit(
- NVCVOperatorHandle const handle,
- cupvaStream_t const stream,
- PvaLidarHistogramParams const *const params,
- NVCVTensorHandle const histogram,
- NVCVTensorHandle const rangeBias,
- NVCVTensorHandle const xyzCalibration,
- NVCVTensorHandle range,
- NVCVTensorHandle xyz,
- NVCVTensorHandle reflectance,
Executes the conversion of LiDAR histograms to XYZ, range and/or reflectance.
First, the locations of peaks are estimated from the histogram data. The time-of-flight in nanoseconds of a given histogram bin index k can be expressed in simplified form as:
tof = offsetNs + binSizeNs * (k)
The actual estimated time-of-flight for a given peak uses a weighted average, taking into account the histogram bin values in the neighborhood of the peak centered at k.
Calibration tensors are required to convert to range and/or xyz outputs from the time-of-flight. For a given pixel location (i,j), histogram (n), and peak (p), the range is computed as:
range[i][j][n*numPeaksPerHist+p] = rangeBias[i][j] + rangeScale * (tof * C)
Where C is the speed of light through air in meters per nanosecond.
The XYZ calibration tensor is used to convert from polar coordinates (range and angle, where angle is inherent in the pixel location) to cartesian coordinates. XYZ is computed from the range as:
xyz[i][j][n*numPeaksPerHist+p+0] = xyzCalibration[i][j][0] * range[n*numPeaksPerHist+p] xyz[i][j][n*numPeaksPerHist+p+1] = xyzCalibration[i][j][1] * range[n*numPeaksPerHist+p] xyz[i][j][n*numPeaksPerHist+p+2] = xyzCalibration[i][j][2] * range[n*numPeaksPerHist+p]
The reflectance is computed as the ratio of the measured intensity to the maxIntensity. Intensity of a peak is estimated as the sum of 3 histogram bins centered at the peak bin index. The reflectance value is not clipped. ie, if measured intensity is > maxIntensity the reflectance output is > 1.0.
Input Limitations:
Histogram tensor:
Must exactly match the histogram tensor requirements specified in pvaLidarHistogramConversionCreate.
Range bias tensor (required if range and/or xyz outputs are not NULL):
Layout: NHWC
Data type: [F32]
N == 1
H,W == histogram H,W
C == 1
XYZ calibration tensor (required if xyz output is not NULL):
Layout: NHWC
Data type: [F32]
N == 1
H,W == histogram H,W
C == 3
Output Limitations:
Outputs are optional, but at least one must be non-NULL.
Range tensor (optional):
Layout: NHWC
Data type: [F32]
N == 1
H,W == histogram H,W
C == numHistPerPixel*numPeaksPerHist
XYZ tensor (optional):
Layout: NHWC
Data type: [F32]
N == 1
H,W == histogram H,W
C == 3*numHistPerPixel*numPeaksPerHist
Reflectance tensor (optional):
Layout: NHWC
Data type: [F32]
N == 1
H,W == histogram H,W
C == numHistPerPixel*numPeaksPerHist
Parameters:
- Parameters:
handle – [in] Handle to the operator.
Must not be NULL.
stream – [in] Handle to a valid CUPVA stream.
params – [in] Pointer to the PvaLidarHistogramParams with constants that apply to this submission.
histogram – [in] Input histogram tensor handle.
rangeBias – [in] Input range bias tensor handle (optional).
xyzCalibration – [in] Input XYZ calibration tensor handle (optional).
range – [out] Output range tensor handle (optional).
xyz – [out] Output XYZ tensor handle (optional).
reflectance – [out] Output reflectance tensor handle (optional).
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null or one or more input and/or output tensors are invalid
NVCV_ERROR_INTERNAL – Internal error in the operator.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaLidarHistogramConversionSubmit(
- NVCVOperatorHandle const handle,
- cudaStream_t const stream,
- PvaLidarHistogramParams const *const params,
- NVCVTensorHandle const histogram,
- NVCVTensorHandle const rangeBias,
- NVCVTensorHandle const xyzCalibration,
- NVCVTensorHandle range,
- NVCVTensorHandle xyz,
- NVCVTensorHandle reflectance,
Submits the LidarHistogramConversion operator to a CUDA stream.
Note
CUDA stream support requirements:
PVA SDK 2.7.0 or later
Jetpack 7 or later
DriveOS 7 or later
x86 Emulator is not supported
- Parameters:
handle – [in] Handle to the operator.
stream – [in] Handle to a valid CUDA stream.
params – [in] Pointer to the PvaLidarHistogramParams with constants that apply to this submission.
histogram – [in] Input histogram tensor handle.
rangeBias – [in] Input range bias tensor handle (optional).
xyzCalibration – [in] Input XYZ calibration tensor handle (optional).
range – [out] Output range tensor handle (optional).
xyz – [out] Output XYZ tensor handle (optional).
reflectance – [out] Output reflectance tensor handle (optional).
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null or one or more input and/or output tensors are invalid
NVCV_ERROR_INTERNAL – Internal error in the operator.
NVCV_ERROR_NOT_IMPLEMENTED – CUDA stream support is not available.
NVCV_SUCCESS – Operation executed successfully.