1234567891011121314151617 |
- #ifndef IMAGE_TEST_H
- #define IMAGE_TEST_H
- #include <opencv4/opencv2/opencv.hpp>
- #include <string>
- namespace ImageTest
- {
- void saveImageFromData(unsigned char *data, int width, int height, const std::string &filename = "./output.png")
- {
- cv::Mat image(height, width, CV_8UC3, data);
- cv::imwrite(filename, image);
- }
- }
- #endif // IMAGE_TEST_H
|