add bgr888

This commit is contained in:
Kalman
2018-08-07 02:29:07 +08:00
parent 26d95ec0ac
commit 6d961203be
11 changed files with 97 additions and 36 deletions

View File

@@ -108,7 +108,7 @@ int main(int argc, char *argv[]) {
const auto frame_empty = [&frame]() { return frame == nullptr; };
uvc::set_device_mode(
*device, 1280, 400, static_cast<int>(Format::RGB888), 20,
*device, 1280, 400, static_cast<int>(Format::BGR888), 20,
[&mtx, &cv, &frame, &frame_ready](
const void *data, std::function<void()> continuation) {
// reinterpret_cast<const std::uint8_t *>(data);
@@ -144,7 +144,7 @@ int main(int argc, char *argv[]) {
// only lastest frame is valid
cv::Mat img(400, 1280, CV_8UC3, const_cast<void *>(frame->data));
// cv::cvtColor(img, img, cv::COLOR_YUV2BGR_YUY2);
cv::cvtColor(img, img, CV_BGRA2RGBA);
cv::imshow("frame", img);
frame = nullptr;