NVIDIA DeepStream SDK API Reference

7.1 Release
nvdsinfer_conversion.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* NvDsInferConvertFcn) (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Function pointer type to which any of the NvDsInferConvert functions can be assigned. More...
 
typedef void(* NvDsInferConvertFcnFloat) (float *outBuffer, float *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 

Functions

void NvDsInferConvert_C3ToP3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 This is a header file for pre-processing cuda kernels with normalization and mean subtraction required by nvdsinfer. More...
 
void NvDsInferConvert_C3ToL3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution. More...
 
void NvDsInferConvert_C4ToP3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution. More...
 
void NvDsInferConvert_C4ToL3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution. More...
 
void NvDsInferConvert_C3ToP3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsInferConvert_C3ToL3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsInferConvert_C4ToP3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 4 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsInferConvert_C4ToL3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 4 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsInferConvert_C1ToP1Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an 1 channel UINT8 input of width x height resolution into an 1 channel float buffer of width x height resolution. More...
 
void NvDsInferConvert_FtFTensor (float *outBuffer, float *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 

Typedef Documentation

◆ NvDsInferConvertFcn

typedef void(* NvDsInferConvertFcn) (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)

Function pointer type to which any of the NvDsInferConvert functions can be assigned.

Definition at line 313 of file nvdsinfer_conversion.h.

◆ NvDsInferConvertFcnFloat

typedef void(* NvDsInferConvertFcnFloat) (float *outBuffer, float *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)

Definition at line 323 of file nvdsinfer_conversion.h.

Function Documentation

◆ NvDsInferConvert_C1ToP1Float()

void NvDsInferConvert_C1ToP1Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an 1 channel UINT8 input of width x height resolution into an 1 channel float buffer of width x height resolution.

The input buffer can have a pitch > width . The cuda kernel supports normalization and mean image subtraction.

Parameters
outBufferCuda device buffer for float output. Should be at least (width * height * sizeof(float)) bytes.
inBufferCuda device buffer for UINT8 input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C3ToL3Float()

void NvDsInferConvert_C3ToL3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGB -> RGB and BGR -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C3ToL3RFloat()

void NvDsInferConvert_C3ToL3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGR -> RGB and RGB -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C3ToP3Float()

void NvDsInferConvert_C3ToP3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

This is a header file for pre-processing cuda kernels with normalization and mean subtraction required by nvdsinfer.

Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution. The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGB -> RGB and BGR -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C3ToP3RFloat()

void NvDsInferConvert_C3ToP3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGR -> RGB and RGB -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C4ToL3Float()

void NvDsInferConvert_C4ToL3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGBA -> RGB and BGRx -> BGR conversions.

Parameters
outBufferCuda device buffer for linear float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C4ToL3RFloat()

void NvDsInferConvert_C4ToL3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 4 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGRx -> RGB and RGBA -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C4ToP3Float()

void NvDsInferConvert_C4ToP3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGBA -> RGB and BGRx -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_C4ToP3RFloat()

void NvDsInferConvert_C4ToP3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 4 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGRx -> RGB and RGBA -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsInferConvert_FtFTensor()

void NvDsInferConvert_FtFTensor ( float *  outBuffer,
float *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)