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
46ff164e
Commit
46ff164e
authored
4 years ago
by
simon.fanetti
Browse files
Options
Downloads
Patches
Plain Diff
update holefilling with 1st non null neighbour
parent
1b351233
No related branches found
No related tags found
1 merge request
!3
Custom realsense
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/SandboxSetup/croppingmask.cpp
+1
-1
1 addition, 1 deletion
app/SandboxSetup/croppingmask.cpp
inc/projection.h
+4
-1
4 additions, 1 deletion
inc/projection.h
src/components/projection.cpp
+9
-17
9 additions, 17 deletions
src/components/projection.cpp
with
14 additions
and
19 deletions
app/SandboxSetup/croppingmask.cpp
+
1
−
1
View file @
46ff164e
...
...
@@ -87,7 +87,7 @@ void CroppingMask::init(){
}
// no config found
if
(
rectPoints
.
empty
()
||
!
maskValideInFrame
(
&
cameraColoredFrame
)){
if
(
!
maskValideInFrame
(
&
cameraColoredFrame
)){
float
y
=
cameraColoredFrame
.
size
().
height
;
float
x
=
cameraColoredFrame
.
size
().
width
;
rectPoints
=
std
::
vector
<
cv
::
Point2i
>
{
cv
::
Point2i
(
1.0
/
4
*
x
,
1.0
/
4
*
y
),
cv
::
Point2i
(
1.0
/
4
*
x
,
3.0
/
4
*
y
),
cv
::
Point2i
(
3.0
/
4
*
x
,
3.0
/
4
*
y
),
cv
::
Point2i
(
3.0
/
4
*
x
,
1.0
/
4
*
y
)
};
...
...
This diff is collapsed.
Click to expand it.
inc/projection.h
+
4
−
1
View file @
46ff164e
...
...
@@ -10,13 +10,16 @@ class Projection{
cv
::
Mat_
<
float
>
adjustingMatrix
;
float
distanceTopSandbox
;
// resized depth frame to dst resolution
cv
::
Mat_
<
float
>
resized_depth
;
// resized src to project to dst resolution
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
// Buffer indicating from where to get the pixels in the source frame
to build the output
cv
::
Mat_
<
cv
::
Point2i
>
frameMap
;
// intrinsics parameters for deprojection, which are adapted to projection's resolution
cv
::
Point2f
fxy
;
cv
::
Point2f
ppxy
;
...
...
This diff is collapsed.
Click to expand it.
src/components/projection.cpp
+
9
−
17
View file @
46ff164e
...
...
@@ -172,7 +172,7 @@ void Projection::buildFrame(cv::Mat_<float> &depth, cv::Mat_<cv::Point2i> &frame
}
/*
average of
non null neighbour
s
fill with value of the 1st
non null neighbour
*/
void
Projection
::
holeFilling
(
cv
::
Mat_
<
cv
::
Vec3b
>
&
dst
,
cv
::
Mat_
<
cv
::
Point2i
>
&
frameMap
){
...
...
@@ -181,34 +181,26 @@ void Projection::holeFilling(cv::Mat_<cv::Vec3b> &dst, cv::Mat_<cv::Point2i> &fr
if
(
frameMap
.
at
<
cv
::
Point2i
>
(
i
,
j
)
==
cv
::
Point2i
(
-
1
,
-
1
)){
int
cpt
=
0
;
int
r
=
0
;
int
g
=
0
;
int
b
=
0
;
cv
::
Vec3b
color
;
bool
found
=
false
;
for
(
int
d_y
=
-
1
;
d_y
<=
1
;
d_y
++
){
for
(
int
d_x
=
-
1
;
d_x
<=
1
;
d_x
++
){
for
(
int
d_y
=
-
1
;
d_y
<=
1
&&
!
found
;
d_y
++
){
for
(
int
d_x
=
-
1
;
d_x
<=
1
&&
!
found
;
d_x
++
){
if
(
!
(
d_x
==
0
&&
d_y
==
0
)){
int
y
=
i
+
d_y
;
int
x
=
j
+
d_x
;
if
(
((
0
<=
x
&&
x
<
dst
.
cols
)
&&
(
0
<=
y
&&
y
<
dst
.
rows
))
&&
(
frameMap
.
at
<
cv
::
Point2i
>
(
y
,
x
)
!=
cv
::
Point2i
(
-
1
,
-
1
))
){
cv
::
Vec3b
color
=
dst
.
at
<
cv
::
Vec3b
>
(
y
,
x
);
r
+=
color
[
0
];
g
+=
color
[
1
];
b
+=
color
[
2
];
cpt
++
;
color
=
dst
.
at
<
cv
::
Vec3b
>
(
y
,
x
);
found
=
true
;
}
}
}
}
if
(
cpt
>
0
){
r
/=
cpt
;
g
/=
cpt
;
b
/=
cpt
;
dst
.
at
<
cv
::
Vec3b
>
(
i
,
j
)
=
cv
::
Vec3b
(
r
,
g
,
b
);
if
(
found
){
dst
.
at
<
cv
::
Vec3b
>
(
i
,
j
)
=
color
;
}
}
}
...
...
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