Get start with OpenCV
来源:互联网 发布:网络直播间布置效果图 编辑:程序博客网 时间:2024/06/05 15:43
Get start with OpenCV
花了三天的时间才把OpenCV装好~这个过程简直艰辛。。。昨天晚上我都差点要绝望了,心里难受啊~最后不知道尝试了多少次之后,libgtk2.0-dev终于装上去了.
apt-get 之前一直找不到libgtk2.0-dev 这个包,无比纠结,时间都砸进去了。仅仅只是搭建开发环境而已,却花了这么多时间,心疼啊~我仅剩不多的暑假时光~如果有viewer和我遇到同样的问题,那我建议——重装一次你的Ubuntu吧~
编译遇到点小麻烦,不过搞定也花什么时间。
Get start with OpenCV, the first demo.
/************************************************************code writer : EOFcode date : 2014.08.04e-mail : jasonleaster@gmail.com jasonleaster@163.comcode purpose:This demo is coded for someone who is the first time to code with OpenCV (A very powerful computer vision library.)Something like your "Hello world" is here.************************************************************/#include "opencv2/highgui/highgui.hpp"#include "opencv2/highgui/highgui_c.h"#include "opencv2/imgproc/imgproc.hpp"#include "opencv2/imgproc/imgproc_c.h"int main(int argc,char* argv[]){IplImage* img = cvLoadImage(argv[1],CV_LOAD_IMAGE_COLOR);//IplImage is a structure which could store a image that retured by function 'cvLoadImage'cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE);//cvNamedWindow is a function which would help you to creat a window.cvShowImage("Example1",img);//Obviously, show the picture that you inputed.cvWaitKey(0);//pause and let the user see the picture.cvReleaseImage(&img);//Finally, release the struture, otherwise, memory leak !return 0;}
没完,编译的参数看的库自带的demo的脚本,不难。这里给出能用的简单的脚本,在当前工作目录下运行即可
#!/bin/shfor i in *.c; do echo "compiling $i" gcc -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`;done
0 0
- Get start with OpenCV
- Get Start With NuGet
- Get start with "Lisp"
- Get Start With HTML
- 0、Get Start With C++
- Get started with OpenCV on Android
- Get start with "Redis" —— by “EOF”
- ES权威指南_03_Dealing with Human Language_01 get start
- Get Start with Riot On Arduino-Due Board.
- Get Start
- Get Start
- start with
- start with
- start with
- START WITH
- OpenCV Start
- Chapter1 Lua 中的转义字符 and get start with Lua ,Types and Value
- (二)Get start with Arduino for windows【The Arduino Platform and C Pro】
- 减法运算符
- Planning Backup Strategy
- LeetCode-Binary Tree Level Order Traversal
- 14年8月4日开博
- Linux中Kill进程的N种方法
- Get start with OpenCV
- 获取自定义View中Text文本的实际宽高
- python time模块详解
- 8/4
- OFBizChina: 理解MVC模式
- android的scaletype
- android 小问题 - android设置弹出软键盘却没有弹出来
- ibatis动态sql配置(in实例,模糊查询等)
- solr高亮、拼写检查及匹配相似简单实践