OpenCV  2.4.13.6
Open Source Computer Vision
cv::RNG Class Reference

#include <core.hpp>

Public Types

enum  { UNIFORM =0, NORMAL =1 }
 

Public Member Functions

 RNG ()
 
 RNG (uint64 state)
 
unsigned next ()
 updates the state and returns the next 32-bit unsigned integer random number More...
 
 operator uchar ()
 
 operator schar ()
 
 operator ushort ()
 
 operator short ()
 
 operator unsigned ()
 
unsigned operator() (unsigned N)
 returns a random integer sampled uniformly from [0, N). More...
 
unsigned operator() ()
 
 operator int ()
 
 operator float ()
 
 operator double ()
 
int uniform (int a, int b)
 returns uniformly distributed integer random number from [a,b) range More...
 
float uniform (float a, float b)
 returns uniformly distributed floating-point random number from [a,b) range More...
 
double uniform (double a, double b)
 returns uniformly distributed double-precision floating-point random number from [a,b) range More...
 
void fill (InputOutputArray mat, int distType, InputArray a, InputArray b, bool saturateRange=false)
 
double gaussian (double sigma)
 returns Gaussian random variate with mean zero. More...
 

Public Attributes

uint64 state
 

Detailed Description

Random Number Generator

The class implements RNG using Multiply-with-Carry algorithm

Member Enumeration Documentation

§ anonymous enum

anonymous enum
Enumerator
UNIFORM 
NORMAL 

Constructor & Destructor Documentation

§ RNG() [1/2]

cv::RNG::RNG ( )
inline

§ RNG() [2/2]

cv::RNG::RNG ( uint64  state)
inline

Member Function Documentation

§ fill()

void cv::RNG::fill ( InputOutputArray  mat,
int  distType,
InputArray  a,
InputArray  b,
bool  saturateRange = false 
)

§ gaussian()

double cv::RNG::gaussian ( double  sigma)

returns Gaussian random variate with mean zero.

§ next()

unsigned cv::RNG::next ( )
inline

updates the state and returns the next 32-bit unsigned integer random number

§ operator double()

cv::RNG::operator double ( )
inline

§ operator float()

cv::RNG::operator float ( )
inline

§ operator int()

cv::RNG::operator int ( )
inline

§ operator schar()

cv::RNG::operator schar ( )
inline

§ operator short()

cv::RNG::operator short ( )
inline

§ operator uchar()

cv::RNG::operator uchar ( )
inline

§ operator unsigned()

cv::RNG::operator unsigned ( )
inline

§ operator ushort()

cv::RNG::operator ushort ( )
inline

§ operator()() [1/2]

unsigned cv::RNG::operator() ( unsigned  N)
inline

returns a random integer sampled uniformly from [0, N).

§ operator()() [2/2]

unsigned cv::RNG::operator() ( )
inline

§ uniform() [1/3]

int cv::RNG::uniform ( int  a,
int  b 
)
inline

returns uniformly distributed integer random number from [a,b) range

§ uniform() [2/3]

float cv::RNG::uniform ( float  a,
float  b 
)
inline

returns uniformly distributed floating-point random number from [a,b) range

§ uniform() [3/3]

double cv::RNG::uniform ( double  a,
double  b 
)
inline

returns uniformly distributed double-precision floating-point random number from [a,b) range

Member Data Documentation

§ state

uint64 cv::RNG::state

The documentation for this class was generated from the following files: