从输入图像中提取方向梯度直方图特征。 更多...
函数 | |
VPIStatus | vpiCreateExtractHOGFeatures (uint64_t backends, int32_t width, int32_t height, int32_t features, int32_t cellSize, int32_t numOrientations, int32_t *outNumFeatures, VPIPayload *payload) |
为非批量版本的 HOG 算法创建负载。 更多... | |
VPIStatus | vpiCreateExtractHOGFeaturesBatch (uint64_t backends, int32_t maxBatchWidth, int32_t maxBatchHeight, int32_t imgWidth, int32_t imgHeight, int32_t features, int32_t cellSize, int32_t numOrientations, int32_t *outNumFeatures, VPIPayload *payload) |
为批量版本的 HOG 算法创建负载。 更多... | |
VPIStatus | vpiSubmitExtractHOGFeatures (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage input, VPIImage *outFeatures, int32_t numFeatures) |
向流提交 HOG 操作。 更多... | |
HOG 标志 | |
#define | VPI_HOG_CONTRAST_SENSITIVE 0x01 |
返回对比度敏感特征。 | |
#define | VPI_HOG_CONTRAST_INSENSITIVE 0x02 |
返回对比度不敏感特征。 | |
#define | VPI_HOG_TEXTURE 0x04 |
返回纹理相关特征。 | |
#define | VPI_HOG_ALL_FEATURES (VPI_HOG_CONTRAST_SENSITIVE | VPI_HOG_CONTRAST_INSENSITIVE | VPI_HOG_TEXTURE) |
用于返回所有特征的辅助标志。 | |
从输入图像中提取方向梯度直方图特征。
VPIStatus vpiCreateExtractHOGFeatures | ( | uint64_t | backends, |
int32_t | width, | ||
int32_t | height, | ||
int32_t | features, | ||
int32_t | cellSize, | ||
int32_t | numOrientations, | ||
int32_t * | outNumFeatures, | ||
VPIPayload * | payload | ||
) |
#include <vpi/experimental/HOG.h>
为非批量版本的 HOG 算法创建负载。
[输入] | backends | 有资格执行算法的 VPI 后端。 |
[输入] | width,height | 要使用的输入图像的尺寸。
|
[输入] | features | 用于指定将返回哪些特征的标志。
|
[输入] | cellSize | 单元格大小,通常为 8 或 16,分别对应 8x8 和 16x16 单元格。
|
[输入] | numOrientations | 使用的方向数量。通常为 18。
|
[输出] | outNumFeatures | 接收将返回的特征数量。如果不需要,则传递 NULL。 |
[输出] | payload | 指向接收创建句柄的负载变量的指针。 |
VPI_ERROR_INVALID_ARGUMENT | payload 句柄为 NULL。 |
VPI_ERROR_INVALID_ARGUMENT | width 或 height 超出有效范围。 |
VPI_ERROR_NOT_IMPLEMENTED | 给定的后端未实现 HOG。 |
VPI_ERROR_INVALID_CONTEXT | 当前上下文已销毁。 |
VPI_ERROR_OUT_OF_MEMORY | 无法分配所需资源。 |
VPI_SUCCESS | 操作执行成功。 |
VPIStatus vpiCreateExtractHOGFeaturesBatch | ( | uint64_t | backends, |
int32_t | maxBatchWidth, | ||
int32_t | maxBatchHeight, | ||
int32_t | imgWidth, | ||
int32_t | imgHeight, | ||
int32_t | features, | ||
int32_t | cellSize, | ||
int32_t | numOrientations, | ||
int32_t * | outNumFeatures, | ||
VPIPayload * | payload | ||
) |
#include <vpi/experimental/HOG.h>
为批量版本的 HOG 算法创建负载。
假定输入图像在内存中以图像的 2D 矩阵形式布局。所有图像必须具有相同的尺寸。
[输入] | backends | 有资格执行算法的 VPI 后端。 |
[输入] | maxBatchWidth,maxBatchHeight | 水平和垂直方向上的最大图像数量。
|
[输入] | imgWidth,imgHeight | 每个批量图像的尺寸。
|
[输入] | features | 用于指定将返回哪些特征的标志。
|
[输入] | cellSize | 单元格大小,通常为 8 或 16,分别对应 8x8 和 16x16 单元格。
|
[输入] | numOrientations | 使用的方向数量。通常为 18。
|
[输出] | outNumFeatures | 接收将返回的特征数量。如果不需要,则传递 NULL。 |
[输出] | payload | 指向将接收分配的负载句柄的负载指针。 |
VPI_ERROR_INVALID_ARGUMENT | payload 句柄为 NULL。 |
VPI_ERROR_INVALID_ARGUMENT | maxBatchWidth 或 maxBatchHeight 超出有效范围。 |
VPI_ERROR_INVALID_ARGUMENT | imgWidth 或 imgHeight 超出有效范围。 |
VPI_ERROR_INVALID_ARGUMENT | 无效的 features 。 |
VPI_ERROR_INVALID_ARGUMENT | cellSize 或 numOrientations 超出有效范围。 |
VPI_ERROR_INVALID_ARGUMENT | imgWidth 必须是单元格宽度的倍数。 |
VPI_ERROR_INVALID_ARGUMENT | imgHeight 必须是单元格高度的倍数。 |
VPI_ERROR_INVALID_ARGUMENT | backends 引用了无效的后端。 |
VPI_ERROR_NOT_IMPLEMENTED | 给定的后端未实现 HOG。 |
VPI_ERROR_INVALID_CONTEXT | 当前上下文已销毁。 |
VPI_ERROR_OUT_OF_MEMORY | 无法分配所需资源。 |
VPI_SUCCESS | 操作执行成功。 |
VPIStatus vpiSubmitExtractHOGFeatures | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | input, | ||
VPIImage * | outFeatures, | ||
int32_t | numFeatures | ||
) |
#include <vpi/experimental/HOG.h>
向流提交 HOG 操作。
它处理批量和非批量负载。
[输入] | stream | 操作将排队到的流。
|
[输入] | backend | 将执行算法的后端。必须是在负载创建期间指定的后端,或 0 作为使用此后端的简写。 |
[输入] | payload | 要与其他参数一起提交的负载。 |
[输入] | input | 如果使用非批量负载,这是要处理的输入图像。
|
[输出] | outFeatures | 指向将接收特征的图像数组的指针。
|
[输入] | numFeatures | 输出数组中的图像数量。必须介于 1 和 32 之间。 |
VPI_ERROR_INVALID_ARGUMENT | stream 为 NULL。 |
VPI_ERROR_INVALID_ARGUMENT | input 或 outFeatures 为 NULL。 |
VPI_ERROR_INVALID_ARGUMENT | payload 不是使用 vpiCreateExtractHOGFeatures 生成的。 |
VPI_ERROR_INVALID_ARGUMENT | numFeatures 超出有效范围。 |
VPI_ERROR_INVALID_ARGUMENT | 批量输入宽度必须是配置的输入宽度的倍数。 |
VPI_ERROR_INVALID_ARGUMENT | 批量输入高度必须是配置的输入高度的倍数。 |
VPI_ERROR_INVALID_ARGUMENT | outFeatures 必须都具有相同的格式。 |
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload 无效。 |
VPI_ERROR_INVALID_OPERATION | 所需的后端未在 stream 、input 或 outFeatures 中启用。 |
VPI_SUCCESS | 操作执行成功。 |