31#include "rtabmap/core/rtabmap_core_export.h"
33#include <rtabmap/core/rvl_codec.h>
34#include <rtabmap/utilite/UThread.h>
35#include <opencv2/opencv.hpp>
89 cv::Mat compressedData_;
90 cv::Mat uncompressedData_;
97std::vector<unsigned char> RTABMAP_CORE_EXPORT
compressImage(
const cv::Mat & image,
const std::string & format =
".png");
99cv::Mat RTABMAP_CORE_EXPORT
compressImage2(
const cv::Mat & image,
const std::string & format =
".png");
107std::vector<unsigned char> RTABMAP_CORE_EXPORT
compressData(
const cv::Mat & data);
114cv::Mat RTABMAP_CORE_EXPORT
uncompressData(
const std::vector<unsigned char> & bytes);
116cv::Mat RTABMAP_CORE_EXPORT
uncompressData(
const unsigned char * bytes,
unsigned long size);
Background thread to compress or uncompress images and generic matrices.
const cv::Mat & getCompressedData() const
CompressionThread(const cv::Mat &mat, const std::string &format="")
Constructs a thread in compress mode.
CompressionThread(const cv::Mat &bytes, bool isImage)
Constructs a thread in uncompress mode.
cv::Mat & getUncompressedData()
cv::Mat RTABMAP_CORE_EXPORT uncompressImage(const cv::Mat &bytes)
Decodes compressed image bytes to a @cv::Mat.
cv::Mat RTABMAP_CORE_EXPORT compressString(const std::string &str)
Compresses a null-terminated string using compressData2().
std::vector< unsigned char > RTABMAP_CORE_EXPORT compressImage(const cv::Mat &image, const std::string &format=".png")
Encodes image to a byte buffer (OpenCV imencode or RVL for depth).
std::string RTABMAP_CORE_EXPORT compressedDepthFormat(const cv::Mat &bytes)
Detects the compression format of depth image bytes.
cv::Mat RTABMAP_CORE_EXPORT uncompressData(const cv::Mat &bytes)
Restores a matrix compressed with compressData() or compressData2().
std::vector< unsigned char > RTABMAP_CORE_EXPORT compressData(const cv::Mat &data)
Compresses a matrix with zlib; appends rows, cols and type at the end.
std::string RTABMAP_CORE_EXPORT uncompressString(const cv::Mat &bytes)
Decompresses a string produced by compressString().
cv::Mat RTABMAP_CORE_EXPORT compressImage2(const cv::Mat &image, const std::string &format=".png")
Same as compressImage() but returns a CV_8UC1 row matrix.
cv::Mat RTABMAP_CORE_EXPORT compressData2(const cv::Mat &data)
Same as compressData() but returns a CV_8UC1 row matrix.