2018-04-27 09:58:53 +08:00
|
|
|
#include "api/processor/disparity_normalized_processor.h"
|
|
|
|
|
2018-04-28 13:26:46 +08:00
|
|
|
#include <opencv2/imgproc/imgproc.hpp>
|
|
|
|
|
2018-04-27 09:58:53 +08:00
|
|
|
#include <glog/logging.h>
|
|
|
|
|
|
|
|
MYNTEYE_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
DisparityNormalizedProcessor::DisparityNormalizedProcessor() : Processor() {
|
|
|
|
VLOG(2) << __func__;
|
|
|
|
}
|
|
|
|
|
|
|
|
DisparityNormalizedProcessor::~DisparityNormalizedProcessor() {
|
|
|
|
VLOG(2) << __func__;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string DisparityNormalizedProcessor::Name() {
|
|
|
|
return NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
Object *DisparityNormalizedProcessor::OnCreateOutput() {
|
2018-04-28 13:26:46 +08:00
|
|
|
return new ObjMat();
|
2018-04-27 09:58:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void DisparityNormalizedProcessor::OnProcess(
|
|
|
|
Object *const in, Object *const out, Processor *const parent) {
|
|
|
|
UNUSED(parent)
|
2018-04-28 13:26:46 +08:00
|
|
|
const ObjMat *input = Object::Cast<ObjMat>(in);
|
|
|
|
ObjMat *output = Object::Cast<ObjMat>(out);
|
|
|
|
cv::normalize(input->value, output->value, 0, 255, cv::NORM_MINMAX, CV_8UC1);
|
2018-04-27 09:58:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MYNTEYE_END_NAMESPACE
|