Commit 8277ca6a authored by Alexander Alekhin's avatar Alexander Alekhin

opencv-core: avoid using of multi-argument CV_Assert()

replace to CV_Assert_N()
parent f368d83f
...@@ -37,8 +37,11 @@ void createPlaneMesh(const String& name, const Size2f& size, InputArray image) ...@@ -37,8 +37,11 @@ void createPlaneMesh(const String& name, const Size2f& size, InputArray image)
void createPointCloudMesh(const String& name, InputArray vertices, InputArray colors) void createPointCloudMesh(const String& name, InputArray vertices, InputArray colors)
{ {
int color_type = colors.type(); int color_type = colors.type();
CV_Assert(_app, vertices.type() == CV_32FC3 && vertices.isContinuous(), CV_Assert(_app);
colors.empty() || color_type == CV_8UC3 || color_type == CV_8UC4); CV_CheckTypeEQ(vertices.type(), CV_32FC3, "")
CV_Assert(vertices.isContinuous());
if (!colors.empty())
CV_CheckType(color_type, color_type == CV_8UC3 || color_type == CV_8UC4);
// material // material
MaterialPtr mat = MaterialManager::getSingleton().create(name, RESOURCEGROUP_NAME); MaterialPtr mat = MaterialManager::getSingleton().create(name, RESOURCEGROUP_NAME);
...@@ -101,7 +104,7 @@ void createPointCloudMesh(const String& name, InputArray vertices, InputArray co ...@@ -101,7 +104,7 @@ void createPointCloudMesh(const String& name, InputArray vertices, InputArray co
void createGridMesh(const String& name, const Size2f& size, const Size& segments) void createGridMesh(const String& name, const Size2f& size, const Size& segments)
{ {
CV_Assert(_app, !segments.empty()); CV_Assert_N(_app, !segments.empty());
// material // material
MaterialPtr mat = MaterialManager::getSingleton().create(name, RESOURCEGROUP_NAME); MaterialPtr mat = MaterialManager::getSingleton().create(name, RESOURCEGROUP_NAME);
......
...@@ -67,8 +67,8 @@ void _createTexture(const String& name, Mat image) ...@@ -67,8 +67,8 @@ void _createTexture(const String& name, Mat image)
static void _convertRT(InputArray rot, InputArray tvec, Quaternion& q, Vector3& t, bool invert = false) static void _convertRT(InputArray rot, InputArray tvec, Quaternion& q, Vector3& t, bool invert = false)
{ {
CV_Assert(rot.empty() || rot.rows() == 3 || rot.size() == Size(3, 3), CV_Assert_N(rot.empty() || rot.rows() == 3 || rot.size() == Size(3, 3),
tvec.empty() || tvec.rows() == 3); tvec.empty() || tvec.rows() == 3);
q = Quaternion::IDENTITY; q = Quaternion::IDENTITY;
t = Vector3::ZERO; t = Vector3::ZERO;
...@@ -717,7 +717,7 @@ void setMaterialProperty(const String& name, int prop, const Scalar& val) ...@@ -717,7 +717,7 @@ void setMaterialProperty(const String& name, int prop, const Scalar& val)
void setMaterialProperty(const String& name, int prop, const String& value) void setMaterialProperty(const String& name, int prop, const String& value)
{ {
CV_Assert(prop >= MATERIAL_TEXTURE0, prop <= MATERIAL_TEXTURE3, _app); CV_Assert_N(prop >= MATERIAL_TEXTURE0, prop <= MATERIAL_TEXTURE3, _app);
MaterialPtr mat = MaterialManager::getSingleton().getByName(name, RESOURCEGROUP_NAME); MaterialPtr mat = MaterialManager::getSingleton().getByName(name, RESOURCEGROUP_NAME);
CV_Assert(mat); CV_Assert(mat);
......
...@@ -35,7 +35,8 @@ protected: ...@@ -35,7 +35,8 @@ protected:
float x_max = buffer[k*nCol + 5]*inputShape.width; float x_max = buffer[k*nCol + 5]*inputShape.width;
float y_max = buffer[k*nCol + 6]*inputShape.height; float y_max = buffer[k*nCol + 6]*inputShape.height;
CV_Assert(x_min < x_max, y_min < y_max); CV_CheckLT(x_min, x_max, "");
CV_CheckLT(y_min, y_max, "");
x_min = std::max(0.f, x_min); x_min = std::max(0.f, x_min);
y_min = std::max(0.f, y_min); y_min = std::max(0.f, y_min);
...@@ -62,7 +63,7 @@ public: ...@@ -62,7 +63,7 @@ public:
void detect(InputArray inputImage_, std::vector<Rect>& Bbox, std::vector<float>& confidence) CV_OVERRIDE void detect(InputArray inputImage_, std::vector<Rect>& Bbox, std::vector<float>& confidence) CV_OVERRIDE
{ {
CV_Assert(inputImage_.channels() == inputChannelCount_); CV_CheckEQ(inputImage_.channels(), inputChannelCount_, "");
Mat inputImage = inputImage_.getMat(); Mat inputImage = inputImage_.getMat();
Bbox.resize(0); Bbox.resize(0);
confidence.resize(0); confidence.resize(0);
...@@ -75,7 +76,7 @@ public: ...@@ -75,7 +76,7 @@ public:
int nbrTextBoxes = outputNet.size[2]; int nbrTextBoxes = outputNet.size[2];
int nCol = outputNet.size[3]; int nCol = outputNet.size[3];
int outputChannelCount = outputNet.size[1]; int outputChannelCount = outputNet.size[1];
CV_Assert(outputChannelCount == 1); CV_CheckEQ(outputChannelCount, 1, "");
getOutputs((float*)(outputNet.data), nbrTextBoxes, nCol, Bbox, confidence, inputImage.size()); getOutputs((float*)(outputNet.data), nbrTextBoxes, nCol, Bbox, confidence, inputImage.size());
} }
} }
......
...@@ -8,8 +8,8 @@ using namespace cv; ...@@ -8,8 +8,8 @@ using namespace cv;
double tracking_internal::computeNCC(const Mat& patch1, const Mat& patch2) double tracking_internal::computeNCC(const Mat& patch1, const Mat& patch2)
{ {
CV_Assert( patch1.rows == patch2.rows, CV_CheckEQ(patch1.rows, patch2.rows, "");
patch1.cols == patch2.cols); CV_CheckEQ(patch1.cols, patch2.cols, "");
int N = patch1.rows * patch1.cols; int N = patch1.rows * patch1.cols;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment