5 #include <depthai-shared/common/CameraBoardSocket.hpp> 6 #include <depthai/depthai.hpp> 8 #include <opencv2/opencv.hpp> 11 #include <unordered_map> 14 #include "rclcpp/rclcpp.hpp" 15 #include "sensor_msgs/msg/camera_info.hpp" 16 #include "sensor_msgs/msg/image.hpp" 17 #include "std_msgs/msg/header.hpp" 21 #include <boost/make_shared.hpp> 22 #include <boost/range/algorithm.hpp> 24 #include "sensor_msgs/CameraInfo.h" 25 #include "sensor_msgs/Image.h" 26 #include "std_msgs/Header.h" 35 namespace StdMsgs = std_msgs::msg;
37 using ImagePtr = ImageMsgs::Image::SharedPtr;
43 using TimePoint = std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration>;
51 void toRosMsg(std::shared_ptr<dai::ImgFrame> inData, std::deque<ImageMsgs::Image>& outImageMsgs);
54 void toDaiMsg(
const ImageMsgs::Image& inMsg, dai::ImgFrame& outData);
62 dai::CameraBoardSocket cameraId,
65 Point2f topLeftPixelId = Point2f(),
66 Point2f bottomRightPixelId = Point2f());
76 void planarToInterleaved(
const std::vector<uint8_t>& srcData, std::vector<uint8_t>& destData,
int w,
int h,
int numPlanes,
int bpp);
77 void interleavedToPlanar(
const std::vector<uint8_t>& srcData, std::vector<uint8_t>& destData,
int w,
int h,
int numPlanes,
int bpp);
static std::unordered_map< dai::RawImgFrame::Type, std::string > planarEncodingEnumMap
const std::string _frameName
ImagePtr toRosMsgPtr(std::shared_ptr< dai::ImgFrame > inData)
ImageConverter(const std::string frameName, bool interleaved)
std::chrono::time_point< std::chrono::steady_clock, std::chrono::steady_clock::duration > TimePoint
cv::Mat rosMsgtoCvMat(ImageMsgs::Image &inMsg)
void planarToInterleaved(const std::vector< uint8_t > &srcData, std::vector< uint8_t > &destData, int w, int h, int numPlanes, int bpp)
void toDaiMsg(const ImageMsgs::Image &inMsg, dai::ImgFrame &outData)
void interleavedToPlanar(const std::vector< uint8_t > &srcData, std::vector< uint8_t > &destData, int w, int h, int numPlanes, int bpp)
ImageMsgs::ImagePtr ImagePtr
static std::unordered_map< dai::RawImgFrame::Type, std::string > encodingEnumMap
ImageMsgs::CameraInfo calibrationToCameraInfo(dai::CalibrationHandler calibHandler, dai::CameraBoardSocket cameraId, int width=-1, int height=-1, Point2f topLeftPixelId=Point2f(), Point2f bottomRightPixelId=Point2f())
void toRosMsg(std::shared_ptr< dai::ImgFrame > inData, std::deque< ImageMsgs::Image > &outImageMsgs)