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
1904bb0d
Commit
1904bb0d
authored
4 years ago
by
simon.fanetti
Browse files
Options
Downloads
Patches
Plain Diff
cleaning
parent
2c7f31d6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/camera.cpp
+5
-2
5 additions, 2 deletions
src/components/camera.cpp
src/components/projection.cpp
+2
-23
2 additions, 23 deletions
src/components/projection.cpp
src/lib/sandbox.cpp
+1
-1
1 addition, 1 deletion
src/lib/sandbox.cpp
with
8 additions
and
26 deletions
src/components/camera.cpp
+
5
−
2
View file @
1904bb0d
...
...
@@ -33,8 +33,11 @@ Camera::~Camera(){
cv
::
Mat
Camera
::
getDepthFrame
(){
static
cv
::
Mat
values
=
cv
::
Mat
(
depth_frame
->
get_height
(),
depth_frame
->
get_width
(),
CV_16UC1
);
static
cv
::
Mat
meters
=
cv
::
Mat
(
depth_frame
->
get_height
(),
depth_frame
->
get_width
(),
CV_32FC1
);
values
.
data
=
(
uchar
*
)
depth_frame
->
get_data
();
values
.
convertTo
(
meters
,
CV_32FC1
,
depth_scale
);
uchar
*
new_values
=
(
uchar
*
)
depth_frame
->
get_data
();
if
(
values
.
data
!=
new_values
){
values
.
data
=
new_values
;
values
.
convertTo
(
meters
,
CV_32FC1
,
depth_scale
);
}
return
meters
.
clone
();
};
...
...
This diff is collapsed.
Click to expand it.
src/components/projection.cpp
+
2
−
23
View file @
1904bb0d
...
...
@@ -33,12 +33,9 @@ cv::Point2i Projection::revertRotatePixel(cv::Point2i center, double angle, cv::
Adjust the projected frame with the topology from the camera to the beamer POV
*/
void
Projection
::
adjustFrame
(
cv
::
Mat_
<
float
>
&
depth
,
cv
::
Mat_
<
cv
::
Vec3b
>
&
src
,
cv
::
Mat_
<
cv
::
Vec3b
>
&
dst
,
Camera
*
camera
,
cv
::
Point3f
beamer_pos
){
// deallocate and reallocate buffers if 1st pass
// or dst.size changed, since for all buffers :
// buff.size == dst.size
// try
// update if dst.size changed, since for all buffers :
// buff.size == dst.size
if
(
deprojectMap
.
size
()
!=
dst
.
size
()){
std
::
vector
<
cv
::
Point2f
>
profil
=
camera
->
getAdaptedIntrinsics
(
dst
);
fxy
=
profil
.
at
(
0
);
...
...
@@ -50,25 +47,7 @@ void Projection::adjustFrame(cv::Mat_<float> &depth, cv::Mat_<cv::Vec3b> &src, c
frameMap
.
create
(
dst
.
rows
,
dst
.
cols
);
resized_depth
.
create
(
dst
.
rows
,
dst
.
cols
);
resized_src
.
create
(
dst
.
rows
,
dst
.
cols
);
/*
// default
if(deprojectMap.empty() || deprojectMap.size() != dst.size()){
if(!deprojectMap.empty()){
deprojectMap.release();
frameMap.release();
resized_depth.release();
resized_src.release();
}
deprojectMap.create(dst.rows, dst.cols);
frameMap.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);
ppxy = profil.at(1);
}
*/
deprojectMap
=
cv
::
Point2i
(
-
1
,
-
1
);
frameMap
=
cv
::
Point2i
(
-
1
,
-
1
);
...
...
This diff is collapsed.
Click to expand it.
src/lib/sandbox.cpp
+
1
−
1
View file @
1904bb0d
...
...
@@ -51,7 +51,7 @@ cv::Mat_<cv::Vec3b> Sandbox::adjustProjection(cv::Mat_<cv::Vec3b> &frame, cv::Ma
//cv::dilate(projectedFrame, projectedFrame, cv::Mat(), cv::Point(-1, -1), 2, 1, 1);
//cv::erode(projectedFrame, projectedFrame, cv::Mat(), cv::Point(-1, -1), 2, 1, 1);
return
projectedFrame
;
return
projectedFrame
.
clone
()
;
}
cv
::
Mat_
<
cv
::
Vec3b
>
Sandbox
::
adjustProjection
(
cv
::
Mat_
<
cv
::
Vec3b
>
&
frame
){
...
...
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