mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merged the trunk r8595:8668 (except iOS and new gpu functionality)
This commit is contained in:
@@ -488,7 +488,7 @@ public:
|
||||
bool balanced=false );
|
||||
|
||||
virtual float predict( const CvMat* sample, bool returnDFVal=false ) const;
|
||||
virtual float predict( const CvMat* samples, CvMat* results ) const;
|
||||
virtual float predict( const CvMat* samples, CV_OUT CvMat* results ) const;
|
||||
|
||||
#ifndef SWIG
|
||||
CV_WRAP CvSVM( const cv::Mat& trainData, const cv::Mat& responses,
|
||||
@@ -510,6 +510,7 @@ public:
|
||||
CvParamGrid degreeGrid = CvSVM::get_default_grid(CvSVM::DEGREE),
|
||||
bool balanced=false);
|
||||
CV_WRAP virtual float predict( const cv::Mat& sample, bool returnDFVal=false ) const;
|
||||
CV_WRAP_AS(predict_all) void predict( cv::InputArray samples, cv::OutputArray results ) const;
|
||||
#endif
|
||||
|
||||
CV_WRAP virtual int get_support_vector_count() const;
|
||||
|
||||
@@ -1250,7 +1250,7 @@ CvBoost::update_weights( CvBoostTree* tree )
|
||||
if( have_subsample )
|
||||
{
|
||||
float* values = (float*)cur_buf_pos;
|
||||
cur_buf_pos = (uchar*)(values + data->buf->step);
|
||||
cur_buf_pos = (uchar*)(values + data->buf->cols);
|
||||
uchar* missing = cur_buf_pos;
|
||||
cur_buf_pos = missing + data->buf->step;
|
||||
CvMat _sample, _mask;
|
||||
|
||||
@@ -2124,6 +2124,12 @@ float CvSVM::predict(const CvMat* samples, CV_OUT CvMat* results) const
|
||||
return result;
|
||||
}
|
||||
|
||||
void CvSVM::predict( cv::InputArray _samples, cv::OutputArray _results ) const
|
||||
{
|
||||
_results.create(_samples.size().height, 1, CV_32F);
|
||||
CvMat samples = _samples.getMat(), results = _results.getMat();
|
||||
predict(&samples, &results);
|
||||
}
|
||||
|
||||
CvSVM::CvSVM( const Mat& _train_data, const Mat& _responses,
|
||||
const Mat& _var_idx, const Mat& _sample_idx, CvSVMParams _params )
|
||||
|
||||
Reference in New Issue
Block a user