1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

ml: add checks of empty train data

This commit is contained in:
Alexander Alekhin
2019-09-22 11:11:08 +00:00
parent eabbe38001
commit fef7fc343e
13 changed files with 33 additions and 11 deletions
+2
View File
@@ -1613,6 +1613,7 @@ public:
bool train( const Ptr<TrainData>& data, int ) CV_OVERRIDE
{
CV_Assert(!data.empty());
clear();
checkParams();
@@ -1739,6 +1740,7 @@ public:
ParamGrid nu_grid, ParamGrid coef_grid, ParamGrid degree_grid,
bool balanced ) CV_OVERRIDE
{
CV_Assert(!data.empty());
checkParams();
int svmType = params.svmType;