@@ -224,7 +224,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
224224 void setActivationFunction (int _activ_func, double _f_param1, double _f_param2) CV_OVERRIDE
225225 {
226226 if ( _activ_func < 0 || _activ_func > LEAKYRELU)
227- CV_Error ( CV_StsOutOfRange , " Unknown activation function" );
227+ CV_Error ( cv::Error::StsOutOfRange , " Unknown activation function" );
228228
229229 activ_func = _activ_func;
230230
@@ -323,7 +323,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
323323 {
324324 int n = layer_sizes[i];
325325 if ( n < 1 + (0 < i && i < l_count-1 ))
326- CV_Error ( CV_StsOutOfRange ,
326+ CV_Error ( cv::Error::StsOutOfRange ,
327327 " there should be at least one input and one output "
328328 " and every hidden layer must have more than 1 neuron" );
329329 max_lsize = std::max ( max_lsize, n );
@@ -342,7 +342,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
342342 float predict ( InputArray _inputs, OutputArray _outputs, int ) const CV_OVERRIDE
343343 {
344344 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" );
346346
347347 Mat inputs = _inputs.getMat ();
348348 int type = inputs.type (), l_count = layer_count ();
@@ -791,7 +791,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
791791 {
792792 t = t*inv_scale[j*2 ] + inv_scale[2 *j+1 ];
793793 if ( t < m1 || t > M1 )
794- CV_Error ( CV_StsOutOfRange ,
794+ CV_Error ( cv::Error::StsOutOfRange ,
795795 " Some of new output training vector components run exceed the original range too much" );
796796 }
797797 }
@@ -818,25 +818,25 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
818818 Mat& sample_weights, int flags )
819819 {
820820 if ( layer_sizes.empty () )
821- CV_Error ( CV_StsError ,
821+ CV_Error ( cv::Error::StsError ,
822822 " The network has not been created. Use method create or the appropriate constructor" );
823823
824824 if ( (inputs.type () != CV_32F && inputs.type () != CV_64F) ||
825825 inputs.cols != layer_sizes[0 ] )
826- CV_Error ( CV_StsBadArg ,
826+ CV_Error ( cv::Error::StsBadArg ,
827827 " input training data should be a floating-point matrix with "
828828 " the number of rows equal to the number of training samples and "
829829 " the number of columns equal to the size of 0-th (input) layer" );
830830
831831 if ( (outputs.type () != CV_32F && outputs.type () != CV_64F) ||
832832 outputs.cols != layer_sizes.back () )
833- CV_Error ( CV_StsBadArg ,
833+ CV_Error ( cv::Error::StsBadArg ,
834834 " output training data should be a floating-point matrix with "
835835 " the number of rows equal to the number of training samples and "
836836 " the number of columns equal to the size of last (output) layer" );
837837
838838 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" );
840840
841841 Mat temp;
842842 double s = sum (sample_weights)[0 ];
@@ -1324,7 +1324,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
13241324 fs << " itePerStep" << params.itePerStep ;
13251325 }
13261326 else
1327- CV_Error (CV_StsError , " Unknown training method" );
1327+ CV_Error (cv::Error::StsError , " Unknown training method" );
13281328
13291329 fs << " term_criteria" << " {" ;
13301330 if ( params.termCrit .type & TermCriteria::EPS )
@@ -1422,7 +1422,7 @@ class ANN_MLPImpl CV_FINAL : public ANN_MLP
14221422 params.itePerStep = tpn[" itePerStep" ];
14231423 }
14241424 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)" );
14261426
14271427 FileNode tcn = tpn[" term_criteria" ];
14281428 if ( !tcn.empty () )
0 commit comments