refactor(synthetic): use shared_ptr for parent_

This commit is contained in:
TinyOh
2019-01-22 11:23:54 +08:00
parent aa83d3bf85
commit 69168303d6
20 changed files with 97 additions and 36 deletions

View File

@@ -45,7 +45,8 @@ Object *DepthProcessor::OnCreateOutput() {
}
bool DepthProcessor::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat *input = Object::Cast<ObjMat>(in);
ObjMat *output = Object::Cast<ObjMat>(out);

View File

@@ -36,7 +36,8 @@ class DepthProcessor : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
private:
std::shared_ptr<struct camera_calib_info_pair> calib_infos_;
};

View File

@@ -39,7 +39,8 @@ Object *DepthProcessorOCV::OnCreateOutput() {
}
bool DepthProcessorOCV::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat *input = Object::Cast<ObjMat>(in);
ObjMat *output = Object::Cast<ObjMat>(out);

View File

@@ -33,7 +33,8 @@ class DepthProcessorOCV : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
};
MYNTEYE_END_NAMESPACE

View File

@@ -43,7 +43,8 @@ Object *DisparityNormalizedProcessor::OnCreateOutput() {
}
bool DisparityNormalizedProcessor::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat *input = Object::Cast<ObjMat>(in);
ObjMat *output = Object::Cast<ObjMat>(out);

View File

@@ -33,7 +33,8 @@ class DisparityNormalizedProcessor : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
};
MYNTEYE_END_NAMESPACE

View File

@@ -66,7 +66,6 @@ DisparityProcessor::DisparityProcessor(DisparityProcessorType type,
#endif
#ifdef WITH_BM_SOBEL_FILTER
} else if (type_ == DisparityProcessorType::BM) {
int bmWinSize = 3;
#ifdef WITH_OPENCV2
LOG(ERROR) << "not supported in opencv 2.x";
// int bmWinSize = 3;
@@ -147,7 +146,8 @@ Object *DisparityProcessor::OnCreateOutput() {
}
bool DisparityProcessor::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat2 *input = Object::Cast<ObjMat2>(in);
ObjMat *output = Object::Cast<ObjMat>(out);

View File

@@ -49,7 +49,8 @@ class DisparityProcessor : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
private:
cv::Ptr<cv::StereoSGBM> sgbm_matcher;

View File

@@ -73,7 +73,8 @@ Object *PointsProcessor::OnCreateOutput() {
}
bool PointsProcessor::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
float fx = calib_infos_->left.K[0];

View File

@@ -38,7 +38,8 @@ class PointsProcessor : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
private:
std::shared_ptr<struct camera_calib_info_pair> calib_infos_;

View File

@@ -41,7 +41,8 @@ Object *PointsProcessorOCV::OnCreateOutput() {
}
bool PointsProcessorOCV::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat *input = Object::Cast<ObjMat>(in);
ObjMat *output = Object::Cast<ObjMat>(out);

View File

@@ -35,7 +35,8 @@ class PointsProcessorOCV : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
private:
cv::Mat Q_;

View File

@@ -417,7 +417,8 @@ Object *RectifyProcessor::OnCreateOutput() {
}
bool RectifyProcessor::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat2 *input = Object::Cast<ObjMat2>(in);
ObjMat2 *output = Object::Cast<ObjMat2>(out);

View File

@@ -77,7 +77,8 @@ class RectifyProcessor : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
private:
void InitParams(IntrinsicsEquidistant in_left,

View File

@@ -61,7 +61,8 @@ Object *RectifyProcessorOCV::OnCreateOutput() {
}
bool RectifyProcessorOCV::OnProcess(
Object *const in, Object *const out, Processor *const parent) {
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) {
MYNTEYE_UNUSED(parent)
const ObjMat2 *input = Object::Cast<ObjMat2>(in);
ObjMat2 *output = Object::Cast<ObjMat2>(out);

View File

@@ -51,7 +51,8 @@ class RectifyProcessorOCV : public Processor {
protected:
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out, Processor *const parent) override;
Object *const in, Object *const out,
std::shared_ptr<Processor> const parent) override;
private:
void InitParams(IntrinsicsPinhole in_left,