摘要: 用c++编写程序,输入两个集合的元素(分别保存到数组,注意一个集合中的元素不能重复),求出它们的并集。例如,有集合a={1,3,5,7,9}, b={1,2,5,4,6},并集c={1,3,5,7,9,2,4,6}。设计时,可以先将一个数组的所有元素存入并集中,对另一个集合的每个元素逐个进行判别:若不属于并集则加入其中我的代码:#include <iostream>#include <algorithm>using namespace std;//检查b是否在数组a中inline bool f1(int *a, int size_a,int b){ if (b < 阅读全文
posted @ 2011-03-05 17:17 hailong 阅读(288) 评论(2) 推荐(0)
摘要: xiaoboalex网友贴的代码,暂时没看,过几天再看下,当是存起来吧:#define NULL 0#include <iostream>using namespace std;void swap(int arr[], int i, int j){ int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp;}void move(int arr[], int s, int e, int& i, int delta){ i += delta; while (i >= s && i <= e && 阅读全文
posted @ 2011-03-03 20:44 hailong 阅读(232) 评论(0) 推荐(0)
摘要: 1. C: Dennis Ritchie于1972年在贝尔实验室开发出来;是一种命令式语言(imperative system language)注:命令式语言又称强制式语言,通过指明一系列可执行的运算及运算的次序来描述计算过程的语言。平时我们用的大多数语言(比如,C,C+,Java,C#,Python等)都是命令式语言。与它相对的是函数式语言(functional language),如Haskell,Lisp。函数式语言更像数学,命令式语言更接近人的思维。2. C的典型特征:1)编译型语言(compiled language)(相对于解释型语言来说) 编译型语言:程序在执行之前需要一个专门 阅读全文
posted @ 2011-03-01 08:54 hailong 阅读(1279) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main(int AC, char **AV){ FILE *fd = fopen("data", "w+"); fprintf(fd, "%x%c", 0x41, '1'); fseek(fd, 0, SEEK_SET); int n; fscanf(fd, "%d", &n); fseek(fd, 0, SEEK_SET); char s[4]; int c = fread(s, 1, sizeof(s), fd); s[c] = 阅读全文
posted @ 2011-03-01 08:34 hailong 阅读(204) 评论(0) 推荐(0)
摘要: 对一帧遥感影像进行专题分类后需要进行分类精度的评价,而进行评价精度的因子有混淆矩阵、总体分类精度、Kappa系数、错分误差、漏分误差、每一类的制图精度和拥护精度。 1、混淆矩阵(ConfusionMatrix): 主要用于比较分类结果和地表真实信息,可以把分类结果的精度显示在一个混淆矩阵里面。混淆矩阵是通过将每个地表真实像元的位置和分类与分类图象中的相应位置和分类像比较计算的。混淆矩阵的每一列代表了一个地表真实分类,每一列中的数值等于地表真实像元在分类图象中对应于相应类别的数量,有像元数和百分比表示两种。 2、总体分类精度(Overall Accuracy): 等于被正确分类的像元总和除以 阅读全文
posted @ 2011-01-06 20:15 hailong 阅读(2036) 评论(0) 推荐(0)
摘要: 平生第一次写论文,何其水也,都说会议很水。但是老师这次让我投的会议却灰常正式,还要先投摘要,审稿都要一个月,正式稿要再弄几个月,这不是消磨时间吗。准备打算找个更加水的会议去投稿。 阅读全文
posted @ 2011-01-05 16:41 hailong 阅读(873) 评论(0) 推荐(0)
摘要: 图像去噪是数字图像处理中的重要环节和步骤。去噪效果的好坏直接影响到后续的图像处理工作如图像分割、边缘检测等。图像信号在产生、传输过程中都可能会受到噪声的污染,一般数字图像系统中的常见噪声主要有:高斯噪声(主要由阻性元器件内部产生)、椒盐噪声(主要是图像切割引起的黑图像上的白点噪声或光电转换过程中产生的泊松噪声)等;目前比较经典的图像去噪算法主要有以下三种:均值滤波算法:也称线性滤波,主要思想为邻域平均法,即用几个像素灰度的平均值来代替每个像素的灰度。有效抑制加性噪声,但容易引起图像模糊,可以对其进行改进,主要避开对景物边缘的平滑处理。中值滤波:基于排序统计理论的一种能有效抑制噪声的非线性平滑滤 阅读全文
posted @ 2011-01-04 11:23 hailong 阅读(84697) 评论(4) 推荐(6)
摘要: 代码 阅读全文
posted @ 2011-01-03 22:38 hailong 阅读(343) 评论(0) 推荐(0)
摘要: 代码 阅读全文
posted @ 2011-01-03 21:09 hailong 阅读(327) 评论(0) 推荐(0)
摘要: 下面说在VS2008下编译BOOST的过程:1.打开VS2008命令符 开始-程序-Microsoft Visual Studio 2008-Visual Studio Tools-Microsoft Visual Studio 2008命令提示符2.pushd D:\boost_1_45_0 这里的路径是你的BOOST路径.3.booststrap.bat 等待N秒.4. dir 这时, 发现有一个 bjam.exe 如果生成失败, 请修改: D:\boost_1_45_0\tools\build\v2\engine\src\build.bat 中, if EXIST "%Prog 阅读全文
posted @ 2011-01-03 11:06 hailong 阅读(282) 评论(0) 推荐(0)
摘要: 代码一步步实现C库,O(∩_∩)O~!但是标准库的实现是这样的[代码]标准库的实现是基于正确、有效、安全基础上写的,从这个代码上可见一斑啊!VS2008内的实现是:[代码] 阅读全文
posted @ 2011-01-02 19:37 hailong 阅读(430) 评论(0) 推荐(0)
摘要: The ctype header is used for testing and converting characters. A control character refersto a character that is not part of the normal printing set. In the ASCII character set, the controlcharacters are the characters from 0 (NUL) through 0x1F (US), and the character 0x7F (DEL). Printable charact 阅读全文
posted @ 2011-01-02 10:44 hailong 阅读(341) 评论(0) 推荐(0)
摘要: The assert header is used for debugging purposes.Macros: assert();External References: NDEBUG2.1.1 assertDeclaration: void assert(int expression);The assert macro allows diagnostic information to be written to the standard error file. If expression evaluates to 0 (false), then the expression, source 阅读全文
posted @ 2011-01-02 10:35 hailong 阅读(338) 评论(0) 推荐(0)
摘要: These preprocessing directives create conditional compiling parameters that control thecompiling of the source code. They must begin on a separate line.Syntax: #if constant_expression #else #endif or #if constant_expression #elif constant_expression #endifThe compiler only compiles the code after t 阅读全文
posted @ 2011-01-02 10:22 hailong 阅读(3122) 评论(0) 推荐(0)
摘要: STL的应用!代码 阅读全文
posted @ 2011-01-01 22:39 hailong 阅读(194) 评论(0) 推荐(0)
摘要: string的妙用:代码 阅读全文
posted @ 2011-01-01 21:55 hailong 阅读(208) 评论(1) 推荐(0)
摘要: /* Copyright (C) 1999 Lucent Technologies *//* From 'Programming Pearls' by Jon Bentley *//* bitsort.c -- bitmap sort from Column 1 * Sort distinct integers in the range [0..N-1] */#include <stdio.... 阅读全文
posted @ 2010-12-27 22:39 hailong 阅读(221) 评论(0) 推荐(0)
摘要: 1.1 OrganizationThis software guide is divided into several parts, each of which is further divided into several chapters.PartI is a general introduction to OTB, with—in the next chapter—a description of how to install theORFEO Toolbox on your computer. PartI also introduces basic system concepts su 阅读全文
posted @ 2010-12-27 14:21 hailong 阅读(382) 评论(0) 推荐(0)
摘要: 貌似这本书灰常经典啊,呵呵! 阅读全文
posted @ 2010-12-26 16:23 hailong 阅读(212) 评论(0) 推荐(0)
摘要: ”谈到搜索代码,借鉴前人的劳动,有几个小tricks, 其中之一是选择代码搜索网站,如http://www.koders.com/,http://www.google.com/codesearchhttp://search.ask.com/。还有一个tricks 搜索关键字+语言,如在GOOGLE里键入: segmetation matlab,会出现很多用MATLAB语言写的分割程序。此外GOOLE的论坛、网景公司的Open Directory Project、Mathtool 公司的工具集、MATLAB 公司 File Exchange Corner 以及 SOURCEFORGE都可以找到很 阅读全文
posted @ 2010-12-25 21:12 hailong 阅读(487) 评论(0) 推荐(0)
摘要: 1. 区域标定算法http://www.codersource.net/csharp_labelling_connected_components.aspx2. 区域内特征不变几何特性提取算法http://www.codersource.net/csharp_calculating_rts_invariant_moments.aspx(1)计算图像函数的(p+q)阶距private void calcAreaCenter(){double momentV=0;double momentH=0;int val;unsafe{byte*p=(byte*)(void*)ptr;for (int ro 阅读全文
posted @ 2010-12-25 21:05 hailong 阅读(636) 评论(0) 推荐(0)
摘要: 最烦的事情莫过于每年的遥感图像处理软件的测评了,这个月逃不掉了,只好坐软件开发方面的工作,其实我自己好喜欢研究算法而不是成熟算法的实现。今天下午和晚上实现了二值和灰度图象的形态学滤波算法的实现。 其中二值图像部分暂且用MATLAB实现的,灰度图部分采用了C#。文献参考:   (1)数字图像处理(MATLAB版)   (2)http://www.codeproject.com/cs/media/Image_Processing_Lab.asp 实现的很丑陋,都不好意思贴出来了:(function out = mydialate;%(inimg, structure)in = imread('bi 阅读全文
posted @ 2010-12-25 21:04 hailong 阅读(1099) 评论(0) 推荐(0)
摘要: % Find a good threshold automatically, using the isodata algorithm (Ridler% and Calvard 1978)%% Example:% vImage = Image(:);% [n xout]=hist(vImage, <nb_of_bins>);% threshold = isodata(n, xout)%... 阅读全文
posted @ 2010-12-25 21:03 hailong 阅读(486) 评论(0) 推荐(0)
摘要: % Question No: 8% Consider a binary image composed of small blobs. Segmenting the circular% blobs using% a) Distance Transform% b) Watershed Transformfunction watersd(x)f=imread(x);bw=im2bw(f,graythre... 阅读全文
posted @ 2010-12-25 21:01 hailong 阅读(4971) 评论(0) 推荐(0)
摘要: function [mu,mask]=kmeans(ima,k)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% kmeans image segmentation%% Input:% ima: grey color image% k: Number of classes% Output:% mu: vector of ... 阅读全文
posted @ 2010-12-25 21:01 hailong 阅读(349) 评论(0) 推荐(1)
摘要: 代码 阅读全文
posted @ 2010-12-25 20:59 hailong 阅读(422) 评论(0) 推荐(0)
摘要: 之一 1。由点到面。选工作实践中的疑点,热点,由一个小枝节,检索较全的文献,一般近期的20 篇左右已经相当多了。之所以不必在意3年以前的,是因为知识更新非常快,且网上能查到的多为近几年的全文。学习别人是怎么发现解决问题的。知道目前对这个问题的共同看法,和分歧。然后,扩展开,根据兴趣和研究的目的,知道,在研究的领域:谁的文章被引用的次数多,谁的文章最多最新最有启发性。去图书馆找他的文章看全文。逐步扩展自己的视野,构建个人的专业知识结构和看法。2。由杂到精。有了一定的知识基础以后,对于繁杂的文献,要有个人的判断。追踪某个专题、某个专家的研究进展,比较对于同一专题的论点的发展,掌握其新的方法或新结论 阅读全文
posted @ 2010-12-25 20:56 hailong 阅读(303) 评论(0) 推荐(0)
摘要: Finding MATLAB Source Code And Tools Having read this log so far, you're probably pretty impressed, but thinking, "This is great stuff- really great stuff, but where else can I find MATLAB source code and tools for data mining?" There are four basic sources:1. General Web Search EnginesTry searching 阅读全文
posted @ 2010-12-25 20:52 hailong 阅读(622) 评论(0) 推荐(0)
摘要: Dear ×,I am sorry if I disturb you, and I am a Ph.D studentwith a great interest in texture analysis. I have just read one of your papers titled "×", and I am impressed by your segmentation result. Of couse, you have done a perfect job.Though it is easy to understand the basic ideas in your paper, I 阅读全文
posted @ 2010-12-25 20:49 hailong 阅读(639) 评论(0) 推荐(0)
摘要: OTBis a C++ library for high resolution remote sensing image processing. It is developped by CNES in the frame of the ORFEO program.About OTB!Orfeo ToolboxLast Updated on Sunday, 01 March 2009 15:49Written by AdministratorWednesday, 18 February 2009 14:14In the frame of the Methodological Part of th 阅读全文
posted @ 2010-12-25 20:37 hailong 阅读(2191) 评论(0) 推荐(0)