2018-04-27 09:58:53 +08:00
|
|
|
#include "api/processor/depth_processor.h"
|
|
|
|
|
|
|
|
#include <glog/logging.h>
|
|
|
|
|
|
|
|
MYNTEYE_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
DepthProcessor::DepthProcessor() : Processor() {
|
|
|
|
VLOG(2) << __func__;
|
|
|
|
}
|
|
|
|
|
|
|
|
DepthProcessor::~DepthProcessor() {
|
|
|
|
VLOG(2) << __func__;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string DepthProcessor::Name() {
|
|
|
|
return NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
Object *DepthProcessor::OnCreateOutput() {
|
2018-04-28 14:27:43 +08:00
|
|
|
return new ObjMat();
|
2018-04-27 09:58:53 +08:00
|
|
|
}
|
|
|
|
|
2018-04-28 13:37:25 +08:00
|
|
|
bool DepthProcessor::OnProcess(
|
2018-04-27 09:58:53 +08:00
|
|
|
Object *const in, Object *const out, Processor *const parent) {
|
|
|
|
UNUSED(parent)
|
2018-04-28 14:27:43 +08:00
|
|
|
const ObjMat *input = Object::Cast<ObjMat>(in);
|
|
|
|
ObjMat *output = Object::Cast<ObjMat>(out);
|
|
|
|
cv::Mat channels[3 /*input->value.channels()*/];
|
|
|
|
cv::split(input->value, channels);
|
|
|
|
channels[2].convertTo(output->value, CV_16UC1);
|
2018-04-28 13:37:25 +08:00
|
|
|
return true;
|
2018-04-27 09:58:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MYNTEYE_END_NAMESPACE
|