PassengerStatistics/Main/ImageUtilities.cpp

10 lines
423 B
C++
Raw Normal View History

2024-03-13 18:01:36 +08:00
#include "ImageUtilities.h"
#include <opencv2/opencv.hpp>
namespace ImageUtilities {
void NV21ToBGR24(const uint8_t *nv21Data, uint8_t *bgr24Data, int width, int height) {
cv::Mat nv21Image(height + height / 2, width, CV_8UC1, const_cast<unsigned char *>(nv21Data));
cv::Mat bgrImage(height, width, CV_8UC3, bgr24Data);
cv::cvtColor(nv21Image, bgrImage, cv::COLOR_YUV2BGR_NV21);
}
} // namespace ImageUtilities