Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ar_sandbox_lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AR_Sandbox
ar_sandbox_lib
Commits
571f6925
Commit
571f6925
authored
4 years ago
by
simon.fanetti
Browse files
Options
Downloads
Patches
Plain Diff
update static buffers in projection
parent
3a3aa518
No related branches found
No related tags found
1 merge request
!3
Custom realsense
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc/projection.h
+3
-2
3 additions, 2 deletions
inc/projection.h
src/components/projection.cpp
+11
-9
11 additions, 9 deletions
src/components/projection.cpp
with
14 additions
and
11 deletions
inc/projection.h
+
3
−
2
View file @
571f6925
...
...
@@ -9,8 +9,9 @@ class Projection{
private:
cv
::
Mat
adjustingMatrix
;
float
distanceTopSandbox
;
// Buffer for the builded virtual frame, which is scaled to n * depth_frame.size for the building process
cv
::
Mat_
<
cv
::
Vec3b
>
resized_dst
;
cv
::
Mat_
<
float
>
resized_depth
;
cv
::
Mat_
<
cv
::
Vec3b
>
resized_src
;
// Buffer containing the pixels's new location when deprojected to beamer's POV
cv
::
Mat_
<
cv
::
Point2i
>
deprojectMap
;
// Buffer indicating from where to get the pixels in the source frame
...
...
This diff is collapsed.
Click to expand it.
src/components/projection.cpp
+
11
−
9
View file @
571f6925
...
...
@@ -36,11 +36,13 @@ void Projection::adjustFrame(cv::Mat_<float> depth, cv::Mat_<cv::Vec3b> src, cv:
if
(
!
deprojectMap
.
empty
()){
deprojectMap
.
release
();
frameMap
.
release
();
resized_dst
.
release
();
resized_depth
.
release
();
resized_src
.
release
();
}
deprojectMap
.
create
(
dst
.
rows
,
dst
.
cols
);
frameMap
.
create
(
dst
.
rows
,
dst
.
cols
);
resized_dst
.
create
(
dst
.
rows
,
dst
.
cols
);
resized_depth
.
create
(
dst
.
rows
,
dst
.
cols
);
resized_src
.
create
(
dst
.
rows
,
dst
.
cols
);
std
::
vector
<
cv
::
Point2f
>
profil
=
camera
->
getAdaptedIntrinsics
(
dst
);
fxy
=
profil
.
at
(
0
);
...
...
@@ -49,18 +51,18 @@ void Projection::adjustFrame(cv::Mat_<float> depth, cv::Mat_<cv::Vec3b> src, cv:
deprojectMap
=
cv
::
Point2i
(
-
1
,
-
1
);
frameMap
=
cv
::
Point2i
(
-
1
,
-
1
);
resized_dst
=
cv
::
Vec3b
(
0
,
0
,
0
);
resized_depth
=
0.0
f
;
resized_src
=
cv
::
Vec3b
(
0
,
0
,
0
);
// resize to match 1:1 ratio with resized_dst, since we'll do later:
// resized_dst[i] = src[i]
cv
::
resize
(
src
,
src
,
dst
.
size
());
cv
::
resize
(
depth
,
depth
,
dst
.
size
());
cv
::
resize
(
src
,
resized_
src
,
dst
.
size
());
cv
::
resize
(
depth
,
resized_
depth
,
dst
.
size
());
deprojectPixelsFromDepth
(
depth
,
camera
,
camera
->
getCroppingMask
()
,
beamer_pos
,
deprojectMap
,
fxy
,
ppxy
);
filterLowestDeprojectedPoints
(
depth
,
deprojectMap
,
frameMap
);
buildFrame
(
depth
,
frameMap
,
src
,
resized_dst
);
deprojectPixelsFromDepth
(
resized_
depth
,
camera
,
camera
->
getCroppingMask
()
,
beamer_pos
,
deprojectMap
,
fxy
,
ppxy
);
filterLowestDeprojectedPoints
(
resized_
depth
,
deprojectMap
,
frameMap
);
buildFrame
(
resized_
depth
,
frameMap
,
resized_
src
,
dst
);
cv
::
resize
(
resized_dst
,
dst
,
dst
.
size
());
cv
::
warpAffine
(
dst
,
dst
,
adjustingMatrix
,
dst
.
size
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment