diff --git a/modules/3d/perf/perf_tsdf.cpp b/modules/3d/perf/perf_tsdf.cpp index ecf8ebb4a7..953f09ddf9 100644 --- a/modules/3d/perf/perf_tsdf.cpp +++ b/modules/3d/perf/perf_tsdf.cpp @@ -535,7 +535,7 @@ protected: TestBase::SetUp(); auto p = GetParam(); - gpu = std::get<0>(std::get<0>(p)); + gpu = (std::get<0>(std::get<0>(p)) == PlatformType::GPU); volumeType = std::get<1>(std::get<0>(p)); testSrcType = std::get<1>(p); diff --git a/modules/3d/src/rgbd/odometry_functions.cpp b/modules/3d/src/rgbd/odometry_functions.cpp index c9b21a9fab..687aafe2cf 100644 --- a/modules/3d/src/rgbd/odometry_functions.cpp +++ b/modules/3d/src/rgbd/odometry_functions.cpp @@ -95,7 +95,7 @@ static void extendPyrMaskByPyrNormals(const std::vector& pyramidNormals, { if (!pyramidNormals.empty()) { - int nLevels = pyramidNormals.size(); + int nLevels = (int)pyramidNormals.size(); for (int i = 0; i < nLevels; i++) { @@ -130,7 +130,7 @@ static void buildPyramidCameraMatrix(const Matx33f& cameraMatrix, int levels, st static void preparePyramidCloud(const std::vector& pyramidDepth, const Matx33f& cameraMatrix, std::vector& pyramidCloud) { - int nLevels = pyramidDepth.size(); + int nLevels = (int)pyramidDepth.size(); std::vector pyramidCameraMatrix; buildPyramidCameraMatrix(cameraMatrix, nLevels, pyramidCameraMatrix); @@ -150,7 +150,7 @@ static void preparePyramidTexturedMask(const std::vector& pyramid_dI_dx, c std::vector minGradMagnitudes, const std::vector& pyramidMask, double maxPointsPart, std::vector& pyramidTexturedMask, double sobelScale) { - int nLevels = pyramid_dI_dx.size(); + int nLevels = (int)pyramid_dI_dx.size(); const float sobelScale2_inv = (float)(1. / (sobelScale * sobelScale)); pyramidTexturedMask.resize(nLevels, UMat()); @@ -183,7 +183,7 @@ static void preparePyramidTexturedMask(const std::vector& pyramid_dI_dx, c static void preparePyramidNormals(const UMat &normals, const std::vector &pyramidDepth, std::vector &pyramidNormals) { - int nLevels = pyramidDepth.size(); + int nLevels = (int)pyramidDepth.size(); buildPyramid(normals, pyramidNormals, nLevels - 1); // renormalize normals @@ -210,7 +210,7 @@ static void preparePyramidNormals(const UMat &normals, const std::vector & static void preparePyramidNormalsMask(const std::vector &pyramidNormals, const std::vector &pyramidMask, double maxPointsPart, std::vector &pyramidNormalsMask) { - int nLevels = pyramidNormals.size(); + int nLevels = (int)pyramidNormals.size(); pyramidNormalsMask.resize(nLevels, UMat()); for (int i = 0; i < nLevels; i++) { @@ -328,7 +328,7 @@ static void prepareRGBFrameDst(OdometryFrame& frame, OdometrySettings settings) std::vector minGradientMagnitudes; settings.getMinGradientMagnitudes(minGradientMagnitudes); - int nLevels = ipyramids.size(); + int nLevels = (int)ipyramids.size(); dxpyramids.resize(nLevels, UMat()); dypyramids.resize(nLevels, UMat()); int sobelSize = settings.getSobelSize(); @@ -375,7 +375,7 @@ static void prepareICPFrameBase(OdometryFrame& frame, OdometrySettings settings) std::vector iterCounts; settings.getIterCounts(iterCounts); - int maxLevel = iterCounts.size() - 1; + int maxLevel = (int)iterCounts.size() - 1; std::vector& dpyramids = frame.impl->pyramids[OdometryFramePyramidType::PYR_DEPTH]; if (dpyramids.empty()) preparePyramidDepth(scaledDepth, dpyramids, maxLevel); @@ -400,7 +400,7 @@ static void prepareICPFrameSrc(OdometryFrame& frame, OdometrySettings settings) settings.getIterCounts(iterCounts); std::vector& mpyramids = frame.impl->pyramids[OdometryFramePyramidType::PYR_MASK]; if (mpyramids.empty()) - preparePyramidMask(mask, dpyramids, iterCounts.size(), settings.getMinDepth(), settings.getMaxDepth(), mpyramids); + preparePyramidMask(mask, dpyramids, (int)iterCounts.size(), settings.getMinDepth(), settings.getMaxDepth(), mpyramids); } @@ -452,7 +452,7 @@ static void prepareICPFrameDst(OdometryFrame& frame, OdometrySettings settings, { std::vector iterCounts; settings.getIterCounts(iterCounts); - preparePyramidMask(mask, dpyramids, iterCounts.size(), settings.getMinDepth(), settings.getMaxDepth(), mpyramids); + preparePyramidMask(mask, dpyramids, (int)iterCounts.size(), settings.getMinDepth(), settings.getMaxDepth(), mpyramids); extendPyrMaskByPyrNormals(npyramids, mpyramids); } @@ -842,7 +842,7 @@ void calcRgbdLsmMatrices(const Mat& cloud0, const Mat& Rt, double w_sobelScale = w * sobelScaleIn; const Vec4f& p0 = cloud0.at(v0, u0); - Point3f tp0 = rtmat * Point3f(p0[0], p0[1], p0[2]); + Point3d tp0 = rtmat * Point3d(p0[0], p0[1], p0[2]); rgbdCoeffsFunc(transformType, A_ptr, @@ -928,7 +928,7 @@ void calcICPLsmMatrices(const Mat& cloud0, const Mat& Rt, Vec4f p1 = cloud1.at(v1, u1); icpCoeffsFunc(transformType, - A_ptr, tps0_ptr[correspIndex], Point3f(p1[0], p1[1], p1[2]), Vec3f(n4[0], n4[1], n4[2]) * w); + A_ptr, tps0_ptr[correspIndex], Point3d(p1[0], p1[1], p1[2]), Vec3d(n4[0], n4[1], n4[2]) * w); for (int y = 0; y < transformDim; y++) { double* AtA_ptr = AtA.ptr(y); diff --git a/modules/3d/src/rgbd/odometry_functions.hpp b/modules/3d/src/rgbd/odometry_functions.hpp index 99a478b3d8..7aa35d7e4c 100644 --- a/modules/3d/src/rgbd/odometry_functions.hpp +++ b/modules/3d/src/rgbd/odometry_functions.hpp @@ -32,7 +32,7 @@ static inline int getTransformDim(OdometryTransformType transformType) static inline -Vec6d calcRgbdEquationCoeffs(double dIdx, double dIdy, const Point3f& p3d, double fx, double fy) +Vec6d calcRgbdEquationCoeffs(double dIdx, double dIdy, const Point3d& p3d, double fx, double fy) { double invz = 1. / p3d.z, v0 = dIdx * fx * invz, @@ -45,7 +45,7 @@ Vec6d calcRgbdEquationCoeffs(double dIdx, double dIdy, const Point3f& p3d, doubl } static inline -Vec3d calcRgbdEquationCoeffsRotation(double dIdx, double dIdy, const Point3f& p3d, double fx, double fy) +Vec3d calcRgbdEquationCoeffsRotation(double dIdx, double dIdy, const Point3d& p3d, double fx, double fy) { double invz = 1. / p3d.z, v0 = dIdx * fx * invz, @@ -59,7 +59,7 @@ Vec3d calcRgbdEquationCoeffsRotation(double dIdx, double dIdy, const Point3f& p3 } static inline -Vec3d calcRgbdEquationCoeffsTranslation(double dIdx, double dIdy, const Point3f& p3d, double fx, double fy) +Vec3d calcRgbdEquationCoeffsTranslation(double dIdx, double dIdy, const Point3d& p3d, double fx, double fy) { double invz = 1. / p3d.z, v0 = dIdx * fx * invz, @@ -70,7 +70,7 @@ Vec3d calcRgbdEquationCoeffsTranslation(double dIdx, double dIdy, const Point3f& } static inline void rgbdCoeffsFunc(OdometryTransformType transformType, - double* C, double dIdx, double dIdy, const Point3f& p3d, double fx, double fy) + double* C, double dIdx, double dIdy, const Point3d& p3d, double fx, double fy) { int dim = getTransformDim(transformType); Vec6d ret; @@ -102,7 +102,7 @@ static inline void rgbdCoeffsFunc(OdometryTransformType transformType, static inline -Vec6d calcICPEquationCoeffs(const Point3f& psrc, const Vec3f& ndst) +Vec6d calcICPEquationCoeffs(const Point3d& psrc, const Vec3d& ndst) { Point3d pxv = psrc.cross(Point3d(ndst)); @@ -110,7 +110,7 @@ Vec6d calcICPEquationCoeffs(const Point3f& psrc, const Vec3f& ndst) } static inline -Vec3d calcICPEquationCoeffsRotation(const Point3f& psrc, const Vec3f& ndst) +Vec3d calcICPEquationCoeffsRotation(const Point3d& psrc, const Vec3d& ndst) { Point3d pxv = psrc.cross(Point3d(ndst)); @@ -118,13 +118,13 @@ Vec3d calcICPEquationCoeffsRotation(const Point3f& psrc, const Vec3f& ndst) } static inline -Vec3d calcICPEquationCoeffsTranslation( const Point3f& /*p0*/, const Vec3f& ndst) +Vec3d calcICPEquationCoeffsTranslation( const Point3d& /*p0*/, const Vec3d& ndst) { return Vec3d(ndst); } static inline -void icpCoeffsFunc(OdometryTransformType transformType, double* C, const Point3f& p0, const Point3f& /*p1*/, const Vec3f& n1) +void icpCoeffsFunc(OdometryTransformType transformType, double* C, const Point3d& p0, const Point3d& /*p1*/, const Vec3d& n1) { int dim = getTransformDim(transformType); Vec6d ret; diff --git a/modules/3d/src/rgbd/volume_impl.cpp b/modules/3d/src/rgbd/volume_impl.cpp index 0dadc5e94b..72a9388564 100644 --- a/modules/3d/src/rgbd/volume_impl.cpp +++ b/modules/3d/src/rgbd/volume_impl.cpp @@ -449,7 +449,7 @@ void HashTsdfVolume::getBoundingBox(OutputArray boundingBox, int precision) cons std::vector pts; for (Vec3i idx : vi) { - Point3f base = Point3f(idx[0], idx[1], idx[2]) * side; + Point3f base = Point3f((float)idx[0], (float)idx[1], (float)idx[2]) * side; pts.push_back(base); pts.push_back(base + Point3f(side, 0, 0)); pts.push_back(base + Point3f(0, side, 0)); diff --git a/modules/3d/test/test_odometry.cpp b/modules/3d/test/test_odometry.cpp index 137b288738..3e4638e57e 100644 --- a/modules/3d/test/test_odometry.cpp +++ b/modules/3d/test/test_odometry.cpp @@ -316,7 +316,7 @@ void OdometryTest::prepareFrameCheck() std::vector gtPyrDepth, gtPyrMask; //TODO: this depth calculation would become incorrect when we implement bilateral filtering, fixit - buildPyramid(gtDepth, gtPyrDepth, nlevels - 1); + buildPyramid(gtDepth, gtPyrDepth, (int)nlevels - 1); for (const auto& gd : gtPyrDepth) { Mat pm = (gd > ods.getMinDepth()) & (gd < ods.getMaxDepth()); @@ -354,7 +354,7 @@ void OdometryTest::prepareFrameCheck() if (otype == OdometryType::RGB || otype == OdometryType::RGB_DEPTH) { std::vector gtPyrImage; - buildPyramid(gtGray, gtPyrImage, nlevels - 1); + buildPyramid(gtGray, gtPyrImage, (int)nlevels - 1); for (size_t i = 0; i < nlevels; i++) { @@ -389,7 +389,7 @@ void OdometryTest::prepareFrameCheck() Mat normals; odf.getNormals(normals); std::vector gtPyrNormals; - buildPyramid(normals, gtPyrNormals, nlevels - 1); + buildPyramid(normals, gtPyrNormals, (int)nlevels - 1); for (size_t i = 0; i < nlevels; i++) { Mat gtNormal = gtPyrNormals[i]; diff --git a/modules/3d/test/test_tsdf.cpp b/modules/3d/test/test_tsdf.cpp index ba3e504b86..6e7dc0bf67 100644 --- a/modules/3d/test/test_tsdf.cpp +++ b/modules/3d/test/test_tsdf.cpp @@ -886,7 +886,7 @@ protected: void SetUp() override { auto p = GetParam(); - gpu = std::get<0>(std::get<0>(p)); + gpu = (std::get<0>(std::get<0>(p)) == PlatformType::GPU); volumeType = std::get<1>(std::get<0>(p)); testSrcType = std::get<1>(p); @@ -1161,7 +1161,7 @@ class StaticVolumeBoundingBox : public ::testing::TestWithParam(p)); + bool gpu = (std::get<0>(p) == PlatformType::GPU); VolumeType volumeType = std::get<1>(p); OpenCLStatusRevert oclStatus; @@ -1183,7 +1183,7 @@ class ReproduceVolPoseRotTest : public ::testing::TestWithParam(p)); - bool enableGrowth = bool(std::get<1>(p)); + bool gpu = (std::get<0>(p) == PlatformType::GPU); + bool enableGrowth = (std::get<1>(p) == Growth::ON); OpenCLStatusRevert oclStatus;