上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 根据最新的manual ,Mat和CvMat,IplImage的相互转化方法如下: // Convert an IplImage or CvMat to an cv::Mat and a cv::Mat to an // IplImage or CvMat:// Assuming somewhere IplImage *iplimg; exists// and has been alloc... 阅读全文
posted @ 2012-03-15 13:52 gaoxw0511 阅读(590) 评论(0) 推荐(0) 编辑
摘要: Mat打印 使用printf或者数据转存,才可以打印. 不可以使用cout直接打印,会出现乱码. Mat , CvMat , IplImage 之间的转换: Mat-> CvMat : CvMat 数据指针分不同类型:data.db(double pointer ),.ptr(uchar pointer)…根据初始化时矩阵的类型确定 // ... 阅读全文
posted @ 2012-03-14 12:35 gaoxw0511 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 近来,使用C++输出一组数据到文件(*.txt). 需要在输出全部结果后,返回到文件头重新写入一组数据. 使用seekp函数定位到相关位置: seekp函数有两种情况,主要是:basic_ostream<_Elem, _Tr>& seekp( pos_type _Pos ); basic_ostream<_Elem, _Tr>& seekp( off_type _Off, ios_base::seekdir _Way );其中:_Pos The position in the stream._Off The offset relative to _Way 阅读全文
posted @ 2012-03-13 17:03 gaoxw0511 阅读(1470) 评论(0) 推荐(0) 编辑
摘要: I am using visual studio 2008 for developing. My program needs to deal with a huge amount of memory. The error happens when my program try to allocate a 512M float array. Code is the following:int size =512*512*512;float*buffer =newfloat[size];Before this allocation, the program already consumed aro 阅读全文
posted @ 2012-03-02 17:22 gaoxw0511 阅读(1965) 评论(0) 推荐(0) 编辑
摘要: 为了利用string类型的字符串连接功能,使用string类型作为ifstream类型对象读入文件的文件路径字符串参数.提示路径名称不可一世string类型,而只能使用char* 类型.路径改成 char*后,将string类型转化为char*.提示string类型直接赋值给char* 错误: error C2440: '=' : cannot convert from 'const char *' to 'char *'更正方法: 将char* 定义为 const char* 即可.代码:string imbagFilePath="G 阅读全文
posted @ 2012-02-14 17:21 gaoxw0511 阅读(6786) 评论(0) 推荐(0) 编辑
摘要: 拷贝: $ cp /cygdrive/d/wget-1.13.tar.xz ~// 拷贝文件/cygdrive/d/wget-1.13.tar.xz到根路径~解压缩:1 *.tar.xz format: 现在很多找到的软件都是tar.xz的格式的,xz 是一个使用 LZMA压缩算法的无损数据压缩文件格式。 和gzip与bzip2一样,同样支持多文件压缩,但是约定不能将多于一个的目标文件压缩进同一个档案文件。 相反,xz通常作为一种归档文件自身的压缩格式,例如使用tar或cpioUnix程序创建的归档。 xz 在GNU coreutils(版本 7.1 或更新) 中被使用。 xz 作为压缩软件包 阅读全文
posted @ 2012-01-18 14:52 gaoxw0511 阅读(845) 评论(0) 推荐(0) 编辑
摘要: (一) 概述string和CString均是字符串模板类,string为标准模板类(STL)定义的字符串类,已经纳入C++标准之中;CString(typedef CStringT > CString)为Visual C++中最常用的字符串类,继承自CSimpleStringT类,主要应用在MFC和ATL编程中,主要数据类型有char(应用于ANSI),wchar_t(unicode),TCHAR(ANSI与unicode均可);char*为C编程中最常用的字符串指针,一般以'\0'为结束标志;(二) 构造string是方便的,可以从几乎所有的字符串构造而来,包括CStr 阅读全文
posted @ 2012-01-04 15:52 gaoxw0511 阅读(2021) 评论(0) 推荐(0) 编辑
摘要: File Names in C++For historical reasons, the IO library uses C-style character strings (Section4.3 , p. 130 ) rather than C++ strings to refer to file names. When we callopen or use a file name as the initializer when creating an fstream object, theargument we pass is a C-style string, not a library 阅读全文
posted @ 2012-01-04 11:30 gaoxw0511 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 在OpenCV中使用Mat处理图像,出现的错误Unhandled exception at 0x0133bc63 .... 0xC0000005: Access violation reading location 0x00000004.描述: 显示完图像,按任意键退出(程序设定),无法退出窗口.错误提示: Unhandled exception at 0x0133bc63 in OpenCV_Mat_Test.exe: 0xC0000005: Access violation reading location 0x00000004.显示窗口始终running, 并弹出访问错误对话框,程序定位 阅读全文
posted @ 2012-01-03 15:22 gaoxw0511 阅读(4463) 评论(2) 推荐(0) 编辑
摘要: 一 :关于指针和堆的内存分配先来介绍一下指针: 指针一种类型,理论上来说它包含其他变量的地址,因此有的书上也叫它:地址变量。既然指针是一个类型,是类型就有大小,在达内的服务器上或者普通的PC机上,都是4个字节大小,里边只是存储了一个变量的地址而已。不管什么类型的指针,char * ,int * ,int (*) ,string * ,float * ,都是说明了本指针所指向的地址空间是什么类型而已,了解了这个基本上所有的问题都好象都变的合理了。在C++中,申请和释放堆中分配的存贮空间,分别使用new和delete的两个运算符来完成:指针类型 指针变量名 = new 指针类型 (初始化); .. 阅读全文
posted @ 2011-12-25 20:07 gaoxw0511 阅读(3570) 评论(0) 推荐(2) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页