From 5ef5e8d8663ee9dff72b6f102cfa048cf0d5bf85 Mon Sep 17 00:00:00 2001 From: KalmanSLightech Date: Fri, 27 Jul 2018 18:06:55 +0800 Subject: [PATCH] read info --- src/api/synthetic.cc | 8 +++++--- src/device/device.cc | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/synthetic.cc b/src/api/synthetic.cc index 3c5a194..9323975 100644 --- a/src/api/synthetic.cc +++ b/src/api/synthetic.cc @@ -18,7 +18,7 @@ #include #include #include - +#include #include "api/plugin.h" #include "api/processor/depth_processor.h" #include "api/processor/disparity_normalized_processor.h" @@ -41,8 +41,10 @@ namespace { cv::Mat frame2mat(const std::shared_ptr &frame) { // TODO(JohnZhao) Support different format frame to cv::Mat - CHECK_EQ(frame->format(), Format::GREY); - return cv::Mat(frame->height(), frame->width(), CV_8UC1, frame->data()); + CHECK_EQ(frame->format(), Format::YUYV); + cv::Mat img(frame->height(), frame->width(), CV_8UC2,frame->data()); + cv::cvtColor(img, img, cv::COLOR_YUV2BGR_YUY2); + return img; } api::StreamData data2api(const device::StreamData &data) { diff --git a/src/device/device.cc b/src/device/device.cc index 7ec23b8..b8e973c 100644 --- a/src/device/device.cc +++ b/src/device/device.cc @@ -87,7 +87,7 @@ Device::Device(const Model &model, std::shared_ptr device) channels_(std::make_shared(device)), motions_(std::make_shared(channels_)) { VLOG(2) << __func__; - //ReadAllInfos(); + ReadAllInfos(); } Device::~Device() {