mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-06 18:17:47 +08:00
Adding more dependencies in Windows CI
This commit is contained in:
@@ -392,7 +392,6 @@ IF(depthai_FOUND)
|
||||
SET(PUBLIC_LIBRARIES
|
||||
${PUBLIC_LIBRARIES}
|
||||
depthai::core
|
||||
depthai::opencv
|
||||
)
|
||||
ENDIF(depthai_FOUND)
|
||||
|
||||
|
||||
@@ -729,6 +729,21 @@ std::string CameraDepthAI::getSerial() const
|
||||
return "";
|
||||
}
|
||||
|
||||
#ifdef RTABMAP_DEPTHAI
|
||||
namespace {
|
||||
// Convert the depthai depth ImgFrame to cv::Mat (similar to dai::ImgFrame::getCvFrame())
|
||||
cv::Mat depthImgFrameToCvMat(const std::shared_ptr<dai::ImgFrame> & frame)
|
||||
{
|
||||
if(frame->getType() != dai::ImgFrame::Type::RAW16)
|
||||
{
|
||||
UERROR("Expected RAW16 depth ImgFrame but got type %d", (int)frame->getType());
|
||||
return cv::Mat();
|
||||
}
|
||||
return cv::Mat((int)frame->getHeight(), (int)frame->getWidth(), CV_16UC1, frame->getData().data()).clone();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info)
|
||||
{
|
||||
SensorData data;
|
||||
@@ -740,7 +755,7 @@ SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info)
|
||||
|
||||
double stamp = std::chrono::duration<double>(depthOrRight->getTimestampDevice(dai::CameraExposureOffset::MIDDLE).time_since_epoch()).count();
|
||||
if(outputMode_)
|
||||
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_ANYCOLOR), depthOrRight->getCvFrame(), stereoModel_.left(), this->getNextSeqID(), stamp);
|
||||
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_ANYCOLOR), depthImgFrameToCvMat(depthOrRight), stereoModel_.left(), this->getNextSeqID(), stamp);
|
||||
else
|
||||
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_GRAYSCALE), cv::imdecode(depthOrRight->getData(), cv::IMREAD_GRAYSCALE), stereoModel_, this->getNextSeqID(), stamp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user