分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
目前OpenCV版本已更新到2.4...由此出现了一系列问题,解决如下:
1、cxcore.h等头文件找不到:
法一、将opencv1.0中的各种.h或者.lib文件拷到opencv2.3.1对应include/library的路径的文件夹下。
e.g. Cannot open include file: 'cxtypes.h': No such file or directory
像这种情况,在opencv1.0中又搜索不到的,果断把#include"cxtypes.h"删掉,其他问题慢慢解决。
2、CvFilter未定义:
opencv高级版本不在含有CvFilter,那么就把类型改成int吧……
3、CvvImage类找不到定义……
高级版本中,以前版本的CvvImage类不见了...为了能够继续使用这个类,下面把这个类的源代码贴出来,使用的时候将该代码加入到工程中便可以使用了。为了方便切换OpenCV的版本,这里用到了一些条件编译宏,来保证代码的灵活性。
不过OpenCV 2.2.0取消CvvImage这个类,一定是有它的原因的,具体可以在做实验的时候体会这些原因。
========================================================================
CvvImage头文件
#ifndef CVVIMAGE_CLASS_DEF#define CVVIMAGE_CLASS_DEF#ifndef RC_OPENCV_2_1_0#include <opencv/cv.h>#include <opencv/highgui.h>/* CvvImage class definition */class CvvImage{
public: CvvImage(); virtual ~CvvImage(); /* Create image (BGR or grayscale) */ virtual bool Create( int width, int height, int bits_per_pixel, int image_origin = 0 ); /* Load image from specified file */ virtual bool Load( const char* filename, int desired_color = 1 ); /* Load rectangle from the file */ virtual bool LoadRect( const char* filename, int desired_color, CvRect r );#if defined WIN32 || defined _WIN32 virtual bool LoadRect( const char* filename, int desired_color, RECT r ) { return LoadRect( filename, desired_color, cvRect( r.left, r.top, r.right - r.left, r.bottom - r.top )); }#endif /* Save entire image to specified file. */ virtual bool Save( const char* filename ); /* Get copy of input image ROI */ virtual