Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
dff14225
Commit
dff14225
authored
Nov 19, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
parents
53b9880f
b3ad2c32
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
7 deletions
+92
-7
pyopencv_LSDDetector.hpp
modules/line_descriptor/misc/python/pyopencv_LSDDetector.hpp
+1
-1
rgbd.hpp
modules/rgbd/include/opencv2/rgbd.hpp
+0
-1
depth.hpp
modules/rgbd/include/opencv2/rgbd/depth.hpp
+19
-0
pyopencv_linemod.hpp
modules/rgbd/misc/python/pyopencv_linemod.hpp
+4
-4
test_rgbd.py
modules/rgbd/misc/python/test/test_rgbd.py
+45
-0
odometry.cpp
modules/rgbd/src/odometry.cpp
+22
-0
pyopencv_ppf_match_3d.hpp
...es/surface_matching/misc/python/pyopencv_ppf_match_3d.hpp
+1
-1
No files found.
modules/line_descriptor/misc/python/pyopencv_LSDDetector.hpp
View file @
dff14225
...
...
@@ -2,7 +2,7 @@
template
<>
struct
pyopencvVecConverter
<
line_descriptor
::
KeyLine
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
line_descriptor
::
KeyLine
>&
value
,
const
ArgInfo
info
)
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
line_descriptor
::
KeyLine
>&
value
,
const
ArgInfo
&
info
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
info
);
}
...
...
modules/rgbd/include/opencv2/rgbd.hpp
View file @
dff14225
...
...
@@ -21,4 +21,3 @@
#endif
/* End of file. */
modules/rgbd/include/opencv2/rgbd/depth.hpp
View file @
dff14225
...
...
@@ -345,6 +345,25 @@ namespace rgbd
{
}
/** Constructor
* @param block_size The size of the blocks to look at for a stable MSE
* @param min_size The minimum size of a cluster to be considered a plane
* @param threshold The maximum distance of a point from a plane to belong to it (in meters)
* @param sensor_error_a coefficient of the sensor error. 0 by default, 0.0075 for a Kinect
* @param sensor_error_b coefficient of the sensor error. 0 by default
* @param sensor_error_c coefficient of the sensor error. 0 by default
* @param method The method to use to compute the planes.
*/
RgbdPlane
(
int
method
,
int
block_size
,
int
min_size
,
double
threshold
,
double
sensor_error_a
=
0
,
double
sensor_error_b
=
0
,
double
sensor_error_c
=
0
);
~
RgbdPlane
();
CV_WRAP
static
Ptr
<
RgbdPlane
>
create
(
int
method
,
int
block_size
,
int
min_size
,
double
threshold
,
double
sensor_error_a
=
0
,
double
sensor_error_b
=
0
,
double
sensor_error_c
=
0
);
/** Find The planes in a depth image
* @param points3d the 3d points organized like the depth image: rows x cols with 3 channels
* @param normals the normals for every point in the depth image
...
...
modules/rgbd/misc/python/pyopencv_linemod.hpp
View file @
dff14225
...
...
@@ -3,7 +3,7 @@
template
<>
struct
pyopencvVecConverter
<
linemod
::
Match
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
linemod
::
Match
>&
value
,
const
ArgInfo
info
)
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
linemod
::
Match
>&
value
,
const
ArgInfo
&
info
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
info
);
}
...
...
@@ -16,7 +16,7 @@ template<> struct pyopencvVecConverter<linemod::Match>
template
<>
struct
pyopencvVecConverter
<
linemod
::
Template
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
linemod
::
Template
>&
value
,
const
ArgInfo
info
)
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
linemod
::
Template
>&
value
,
const
ArgInfo
&
info
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
info
);
}
...
...
@@ -29,7 +29,7 @@ template<> struct pyopencvVecConverter<linemod::Template>
template
<>
struct
pyopencvVecConverter
<
linemod
::
Feature
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
linemod
::
Feature
>&
value
,
const
ArgInfo
info
)
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
linemod
::
Feature
>&
value
,
const
ArgInfo
&
info
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
info
);
}
...
...
@@ -42,7 +42,7 @@ template<> struct pyopencvVecConverter<linemod::Feature>
template
<>
struct
pyopencvVecConverter
<
Ptr
<
linemod
::
Modality
>
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
Ptr
<
linemod
::
Modality
>
>&
value
,
const
ArgInfo
info
)
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
Ptr
<
linemod
::
Modality
>
>&
value
,
const
ArgInfo
&
info
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
info
);
}
...
...
modules/rgbd/misc/python/test/test_rgbd.py
0 → 100644
View file @
dff14225
#!/usr/bin/env python
# Python 2/3 compatibility
from
__future__
import
print_function
import
os
,
numpy
import
cv2
as
cv
from
tests_common
import
NewOpenCVTests
class
rgbd_test
(
NewOpenCVTests
):
def
test_computeRgbdPlane
(
self
):
depth_image
=
self
.
get_sample
(
'/cv/rgbd/depth.png'
,
cv
.
IMREAD_ANYDEPTH
)
if
depth_image
is
None
:
raise
unittest
.
SkipTest
(
"Missing files with test data"
)
K
=
numpy
.
array
([[
525
,
0
,
320.5
],
[
0
,
525
,
240.5
],
[
0
,
0
,
1
]])
points3d
=
cv
.
rgbd
.
depthTo3d
(
depth_image
,
K
)
normals_computer
=
normals_computer
=
cv
.
rgbd
.
RgbdNormals_create
(
480
,
640
,
5
,
K
)
normals
=
normals_computer
.
apply
(
points3d
)
rgbd_plane
=
cv
.
rgbd
.
RgbdPlane_create
(
cv
.
rgbd
.
RgbdPlane_RGBD_PLANE_METHOD_DEFAULT
,
40
,
1600
,
0.01
,
0
,
0
,
0
)
_
,
planes_coeff
=
rgbd_plane
.
apply
(
points3d
,
normals
)
planes_coeff_expected
=
\
numpy
.
asarray
([[[
-
0.02447728
,
-
0.8678335
,
-
0.49625182
,
4.02800846
]],
[[
-
0.05055107
,
-
0.86144137
,
-
0.50533485
,
3.95456314
]],
[[
-
0.03294908
,
-
0.86964548
,
-
0.49257591
,
3.97052431
]],
[[
-
0.02886586
,
-
0.87153459
,
-
0.48948362
,
7.77550507
]],
[[
-
0.04455929
,
-
0.87659335
,
-
0.47916424
,
3.93200684
]],
[[
-
0.21514639
,
0.18835169
,
-
0.95824611
,
7.59479475
]],
[[
-
0.01006953
,
-
0.86679155
,
-
0.49856904
,
4.01355648
]],
[[
-
0.00876531
,
-
0.87571168
,
-
0.48275498
,
3.96768975
]],
[[
-
0.06395926
,
-
0.86951321
,
-
0.48975089
,
4.08618736
]],
[[
-
0.01403128
,
-
0.87593341
,
-
0.48222789
,
7.74559402
]],
[[
-
0.01143177
,
-
0.87495202
,
-
0.4840748
,
7.75355816
]]],
dtype
=
numpy
.
float32
)
eps
=
0.05
self
.
assertLessEqual
(
cv
.
norm
(
planes_coeff
,
planes_coeff_expected
,
cv
.
NORM_L2
),
eps
)
if
__name__
==
'__main__'
:
NewOpenCVTests
.
bootstrap
()
modules/rgbd/src/odometry.cpp
View file @
dff14225
...
...
@@ -983,6 +983,28 @@ Ptr<DepthCleaner> DepthCleaner::create(int depth_in, int window_size_in, int met
return
makePtr
<
DepthCleaner
>
(
depth_in
,
window_size_in
,
method_in
);
}
RgbdPlane
::
RgbdPlane
(
int
method
,
int
block_size
,
int
min_size
,
double
threshold
,
double
sensor_error_a
,
double
sensor_error_b
,
double
sensor_error_c
)
:
method_
(
method
),
block_size_
(
block_size
),
min_size_
(
min_size
),
threshold_
(
threshold
),
sensor_error_a_
(
sensor_error_a
),
sensor_error_b_
(
sensor_error_b
),
sensor_error_c_
(
sensor_error_c
)
{}
Ptr
<
RgbdPlane
>
RgbdPlane
::
create
(
int
method
,
int
block_size
,
int
min_size
,
double
threshold
,
double
sensor_error_a
,
double
sensor_error_b
,
double
sensor_error_c
)
{
return
makePtr
<
RgbdPlane
>
(
method
,
block_size
,
min_size
,
threshold
,
sensor_error_a
,
sensor_error_b
,
sensor_error_c
);
}
RgbdPlane
::~
RgbdPlane
()
{}
RgbdFrame
::
RgbdFrame
()
:
ID
(
-
1
)
{}
...
...
modules/surface_matching/misc/python/pyopencv_ppf_match_3d.hpp
View file @
dff14225
...
...
@@ -2,7 +2,7 @@
template
<>
struct
pyopencvVecConverter
<
ppf_match_3d
::
Pose3DPtr
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
ppf_match_3d
::
Pose3DPtr
>&
value
,
const
ArgInfo
info
)
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
ppf_match_3d
::
Pose3DPtr
>&
value
,
const
ArgInfo
&
info
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
info
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment