Histogram

group NVCV_C_ALGORITHM__HISTOGRAM

Functions

NVCVStatus cvcudaHistogramCreate(NVCVOperatorHandle *handle)

Constructs and an instance of the Histogram operator.

Parameters:

handle[out] Where the image instance handle will be written to.

  • Must not be NULL.

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 cvcudaHistogramSubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorHandle in, NVCVTensorHandle mask, NVCVTensorHandle histogram)

Executes the Histogram operation on the given cuda stream. This operation does not wait for completion.

Limitations:

Input: Data Layout: [kNHWC, kHWC] Channels: [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: Data Layout: [kHWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

Yes

32bit Signed

Yes

32bit Float

No

64bit Float

No

Input/Output dependency

 Property      |  Input == Output
-------------- | -------------
 Data Layout   | N/A
 Data Type     | N/A
 Number        | N/A
 Channels      | N/A
 Width         | N/A
 Height        | N/A

Parameters:
  • handle[in] Handle to the operator.

    • Must not be NULL.

  • stream[in] Handle to a valid CUDA stream.

  • in[in] input tensor.

  • histogram[out] output histogram, with width of 256 and a height = N on input tensor (1 if HWC tensor).

  • mask[in] mask tensor, with shape the same as input tensor any value != 0 will be counted in the histogram.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.

  • NVCV_SUCCESS – Operation executed successfully.