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
763a4516
Commit
763a4516
authored
Dec 01, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2365 from malfet:dont-use-VLA
parents
3ae0e125
42e04927
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
dynafu.cpp
modules/rgbd/src/dynafu.cpp
+8
-10
No files found.
modules/rgbd/src/dynafu.cpp
View file @
763a4516
...
...
@@ -231,27 +231,25 @@ void DynaFuImpl<T>::drawScene(OutputArray depthImage, OutputArray shadedImage)
ogl
::
render
(
arr
,
idx
,
ogl
::
TRIANGLES
);
float
f
[
params
.
frameSize
.
width
*
params
.
frameSize
.
height
]
;
float
pixels
[
params
.
frameSize
.
width
*
params
.
frameSize
.
height
][
3
]
;
glReadPixels
(
0
,
0
,
params
.
frameSize
.
width
,
params
.
frameSize
.
height
,
GL_DEPTH_COMPONENT
,
GL_FLOAT
,
&
f
[
0
]
);
glReadPixels
(
0
,
0
,
params
.
frameSize
.
width
,
params
.
frameSize
.
height
,
GL_RGB
,
GL_FLOAT
,
&
pixels
[
0
][
0
]
);
Mat
depthData
(
params
.
frameSize
.
height
,
params
.
frameSize
.
width
,
CV_32F
)
;
Mat
shadeData
(
params
.
frameSize
.
height
,
params
.
frameSize
.
width
,
CV_32FC3
)
;
glReadPixels
(
0
,
0
,
params
.
frameSize
.
width
,
params
.
frameSize
.
height
,
GL_DEPTH_COMPONENT
,
GL_FLOAT
,
depthData
.
ptr
()
);
glReadPixels
(
0
,
0
,
params
.
frameSize
.
width
,
params
.
frameSize
.
height
,
GL_RGB
,
GL_FLOAT
,
shadeData
.
ptr
()
);
// linearise depth
for
(
int
i
=
0
;
i
<
params
.
frameSize
.
width
*
params
.
frameSize
.
height
;
i
++
)
for
(
auto
it
=
depthData
.
begin
<
float
>
();
it
!=
depthData
.
end
<
float
>
();
++
it
)
{
f
[
i
]
=
farZ
*
nearZ
/
(
f
[
i
]
*
(
nearZ
-
farZ
)
+
farZ
);
*
it
=
farZ
*
nearZ
/
((
*
it
)
*
(
nearZ
-
farZ
)
+
farZ
);
if
(
f
[
i
]
>=
farZ
)
f
[
i
]
=
std
::
numeric_limits
<
float
>::
quiet_NaN
();
if
(
*
it
>=
farZ
)
*
it
=
std
::
numeric_limits
<
float
>::
quiet_NaN
();
}
if
(
depthImage
.
needed
())
{
Mat
depthData
(
params
.
frameSize
.
height
,
params
.
frameSize
.
width
,
CV_32F
,
f
);
depthData
.
copyTo
(
depthImage
);
}
if
(
shadedImage
.
needed
())
{
Mat
shadeData
(
params
.
frameSize
.
height
,
params
.
frameSize
.
width
,
CV_32FC3
,
pixels
);
shadeData
.
copyTo
(
shadedImage
);
}
#else
...
...
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