OpenCV2学习笔记

一、引言

通常用的是OpenCV3进行编程,但因需要则要看一下之前OpenCV2的代码,因此对OpenCV2中的函数用法进行整理

二、基本函数

  • cvCreateImage
    功能: 创建图像首地址,并分配存储空间。
    函数原型:
IplImage* cvCreateImage(CvSize cvSize(int width, int height), int depth, int channels);

        使用举例

IplImage* img=cvCreateImage( cvSize(360,640), IPL_DEPTH_8U,3 );  
  • CvSaveimage
    功能:用于对ipImage类型的图片进行保存
    函数原型
/* save image to file */
CVAPI(int) cvSaveImage( const char* filename, const CvArr* image,
                        const int* params CV_DEFAULT(0) );

        使用举例

cvSaveImage("image.jpg",img);
  • CvPoint
    功能:表示一个坐标为整数的二维点,是一个包含integer类型成员x和y的简单结构体
    函数原型
typedef struct CvPoint
{
    int x;
    int y;
}
CvPoint;

        使用举例

CvPoint* PointArray;

猜你喜欢

转载自blog.csdn.net/yph001/article/details/80591818