
������
|
|
-
RNG��OpenCV�е������������࣬�䶨����core.hpp�У�
123456789101112131415161718192021222324252627282930313233class CV_EXPORTS RNG{public:enum { UNIFORM=0, NORMAL=1 };RNG();RNG(uint64 _state);//! updates the state and returns the next 32-bit unsigned integer random numberunsigned next();operator uchar();operator schar();operator ushort();operator short();operator unsigned();//! returns a random integer sampled uniformly from [0, N).unsigned operator()(unsigned N);unsigned operator ()();operator int();operator float();operator double();//! returns uniformly distributed integer random number from [a,b) rangeint uniform(int a, int b);//! returns uniformly distributed floating-point random number from [a,b) rangefloat uniform(float a, float b);//! returns uniformly distributed double-precision floating-point random number from [a,b) rangedouble uniform(double a, double b);void fill( InputOutputArray mat, int distType, InputArray a, InputArray b );//! returns Gaussian random variate with mean zero.double gaussian(double sigma);uint64 state;};�ṩ�������������������ȷֲ���uniform)��˹��̬�ֲ���gaussian��������ʹ�õ��������ֲ������������ֲ���ʾ���ȷֲ����������ޡ�
RNG rng(0xFFFFFFFF);�е�0xFFFFFFFF��ʾ��ʼ������ֵ�� -
Mat������ʼ����
1Mat image = Mat::zeros(height, width, CV_8UC3); -
line���ڻ���ֱ�ߣ�Ҳ������core.hpp�У�
12//! draws the line segment (pt1, pt2) in the imageCV_EXPORTS_W void line(Mat& img, Point pt1, Point pt2, const Scalar& color,int thickness=1, int lineType=8, int shift=0);����������ͼ����circle��ellipse��rectangle��ҲҲ���Դ�core.hpp���ҵ�ԭ�ͣ����õ�ʱ����ѧϰ��
-
putText���Խ��������ӵ�ͼƬ�У�
12345//! renders text string in the imageCV_EXPORTS_W void putText( Mat& img, const string& text, Point org,int fontFace, double fontScale, Scalar color,int thickness=1, int linetype=8,bool bottomLeftOrigin=false );����һ������img����Ҫ�������ֵ�ͼ�ڶ�����������Ҫ���ӵ����֣���������”OpenCV”��
-
������ɫ����ɫ����RGB��ͨ����ʾ�ģ��������溯������ɫ���������Ͷ���Scalar���͡�Scalar��OpenCV�����������������䳤������Ϊ4ͨ����Դ������
1Scalar(icolor&0xFF, (icolor>>8)&0xFF, (icolor>>16)&0xFF);����������ֵȡ���ֱ���ΪRGB����ͨ������ɫֵ��
��

������������

���ӡ�OpenCV�����ֺ�Ч��




近期评论