当前位置:网站首页>OpenCV简介与搭建使用环境
OpenCV简介与搭建使用环境
2022-08-09 14:52:00 【Nicolas0311】
1、OpenCV是计算机视觉开源库,主要算法涉及图像处理和机器学习相关方法。 是Intel公司贡献出来的,俄罗斯工程师贡献大部分C/C++带代码。 在多数图像处理相关的应用程序中被采用,BSD许可,可以免费应用在商业和研究领域,当前SDK支持语言包括了Java、Python、IOS和Android版本。
2、OpenCV3.0版本组成模块,可以在这个地址查看:OpenCV: OpenCV moduleshttps://docs.opencv.org/3.0.0/index.html
3、使用环境搭建准备工作
3.1、安装VS2015
3.2、安装OpenCV3.0版本
3.3、新建控制台应用程序
int main(int argc, char** args)
{
return 0;
}
3.4、添加头文件目录、添加库文件目录、添加附加链接库、添加动态库到exe目录
添加头文件:
D:\opencv3.1\opencv\build\include
D:\opencv3.1\opencv\build\include\opencv
D:\opencv3.1\opencv\build\include\opencv2
添加库文件
D:\opencv3.1\opencv\build\x64\vc14\lib
添加附加链接库
opencv_world310.lib
添加动态库到exe目录
opencv_world310.dll、opencv_ts310.dll
3.5、添加示例代码
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** args)
{
Mat image = imread("lena.jpg", IMREAD_GRAYSCALE);
if (image.empty())
{
cout << "could not find the image resource..." << std::endl;
return -1;
}
namedWindow("My Image", CV_WINDOW_AUTOSIZE);
imshow("My Image", image);
waitKey(0);
return 0;
}
边栏推荐
猜你喜欢
【超级账本开发者系列】专访——肖慧 : 不忘初心,方得始终
Shell programming loop statement
What is a template engine?What are the common template engines?Introduction to common commands of thymeleaf.
Shell -- -- -- -- -- - common gadgets, sort and uniq, tr, the cut
Shell编程之循环语句
MySQL 原理与优化:Limit 查询优化
6大论坛,30+技术干货议题,2022首届阿里巴巴开源开放周来了!
DBCO-PEG-DSPE,磷脂-聚乙二醇-二苯并环辛炔,在无铜离子的催化下反应
【OpenGL】四、OpenGL入门总结:LearnOpenGL CN教程中关于欧拉角公式推导
【Qt5 + OpenGL】glPointSize(10); error: undefined reference to `__imp_glPointSize‘
随机推荐
【OpenGL】三、OpenGL总结:OpenGL坐标系
What drives the development of quantitative trading interfaces?
For programming trading, focusing on forecast or on countermeasures?
pytorch从零搭建神经网络实现多分类(训练自己的数据集)
多线程学习
对于程序化交易,重在预测还是重在对策呢?
[ERR] 1273 - Unknown collation: ‘utf8mb4_0900_ai_ci‘
Mysql two engines comparison
【OpenGL】四、OpenGL入门总结:LearnOpenGL CN教程中关于欧拉角公式推导
How to achieve stable profit through the stock quantitative trading interface?
How to achieve long-term benefits through the Tongdaxin quantitative trading interface?
FilenameFilter filters filenames
英语议论文读写02 Engineering
OpenCV - 图像模板匹配 matchTemplate
How to use and execute quantitative programmatic trading?
如何通过通达信量化交易接口达到长期的收益?
Grad CAM model visualization
在量化交易过程中,散户可以这样做
Startup error: Caused by: org.apache.ibatis.binding.BindingException summary solution
What are the hot topics in quantitative programmatic trading?