C/C++
文章平均质量分 65
nevermoredanny
这个作者很懒,什么都没留下…
展开
-
BP网络练习(二)
上次用MATLAB做的,这次尝试用C写了下,有待改进! #include #include double daoshu(double p)//求导数函数 { double d; d = 1/p; return d; } int main(int argc,char argv[]) { int n; double P[10] = {4,11,23,34,47,58,62,71,89,原创 2012-03-25 23:07:22 · 988 阅读 · 0 评论 -
二维数组定义以及动态分配空间
下面三种定义形式怎么理解?怎么动态分配空间? (1)、int **Ptr; (2)、int *Ptr[ 5 ]; 我更喜欢写成 int* Prt[5]; (3)、int ( *Ptr )[ 5 ]; 此文引自网上,出处不详,但是觉得非常好。略改了一点。 多维数组一向很难,一般都采用一维数组,但是一旦要用到还真是头疼。 闲话少说,这里我就以三个二维数组的比较来展开讨论:转载 2012-07-23 17:53:47 · 1214 阅读 · 0 评论 -
返回引用的函数
函数可以返回一个引用,将函数声明为返回一个引用主要是为了将该函数用在赋值运算符的左边。 #include using namespace std; int a[] = {2,4,6,8,10,12}; int& index(int i); void main(){ index(3) =16; cout<<index(3)<<endl; } int& index(int i){ retur原创 2012-06-30 09:47:20 · 913 阅读 · 1 评论 -
Using the Singleton design pattern
《Using a Controller to communicate with processing modules》在MFC框架中实现的,本文将把同样的图像处理功能在Qt下实现。 Qt GUI项目的创建,在以前的文章中已经描述过,这里不再做描述; mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include原创 2012-05-31 16:49:28 · 1352 阅读 · 0 评论 -
Creating a GUI application using Qt
Create New Project... and choose Qt GUI Application Specifying the OpenCV library files and header files location (with extension .pro) #------------------------------------------------- # #原创 2012-05-29 19:01:03 · 1304 阅读 · 0 评论 -
Using a Controller to communicate with processing modules
Create a simple dialog-based application with two button,one to select an image and one to start the processing Now,we will first add a button that will allow us to select the file that co原创 2012-05-07 12:29:27 · 1368 阅读 · 1 评论 -
C++笔记:迭代器
http://ceeji.net/blog/cpp-learn-iterator/ 文章作者是 Ceeji(文章中注明为转载的除外) 迭代器的概念 除了在其它语言中司空见惯的下标法访问容器元素之外,C++ 语言提供了一种全新的方法——迭代器(iterator)来访问容器的元素。迭代器其实类似于引用,指向容器中某一元素。 我个人认为,迭代器的产生,主要是为了统一各类容转载 2012-04-22 22:24:06 · 742 阅读 · 0 评论 -
std::vector : 用法与技巧
http://ceeji.net/blog/cpp-std-vector/ 文章作者是 Ceeji(文章中注明为转载的除外) 介绍 这篇文章的目的是为了介绍std::vector,如何恰当地使用它们的成员函数等操作。本文中还讨论了条件函数和函数指针在迭代算法中使用,如在 remove_if()和for_each()中的使用。通过阅读这篇文章读者应该能够有效地使用vecto转载 2012-04-22 22:22:34 · 930 阅读 · 0 评论 -
Using the Strategy pattern in algorithm design
#include #include class ColorDetector { private: // minimum acceptable distance int minDist; // target color cv::Vec3b target; // image containing resulting binary map cv::Mat result;原创 2012-05-05 17:39:47 · 804 阅读 · 0 评论