Skip to content

Commit d8ebbc2

Browse files
committed
CameraK4A: rectifying color image (this improves a lot visual odometry accuracy)
1 parent d700d09 commit d8ebbc2

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

corelib/src/camera/CameraK4A.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ bool CameraK4A::init(const std::string & calibrationFolder, const std::string &
286286
cv::Size(calibration_.depth_camera_calibration.resolution_width, calibration_.depth_camera_calibration.resolution_height),
287287
K,D,R,P,
288288
this->getLocalTransform());
289-
UASSERT(model_.isValidForRectification());
290-
model_.initRectificationMap();
291289
}
292290
else
293291
{
@@ -317,6 +315,8 @@ bool CameraK4A::init(const std::string & calibrationFolder, const std::string &
317315
K,D,R,P,
318316
this->getLocalTransform());
319317
}
318+
UASSERT(model_.isValidForRectification());
319+
model_.initRectificationMap();
320320

321321
if (ULogger::level() <= ULogger::kInfo)
322322
{
@@ -490,6 +490,7 @@ SensorData CameraK4A::captureImage(CameraInfo * info)
490490

491491
cv::cvtColor(bgra, bgrCV, CV_BGRA2BGR);
492492
}
493+
bgrCV = model_.rectifyImage(bgrCV);
493494

494495
// Release the image
495496
k4a_image_release(rgb_image_);

guilib/src/ui/preferencesDialog.ui

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<property name="geometry">
6464
<rect>
6565
<x>0</x>
66-
<y>0</y>
66+
<y>-677</y>
6767
<width>686</width>
6868
<height>3286</height>
6969
</rect>
@@ -95,7 +95,7 @@
9595
<enum>QFrame::Raised</enum>
9696
</property>
9797
<property name="currentIndex">
98-
<number>10</number>
98+
<number>5</number>
9999
</property>
100100
<widget class="QWidget" name="page_22">
101101
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
@@ -3220,7 +3220,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
32203220
<item>
32213221
<widget class="QStackedWidget" name="stackedWidget_rgbd">
32223222
<property name="currentIndex">
3223-
<number>9</number>
3223+
<number>10</number>
32243224
</property>
32253225
<widget class="QWidget" name="page_32">
32263226
<layout class="QVBoxLayout" name="verticalLayout_63">
@@ -4476,6 +4476,9 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
44764476
<property name="text">
44774477
<string>Frames per second</string>
44784478
</property>
4479+
<property name="textInteractionFlags">
4480+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
4481+
</property>
44794482
</widget>
44804483
</item>
44814484
<item row="5" column="0">
@@ -4567,11 +4570,14 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
45674570
<item row="3" column="2">
45684571
<widget class="QLabel" name="label_558">
45694572
<property name="text">
4570-
<string>Use IR for RGB image (odometry may be better)</string>
4573+
<string>Use IR for RGB image (may work better in dark areas).</string>
45714574
</property>
45724575
<property name="wordWrap">
45734576
<bool>true</bool>
45744577
</property>
4578+
<property name="textInteractionFlags">
4579+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
4580+
</property>
45754581
</widget>
45764582
</item>
45774583
<item row="1" column="1">
@@ -4606,12 +4612,21 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
46064612
<property name="wordWrap">
46074613
<bool>true</bool>
46084614
</property>
4615+
<property name="textInteractionFlags">
4616+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
4617+
</property>
46094618
</widget>
46104619
</item>
46114620
<item row="0" column="2">
46124621
<widget class="QLabel" name="label_600">
46134622
<property name="text">
4614-
<string>RGB camera resolution</string>
4623+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;RGB camera resolution. Note that when color camera is used (IR mode is not checked below), to &lt;span style=&quot; font-weight:600;&quot;&gt;avoid black borders in point clouds&lt;/span&gt; generated, set ROI ratios under 3D Rendering settings to &amp;quot;0.05 0.05 0.05 0.05&amp;quot; under Map and Odom columns.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
4624+
</property>
4625+
<property name="wordWrap">
4626+
<bool>true</bool>
4627+
</property>
4628+
<property name="textInteractionFlags">
4629+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
46154630
</property>
46164631
</widget>
46174632
</item>

0 commit comments

Comments
 (0)