Separate foreground and background from video. More...
Data Structures | |
struct | VPIBackgroundSubtractorParams |
Structure that defines the parameters for vpiCreateBackgroundSubtractor. More... | |
Functions | |
VPIStatus | vpiInitBackgroundSubtractorParams (VPIBackgroundSubtractorParams *params) |
Initializes VPIBackgroundSubtractorParams with default values. More... | |
VPIStatus | vpiCreateBackgroundSubtractor (uint64_t backends, int32_t imageWidth, int32_t imageHeight, VPIImageFormat inputFormat, VPIPayload *payload) |
Creates payload for vpiSubmitBackgroundSubtractor. More... | |
VPIStatus | vpiSubmitBackgroundSubtractor (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage inFrame, VPIImage outFGMask, VPIImage outBGImage, const VPIBackgroundSubtractorParams *params) |
Submits a Background Subtractor operation to the stream. More... | |
Separate foreground and background from video.
Refer to Background Subtractor for more details and usage examples.
struct VPIBackgroundSubtractorParams |
Structure that defines the parameters for vpiCreateBackgroundSubtractor.
Definition at line 82 of file BackgroundSubtractor.h.
VPIStatus vpiInitBackgroundSubtractorParams | ( | VPIBackgroundSubtractorParams * | params | ) |
#include <vpi/algo/BackgroundSubtractor.h>
Initializes VPIBackgroundSubtractorParams with default values.
Defaults:
[out] | params | Structure to be filled with default values. |
VPI_ERROR_INVALID_ARGUMENT | params is NULL |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiCreateBackgroundSubtractor | ( | uint64_t | backends, |
int32_t | imageWidth, | ||
int32_t | imageHeight, | ||
VPIImageFormat | inputFormat, | ||
VPIPayload * | payload | ||
) |
#include <vpi/algo/BackgroundSubtractor.h>
Creates payload for vpiSubmitBackgroundSubtractor.
[in] | backends | VPI backend that will execute the algorithm.
|
[in] | imageWidth,imageHeight | Input image dimensions.
|
[in] | inputFormat | Input image format.
|
[out] | payload | Pointer to the payload variable that receives the created handle. |
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | imageWidth or imageHeight outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | backend refers to an invalid backend. |
VPI_IMAGE_FORMAT_INVALID | inputFormat is not supported. |
VPI_ERROR_NOT_IMPLEMENTED | Background Subtractor algorithm is not supported by given backend. |
VPI_ERROR_INVALID_CONTEXT | Current context was destroyed. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitBackgroundSubtractor | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | inFrame, | ||
VPIImage | outFGMask, | ||
VPIImage | outBGImage, | ||
const VPIBackgroundSubtractorParams * | params | ||
) |
#include <vpi/algo/BackgroundSubtractor.h>
Submits a Background Subtractor operation to the stream.
Runs background subtractor on the incoming image from the video and outputs an estimate of the foreground mask.
[in] | stream | The stream where the operation will be queued in.
|
[in] | backend | Backend that will execute the algorithm.
|
[in] | payload | Payload to be submitted along the other parameters. |
[in] | inFrame | Incoming frame from the video.
|
[out] | outFGMask | The output foreground mask as an 8-bit binary image.
|
[out] | outBGImage | Background image. Pass NULL if not needed.
|
[in] | params | Algorithm control parameters. Pass NULL to use the defaults given by vpiInitBackgroundSubtractorParams. |
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | params is NULL. |
VPI_ERROR_INVALID_ARGUMENT | inFrame or outFGMask are NULL. |
VPI_ERROR_INVALID_ARGUMENT | payload is not created by vpiCreateBackgroundSubtractor. |
VPI_ERROR_INVALID_ARGUMENT | inFrame image dimension does not match the one associated with payload . |
VPI_ERROR_INVALID_ARGUMENT | outFGMask dimension does not match the one associated with payload . |
VPI_ERROR_INVALID_ARGUMENT | Learning rate in params outside valid range. |
VPI_ERROR_INVALID_IMAGE_FORMAT | inFrame image format does not match the one associated with payload . |
VPI_ERROR_INVALID_IMAGE_FORMAT | outFGMask format not supported. |
VPI_ERROR_INVALID_IMAGE_FORMAT | outBGImage format does not match the one associated with payload . |
VPI_ERROR_INVALID_ARGUMENT | payload is invalid. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , inFrame , outFGMask or outBGImage . |
VPI_SUCCESS | Operation executed successfully. |