windows安装Halide

https://github.com/halide/Halide/releases
下载Halide压缩包,解压
添加环境变量,C:\Opencv3.4\halide\Debug;C:\Opencv3.4\halide\Release

①Linker>general>Adiditional Library Directories
release
C:\lib\halide\Release
Debag
C:\lib\halide\Debag
②Linker>Input>
Halide.lib;
追加
③C/C++>General>Additional Include Directory
C:\lib\halide\include
C:\Opencv3.4\halide\tools
追加


#include
#include
int main()
{
Halide::Func gradient;
Halide::Var x, y;
gradient(x, y) = x + y;
Halide::Buffer output = gradient.realize(3, 3);
for (int i = 0; i < output.height(); i++)
{
for (int j = 0; j < output.width(); j++)
{
std::cout << output(i, j) << " ";
}
std::cout << std::endl;
}
return 0;
}

如果要使用halide的图片读入函数,还需进行如下操作:
1.需包含头文件
C:\OpenCV4.1\opencv\sources\3rdparty\zlib
C:\OpenCV4.1\opencv\sources\3rdparty\libpng
C:\OpenCV4.1\opencv\sources\3rdparty\libjpeg //次三个文件夹都是opencv中的文件夹
2.引用lib文件
libpng.lib
jpeg.lib //这两个lib文件可在python安装文件中寻找,然后加入linker中

Linux:
https://blog.csdn.net/gaussrieman123/article/details/90208636 安装halide
https://www.jianshu.com/p/ad7e7fca51bb //安装llvm

你可能感兴趣的:(opencv,Halide,opencv)