Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
f6c8fcf2
Commit
f6c8fcf2
authored
4 years ago
by
Sebastian Hahta
Browse files
Options
Downloads
Patches
Plain Diff
add check
parent
721c6752
No related branches found
No related tags found
1 merge request
!316
Resolves #343 GUI and Frame Refactor
Pipeline
#28311
passed
4 years ago
Stage: all
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/gui2/src/modules/calibration/calibration.hpp
+5
-5
5 additions, 5 deletions
applications/gui2/src/modules/calibration/calibration.hpp
applications/gui2/src/modules/calibration/stereo.cpp
+8
-3
8 additions, 3 deletions
applications/gui2/src/modules/calibration/stereo.cpp
with
13 additions
and
8 deletions
applications/gui2/src/modules/calibration/calibration.hpp
+
5
−
5
View file @
f6c8fcf2
...
@@ -19,9 +19,10 @@ public:
...
@@ -19,9 +19,10 @@ public:
void
set
(
unsigned
int
flag
)
{
flags_
|=
flag
;
}
void
set
(
unsigned
int
flag
)
{
flags_
|=
flag
;
}
void
unset
(
unsigned
int
flag
)
{
flags_
&=
~
flag
;
}
void
unset
(
unsigned
int
flag
)
{
flags_
&=
~
flag
;
}
void
reset
()
{
flags_
=
0
;
}
void
reset
()
{
flags_
=
0
;
}
std
::
string
name
(
int
)
const
;
int
defaultFlags
()
const
;
int
defaultFlags
()
const
;
std
::
vector
<
int
>
list
()
const
;
std
::
vector
<
int
>
list
()
const
;
std
::
string
name
(
int
)
const
;
std
::
string
explain
(
int
)
const
;
std
::
string
explain
(
int
)
const
;
operator
int
()
{
return
flags_
;
}
operator
int
()
{
return
flags_
;
}
...
@@ -36,8 +37,6 @@ public:
...
@@ -36,8 +37,6 @@ public:
std
::
string
explain
(
int
)
const
;
std
::
string
explain
(
int
)
const
;
};
};
/**
/**
* Calibration. Loads Intrinsic and Extrinsic calibration modules and
* Calibration. Loads Intrinsic and Extrinsic calibration modules and
* adds buttons to main screen.
* adds buttons to main screen.
...
@@ -313,6 +312,8 @@ private:
...
@@ -313,6 +312,8 @@ private:
std
::
future
<
void
>
future_
;
std
::
future
<
void
>
future_
;
std
::
mutex
mtx_
;
std
::
mutex
mtx_
;
ftl
::
data
::
FrameSetPtr
fs_current_
;
ftl
::
data
::
FrameSetPtr
fs_update_
;
struct
State
{
struct
State
{
cv
::
Mat
gray_left
;
cv
::
Mat
gray_left
;
...
@@ -328,10 +329,9 @@ private:
...
@@ -328,10 +329,9 @@ private:
float
last
=
0.0
f
;
float
last
=
0.0
f
;
float
frequency
=
0.5
f
;
float
frequency
=
0.5
f
;
int
count
=
0
;
int
count
=
0
;
float
reprojection_error
=
NAN
;
OpenCVCalibrateFlagsStereo
flags
;
OpenCVCalibrateFlagsStereo
flags
;
ftl
::
data
::
FrameSetPtr
fs_current
;
ftl
::
data
::
FrameSetPtr
fs_updated
;
ftl
::
data
::
FrameSetPtr
fs_previous_points
;
ftl
::
data
::
FrameSetPtr
fs_previous_points
;
std
::
vector
<
std
::
vector
<
cv
::
Point2f
>>
points_l
;
std
::
vector
<
std
::
vector
<
cv
::
Point2f
>>
points_l
;
std
::
vector
<
std
::
vector
<
cv
::
Point2f
>>
points_r
;
std
::
vector
<
std
::
vector
<
cv
::
Point2f
>>
points_r
;
...
...
This diff is collapsed.
Click to expand it.
applications/gui2/src/modules/calibration/stereo.cpp
+
8
−
3
View file @
f6c8fcf2
...
@@ -135,6 +135,7 @@ bool StereoCalibration::onFrame_(const ftl::data::FrameSetPtr& fs) {
...
@@ -135,6 +135,7 @@ bool StereoCalibration::onFrame_(const ftl::data::FrameSetPtr& fs) {
auto
&
frame
=
fs
->
frames
[
state_
->
id
.
source
()];
auto
&
frame
=
fs
->
frames
[
state_
->
id
.
source
()];
if
(
!
checkFrame
(
frame
))
{
return
true
;
}
if
(
!
checkFrame
(
frame
))
{
return
true
;
}
if
(
!
frame
.
hasAll
({
channelLeft_
(),
channelRight_
()}))
{
return
true
;
}
if
(
!
state_
->
capture
)
{
return
true
;
}
if
(
!
state_
->
capture
)
{
return
true
;
}
if
((
float
(
glfwGetTime
())
-
state_
->
last
)
<
state_
->
frequency
)
{
return
true
;
}
if
((
float
(
glfwGetTime
())
-
state_
->
last
)
<
state_
->
frequency
)
{
return
true
;
}
if
(
state_
->
running
.
exchange
(
true
))
{
return
true
;
}
if
(
state_
->
running
.
exchange
(
true
))
{
return
true
;
}
...
@@ -143,8 +144,10 @@ bool StereoCalibration::onFrame_(const ftl::data::FrameSetPtr& fs) {
...
@@ -143,8 +144,10 @@ bool StereoCalibration::onFrame_(const ftl::data::FrameSetPtr& fs) {
try
{
try
{
auto
&
frame
=
(
*
fs
)[
state_
->
id
.
source
()].
cast
<
ftl
::
rgbd
::
Frame
>
();
auto
&
frame
=
(
*
fs
)[
state_
->
id
.
source
()].
cast
<
ftl
::
rgbd
::
Frame
>
();
cv
::
cvtColor
(
getMat
(
frame
,
channelLeft_
()),
state_
->
gray_left
,
cv
::
COLOR_BGRA2GRAY
);
auto
l
=
getMat
(
frame
,
channelLeft_
());
cv
::
cvtColor
(
getMat
(
frame
,
channelRight_
()),
state_
->
gray_right
,
cv
::
COLOR_BGRA2GRAY
);
auto
r
=
getMat
(
frame
,
channelRight_
());
cv
::
cvtColor
(
l
,
state_
->
gray_left
,
cv
::
COLOR_BGRA2GRAY
);
cv
::
cvtColor
(
r
,
state_
->
gray_right
,
cv
::
COLOR_BGRA2GRAY
);
std
::
vector
<
cv
::
Point2d
>
pointsl
;
std
::
vector
<
cv
::
Point2d
>
pointsl
;
std
::
vector
<
cv
::
Point2d
>
pointsr
;
std
::
vector
<
cv
::
Point2d
>
pointsr
;
...
@@ -203,8 +206,10 @@ bool StereoCalibration::isBusy() {
...
@@ -203,8 +206,10 @@ bool StereoCalibration::isBusy() {
}
}
void
StereoCalibration
::
run
()
{
void
StereoCalibration
::
run
()
{
if
(
state_
->
running
)
{
return
;
}
state_
->
running
=
true
;
state_
->
running
=
true
;
future_
=
ftl
::
pool
.
push
([
this
](
int
id
)
{
future_
=
ftl
::
pool
.
push
([
this
](
int
)
{
try
{
try
{
auto
&
calib_l
=
state_
->
calib
.
get
(
Channel
::
Left
);
auto
&
calib_l
=
state_
->
calib
.
get
(
Channel
::
Left
);
auto
&
calib_r
=
state_
->
calib
.
get
(
Channel
::
Right
);
auto
&
calib_r
=
state_
->
calib
.
get
(
Channel
::
Right
);
...
...
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