Using OpenCV with gcc and CMake
来源:互联网 发布:魔兽世界淘宝买金价格 编辑:程序博客网 时间:2024/05/17 01:16
Note
We assume that you have successfully installed OpenCV in your workstation.
- The easiest way of using OpenCV in your code is to use CMake. A few advantages (taken from the Wiki):
- No need to change anything when porting between Linux and Windows
- Can easily be combined with other tools by CMake( i.e. Qt, ITK and VTK )
- If you are not familiar with CMake, checkout the tutorial on its website.
Steps
Create a program using OpenCV
Let’s use a simple program such as DisplayImage.cpp shown below.
Create a CMake file
Now you have to create your CMakeLists.txt file. It should look like this:
Generate the executable
This part is easy, just proceed as with any other project using CMake:
Result
By now you should have an executable (called DisplayImage in this case). You just have to run it giving an image location as an argument, i.e.:
You should get a nice window as the one shown below:
0 0
- Using OpenCV with gcc and CMake
- Using OpenCV with gcc and CMake
- Using OpenCV with gcc and CMake
- OpenCV学习笔记01: Using OpenCV with gcc and CMake
- Using OpenCV with MFC
- Using OpenCV with Qt
- Using Inline Assembly With gcc
- 使用GCC和CMake编译OpenCV
- Using OpenCV Java with Eclipse
- Using OpenCV Java with Eclipse
- install opencv 3.0.0 with python 3.4 on Mac using Homebrew and Git
- using OpenCV with python for descriptor extraction
- using opencv with eclipse(plugin cdt)
- Using OpenCV with Eclipse (plugin CDT)
- Tricks & Notes of Using OpenCV with MFC
- OpenCV 3.0.0 alpha compile by gcc cmake
- 使用gcc和cmake编译工具编辑opencv例子
- 使用 gcc 和 CMake 编译简单的 OpenCV 程序
- hibernate配置
- Ajax实现三层级联3
- javascript去掉url的一个参数
- cocos2dx 不要直接在 onEnter 里面 addTargetedDelegate (或 addStandardDelegate)
- C语言随笔(指针)
- Using OpenCV with gcc and CMake
- dom4j如何获取节点的行数,列数
- Remove Duplicates from Sorted List I&II and Sorted Array I&II
- .net中Global.asax中的事件详解
- HDU 1385 Minimum Transport Cost
- Linux 3.3.5系统移植(refer)
- android输入框限制输入法中的表情符号
- 有关magento控制器重写
- Oracle中表被删除或数据被错误修改后的恢复方法 .