CCL#
Functions#
- NVCVStatus pvaCCLCreate(NVCVOperatorHandle *handle, const NVCVTensorRequirements *imageParams, const NVCVTensorRequirements *labelParams, const PVAConnectivityType connectivity, const uint8_t threshold)
Constructs an instance of the CCL operator.
- NVCVStatus pvaCCLSubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorHandle image, NVCVTensorHandle labels, NVCVTensorHandle numLabels)
Submits the CCL operator to a CUDA stream.
- NVCVStatus pvaCCLSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVTensorHandle image, NVCVTensorHandle labels, NVCVTensorHandle numLabels)
Submits the CCL operator to a cuPVA stream.
Functions#
- NVCVStatus pvaCCLCreate(
- NVCVOperatorHandle *handle,
- const NVCVTensorRequirements *imageParams,
- const NVCVTensorRequirements *labelParams,
- const PVAConnectivityType connectivity,
- const uint8_t threshold,
Constructs an instance of the CCL operator.
Limitations:
Input imageParams: Data Layout: [CHW], [NCHW] only when C = 1 and N = 1
Data Type
Allowed
8bit Unsigned
Yes
8bit Signed
No
16bit Unsigned
No
16bit Signed
No
32bit Unsigned
No
32bit Signed
No
32bit Float
No
64bit Float
No
Output labelParams: Data Layout: [CHW], [NCHW] only when C = 1 and N = 1
Data Type
Allowed
8bit Unsigned
No
8bit Signed
No
16bit Unsigned
Yes
16bit Signed
No
32bit Unsigned
No
32bit Signed
No
32bit Float
No
64bit Float
No
Input/Output Dependency:
Property
Input == Output
Data Layout
Yes
Data Type
No
Number
Yes
Channels
Yes
Width
Yes
Height
Yes
Value 0 in the output labeled image is background. Maximum number of labels: 65535 excluding label 0 which is reserved for background.
- Parameters:
handle – [out] Where the operator instance handle will be written to.
Must not be NULL.
imageParams – [in] Pointer to the NVCVTensorRequirements structure which contains input tensor rank, shape, layout and data type information.
labelParams – [in] Pointer to the NVCVTensorRequirements structure which contains output tensor rank, shape, layout and data type information.
connectivity – [in] Must be PVA_4_CONNECTIVITY or PVA_8_CONNECTIVITY. PVA_4_CONNECTIVITY for 4-connectivity and PVA_8_CONNECTIVITY for 8-connectivity.
threshold – [in] Only pixels with values greater than this threshold are treated as foreground when running connected components. If input image is already binary, set it to 0.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null.
NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaCCLSubmit(
- NVCVOperatorHandle handle,
- cudaStream_t stream,
- NVCVTensorHandle image,
- NVCVTensorHandle labels,
- NVCVTensorHandle numLabels,
Submits the CCL operator to a CUDA stream.
- Parameters:
handle – [in] Handle to the operator.
Must not be NULL.
stream – [in] Handle to a valid CUDA stream.
image – [in] Input tensor handle of input image.
labels – [out] Output tensor handle of labeled image. Note that labels in the output are not required to be sequential.
numLabels – [out] Output tensor handle of number of labels excluding label 0 which is reserved for background. Data Layout: [W] Width: 1 Data Type: NVCV_DATA_TYPE_S32 If the runtime labels exceed the limit (65536 labels including label 0 which is reserved for background), numLabels will return -1.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside the valid range.
NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaCCLSubmit(
- NVCVOperatorHandle handle,
- cupvaStream_t stream,
- NVCVTensorHandle image,
- NVCVTensorHandle labels,
- NVCVTensorHandle numLabels,
Submits the CCL operator to a cuPVA stream.
- Parameters:
handle – [in] Handle to the operator.
Must not be NULL.
stream – [in] Handle to a valid cuPVA stream.
image – [in] Input tensor handle of input image.
labels – [out] Output tensor handle of labeled image. Note that labels in the output are not required to be sequential
numLabels – [out] Output tensor handle of number of labels excluding label 0 which is reserved for background. Data Layout: [W] Width: 1 Data Type: NVCV_DATA_TYPE_S32 If the runtime labels exceed the limit (65536 labels including label 0 which is reserved for background), numLabels will return -1.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside the valid range.
NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.
NVCV_SUCCESS – Operation executed successfully.