Heim Datenbank MySQL-Tutorial ubuntu下codeblocks opencv2.4.9配置

ubuntu下codeblocks opencv2.4.9配置

Jun 07, 2016 pm 03:20 PM
ubuntu

本文只是参考,每个人配置根据opencv与codeblocks安装路径不同而不同。 一.安装 CodeBlocks 安装 codeblocks [plain] view plaincopyprint? #apt-getinstallcodeblocks #apt-getinstallcodeblocks-contrib#wxWidgets貌要用 #apt-getinstalllibwxbase2.8-dev#

本文只是参考,每个人配置根据opencv与codeblocks安装路径不同而不同。

一.安装 CodeBlocks

安装 codeblocks

[plain] view plaincopyprint?

  1. # apt-get install codeblocks  
  2. # apt-get install codeblocks-contrib     # wxWidgets 貌似要用  
  3. # apt-get install libwxbase2.8-dev       # 还是 wxWidgets 的东东  


二.安装 opencv

1.先查询 opencv :

[plain] view plaincopyprint?

  1. ~# apt-cache search opencv  
  2. libcv-dev - Translation package for libcv-dev  
  3. libcv2.3 - computer vision library - libcv* translation package  
  4. libcvaux-dev - Translation package for libcvaux-dev  
  5. libcvaux2.3 - computer vision library - libcvaux translation package  
  6. libhighgui-dev - Translation package for libhighgui-dev  
  7. libhighgui2.3 - computer vision library - libhighgui translation package  
  8. libopencv-calib3d-dev - development files for libopencv-calib3d  
  9. libopencv-calib3d2.3 - computer vision Camera Calibration library  
  10. libopencv-contrib-dev - development files for libopencv-contrib  
  11. libopencv-contrib2.3 - computer vision contrib library  
  12. libopencv-core-dev - development files for libopencv-core  
  13. libopencv-core2.3 - computer vision core library  
  14. libopencv-dev - development files for opencv  
  15. libopencv-features2d-dev - development files for libopencv-features2d  
  16. libopencv-features2d2.3 - computer vision Feature Detection and Descriptor Extraction library  
  17. libopencv-flann-dev - development files for libopencv-flann  
  18. libopencv-flann2.3 - computer vision Clustering and Search in Multi-Dimensional spaces library  
  19. libopencv-gpu-dev - development files for libopencv-gpu  
  20. libopencv-gpu2.3 - computer vision GPU Processing library  
  21. libopencv-highgui-dev - development files for libopencv-highgui  
  22. libopencv-highgui2.3 - computer vision High-level GUI and Media I/O library  
  23. libopencv-imgproc-dev - development files for libopencv-imgproc  
  24. libopencv-imgproc2.3 - computer vision Image Processing library  
  25. libopencv-legacy-dev - development files for libopencv-legacy  
  26. libopencv-legacy2.3 - computer vision legacy library  
  27. libopencv-ml-dev - development files for libopencv-ml  
  28. libopencv-ml2.3 - computer vision Machine Learning library  
  29. libopencv-objdetect-dev - development files for libopencv-objdetect  
  30. libopencv-objdetect2.3 - computer vision Object Detection library  
  31. libopencv-video-dev - development files for libopencv-video  
  32. libopencv-video2.3 - computer vision Video analysis library  
  33. opencv-doc - OpenCV documentation and examples  
  34. python-opencv - Python bindings for the computer vision library  

2.根据查询结果安装

[plain] view plaincopyprint?

  1. #  apt-get install libcv2.3 libcvaux2.3 libhighgui2.3  
  2. #  apt-get install libcv-dev libcvaux-dev libhighgui-dev  



三. codeblocks + opencv 配置

1. 相关文件位置

~# pkg-config --cflags opencv     # opencv 头文件(.h) 位置
-I/usr/include/opencv  

~# pkg-config --libs opencv         # opencv 库文件
-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann  


2. codeBlocks链接库配置: Project -> Build Options 如下图:

ubuntu下codeblocks opencv2.4.9配置


3. codeBlocks 头文件目录配置(pkg-config --cflags opencv   结果)

