This commit is contained in:
matlabbe
2018-04-30 11:16:26 -04:00
parent 63cc86bdcd
commit a39d0840ce
2 changed files with 3 additions and 2 deletions

View File

@@ -1434,7 +1434,7 @@ void DatabaseViewer::extractImages()
else if(!data.imageRaw().empty() && !data.depthRaw().empty()) else if(!data.imageRaw().empty() && !data.depthRaw().empty())
{ {
cv::imwrite(QString("%1/rgb/%2.%3").arg(path).arg(id).arg(ext).toStdString(), data.imageRaw()); cv::imwrite(QString("%1/rgb/%2.%3").arg(path).arg(id).arg(ext).toStdString(), data.imageRaw());
cv::imwrite(QString("%1/depth/%2.png").arg(path).arg(id).toStdString(), data.depthRaw()); cv::imwrite(QString("%1/depth/%2.png").arg(path).arg(id).toStdString(), data.depthRaw().type()==CV_32FC1?util2d::cvtDepthFromFloat(data.depthRaw()):data.depthRaw());
UINFO(QString("Saved rgb/%1.%2 and depth/%1.png").arg(id).arg(ext).toStdString().c_str()); UINFO(QString("Saved rgb/%1.%2 and depth/%1.png").arg(id).arg(ext).toStdString().c_str());
++imagesExported; ++imagesExported;
} }

View File

@@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "rtabmap/core/OccupancyGrid.h" #include "rtabmap/core/OccupancyGrid.h"
#include "rtabmap/core/GainCompensator.h" #include "rtabmap/core/GainCompensator.h"
#include "rtabmap/core/Recovery.h" #include "rtabmap/core/Recovery.h"
#include "rtabmap/core/util2d.h"
#include "rtabmap/gui/ImageView.h" #include "rtabmap/gui/ImageView.h"
#include "rtabmap/gui/KeypointItem.h" #include "rtabmap/gui/KeypointItem.h"
@@ -6831,7 +6832,7 @@ void MainWindow::exportImages()
else if(!data.imageRaw().empty() && !data.depthRaw().empty()) else if(!data.imageRaw().empty() && !data.depthRaw().empty())
{ {
cv::imwrite(QString("%1/rgb/%2.%3").arg(path).arg(id).arg(ext).toStdString(), data.imageRaw()); cv::imwrite(QString("%1/rgb/%2.%3").arg(path).arg(id).arg(ext).toStdString(), data.imageRaw());
cv::imwrite(QString("%1/depth/%2.png").arg(path).arg(id).toStdString(), data.depthRaw()); cv::imwrite(QString("%1/depth/%2.png").arg(path).arg(id).toStdString(), data.depthRaw().type()==CV_32FC1?util2d::cvtDepthFromFloat(data.depthRaw()):data.depthRaw());
info = tr("Saved rgb/%1.%2 and depth/%1.png.").arg(id).arg(ext); info = tr("Saved rgb/%1.%2 and depth/%1.png.").arg(id).arg(ext);
} }
else if(!data.imageRaw().empty()) else if(!data.imageRaw().empty())