ImageStats#

Functions#

NVCVStatus pvaImageStatsCreate(NVCVOperatorHandle *handle, NVCVImageRequirements *imageRequirements, NVCVImageRequirements *maskRequirements, uint32_t flags)

Constructs an instance of the ImageStats operator.

NVCVStatus pvaImageStatsSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVImageHandle in, NVCVImageHandle mask, NVCVTensorHandle out)

Executes the image statistics operation.

Functions#

NVCVStatus pvaImageStatsCreate(
NVCVOperatorHandle *handle,
NVCVImageRequirements *imageRequirements,
NVCVImageRequirements *maskRequirements,
uint32_t flags,
)#

Constructs an instance of the ImageStats operator.

Limitations:

  1. For input image formats NV12 and NV12_ER, the image width and height must be even.

  2. Product of image width and height must be less than 1<<24 (4096 * 4096).

  3. The value in the mask image must be either 0 or 1.

Input: Input image sizes and format are specified in imageRequirements.

Image Format

Allowed

U8

Yes

RGB8

Yes

BGR8

Yes

NV12

Yes

NV12_ER

Yes

Mask: Mask image sizes are specified in maskRequirements. Mask must be binary and of image format U8.

Input/Mask Dependency:

Property

Input == Mask

Width

Yes

Height

Yes

Parameters

Parameters:
  • handle[out] Where the operator instance handle will be written to.

    • Must not be NULL.

  • imageRequirements[in] Pointer to the NVCVImageRequirements structure which contains image shape, strides, and format information.

  • maskRequirements[in] Pointer to the NVCVImageRequirements structure for the mask image. If without mask, the pointer is set to NULL.

  • flags[in] Flags to control which statistics are computed. Accepted flags are listed in PVAImageStatFlag. flags can be a combination of the accepted flags.

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 pvaImageStatsSubmit(
NVCVOperatorHandle handle,
cupvaStream_t stream,
NVCVImageHandle in,
NVCVImageHandle mask,
NVCVTensorHandle out,
)#

Executes the image statistics operation.

Data Layout: [W] Length: sizeof(PVAImageStatOutput) Data Type: NVCV_DATA_TYPE_U8

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

    • Must not be NULL.

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

  • in[in] Input image handle.

  • mask[in] Mask image handle.

  • out[out] Output tensor handle. 1D tensor to store the output struct PVAImageStatOutput.

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.