随笔分类 - OpenCV
摘要:Initializing "cv::StereoBM bm.state->disp12MaxDiff" should be careful, inappropriate value might crash your program. Suggested that you set it to -1 t...
阅读全文
摘要:cvSave这个函数是OpenCV中用来保存某个数据类型到文件中常用的函数,它原本共有五个参数,但是在VS2010中只需要填前两个,而在Linux必须填满五个,否则会出错,如下:// VS2010cvSave("m.xml", mat);// LinuxcvSave("m.xml", mat, NU...
阅读全文
摘要:如果我们想把OpenCV中的矩阵数据类型cv::Mat保存在一个文件中,可以使用如下的代码:void writeMatToFile(cv::Mat& m, const char* filename) { ofstream fout(filename); if(!fout) { ...
阅读全文
摘要:Download CMake 2.8.12Extract the file, and run "./bootstrap", then "make", then "sudo make install"Add some dependencies, run "sudo apt-get install bu...
阅读全文
摘要:Download OpenCV 2.4.10Download CMake 2.8Open CMake and choose the source code directory and build binary directoryThen click "Configure", and "Generat...
阅读全文
摘要:有时候在项目中我们需要检测当前连接在机子上的摄像头的数量,可以通过下面的代码实现,其中连接摄像头的最大数量maxCamNum可以任意修改:/** * Count current camera number */int countCamera() { int maxCamNum = 5; ...
阅读全文
摘要:Add in the system Path:C:\opencv\build\x86\vc10\bin;Project->Project Property->Configuration Properties->VC++Directories ->Include Directories:C:\open...
阅读全文
摘要:Download CMake 2.8.2Download OpenCV 2.4.11Download Qt 5.4Highly improtant note: The installation directory should not contain any space or non-English...
阅读全文
摘要:用OpenCV同时显示两个摄像头的内容的代码如下:#include #include #include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]) { CvCapture...
阅读全文
摘要:在使用Qt和OpenCV编程时,对于它们各自的图像类QImage和IplImage难以避免的需要互相之间的转换,下面我们就来看它们的相互转换。1. QImage 转换为 IplImageIplImage *QImageToIplImage(const QImage * qImage){ int...
阅读全文
摘要:CvMat:typedef struct CvMat{ int type; int step; /* for internal use only */ int* refcount; int hdr_refcount; union { uchar...
阅读全文
摘要:原文地址: http://blog.csdn.net/holybin/article/details/17711013在OpenCV中Mat、CvMat和IplImage类型都可以代表和显示图像。 IplImage由CvMat派生,而CvMat由CvArr派生即CvArr -> CvMat -> I...
阅读全文
摘要:Add in the system Path:C:\Program Files (x86)\OpenCV-2.1.0\build\bin\DebugProject->Project Property->Configuration Properties->VC++Directories ->Inclu...
阅读全文
摘要:Creating a video with OpenCV
阅读全文
摘要:FOURCCNameSummary1978A.M.Paredes predictorThis is a LossLess video codec. >>>2VUY2VUY / BlackMagic>>>3IV03ivx3IV0 no longer used for this codec, howev...
阅读全文
摘要:新版的OpenCV在所有的函数和类前都加上了cv或Cv,这样很好的避免了区域污染(namespace pollution),而且不用在前面加‘cv::’,非常的使用。像之前的imshow()函数被现在的cvShowImage()所替代,现如今在OpenCV中显示一张图片可用如下代码:C API:Ip...
阅读全文
摘要:OpenCV的IplImag和 FlyCapture2 的 Image是两种常见的图片格式,在实际的应用中,我们通常要混合使用OpenCV和FlyCapture2这两个SDK,所以这两种图片格式之间的相互转换就是经常需要做的。首先分别来看看两种图片类的定义:IplImage:typedef stru...
阅读全文