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
f9b57527
Commit
f9b57527
authored
Feb 15, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #999 from Sahloul:features/python_wrapper/rgbd
parents
31fd7e1f
62f5e865
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
rgbd.hpp
modules/rgbd/include/opencv2/rgbd.hpp
+3
-3
odometry.cpp
modules/rgbd/src/odometry.cpp
+8
-7
No files found.
modules/rgbd/include/opencv2/rgbd.hpp
View file @
f9b57527
...
...
@@ -334,7 +334,7 @@ namespace rgbd
* depth of `K` if `depth` is of depth CV_U
* @param mask the mask of the points to consider (can be empty)
*/
CV_EXPORTS
CV_EXPORTS
_W
void
depthTo3d
(
InputArray
depth
,
InputArray
K
,
OutputArray
points3d
,
InputArray
mask
=
noArray
());
...
...
@@ -1026,10 +1026,10 @@ namespace rgbd
* @param warpedDepth The warped depth.
* @param warpedMask The warped mask.
*/
CV_EXPORTS
CV_EXPORTS
_W
void
warpFrame
(
const
Mat
&
image
,
const
Mat
&
depth
,
const
Mat
&
mask
,
const
Mat
&
Rt
,
const
Mat
&
cameraMatrix
,
const
Mat
&
distCoeff
,
Mat
&
warpedImage
,
Mat
*
warpedDepth
=
0
,
Mat
*
warpedMask
=
0
);
const
Mat
&
distCoeff
,
OutputArray
warpedImage
,
OutputArray
warpedDepth
=
noArray
(),
OutputArray
warpedMask
=
noArray
()
);
// TODO Depth interpolation
// Curvature
...
...
modules/rgbd/src/odometry.cpp
View file @
f9b57527
...
...
@@ -941,7 +941,7 @@ template<class ImageElemType>
static
void
warpFrameImpl
(
const
Mat
&
image
,
const
Mat
&
depth
,
const
Mat
&
mask
,
const
Mat
&
Rt
,
const
Mat
&
cameraMatrix
,
const
Mat
&
distCoeff
,
Mat
&
warpedImage
,
Mat
*
warpedDepth
,
Mat
*
warpedMask
)
OutputArray
_warpedImage
,
OutputArray
warpedDepth
,
OutputArray
warpedMask
)
{
CV_Assert
(
image
.
size
()
==
depth
.
size
());
...
...
@@ -954,7 +954,8 @@ warpFrameImpl(const Mat& image, const Mat& depth, const Mat& mask,
projectPoints
(
transformedCloud
.
reshape
(
3
,
1
),
Mat
::
eye
(
3
,
3
,
CV_64FC1
),
Mat
::
zeros
(
3
,
1
,
CV_64FC1
),
cameraMatrix
,
distCoeff
,
points2d
);
warpedImage
=
Mat
(
image
.
size
(),
image
.
type
(),
Scalar
::
all
(
0
));
_warpedImage
.
create
(
image
.
size
(),
image
.
type
());
Mat
warpedImage
=
_warpedImage
.
getMat
();
Mat
zBuffer
(
image
.
size
(),
CV_32FC1
,
std
::
numeric_limits
<
float
>::
max
());
const
Rect
rect
=
Rect
(
0
,
0
,
image
.
cols
,
image
.
rows
);
...
...
@@ -978,13 +979,13 @@ warpFrameImpl(const Mat& image, const Mat& depth, const Mat& mask,
}
}
if
(
warpedMask
)
*
warpedMask
=
zBuffer
!=
std
::
numeric_limits
<
float
>::
max
(
);
if
(
warpedMask
.
needed
()
)
Mat
(
zBuffer
!=
std
::
numeric_limits
<
float
>::
max
()).
copyTo
(
warpedMask
);
if
(
warpedDepth
)
if
(
warpedDepth
.
needed
()
)
{
zBuffer
.
setTo
(
std
::
numeric_limits
<
float
>::
quiet_NaN
(),
zBuffer
==
std
::
numeric_limits
<
float
>::
max
());
*
warpedDepth
=
zBuffer
;
zBuffer
.
copyTo
(
warpedDepth
)
;
}
}
...
...
@@ -1406,7 +1407,7 @@ bool RgbdICPOdometry::computeImpl(const Ptr<OdometryFrame>& srcFrame, const Ptr<
void
warpFrame
(
const
Mat
&
image
,
const
Mat
&
depth
,
const
Mat
&
mask
,
const
Mat
&
Rt
,
const
Mat
&
cameraMatrix
,
const
Mat
&
distCoeff
,
Mat
&
warpedImage
,
Mat
*
warpedDepth
,
Mat
*
warpedMask
)
OutputArray
warpedImage
,
OutputArray
warpedDepth
,
OutputArray
warpedMask
)
{
if
(
image
.
type
()
==
CV_8UC1
)
warpFrameImpl
<
uchar
>
(
image
,
depth
,
mask
,
Rt
,
cameraMatrix
,
distCoeff
,
warpedImage
,
warpedDepth
,
warpedMask
);
...
...
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