OpenCV  2.4.13.7
Open Source Computer Vision
cv::ocl::KNearestNeighbour Class Reference

#include <ocl.hpp>

Inheritance diagram for cv::ocl::KNearestNeighbour:
CvKNearest CvStatModel

Public Member Functions

 KNearestNeighbour ()
 
 ~KNearestNeighbour ()
 
bool train (const Mat &trainData, Mat &labels, Mat &sampleIdx=Mat().setTo(Scalar::all(0)), bool isRegression=false, int max_k=32, bool updateBase=false)
 
void clear ()
 
void find_nearest (const oclMat &samples, int k, oclMat &lables)
 
- Public Member Functions inherited from CvKNearest
 CvKNearest ()
 
virtual ~CvKNearest ()
 
 CvKNearest (const CvMat *trainData, const CvMat *responses, const CvMat *sampleIdx=0, bool isRegression=false, int max_k=32)
 
virtual bool train (const CvMat *trainData, const CvMat *responses, const CvMat *sampleIdx=0, bool is_regression=false, int maxK=32, bool updateBase=false)
 
virtual float find_nearest (const CvMat *samples, int k, CV_OUT CvMat *results=0, const float **neighbors=0, CV_OUT CvMat *neighborResponses=0, CV_OUT CvMat *dist=0) const
 
 CvKNearest (const cv::Mat &trainData, const cv::Mat &responses, const cv::Mat &sampleIdx=cv::Mat(), bool isRegression=false, int max_k=32)
 
virtual bool train (const cv::Mat &trainData, const cv::Mat &responses, const cv::Mat &sampleIdx=cv::Mat(), bool isRegression=false, int maxK=32, bool updateBase=false)
 
virtual float find_nearest (const cv::Mat &samples, int k, cv::Mat *results=0, const float **neighbors=0, cv::Mat *neighborResponses=0, cv::Mat *dist=0) const
 
virtual float find_nearest (const cv::Mat &samples, int k, CV_OUT cv::Mat &results, CV_OUT cv::Mat &neighborResponses, CV_OUT cv::Mat &dists) const
 
int get_max_k () const
 
int get_var_count () const
 
int get_sample_count () const
 
bool is_regression () const
 
virtual float write_results (int k, int k1, int start, int end, const float *neighbor_responses, const float *dist, CvMat *_results, CvMat *_neighbor_responses, CvMat *_dist, Cv32suf *sort_buf) const
 
virtual void find_neighbors_direct (const CvMat *_samples, int k, int start, int end, float *neighbor_responses, const float **neighbors, float *dist) const
 
- Public Member Functions inherited from CvStatModel
 CvStatModel ()
 
virtual ~CvStatModel ()
 
virtual void save (const char *filename, const char *name=0) const
 
virtual void load (const char *filename, const char *name=0)
 
virtual void write (CvFileStorage *storage, const char *name) const
 
virtual void read (CvFileStorage *storage, CvFileNode *node)
 

Additional Inherited Members

- Protected Attributes inherited from CvKNearest
int max_k
 
int var_count
 
int total
 
bool regression
 
CvVectorssamples
 
- Protected Attributes inherited from CvStatModel
const char * default_model_name
 

Detailed Description

***************K Nearest Neighbour*************!

Constructor & Destructor Documentation

§ KNearestNeighbour()

cv::ocl::KNearestNeighbour::KNearestNeighbour ( )

§ ~KNearestNeighbour()

cv::ocl::KNearestNeighbour::~KNearestNeighbour ( )

Member Function Documentation

§ clear()

void cv::ocl::KNearestNeighbour::clear ( )
virtual

Reimplemented from CvKNearest.

§ find_nearest()

void cv::ocl::KNearestNeighbour::find_nearest ( const oclMat samples,
int  k,
oclMat lables 
)

§ train()

bool cv::ocl::KNearestNeighbour::train ( const Mat trainData,
Mat labels,
Mat sampleIdx = Mat().setTo(Scalar::all(0)),
bool  isRegression = false,
int  max_k = 32,
bool  updateBase = false 
)

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