@@ -224,7 +224,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
224
224
void setActivationFunction (int _activ_func, double _f_param1, double _f_param2) CV_OVERRIDE
225
225
{
226
226
if ( _activ_func < 0 || _activ_func > LEAKYRELU)
227
- CV_Error ( CV_StsOutOfRange , " Unknown activation function" );
227
+ CV_Error ( cv::Error::StsOutOfRange , " Unknown activation function" );
228
228
229
229
activ_func = _activ_func;
230
230
@@ -323,7 +323,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
323
323
{
324
324
int n = layer_sizes[i];
325
325
if ( n < 1 + (0 < i && i < l_count-1 ))
326
- CV_Error ( CV_StsOutOfRange ,
326
+ CV_Error ( cv::Error::StsOutOfRange ,
327
327
" there should be at least one input and one output "
328
328
" and every hidden layer must have more than 1 neuron" );
329
329
max_lsize = std::max ( max_lsize, n );
@@ -342,7 +342,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
342
342
float predict ( InputArray _inputs, OutputArray _outputs, int ) const CV_OVERRIDE
343
343
{
344
344
if ( !trained )
345
- CV_Error ( CV_StsError , " The network has not been trained or loaded" );
345
+ CV_Error ( cv::Error::StsError , " The network has not been trained or loaded" );
346
346
347
347
Mat inputs = _inputs.getMat ();
348
348
int type = inputs.type (), l_count = layer_count ();
@@ -791,7 +791,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
791
791
{
792
792
t = t*inv_scale[j*2 ] + inv_scale[2 *j+1 ];
793
793
if ( t < m1 || t > M1 )
794
- CV_Error ( CV_StsOutOfRange ,
794
+ CV_Error ( cv::Error::StsOutOfRange ,
795
795
" Some of new output training vector components run exceed the original range too much" );
796
796
}
797
797
}
@@ -818,25 +818,25 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
818
818
Mat& sample_weights, int flags )
819
819
{
820
820
if ( layer_sizes.empty () )
821
- CV_Error ( CV_StsError ,
821
+ CV_Error ( cv::Error::StsError ,
822
822
" The network has not been created. Use method create or the appropriate constructor" );
823
823
824
824
if ( (inputs.type () != CV_32F && inputs.type () != CV_64F) ||
825
825
inputs.cols != layer_sizes[0 ] )
826
- CV_Error ( CV_StsBadArg ,
826
+ CV_Error ( cv::Error::StsBadArg ,
827
827
" input training data should be a floating-point matrix with "
828
828
" the number of rows equal to the number of training samples and "
829
829
" the number of columns equal to the size of 0-th (input) layer" );
830
830
831
831
if ( (outputs.type () != CV_32F && outputs.type () != CV_64F) ||
832
832
outputs.cols != layer_sizes.back () )
833
- CV_Error ( CV_StsBadArg ,
833
+ CV_Error ( cv::Error::StsBadArg ,
834
834
" output training data should be a floating-point matrix with "
835
835
" the number of rows equal to the number of training samples and "
836
836
" the number of columns equal to the size of last (output) layer" );
837
837
838
838
if ( inputs.rows != outputs.rows )
839
- CV_Error ( CV_StsUnmatchedSizes , " The numbers of input and output samples do not match" );
839
+ CV_Error ( cv::Error::StsUnmatchedSizes , " The numbers of input and output samples do not match" );
840
840
841
841
Mat temp;
842
842
double s = sum (sample_weights)[0 ];
@@ -1324,7 +1324,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
1324
1324
fs << " itePerStep" << params.itePerStep ;
1325
1325
}
1326
1326
else
1327
- CV_Error (CV_StsError , " Unknown training method" );
1327
+ CV_Error (cv::Error::StsError , " Unknown training method" );
1328
1328
1329
1329
fs << " term_criteria" << " {" ;
1330
1330
if ( params.termCrit .type & TermCriteria::EPS )
@@ -1422,7 +1422,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
1422
1422
params.itePerStep = tpn[" itePerStep" ];
1423
1423
}
1424
1424
else
1425
- CV_Error (CV_StsParseError , " Unknown training method (should be BACKPROP or RPROP)" );
1425
+ CV_Error (cv::Error::StsParseError , " Unknown training method (should be BACKPROP or RPROP)" );
1426
1426
1427
1427
FileNode tcn = tpn[" term_criteria" ];
1428
1428
if ( !tcn.empty () )
0 commit comments