1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

refactor: don't use CV_ErrorNoReturn() internally

This commit is contained in:
Alexander Alekhin
2018-04-23 19:02:39 +03:00
parent 4ec456f0a0
commit 576d2dbac0
20 changed files with 60 additions and 62 deletions
+2 -2
View File
@@ -1941,7 +1941,7 @@ Net::Net() : impl(new Net::Impl)
Net Net::readFromModelOptimizer(const String& xml, const String& bin)
{
#ifndef HAVE_INF_ENGINE
CV_ErrorNoReturn(Error::StsError, "Build OpenCV with Inference Engine to enable loading models from Model Optimizer.");
CV_Error(Error::StsError, "Build OpenCV with Inference Engine to enable loading models from Model Optimizer.");
#else
InferenceEngine::CNNNetReader reader;
reader.ReadNetwork(xml);
@@ -2930,7 +2930,7 @@ Net readNet(const String& _model, const String& _config, const String& _framewor
std::swap(model, config);
return readNetFromModelOptimizer(config, model);
}
CV_ErrorNoReturn(Error::StsError, "Cannot determine an origin framework of files: " +
CV_Error(Error::StsError, "Cannot determine an origin framework of files: " +
model + (config.empty() ? "" : ", " + config));
}
@@ -151,7 +151,7 @@ public:
message += " layer parameter does not contain ";
message += parameterName;
message += " parameter.";
CV_ErrorNoReturn(Error::StsBadArg, message);
CV_Error(Error::StsBadArg, message);
}
else
{
@@ -471,12 +471,12 @@ public:
{
int label = it->first;
if (confidenceScores.rows <= label)
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find confidence predictions for label %d", label));
CV_Error_(cv::Error::StsError, ("Could not find confidence predictions for label %d", label));
const std::vector<float>& scores = confidenceScores.row(label);
int locLabel = _shareLocation ? -1 : label;
LabelBBox::const_iterator label_bboxes = decodeBBoxes.find(locLabel);
if (label_bboxes == decodeBBoxes.end())
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", locLabel));
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", locLabel));
const std::vector<int>& indices = it->second;
for (size_t j = 0; j < indices.size(); ++j, ++count)
@@ -507,14 +507,14 @@ public:
if (c == _backgroundLabelId)
continue; // Ignore background class.
if (c >= confidenceScores.rows)
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find confidence predictions for label %d", c));
CV_Error_(cv::Error::StsError, ("Could not find confidence predictions for label %d", c));
const std::vector<float> scores = confidenceScores.row(c);
int label = _shareLocation ? -1 : c;
LabelBBox::const_iterator label_bboxes = decodeBBoxes.find(label);
if (label_bboxes == decodeBBoxes.end())
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
if (_bboxesNormalized)
NMSFast_(label_bboxes->second, scores, _confidenceThreshold, _nmsThreshold, 1.0, _topK,
indices[c], util::caffe_norm_box_overlap);
@@ -532,7 +532,7 @@ public:
int label = it->first;
const std::vector<int>& labelIndices = it->second;
if (label >= confidenceScores.rows)
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
const std::vector<float>& scores = confidenceScores.row(label);
for (size_t j = 0; j < labelIndices.size(); ++j)
{
@@ -645,7 +645,7 @@ public:
decode_bbox.ymax = decode_bbox_center_y + decode_bbox_height * .5;
}
else
CV_ErrorNoReturn(Error::StsBadArg, "Unknown type.");
CV_Error(Error::StsBadArg, "Unknown type.");
if (clip_bbox)
{
@@ -714,7 +714,7 @@ public:
continue; // Ignore background class.
LabelBBox::const_iterator label_loc_preds = loc_preds.find(label);
if (label_loc_preds == loc_preds.end())
CV_ErrorNoReturn_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
CV_Error_(cv::Error::StsError, ("Could not find location predictions for label %d", label));
DecodeBBoxes(prior_bboxes, prior_variances,
code_type, variance_encoded_in_target, clip, clip_bounds,
normalized_bbox, label_loc_preds->second, decode_bboxes[label]);
@@ -89,7 +89,7 @@ public:
if (net.node(i).name() == name)
return net.node(i);
}
CV_ErrorNoReturn(Error::StsParseError, "Input node with name " + name + " not found");
CV_Error(Error::StsParseError, "Input node with name " + name + " not found");
}
// Match TensorFlow subgraph starting from <nodeId> with a set of nodes to be fused.