随笔分类 -  C/C++

windows下编译Hugin时的template错误
摘要:Hugin依赖于VIGRA,而VIGRA包含大量的模板,编译Hugin是出现如下的大量错误: "unexpected token(s) preceding ':'; skipping apparent function body" "'vigra::NumericTraits<unsigned ch 阅读全文

posted @ 2016-09-09 16:05 龖龖 阅读(363) 评论(0) 推荐(0)

C++ 类型转换的特殊用法
摘要:C++ 类型转换的特殊用法下面是ossimLsrRay.h中的一个例子/*!* CASTING OPERATOR: ossimEcefRay()* Looks like a constructor for an ossimEcefRay but is an operation on this* ob... 阅读全文

posted @ 2014-05-16 14:09 龖龖 阅读(204) 评论(0) 推荐(0)

ossim中Spot5模型bug修复
摘要:ossim中Spot5模型在读取像素视线角时存在一个严重的bug,导致某些点的视线角提取错误。下面是ossim中getPixelLookAngleX 函数的代码:ossimSpotDimapSupportData::getPixelLookAngleX(const ossim_float64& sample, ossim_float64& pa) const{ ossim_uint32 s = static_cast(sample); getInterpolatedLookAngle(s... 阅读全文

posted @ 2014-02-21 08:38 龖龖 阅读(282) 评论(0) 推荐(0)

多个数值转QString
摘要:int, float, double等数值类型转换为QString的方法1. 用QTextStreamQTextStream类可以用数据流的方式直接将任意多个数值、字符、字符串等传入QString。举例如下:QString strData;double a1 = 3.14;int a2 798;QTextStream(&strData) <<a1 <<"-"<<a2 ;用法还比较简单,但是设置数值类型的格式不太方便。2. 用QString::arg() (推荐)QString::arg()是QString类中的一个重载函数,可以转 阅读全文

posted @ 2013-10-15 17:07 龖龖 阅读(2327) 评论(0) 推荐(0)

Qt (QGis) 中动态布局例子
摘要:QHBoxLayout* classLayout = new QHBoxLayout; QLabel *label1 = new QLabel(tr("选择分类栅格图层:")); mInputClassCombo = new QComboBox(this); classLayout->addWidget(label1); classLayout->addWidget(mInputClassCombo); QHBoxLayout* outputLayout = new QHBoxLayout; QLabel *label2 = new QLabel(tr(&quo 阅读全文

posted @ 2013-05-28 13:55 龖龖 阅读(2788) 评论(0) 推荐(0)

visual studio has encountered an exception .this may be caused by an extension.
摘要:It seems this error was due to extension. What's your Visual Studio version?Could you please disable or remove all of your extensions?After that, please follow some common steps to reinstall templates:1)Please open Windows Explorer, and navigate to <Visual Studio Installation Path>\Common7 阅读全文

posted @ 2013-01-05 14:52 龖龖 阅读(1914) 评论(0) 推荐(0)

Qt中int转换成QString
摘要:有两种方法1.使用QString QString::number ( long n, int base = 10 ) [static]如:long a = 63; QString s = QString::number(a, 10); // s == "63" QString t = QString::number(a, 16).toUpper(); // t == "3F"2.使用long a = 63; QString s = QString("%1").arg(a);推荐第1种用法from:http://blog.163.com 阅读全文

posted @ 2012-12-21 08:56 龖龖 阅读(4743) 评论(0) 推荐(0)

Opencv无法调用SURF算子
摘要:Opencv无法调用SURF算子的问题:OpenCV Error: The function/feature is not implemented (OpenCV was built without SURF support) in unknown function解决方法:调用前执行cv::initModule_nonfree(); 阅读全文

posted @ 2012-11-30 15:50 龖龖 阅读(2148) 评论(0) 推荐(0)

ossim中改变图像处理的块大小
摘要:ossim中默认图像处理的块大小是64*64,如果要修改为自定义大小,可以使用rspfImageSourceSequencer进行修改,具体方式如下:vector<ossim_uint32> outBandList;outBandList.push_back(1);ossimBandSelector* theBandSelector = new ossimBandSelector;theBandSelector->connectMyInputTo(0, handler);theBandSelector->setOutputBandList(outBandList);fi 阅读全文

posted @ 2012-11-30 08:47 龖龖 阅读(255) 评论(0) 推荐(0)

fatal error C1189: #error : The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.
摘要:错误:fatal error C1189: #error : The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.解决方法:add "_XKEYCHECK_H" in Preprocessor Definitions 阅读全文

posted @ 2012-11-22 17:48 龖龖 阅读(6993) 评论(0) 推荐(0)

带命令行的应用程序的调试
摘要:工程->属性->调试->命令参数中填写命令行内容,然后运行调试即可。 阅读全文

posted @ 2012-11-19 10:54 龖龖 阅读(184) 评论(0) 推荐(0)

Visual Studio 2012调试时看不到变量的值
摘要:情况一:Visual Studio 2012调试时看不到QString字符串的值,仅显示第一个字符的ASCII码,很不方便。而在2008版本中可以正常显示,很奇怪。其实稍作设置就可以了,如下图,在“Tool->Option->Debuggin->Edit and Continue”中勾选“Enable native Edit and Continue”就O啦~情况二:将Enable Intrinsic Functions 设置为No 阅读全文

posted @ 2012-10-26 16:31 龖龖 阅读(14240) 评论(1) 推荐(0)

Visual Studio 新版本中VC++ Directories的设置
摘要:以往,在Visual Studio 2008中,VC++ Directories的设置位于:Tools | Options | Projects and Solutions | VC++ Directories在Visual Studio 2010和Visual Studio 2012中,VC++ Directories的位置变了。如下:View | Other Window | Property Manager,然后,譬如我们要设置Win32 Debug配置下的VC++ Directories,就双击Microsoft.Cpp.Win32.user,然后就看到我们所熟悉的VC++ Direc 阅读全文

posted @ 2012-10-25 08:53 龖龖 阅读(723) 评论(0) 推荐(0)

\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props 错误
摘要:del %USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props 阅读全文

posted @ 2012-10-19 15:37 龖龖 阅读(599) 评论(0) 推荐(0)

Visual Studio Version Interoperability
摘要:Visual Studio Version InteroperabilityIntroductionMicrosoft officially released Visual Studio 2008 in February 2008 and Visual Studio 2010 in May 2010. However, many users were disappointed that the file format for the older Visual Studio "project files" was not backwards compatible.If you 阅读全文

posted @ 2012-10-13 13:42 龖龖 阅读(773) 评论(0) 推荐(0)

cv::Mat与IplImage 的相互转换
摘要:From IplImage or CvMat to cv::Mat:from definition of cv::Mat// converts old-style CvMat to the new matrix; the data is not copied bydefaultMat(const CvMat* m, bool copyData=false);// converts old-style IplImage to the new matrix; the data is not copied bydefaultMat(const IplImage* img, bool copyData 阅读全文

posted @ 2012-10-11 17:01 龖龖 阅读(2772) 评论(0) 推荐(0)

error LNK2001: unresolved external symbol "*******__cdecl****"
摘要:error LNK2001: unresolved external symbol "*******__cdecl****"这种连接错误是在C++文件里调用C程序导致的,解决方法是:In the header file for C files (ANSI C), add the followingprior to and after function prototypes.#ifdef __cplusplusextern "C"{#endif//////////////////////code...../////////////////////#ifde 阅读全文

posted @ 2012-09-21 21:04 龖龖 阅读(363) 评论(0) 推荐(0)

#pragma warning(disable:4244)
摘要:#pragma warning(disable:4244)可以去掉讨厌的 "see reference to function template instantiation..." 阅读全文

posted @ 2012-09-03 11:07 龖龖 阅读(606) 评论(0) 推荐(0)

error LNK2019: unresolved external symbol _va_end referenced in function _fatal_error
摘要:1>Linking...1>utils.obj : error LNK2019: unresolved external symbol _va_end referenced in function _fatal_error1>utils.obj : error LNK2019: unresolved external symbol _va_start referenced in function _fatal_error1>.\Release/dspFeat.exe : fatal error LNK1120: 2 unresolved externals1>Bu 阅读全文

posted @ 2012-08-28 18:38 龖龖 阅读(1377) 评论(0) 推荐(0)

QGIS二次开发教程(一)
摘要:QGIS二次开发教程一——用QGIS的API编写自定义应用程序教程一:使用QGIS Canvas API编写一个简单的地图显示程序参考翻译自Quantum GIS官方网站事实上,我们并不是所有的时候都需要一个庞大、完整的GIS桌面应用程序,有时候我们的应用程序主要用于其他的目的,而我们所需要的只是在用程序中添加一个具有地图显示功能的小工具。譬如一个带有地图显示功能的数据库前端。接下来我们就创建一个简单的地图小工具,功能仅仅是加载一个shape文件并用随机颜色加以显示。但是通过这个简单的例子你应该能体会到将QGIS作为一个嵌入式的地图组件的潜力。首先,在我们的应用程序里添加必要的includes 阅读全文

posted @ 2012-05-25 18:18 龖龖 阅读(21035) 评论(1) 推荐(0)

导航