ubuntu下codeblocks opencv2.4.9配置


4. CodeBlocks 路文件目录配置

ubuntu下codeblocks opencv2.4.9配置


5. 测试结果

ubuntu下codeblocks opencv2.4.9配置


四. 程序演示

还没有呢 ....(图片显示不出来,不好意思贴出来,见谅 。。。

努力查找编码错误后,得出结果( 小鱼终于显示了):

ubuntu下codeblocks opencv2.4.9配置


五. 示例代码

[cpp] view plaincopyprint?

  1. #include "cv.h"  
  2. #include "highgui.h"  
  3. int main()  
  4. {  
  5.     IplImage* pImg;  
  6.     pImg = cvLoadImage("/home/nehc/fish.jpg", 1);  
  7.   
  8.     cvNamedWindow("Image", 1);  
  9.     cvShowImage("Image", pImg);  
  10.   
  11.     cvWaitKey(0);  
  12.   
  13.     cvDestroyWindow("Image");  
  14.     cvReleaseImage(&pImg);  
  15.   
  16.     return 0;  
  17. }  



Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
2 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
Repo: Wie man Teamkollegen wiederbelebt
4 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Abenteuer: Wie man riesige Samen bekommt
3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Was soll ich tun, wenn das Ubuntu-Terminal nicht geöffnet werden kann? Wie kann das Problem behoben werden, dass Ubuntu das Terminal nicht öffnen kann? Was soll ich tun, wenn das Ubuntu-Terminal nicht geöffnet werden kann? Wie kann das Problem behoben werden, dass Ubuntu das Terminal nicht öffnen kann? Feb 29, 2024 pm 05:30 PM

Was soll ich tun, wenn das Ubuntu-Terminal nicht geöffnet werden kann? Wie kann das Problem behoben werden, dass Ubuntu das Terminal nicht öffnen kann?

Wie entferne ich das Schlosssymbol in der unteren rechten Ecke des Ubuntu 18.04-Ordners? Wie entferne ich das Schlosssymbol in der unteren rechten Ecke des Ubuntu 18.04-Ordners? Jan 12, 2024 pm 11:18 PM

Wie entferne ich das Schlosssymbol in der unteren rechten Ecke des Ubuntu 18.04-Ordners?

Melden Sie sich als Superuser bei Ubuntu an Melden Sie sich als Superuser bei Ubuntu an Mar 20, 2024 am 10:55 AM

Melden Sie sich als Superuser bei Ubuntu an

Ein kleiner Vorgeschmack auf die sieben Highlights von Ubuntu 24.04 LTS Ein kleiner Vorgeschmack auf die sieben Highlights von Ubuntu 24.04 LTS Feb 27, 2024 am 11:22 AM

Ein kleiner Vorgeschmack auf die sieben Highlights von Ubuntu 24.04 LTS

Grafik-Tutorial zur Installation und Deinstallation der Ubuntu 20.04-Bildschirmaufzeichnungssoftware OBS Grafik-Tutorial zur Installation und Deinstallation der Ubuntu 20.04-Bildschirmaufzeichnungssoftware OBS Feb 29, 2024 pm 04:01 PM

Grafik-Tutorial zur Installation und Deinstallation der Ubuntu 20.04-Bildschirmaufzeichnungssoftware OBS

Wie entferne ich Symbole im Ubuntu-Startmenü? Wie entferne ich Symbole im Ubuntu-Startmenü? Jan 13, 2024 am 10:45 AM

Wie entferne ich Symbole im Ubuntu-Startmenü?

Ubuntu unterstützt endlich die Deaktivierung automatischer Updates von Snap-Paketen Ubuntu unterstützt endlich die Deaktivierung automatischer Updates von Snap-Paketen Jan 13, 2024 am 10:09 AM

Ubuntu unterstützt endlich die Deaktivierung automatischer Updates von Snap-Paketen

So installieren Sie Angular unter Ubuntu 24.04 So installieren Sie Angular unter Ubuntu 24.04 Mar 23, 2024 pm 12:20 PM

So installieren Sie Angular unter Ubuntu 24.04

See all articles