(索引)OpenGL学习资料

(原)ubuntu 下安装opencv

孔令春 posted @ 2010年9月18日 08:34 in 计算机视觉 with tags 安装opencv , 5799 阅读

在ubuntu 10.04下安装opencv,步骤如下:

1、找到opencv的依赖包

$ sudo apt-cache search opencv

libcv-dev - development files for libcv
libcv4 - computer vision library
libcvaux-dev - development files for libcvaux
libcvaux4 - computer vision extension library
libhighgui-dev - development files for libhighgui
libhighgui4 - computer vision GUI library
opencv-doc - OpenCV documentation and examples
python-opencv - Python bindings for the computer vision library
harpia - Image Processing/Computer Vision Automatic Prgm. Tool

2、安装opencv

$ sudo apt-get install libcv-dev libcv4 libcvaux-dev libcvaux4 libhighgui-dev libhighgui4 opencv-doc harpia

 

3、在CodeBlocks中配置opencv

点击Settings ->Compiler and debugger settings,在Linker settings的Other linker options:里添加 -lcv -lcxcore -lhighgui。在Search directories -> Compier 下添加目录 /usr/include/opencv,在右边的Linker标签下添加目录/usr/lib

4、示例代码

/*
 * 例示1:用于从磁盘加载并在屏幕上显示一幅图像
 */

#include <iostream>
#include <highgui.h>

using namespace std;

int main( int argc, char *argv[] )
{
		if( argc < 2) {
			cout<< "Usage:" << argv[0] << "<image_name>" << endl;
			return 1;
		}

		IplImage *img = cvLoadImage( argv[1] );
		if( !img ) {
			cout<< argv[1] << "image load error." << endl;
			return 1;
		}

		cvNamedWindow( "Exampe1: LoadImage", CV_WINDOW_AUTOSIZE );
		cvShowImage( "Example1", img );
		cvWaitKey( 0 );
		cvReleaseImage( &img );
		cvDestroyWindow( "Example1" );

		return 0;
}

(要运行此示例,需要设置项目参数,具体如下:Project -> set programs' arguments...,在Program arguments下输入要显示的图片的名字。)

Avatar_small
Pay LIC Premium Onli 说:
2022年8月03日 06:06

Google Pay which is also known as Tez App, is a UPI payment service app by Google which has become quite popular all across India for fast transactions. As Life Insurance Corporation of India has gone through changes which have enabled UPI payments as a source for LIC premium payments by their customers. Pay LIC Premium Online Yes, this means that if you are someone who has a Policy running with LIC India then you can use your Google pay app to pay for upcoming premium payments directly, and there are different ways of paying the LIC Premium by Google Pay app. Google Pay which is also known as Tez App, is a UPI payment service app by Google which has become quite popular all across India for fast transactions. As Life Insurance Corporation of India has gone through changes which have enabled UPI payments as a source for LIC premium payments by their customers.

Avatar_small
GSEB STD-1 Question 说:
2022年9月10日 02:57

Gujarat State Department of School Education, Gandhinagar and the State level subject experts and other private school teaching staff of the Elementary Level Primary School have designed and suggested the GSEB 1st Class Model Paper 2023 with sample answers Set wide as SET-A, SET-B, SET-C and SET-D to know the new exam scheme or question pattern. GSEB STD-1 Question Paper Students of the Gujarat state can download the NCERT & SCERT Syllabus GSEB STD-1 Question Paper 2023 Pdf with sample answers along with the class teacher’s suggested all lesson or chapter’s most important questions for Part-A, Part-B, Part-C and Part-D exams of Term-1 & Term-2 to the academic year of 2023.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter