Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
opencv
提交
28521891
O
opencv
项目概览
OpenCV
/
opencv
上一次同步 大约 1 年
通知
1005
Star
71102
Fork
55580
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
28521891
编写于
1月 27, 2023
作者:
R
Rostislav Vasilikhin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
msvc cast warnings
上级
8329c09b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
29 deletion
+29
-29
modules/3d/perf/perf_tsdf.cpp
modules/3d/perf/perf_tsdf.cpp
+1
-1
modules/3d/src/rgbd/odometry_functions.cpp
modules/3d/src/rgbd/odometry_functions.cpp
+11
-11
modules/3d/src/rgbd/odometry_functions.hpp
modules/3d/src/rgbd/odometry_functions.hpp
+8
-8
modules/3d/src/rgbd/volume_impl.cpp
modules/3d/src/rgbd/volume_impl.cpp
+1
-1
modules/3d/test/test_odometry.cpp
modules/3d/test/test_odometry.cpp
+3
-3
modules/3d/test/test_tsdf.cpp
modules/3d/test/test_tsdf.cpp
+5
-5
未找到文件。
modules/3d/perf/perf_tsdf.cpp
浏览文件 @
28521891
...
...
@@ -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
);
...
...
modules/3d/src/rgbd/odometry_functions.cpp
浏览文件 @
28521891
...
...
@@ -95,7 +95,7 @@ static void extendPyrMaskByPyrNormals(const std::vector<UMat>& 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
<
UMat
>&
pyramidDepth
,
const
Matx33f
&
cameraMatrix
,
std
::
vector
<
UMat
>&
pyramidCloud
)
{
int
nLevels
=
pyramidDepth
.
size
();
int
nLevels
=
(
int
)
pyramidDepth
.
size
();
std
::
vector
<
Matx33f
>
pyramidCameraMatrix
;
buildPyramidCameraMatrix
(
cameraMatrix
,
nLevels
,
pyramidCameraMatrix
);
...
...
@@ -150,7 +150,7 @@ static void preparePyramidTexturedMask(const std::vector<UMat>& pyramid_dI_dx, c
std
::
vector
<
float
>
minGradMagnitudes
,
const
std
::
vector
<
UMat
>&
pyramidMask
,
double
maxPointsPart
,
std
::
vector
<
UMat
>&
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<UMat>& pyramid_dI_dx, c
static
void
preparePyramidNormals
(
const
UMat
&
normals
,
const
std
::
vector
<
UMat
>
&
pyramidDepth
,
std
::
vector
<
UMat
>
&
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<UMat> &
static
void
preparePyramidNormalsMask
(
const
std
::
vector
<
UMat
>
&
pyramidNormals
,
const
std
::
vector
<
UMat
>
&
pyramidMask
,
double
maxPointsPart
,
std
::
vector
<
UMat
>
&
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
<
float
>
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
<
int
>
iterCounts
;
settings
.
getIterCounts
(
iterCounts
);
int
maxLevel
=
iterCounts
.
size
()
-
1
;
int
maxLevel
=
(
int
)
iterCounts
.
size
()
-
1
;
std
::
vector
<
UMat
>&
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
<
UMat
>&
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
<
int
>
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
<
Vec4f
>
(
v0
,
u0
);
Point3
f
tp0
=
rtmat
*
Point3f
(
p0
[
0
],
p0
[
1
],
p0
[
2
]);
Point3
d
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
<
Vec4f
>
(
v1
,
u1
);
icpCoeffsFunc
(
transformType
,
A_ptr
,
tps0_ptr
[
correspIndex
],
Point3
f
(
p1
[
0
],
p1
[
1
],
p1
[
2
]),
Vec3f
(
n4
[
0
],
n4
[
1
],
n4
[
2
])
*
w
);
A_ptr
,
tps0_ptr
[
correspIndex
],
Point3
d
(
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
<
double
>
(
y
);
...
...
modules/3d/src/rgbd/odometry_functions.hpp
浏览文件 @
28521891
...
...
@@ -32,7 +32,7 @@ static inline int getTransformDim(OdometryTransformType transformType)
static
inline
Vec6d
calcRgbdEquationCoeffs
(
double
dIdx
,
double
dIdy
,
const
Point3
f
&
p3d
,
double
fx
,
double
fy
)
Vec6d
calcRgbdEquationCoeffs
(
double
dIdx
,
double
dIdy
,
const
Point3
d
&
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
Point3
f
&
p3d
,
double
fx
,
double
fy
)
Vec3d
calcRgbdEquationCoeffsRotation
(
double
dIdx
,
double
dIdy
,
const
Point3
d
&
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
Point3
f
&
p3d
,
double
fx
,
double
fy
)
Vec3d
calcRgbdEquationCoeffsTranslation
(
double
dIdx
,
double
dIdy
,
const
Point3
d
&
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
Point3
f
&
p3d
,
double
fx
,
double
fy
)
double
*
C
,
double
dIdx
,
double
dIdy
,
const
Point3
d
&
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
Point3
f
&
psrc
,
const
Vec3f
&
ndst
)
Vec6d
calcICPEquationCoeffs
(
const
Point3
d
&
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
Point3
f
&
psrc
,
const
Vec3f
&
ndst
)
Vec3d
calcICPEquationCoeffsRotation
(
const
Point3
d
&
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
Point3
f
&
/*p0*/
,
const
Vec3f
&
ndst
)
Vec3d
calcICPEquationCoeffsTranslation
(
const
Point3
d
&
/*p0*/
,
const
Vec3d
&
ndst
)
{
return
Vec3d
(
ndst
);
}
static
inline
void
icpCoeffsFunc
(
OdometryTransformType
transformType
,
double
*
C
,
const
Point3
f
&
p0
,
const
Point3f
&
/*p1*/
,
const
Vec3f
&
n1
)
void
icpCoeffsFunc
(
OdometryTransformType
transformType
,
double
*
C
,
const
Point3
d
&
p0
,
const
Point3d
&
/*p1*/
,
const
Vec3d
&
n1
)
{
int
dim
=
getTransformDim
(
transformType
);
Vec6d
ret
;
...
...
modules/3d/src/rgbd/volume_impl.cpp
浏览文件 @
28521891
...
...
@@ -449,7 +449,7 @@ void HashTsdfVolume::getBoundingBox(OutputArray boundingBox, int precision) cons
std
::
vector
<
Point3f
>
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
));
...
...
modules/3d/test/test_odometry.cpp
浏览文件 @
28521891
...
...
@@ -316,7 +316,7 @@ void OdometryTest::prepareFrameCheck()
std
::
vector
<
Mat
>
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
<
Mat
>
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
<
Mat
>
gtPyrNormals
;
buildPyramid
(
normals
,
gtPyrNormals
,
nlevels
-
1
);
buildPyramid
(
normals
,
gtPyrNormals
,
(
int
)
nlevels
-
1
);
for
(
size_t
i
=
0
;
i
<
nlevels
;
i
++
)
{
Mat
gtNormal
=
gtPyrNormals
[
i
];
...
...
modules/3d/test/test_tsdf.cpp
浏览文件 @
28521891
...
...
@@ -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
);
...
...
@@ -1160,7 +1160,7 @@ class StaticVolumeBoundingBox : public ::testing::TestWithParam<PlatformVolumeTy
TEST_P
(
StaticVolumeBoundingBox
,
staticBoundingBox
)
{
auto
p
=
GetParam
();
bool
gpu
=
bool
(
std
::
get
<
0
>
(
p
)
);
bool
gpu
=
(
std
::
get
<
0
>
(
p
)
==
PlatformType
::
GPU
);
VolumeType
volumeType
=
std
::
get
<
1
>
(
p
);
OpenCLStatusRevert
oclStatus
;
...
...
@@ -1182,7 +1182,7 @@ class ReproduceVolPoseRotTest : public ::testing::TestWithParam<PlatformTypeEnum
TEST_P
(
ReproduceVolPoseRotTest
,
reproduce_volPoseRot
)
{
bool
gpu
=
bool
(
GetParam
()
);
bool
gpu
=
(
GetParam
()
==
PlatformType
::
GPU
);
OpenCLStatusRevert
oclStatus
;
...
...
@@ -1207,8 +1207,8 @@ class BoundingBoxEnableGrowthTest : public ::testing::TestWithParam<std::tuple<P
TEST_P
(
BoundingBoxEnableGrowthTest
,
boundingBoxEnableGrowth
)
{
auto
p
=
GetParam
();
bool
gpu
=
bool
(
std
::
get
<
0
>
(
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录