read info

This commit is contained in:
KalmanSLightech 2018-07-27 18:06:55 +08:00
parent f1003b63b3
commit 5ef5e8d866
2 changed files with 6 additions and 4 deletions

View File

@ -18,7 +18,7 @@
#include <algorithm>
#include <functional>
#include <stdexcept>
#include <opencv2/imgproc/imgproc.hpp>
#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<device::Frame> &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) {

View File

@ -87,7 +87,7 @@ Device::Device(const Model &model, std::shared_ptr<uvc::device> device)
channels_(std::make_shared<Channels>(device)),
motions_(std::make_shared<Motions>(channels_)) {
VLOG(2) << __func__;
//ReadAllInfos();
ReadAllInfos();
}
Device::~Device() {