Minor fixes

- Moved TimeUtil from header to src
- Fixed issue with Qimage -> Mat conversion
This commit is contained in:
Brenno
2021-01-13 20:22:17 -03:00
parent 7fbb8a2cb7
commit f6de53350f
12 changed files with 12 additions and 30 deletions

View File

@@ -943,7 +943,7 @@ std::shared_ptr<QImage> Frame::GetImage()
// Convert Qimage to Mat
cv::Mat Frame::Qimage2mat( std::shared_ptr<QImage>& qimage) {
cv::Mat mat = cv::Mat(qimage->height(), qimage->width(), CV_8UC4, (const uchar*)qimage->constbits(), qimage->bytesPerLine()).clone();
cv::Mat mat = cv::Mat(qimage->height(), qimage->width(), CV_8UC4, (uchar*)qimage->constBits(), qimage->bytesPerLine()).clone();
cv::Mat mat2 = cv::Mat(mat.rows, mat.cols, CV_8UC3 );
int from_to[] = { 0,0, 1,1, 2,2 };
cv::mixChannels( &mat, 1, &mat2, 1, from_to, 3 );