上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: 对于图像中的某一像素点 P(x, y), 在我们正常的坐标系中,x代表其横坐标,y代表其纵坐标,而在opencv的函数 cvGet2D()与cvSet2D() 中,却行不通。cvGet2D() 的函数原型是 : CvScalar cvGet2D (const CvArr * arr, int idx0, int idx1); 函数返回的是一个CvScalar 容器,其参数中也有两个方向的坐标,但跟我们平常习惯的坐标不一样的是,idx0代表是的行,即高度,对应于我们平常坐标系的y, idx1代表的是列,即宽度,对应于我们平常坐标系的x,cvSet2D() 也类似。所以在使用cvSet2D() 与 阅读全文
posted @ 2011-08-25 00:24 大有|元亨 阅读(433) 评论(0) 推荐(0)
摘要: 原本用宏定义包起来的代码类似如下:#ifndef A// codes#endif // A现在要加入一个宏定义 B,实现类似这样的条件判断(显然实际上这样是不行的):#ifndef A && ifdef B其实应该这样:#if (!defined A) && (defined B)// codes#endif // !A && B这就修正了之前一直以为的“既生 #ifdef,何生 #if defined”的思维,其实还是有差别的。trackback:http://wutiam.net/2009/08/logical-and-or-operatio 阅读全文
posted @ 2011-08-24 23:21 大有|元亨 阅读(727) 评论(1) 推荐(0)
摘要: cvMinMaxLoc()找出图片或一组数据中最大值及最小值的数据,以及最大值及最小值的位置,第一个引数为输入IplImage资料结构或CvMat资料结构,第二个引数为输出最小值double型别数据,第三个引数为输出最大值double型别数据,第四个引数为输出最小值位置CvPoint资料结构,第五个引数为输出最大值位置CvPoint资料结构.找出图片或一组数据中最大值及最小值的数据,以及最大值及最小值的位置,第一个引数为输入IplImage资料结构或CvMat资料结构,第二个引数为输出最小值double型别数据,第三个引数为输出最大值double型别数据,第四个引数为输出最小值位置CvPoin 阅读全文
posted @ 2011-08-24 12:00 大有|元亨 阅读(1370) 评论(0) 推荐(0)
摘要: Given Summed Input:x =Instead ofthreshold, and fire/not fire,we could havecontinuousoutput y according to thesigmoidfunction:Noteeand itsproperties.As x goes to minus infinity, y goes to 0 (tends not to fire).As x goes to infinity, y goes to 1 (tends to fire):At x=0, y=1/2More threshold-likeWe can m 阅读全文
posted @ 2011-08-24 11:58 大有|元亨 阅读(1657) 评论(0) 推荐(0)
摘要: 新函数用红色显示,程序为:#include <highgui.h>#include <cv.h>#include <iostream.h>void main(){IplImage * src=cvLoadImage("baboon.jpg",-1);IplImage * dst;CvRect roi_rect_src;CvRect roi_rect_dst;cvNamedWindow("src",CV_WINDOW_AUTOSIZE);cvMoveWindow("src",200,200); //设 阅读全文
posted @ 2011-08-24 11:57 大有|元亨 阅读(2073) 评论(0) 推荐(0)
摘要: 一、基础 对于彩色转灰度,有一个很著名的心理学公式: Gray = R*0.299 + G*0.587 + B*0.114二、整数算法 而实际应用时,希望避免低速的浮点运算,所以需要整数算法。 注意到系数都是3位精度的没有,我们可以将它们缩放1000倍来实现整数运算算法: Gray = (R*299 + G*587 + B*114 + 500) / 1000 RGB一般是8位精度,现在缩放1000倍,所以上面的运算是32位整型的运算。注意后面那个除法是整数除法,所以需要加上500来实现四舍五入。 就是由于该算法需要32位运算,所以该公式的另一个变种很流行: Gray = (R*30 ... 阅读全文
posted @ 2011-08-24 09:51 大有|元亨 阅读(559) 评论(0) 推荐(0)
摘要: https://github.com/http://sourceforge.net/http://www.codeproject.com/http://www.pudn.com/http://www.hackchina.com/http://www.codesoso.comhttp://fayaa.com/updating... 阅读全文
posted @ 2011-08-24 04:25 大有|元亨 阅读(308) 评论(0) 推荐(0)
摘要: 1 /* 2 * Timer Class 3 * By Danny Battison 4 * gabehabe@hotmail.com 5 */ 6 7 #include <ctime> 8 9 class CTimer10 {11 public: // everything is public for ease of access12 // begin/end variables13 clock_t begin;14 clock_t end;15 16 // variable declarations used ... 阅读全文
posted @ 2011-08-24 04:24 大有|元亨 阅读(197) 评论(0) 推荐(0)
摘要: https://bilateralfilter.googlecode.com 阅读全文
posted @ 2011-08-24 02:59 大有|元亨 阅读(406) 评论(0) 推荐(0)
摘要: 代码片段,留作日后用。 1 vector<double> GaussianFilter(const vector<double> data, double standard_deviation, int filterlength) 2 { //length of data 3 4 int length = data.size(); 5 6 //position array of filter elements 7 int* position = new int[filterlength]; 8 int middle = filterlength/2; 9 for(int 阅读全文
posted @ 2011-08-24 02:48 大有|元亨 阅读(382) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页