VPI - 视觉编程接口

3.2 版本

BackgroundSubtractor.h
前往此文件的文档
1 /*
2  * 版权所有 2021 NVIDIA Corporation。保留所有权利。
3  *
4  * 许可证持有者须知:
5  *
6  * 此源代码和/或文档(“许可交付物”)受美国和国际版权法规定的 NVIDIA 知识产权保护。
7  * subject to NVIDIA intellectual property rights under U.S. and
8  * 国际版权法。
9  *
10  * 此处包含的这些许可交付物是 NVIDIA 的专有和机密信息,并根据 NVIDIA 与被许可方之间的软件许可协议(“许可协议”)条款和条件或被许可方以电子方式接受的条款和条件提供。
11  * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12  * conditions of a form of NVIDIA software license agreement by and
13  * between NVIDIA and Licensee ("License Agreement") or electronically
14  * accepted by Licensee. Notwithstanding any terms or conditions to
15  * 与许可协议中的任何相反条款或条件相悖,未经 NVIDIA 明确书面同意,禁止将许可交付物复制或披露给任何第三方。
16  * of the Licensed Deliverables to any third party without the express
17  * written consent of NVIDIA is prohibited.
18  *
19  * 尽管许可协议中有任何相反的条款或条件,NVIDIA 对这些许可交付物对任何用途的适用性不做任何陈述。
20  * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21  * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
22  * 它们按“原样”提供,不提供任何形式的明示或暗示保证。
23  * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
24  * NVIDIA 声明不对这些许可交付物承担任何保证责任,包括对适销性、非侵权性和适用于特定用途的所有暗示保证。
25  * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26  * 尽管许可协议中有任何相反的条款或条件,在任何情况下,NVIDIA 均不对任何特殊的、间接的、附带的或后果性的损害,或因使用、数据或利润损失而导致的任何损害负责,
27  * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28  * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30  * 无论是在合同诉讼、过失或其他侵权行为中,因使用或执行这些许可交付物而引起或与之相关的。
31  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32  * OF THESE LICENSED DELIVERABLES.
33  *
34  * 美国政府最终用户。 这些许可交付物是“商业项目”,该术语在 48 C.F.R. 2.101 (OCT
35  * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36  * 1995) 中定义,包括 “商业计算机软件” 和 “商业计算机软件文档”,这些术语在 48
37  * computer software documentation" as such terms are used in 48
38  * C.F.R. 12.212 (SEPT 1995) 中使用,并且仅作为商业终端项目提供给美国政府。 与 48 C.F.R. 12.212 和
39  * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
40  * 48 C.F.R. 227.7202-1 至 227.7202-4 (1995 年 6 月) 一致,所有
41  * U.S. Government End Users acquire the Licensed Deliverables with
42  * 美国政府最终用户仅根据本文规定的权利获得许可交付物。
43  * only those rights set forth herein.
44  *
45  * 在个人和商业软件中使用许可交付物时,必须在用户文档和代码内部注释中包含上述免责声明和美国政府最终用户须知。
46  * comments to the code, the above Disclaimer and U.S. Government End
47  * Users Notice.
48  */
49 
56 #ifndef NV_VPI_ALGORITHMS_BACKGROUND_SUBTRACTOR_H
57 #define NV_VPI_ALGORITHMS_BACKGROUND_SUBTRACTOR_H
58 
59 #include "../Export.h"
60 #include "../Status.h"
61 #include "../Types.h"
62 
63 #include <stdint.h>
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
82 typedef struct
83 {
87  float varThreshold;
88 
90  uint8_t detectShadow;
91 
94 
103 
119 
153 VPI_PUBLIC VPIStatus vpiCreateBackgroundSubtractor(uint64_t backends, int32_t imageWidth, int32_t imageHeight,
154  VPIImageFormat inputFormat, VPIPayload *payload);
155 
204 VPI_PUBLIC VPIStatus vpiSubmitBackgroundSubtractor(VPIStream stream, uint64_t backend, VPIPayload payload,
205  VPIImage inFrame, VPIImage outFGMask, VPIImage outBGImage,
206  const VPIBackgroundSubtractorParams *params);
207 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /* NV_VPI_ALGORITHMS_BACKGROUND_SUBTRACTOR_H */
uint8_t detectShadow
如果设置为非零值,算法将检测阴影并标记它们。
float learningRate
学习率,指示背景模型学习的速度。
uint8_t shadowPixelValue
表示阴影的像素值。
float varThreshold
像素与模型之间平方马氏距离的阈值,以确定像素是否为...
VPIStatus vpiSubmitBackgroundSubtractor(VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage inFrame, VPIImage outFGMask, VPIImage outBGImage, const VPIBackgroundSubtractorParams *params)
向流提交背景减除器操作。
VPIStatus vpiInitBackgroundSubtractorParams(VPIBackgroundSubtractorParams *params)
使用默认值初始化 VPIBackgroundSubtractorParams。
VPIStatus vpiCreateBackgroundSubtractor(uint64_t backends, int32_t imageWidth, int32_t imageHeight, VPIImageFormat inputFormat, VPIPayload *payload)
为 vpiSubmitBackgroundSubtractor 创建负载。
定义 vpiCreateBackgroundSubtractor 参数的结构体。
uint64_t VPIImageFormat
预定义的图像格式。
struct VPIImageImpl * VPIImage
图像的句柄。
定义: Types.h:256
struct VPIPayloadImpl * VPIPayload
算法负载的句柄。
定义: Types.h:268
VPIStatus
状态码。
定义: Status.h:81
struct VPIStreamImpl * VPIStream
流的句柄。
定义: Types.h:250