mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
ml: update checks
This commit is contained in:
parent
b9b19185bc
commit
0bdbc745c4
@ -479,7 +479,7 @@ public:
|
||||
float predict( InputArray samples, OutputArray results, int flags ) const CV_OVERRIDE
|
||||
{
|
||||
CV_TRACE_FUNCTION();
|
||||
CV_Assert( samples.cols() == getVarCount() && samples.type() == CV_32F );
|
||||
CV_CheckEQ(samples.cols(), getVarCount(), "");
|
||||
return impl.predict(samples, results, flags);
|
||||
}
|
||||
|
||||
|
@ -1701,6 +1701,9 @@ void DTreesImpl::readParams( const FileNode& fn )
|
||||
/*int cat_var_count = (int)fn["cat_var_count"];
|
||||
int ord_var_count = (int)fn["ord_var_count"];*/
|
||||
|
||||
if (varAll <= 0)
|
||||
CV_Error(Error::StsParseError, "The field \"var_all\" of DTree classifier is missing or non-positive");
|
||||
|
||||
FileNode tparams_node = fn["training_params"];
|
||||
|
||||
TreeParams params0 = TreeParams();
|
||||
|
Loading…
Reference in New Issue
Block a user