Crops rectangular regions from the input image, rescale them to uniform dimensions and writes them in a single image to be used in further batched image processing.
More...
|
| VPIStatus | vpiCreateCropScaler (uint64_t backends, int maxFrames, int maxObjects, VPIPayload *payload) |
| | Creates payload instance for the Crop Scale algorithm. More...
|
| |
| VPIStatus | vpiSubmitCropScalerBatch (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage *frameList, int32_t numFrames, VPIArray objects, int32_t patchWidth, int32_t patchHeight, VPIImage outPatches) |
| | Crops rectangular regions from the input frames and rescale them all to the same dimensions. More...
|
| |
Crops rectangular regions from the input image, rescale them to uniform dimensions and writes them in a single image to be used in further batched image processing.
◆ vpiCreateCropScaler()
| VPIStatus vpiCreateCropScaler |
( |
uint64_t |
backends, |
|
|
int |
maxFrames, |
|
|
int |
maxObjects, |
|
|
VPIPayload * |
payload |
|
) |
| |
#include <vpi/algo/CropScaler.h>
Creates payload instance for the Crop Scale algorithm.
- Parameters
-
| [in] | backends | VPI backends that are eligible to execute the algorithm.
- Valid values:
- Backend must be enabled in current context.
|
| [in] | maxFrames | Maximum number of frames.
|
| [in] | maxObjects | Maximum number of objects.
|
| [out] | payload | Pointer to the payload variable that receives the created handle. |
- Return values
-
◆ vpiSubmitCropScalerBatch()
#include <vpi/algo/CropScaler.h>
Crops rectangular regions from the input frames and rescale them all to the same dimensions.
- Parameters
-
| [in] | stream | The stream where the operation will be queued in.
- Must not be NULL.
- Stream must have enabled the backends that will execute the algorithm.
|
| [in] | backend | Backend that will execute the algorithm.
- Must be the backend specified during payload creation or 0 as a shorthand to use this backend.
|
| [in] | payload | Payload created by vpiCreateCropScaler. |
| [in] | frameList | List of image frames. If an image within frameList is NULL, its correponding objects won't be processed.
- Must not be NULL.
- Must point to an array of at least
numFrames images.
- Each image must have enabled the backends that will execute the algorithm.
- All frames must have the same image format, size, and pitch.
- For VPI_BACKEND_PVA, the image size must be at least 128x128.
- The pitch must be a multiple of the element size.
- Valid image formats:
|
| [in] | numFrames | Number of input frames in the batch.
|
| [in] | objects | Input array with bounding boxes associated with each input frame via its index.
- Must not be NULL.
- Must have enabled the backends that will execute the algorithm.
- The index of the input frame for each object must be >= 0 and <
numFrames. An out-of-bounds index is undefined behavior.
- The number of objects in the array must be >= 0 and < maxObjects as specified by vpiCreateCropScaler.
- Valid array types:
|
| [in] | patchWidth | The width of the patch to be written to outPatches.
|
| [in] | patchHeight | The height of the patch to be written to outPatches.
|
| [out] | outPatches | Image where the cropped and rescale patches will be written to. The width of each patch will be equal to patchWidth. The height of each patch will be equal to patchHeight. The patch for an object 'o' will then start at row o * patchHeight and have height 'patchHeight'. If image format is different from input frame's, an image format conversion will be performed on the fly.
- Image height must be at least
patchHeight * numObjects, where 'numObjects' is the size of inObjects.
- Image width must be at least
patchWidth.
- Valid image formats:
|
- Return values
-