Commit 7c4861fe by 景炳强

fix

parent 50e21ba3
......@@ -116,26 +116,17 @@ void ProcessThread::run()
//qDebug() << "ROI- " << idx << " " << roi.X() << " " << roi.Y() << " " << roi.Width() << " " << roi.Height() << "\n";
size_t size = roi.Width() * roi.Height() << 2;
uint8_t *buff1 = new uint8_t[size];
libyuv::ConvertToARGB(image->GetBytes(), (1920 * 1080 << 2),
buff1, (roi.Height() << 2),
roi.X(), roi.Y(),
1920, 1080,
roi.Width(), roi.Height(),
libyuv::kRotate90,
libyuv::FOURCC_ARGB);
libyuv::ConvertToARGB(image->GetBytes(), (1920 * 1080 << 2), buff1, (roi.Height() << 2),
roi.X(), roi.Y(), 1920, 1080, roi.Width(), roi.Height(),
libyuv::kRotate90, libyuv::FOURCC_ARGB);
uint8_t *buff2 = new uint8_t[1440 * 1080 << 2];
libyuv::ARGBScale(buff1, (roi.Height() << 2), roi.Height(), roi.Width(),
buff2, 1440 << 2, 1440, 1080, libyuv::FilterMode::kFilterNone);
buff2, 1440 << 2, 1440, 1080, libyuv::FilterMode::kFilterNone);
uint8_t *buff3 = new uint8_t[1920 * 1080 << 2];
memset(buff3, 0, (1920 * 1080 << 2));
libyuv::ARGBCopy(buff2,
1440 << 2,
(buff3 + 240 * 4),
1920 << 2,
1440,
1080);
libyuv::ARGBCopy(buff2, 1440 << 2, (buff3 + 240 * 4), 1920 << 2, 1440, 1080);
cv::Mat bgra = cv::Mat(1080, 1920, CV_8UC4, buff3);
image->SetMat(bgra);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment