diff --git a/hgdriver/hgdev/imgproc-pak/fill_hole.cpp b/hgdriver/hgdev/imgproc-pak/fill_hole.cpp index 228000f..52aa371 100644 --- a/hgdriver/hgdev/imgproc-pak/fill_hole.cpp +++ b/hgdriver/hgdev/imgproc-pak/fill_hole.cpp @@ -59,7 +59,7 @@ void hole_filler::enable(const char* name, bool able) { enabled_ = able; } -int hole_filler::process(const std::vector& in, std::vector& out) +int hole_filler::process(std::vector& in, std::vector& out) { int ret = SCANNER_ERR_OK; diff --git a/hgdriver/hgdev/imgproc-pak/fill_hole.h b/hgdriver/hgdev/imgproc-pak/fill_hole.h index 0d9a41b..5dc14b4 100644 --- a/hgdriver/hgdev/imgproc-pak/fill_hole.h +++ b/hgdriver/hgdev/imgproc-pak/fill_hole.h @@ -33,7 +33,7 @@ protected: public: virtual int set_value(const char* name, void* val) override; virtual void enable(const char* name, bool able) override; - virtual int process(const std::vector& in, std::vector& out) override; + virtual int process(std::vector& in, std::vector& out) override; }; //{ diff --git a/sdk/imgprc/img_processor.h b/sdk/imgprc/img_processor.h index 6640810..6183795 100644 --- a/sdk/imgprc/img_processor.h +++ b/sdk/imgprc/img_processor.h @@ -79,6 +79,6 @@ public: int get_version(void) { return ver_; } int get_position(void) { return pos_; } - virtual int process(const std::vector& in, std::vector& out) = 0; + virtual int process(std::vector& in, std::vector& out) = 0; }; diff --git a/sdk/imgprc/imgprc_mgr.cpp b/sdk/imgprc/imgprc_mgr.cpp index e9b842e..6b363a5 100644 --- a/sdk/imgprc/imgprc_mgr.cpp +++ b/sdk/imgprc/imgprc_mgr.cpp @@ -7,6 +7,7 @@ #include #include +#include static std::string device_opt_json[] = { @@ -306,10 +307,16 @@ int imgproc_mgr::set_value(const char* name, void* val) int imgproc_mgr::load_processor(const char* path) { int ret = SCANNER_ERR_OK; - hole_filler* holer = new hole_filler(); - opts_->add(holer); - holer->release(); +#define ADD_IMG_PROCESSOR(cls) \ + { \ + cls *obj = new cls(); \ + opts_->add(obj); \ + obj->release(); \ + } + + ADD_IMG_PROCESSOR(hole_filler); + ADD_IMG_PROCESSOR(multi_outer); std::sort(processors_.begin(), processors_.end(), &imgproc_mgr::sort_processor_by_pos);