123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #include "config.h"
- #include <iostream>
- #define VNAME(value) (#value)
- namespace graft_cv{
- CGCvConfig::CGCvConfig()
- :m_cparam(0)
- {
- };
- CGCvConfig::~CGCvConfig()
- {
- };
- void CGCvConfig::setConfParam(ConfigParam*cp)
- {
- m_cparam = cp;
- }
- void CGCvConfig::write(cv::FileStorage &fs)const{
- assert(m_cparam!=0);
- fs << "{"
- << "image_show"<< m_cparam->image_show
- << "image_return"<< m_cparam->image_return
-
- <<"image_save"<<m_cparam->image_save
- <<"image_depository"<<m_cparam->image_depository
- <<"image_backup_days"<<m_cparam->image_backup_days
- <<"model_path_grab"<<m_cparam->model_path_grab
- <<"object_threshold_grab"<<m_cparam->object_threshold_grab
- <<"nms_threshold_grab"<<m_cparam->nms_threshold_grab
- << "model_path_cut" << m_cparam->model_path_cut
- << "object_threshold_cut" << m_cparam->object_threshold_cut
- << "nms_threshold_cut" << m_cparam->nms_threshold_cut
-
- << "}";
- };
- void CGCvConfig::read(const cv::FileNode& node){ //Read serialization for this class
- assert(m_cparam!=0);
- m_cparam->image_show = (bool)(int)node["image_show"];
- m_cparam->image_return = (bool)(int)node["image_return"];
-
- m_cparam->image_save = (bool)(int)node["image_save"];
- m_cparam->image_depository =(string)node["image_depository"];
- m_cparam->image_backup_days = (int)node["image_backup_days"];
- m_cparam->model_path_grab =(string)node["model_path_grab"];
- m_cparam->object_threshold_grab = (float)node["object_threshold_grab"];
- m_cparam->nms_threshold_grab = (float)node["nms_threshold_grab"];
- m_cparam->model_path_cut = (string)node["model_path_cut"];
- m_cparam->object_threshold_cut = (float)node["object_threshold_cut"];
- m_cparam->nms_threshold_cut = (float)node["nms_threshold_cut"];
-
-
- }
- string get_cparam_info(ConfigParam*m_cparam)
- {
- if(!m_cparam){return string("");}
- stringstream buff;
- buff << "{" <<endl
- << "image_show:\t"<< m_cparam->image_show << endl
- << "image_return:\t"<< m_cparam->image_return << endl
-
- <<"image_save:\t"<<m_cparam->image_save << endl
- <<"image_depository:\t"<<m_cparam->image_depository << endl
- <<"image_backup_days:\t"<<m_cparam->image_backup_days << endl
- <<"model_path_grab:\t"<<m_cparam->model_path_grab << endl
- <<"object_threshold_grab:\t"<<m_cparam->object_threshold_grab << endl
- <<"nms_threshold_grab:\t"<<m_cparam->nms_threshold_grab << endl
- << "model_path_cut:\t" << m_cparam->model_path_cut << endl
- << "object_threshold_cut:\t" << m_cparam->object_threshold_cut << endl
- << "nms_threshold_cut:\t" << m_cparam->nms_threshold_cut << endl
- << "}" << endl;
- return buff.str();
- }
- }
|