openCV(3) - 임의 수 생성 사용

2131 단어 openCV
코드를 보면 얼마 안 남았어요.
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include 
#include
#include 
#include 
#include 

using namespace cv;
using namespace std;

int main()
{
    Mat image(600, 600, CV_8UC3);

    RNG rng((unsigned)time(NULL));//                 rng,        。      #include
    //RNG &rng = theRNG();//              

    double x = rng.uniform((double)0, (double)255);//    0-255   double  ,        
    float y = rng.uniform(0.f, 255.f);
    int z = rng.uniform(0, 255);
    cout << x << endl << y << endl << z <"pause");
    return 0;
}

상세 참조 블로그 주소http://blog.csdn.net/bella_yux/article/details/49717083

좋은 웹페이지 즐겨찾기