Skip to content

Commit

Permalink
CameraK4A: rectifying color image (this improves a lot visual odometr…
Browse files Browse the repository at this point in the history
…y accuracy)
  • Loading branch information
matlabbe committed Dec 13, 2020
1 parent d700d09 commit d8ebbc2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
5 changes: 3 additions & 2 deletions corelib/src/camera/CameraK4A.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ bool CameraK4A::init(const std::string & calibrationFolder, const std::string &
cv::Size(calibration_.depth_camera_calibration.resolution_width, calibration_.depth_camera_calibration.resolution_height),
K,D,R,P,
this->getLocalTransform());
UASSERT(model_.isValidForRectification());
model_.initRectificationMap();
}
else
{
Expand Down Expand Up @@ -317,6 +315,8 @@ bool CameraK4A::init(const std::string & calibrationFolder, const std::string &
K,D,R,P,
this->getLocalTransform());
}
UASSERT(model_.isValidForRectification());
model_.initRectificationMap();

if (ULogger::level() <= ULogger::kInfo)
{
Expand Down Expand Up @@ -490,6 +490,7 @@ SensorData CameraK4A::captureImage(CameraInfo * info)

cv::cvtColor(bgra, bgrCV, CV_BGRA2BGR);
}
bgrCV = model_.rectifyImage(bgrCV);

// Release the image
k4a_image_release(rgb_image_);
Expand Down
25 changes: 20 additions & 5 deletions guilib/src/ui/preferencesDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-677</y>
<width>686</width>
<height>3286</height>
</rect>
Expand Down Expand Up @@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>10</number>
<number>5</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
Expand Down Expand Up @@ -3220,7 +3220,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<item>
<widget class="QStackedWidget" name="stackedWidget_rgbd">
<property name="currentIndex">
<number>9</number>
<number>10</number>
</property>
<widget class="QWidget" name="page_32">
<layout class="QVBoxLayout" name="verticalLayout_63">
Expand Down Expand Up @@ -4476,6 +4476,9 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<property name="text">
<string>Frames per second</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0">
Expand Down Expand Up @@ -4567,11 +4570,14 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<item row="3" column="2">
<widget class="QLabel" name="label_558">
<property name="text">
<string>Use IR for RGB image (odometry may be better)</string>
<string>Use IR for RGB image (may work better in dark areas).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
Expand Down Expand Up @@ -4606,12 +4612,21 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_600">
<property name="text">
<string>RGB camera resolution</string>
<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>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit d8ebbc2

Please sign in to comment.