9 class CSamplesAccumulator;
56 DllExport
void reset(
void);
57 DllExport
void save(
const std::string &path,
const std::string &name = std::string(),
short idx = -1)
const;
58 DllExport
void load(
const std::string &path,
const std::string &name = std::string(),
short idx = -1);
60 DllExport
void addFeatureVec(
const Mat &featureVector, byte gt);
62 DllExport
void train(
bool doClean =
false);
void loadFile(FILE *pFile)
Loads the random model from the file.
OpenCV k-Nearest Neighbors parameters.
Ptr< ml::KNearest > m_pKNN
k-Nearest Neighbors
void reset(void)
Resets class variables.
size_t maxNeighbors
Max number of neighbors to be used for calculating potentials.
void save(const std::string &path, const std::string &name=std::string(), short idx=-1) const
Saves the training data.
void init(TrainNodeCvKNNParams params)
const TrainNodeCvKNNParams TRAIN_NODE_CV_KNN_PARAMS_DEFAULT
void addFeatureVec(const Mat &featureVector, byte gt)
Adds new feature vector.
OpenCV Nearest Neighbor training class.
void train(bool doClean=false)
Random model training.
struct DirectGraphicalModels::TrainNodeCvKNNParams TrainNodeCvKNNParams
OpenCV k-Nearest Neighbors parameters.
float bias
Regularization CRF parameter: bias is added to all potential values.
Samples accumulator abstract class.
size_t maxSamples
Maximum number of samples to be used in training. 0 means using all the samples.
void load(const std::string &path, const std::string &name=std::string(), short idx=-1)
Loads the training data.
Base abstract class for node potentials training.
void calculateNodePotentials(const Mat &featureVector, Mat &potential, Mat &mask) const
Calculates the node potential, based on the feature vector.
CSamplesAccumulator * m_pSamplesAcc
Samples Accumulator.
virtual ~CTrainNodeCvKNN(void)
TrainNodeCvKNNParams m_params
CTrainNodeCvKNN(byte nStates, word nFeatures, TrainNodeCvKNNParams params=TRAIN_NODE_CV_KNN_PARAMS_DEFAULT)
Constructor.
TrainNodeCvKNNParams(float _bias, size_t _maxNeighbors, size_t _maxSamples)
void saveFile(FILE *pFile) const
Saves the random model into the file.