CV_WRAP和CV_EXPORTS_W

CV_EXPORTS_W is defined in modules/core/include/opencv2/core/types_c.h as alias for CV_EXPORTS, CV_EXPORTS is defined as:

#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS
# define CV_EXPORTS __declspec(dllexport)
#else
# define CV_EXPORTS
#endif

So it's alias for __declspec(dllexport) on Windows platform where CVAPI_EXPORTS is defined, otherwise it's empty.

CV_WRAP is used as flag for scripts to create wrappers of the function or method. It is used for creation Python or Java wrappers.

在Windows平台并且在定义了CVAPI_EXPORTS前提下,CV_EXPORTS是__declspec(dllexport)的别名,如果没有定义CVAPI_EXPORTS,那么CV_EXPORTS为空。

CV_WRAP是一个描述标志,在创建函数或方法(成员函数)包裹的说明标志。它是在Python或Java打包时使用。

在 OpenCV 中,所有算法都是用 C ++实现的。但是这些算法可以用于不同的语言,如 Python,Java 等。

参考文献:

11. OpenCV-Python 绑定 - 如何生成 OpenCV-Python 绑定? - 《OpenCV 中文文档 4.0.0》 - 书栈网 · BookStack

posted @ 2024-06-16 13:50  凤凰_1  阅读(18)  评论(0编辑  收藏  举报