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
58d28e7e
Commit
58d28e7e
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/gui2' of gitlab.utu.fi:nicolas.pope/ftl into feature/gui2
parents
76d93864
a10c6308
No related branches found
No related tags found
1 merge request
!316
Resolves #343 GUI and Frame Refactor
Pipeline
#28150
passed
4 years ago
Stage: all
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/rgbd-sources/src/sources/stereovideo/pylon.cpp
+7
-4
7 additions, 4 deletions
components/rgbd-sources/src/sources/stereovideo/pylon.cpp
components/rgbd-sources/src/sources/stereovideo/rectification.cpp
+15
-9
15 additions, 9 deletions
...ts/rgbd-sources/src/sources/stereovideo/rectification.cpp
with
22 additions
and
13 deletions
components/rgbd-sources/src/sources/stereovideo/pylon.cpp
+
7
−
4
View file @
58d28e7e
...
...
@@ -50,9 +50,9 @@ PylonDevice::PylonDevice(nlohmann::json &config)
}
if
(
dev_left_num
==
i
)
{
LOG
(
INFO
)
<<
" - found Pylon device - "
<<
d
.
GetSerialNumber
()
<<
"("
<<
d
.
GetModelName
()
<<
") [primary]"
;
LOG
(
INFO
)
<<
" - found Pylon device - "
<<
d
.
GetSerialNumber
()
<<
"
("
<<
d
.
GetModelName
()
<<
") [primary]"
;
}
else
{
LOG
(
INFO
)
<<
" - found Pylon device - "
<<
d
.
GetSerialNumber
()
<<
"("
<<
d
.
GetModelName
()
<<
")"
;
LOG
(
INFO
)
<<
" - found Pylon device - "
<<
d
.
GetSerialNumber
()
<<
"
("
<<
d
.
GetModelName
()
<<
")"
;
}
++
i
;
...
...
@@ -147,8 +147,11 @@ void PylonDevice::_configureCamera(CBaslerUniversalInstantCamera *cam) {
LOG
(
WARNING
)
<<
"Could not change pixel format"
;
}
cam
->
ExposureTime
.
SetValue
(
24000.0
f
);
// Exposure time in microseconds
cam
->
LightSourcePreset
.
SetValue
(
Basler_UniversalCameraParams
::
LightSourcePreset_Tungsten2800K
);
// White balance option
if
(
cam
->
GetDeviceInfo
().
GetModelName
()
!=
"Emulation"
)
{
// Emulated device throws exception with these
cam
->
ExposureTime
.
SetValue
(
24000.0
f
);
// Exposure time in microseconds
cam
->
LightSourcePreset
.
SetValue
(
Basler_UniversalCameraParams
::
LightSourcePreset_Tungsten2800K
);
// White balance option
}
}
bool
PylonDevice
::
grab
()
{
...
...
This diff is collapsed.
Click to expand it.
components/rgbd-sources/src/sources/stereovideo/rectification.cpp
+
15
−
9
View file @
58d28e7e
...
...
@@ -28,7 +28,9 @@ StereoRectification::StereoRectification(nlohmann::json &config, cv::Size image_
void
StereoRectification
::
setSize
(
cv
::
Size
size
)
{
image_resolution_
=
size
;
calculateParameters
();
if
(
calibrated
())
{
calculateParameters
();
}
}
void
StereoRectification
::
setInterpolation
(
int
interpolation
)
{
...
...
@@ -64,13 +66,18 @@ void StereoRectification::setCalibration(const CalibrationData &calib) {
void
StereoRectification
::
calculateParameters
()
{
using
namespace
ftl
::
calibration
;
// TODO: lock
{
bool
valid
=
true
;
valid
&=
calib_left_
.
intrinsic
.
resolution
!=
cv
::
Size
{
0
,
0
};
valid
&=
calib_right_
.
intrinsic
.
resolution
!=
cv
::
Size
{
0
,
0
};
valid
&=
calib_left_
.
intrinsic
.
distCoeffs
.
size
()
!=
0
;
valid
&=
calib_right_
.
intrinsic
.
distCoeffs
.
size
()
!=
0
;
valid
&=
validate
::
cameraMatrix
(
calib_left_
.
intrinsic
.
matrix
());
valid
&=
validate
::
cameraMatrix
(
calib_right_
.
intrinsic
.
matrix
());
if
(
!
valid
)
{
return
;
}
}
valid_
=
false
;
bool
valid
=
true
;
valid_
&=
!
calib_left_
.
intrinsic
.
resolution
.
empty
();
valid_
&=
!
calib_right_
.
intrinsic
.
resolution
.
empty
();
valid_
&=
validate
::
cameraMatrix
(
calib_left_
.
intrinsic
.
matrix
());
valid_
&=
validate
::
cameraMatrix
(
calib_right_
.
intrinsic
.
matrix
());
if
(
!
valid
)
{
return
;
}
// create temporary buffers
if
(
tmp_l_
.
size
()
!=
image_resolution_
)
{
...
...
@@ -104,9 +111,8 @@ void StereoRectification::calculateParameters() {
cv
::
Mat
R
;
cv
::
Mat
t
;
transform
::
getRotationAndTranslation
(
T
,
R
,
t
);
baseline_
=
cv
::
norm
(
t
);
if
(
baseline_
==
0
)
{
return
;
}
if
(
baseline_
==
0.
0
)
{
return
;
}
// calculate rectification parameters
cv
::
stereoRectify
(
K_l
,
dc_l
,
K_r
,
dc_r
,
image_resolution_
,
...
...
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