30 #ifndef OPENCV_FLANN_SAMPLING_H_
31 #define OPENCV_FLANN_SAMPLING_H_
42 Matrix<T> random_sample(Matrix<T>& srcMatrix,
long size,
bool remove =
false)
44 Matrix<T> newSet(
new T[
size * srcMatrix.cols],
size,srcMatrix.cols);
47 for (
long i=0; i<
size; ++i) {
48 long r = rand_int((
int)(srcMatrix.rows-i));
53 src = srcMatrix[srcMatrix.rows-i-1];
59 srcMatrix.rows -=
size;
65 Matrix<T> random_sample(
const Matrix<T>& srcMatrix,
size_t size)
67 UniqueRandom
rand((
int)srcMatrix.rows);
68 Matrix<T> newSet(
new T[
size * srcMatrix.cols],
size,srcMatrix.cols);
71 for (
size_t i=0; i<
size; ++i) {
InputArrayOfArrays InputArrayOfArrays InputOutputArray InputOutputArray InputOutputArray InputOutputArray Size InputOutputArray InputOutputArray T
Definition: calib3d.hpp:1867
CvSize size
Definition: core_c.h:112
CvRect r
Definition: imgproc_c.h:984