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

core: added MatSize::dims() method

to avoid accessing of 'p[-1]' (static code analysers dislike this)
This commit is contained in:
Alexander Alekhin
2018-04-26 18:54:43 +03:00
parent 87a4f4ab3a
commit 8c349ff8ff
6 changed files with 27 additions and 11 deletions
+3 -2
View File
@@ -6,6 +6,7 @@
// Third party copyrights are property of their respective owners.
#include "precomp.hpp"
#include <opencv2/dnn/shape_utils.hpp>
#include "op_halide.hpp"
#ifdef HAVE_HALIDE
@@ -36,7 +37,7 @@ static MatShape getBufferShape(const MatShape& shape)
static MatShape getBufferShape(const MatSize& size)
{
return getBufferShape(MatShape(size.p, size.p + size[-1]));
return getBufferShape(shape(size));
}
Halide::Buffer<float> wrapToHalideBuffer(const Mat& mat)
@@ -160,7 +161,7 @@ void HalideBackendWrapper::setHostDirty()
void getCanonicalSize(const MatSize& size, int* w, int* h, int* c, int* n)
{
getCanonicalSize(MatShape(size.p, size.p + size[-1]), w, h, c, n);
getCanonicalSize(shape(size), w, h, c, n);
}
void getCanonicalSize(const MatShape& shape, int* width, int* height,