#pragma once #include "afx.h" #include "IntRange.h" #include "DoubleRange.h" #include "XMLSerialization.h" // COTSStageData command target namespace OTSIMGPROC { using namespace OTSDATA; __declspec(dllexport) const int DEFUALT_PARTICALE_AREA_MIN = 1; __declspec(dllexport) const int DEFUALT_PARTICALE_AREA_MAX = 200; __declspec(dllexport) const int DEFUALT_BG_GRAY_LEVEL_MIN = 150; __declspec(dllexport) const int DEFUALT_BG_GRAY_LEVEL_MAX = 255; __declspec(dllexport) const int DEFUALT_PARTICLE_GRAY_LEVEL_MIN = 5; __declspec(dllexport) const int DEFUALT_PARTICLE_GRAY_LEVEL_MAX = 155; class __declspec(dllexport) COTSImageProcessParam : public xmls::ISlo { public: COTSImageProcessParam(); // constructor COTSImageProcessParam(const COTSImageProcessParam&); // copy constructor COTSImageProcessParam(COTSImageProcessParam*); // copy constructor COTSImageProcessParam& operator=(const COTSImageProcessParam&); // =operator BOOL operator==(const COTSImageProcessParam&); // =operator virtual ~COTSImageProcessParam(); // detractor // serialization void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode); CDoubleRange GetIncArea() const { return m_oIncArea; } void SetIncArea(CDoubleRange a_oVal) { m_oIncArea = a_oVal; } CIntRange GetBGGray() const { return m_oBGGray; } void SetBGGray(CIntRange a_oVal) { m_oBGGray = a_oVal; } CIntRange GetParticleGray() const { return m_oParticleGray; } void SetParticleGray(CIntRange a_oVal) { m_oParticleGray = a_oVal; } OTS_BGREMOVE_TYPE GetBGRemoveType() const { return (OTS_BGREMOVE_TYPE)m_BGRemoveType; } void SetBGRemoveType(int a_oVal) { m_BGRemoveType = a_oVal; } OTS_AUTOBGREMOVE_TYPE GetAutoBGRemoveType() const { return(OTS_AUTOBGREMOVE_TYPE)m_autoBGRemoveType; } void SetAutoBGRemoveType(int a_oVal) { m_autoBGRemoveType = a_oVal; } void SetErrodDilateParam(int a_val) { m_errodDilateParam = a_val; }// 0 means don't use errosion and dilation. int GetErrodDilateParam() {return m_errodDilateParam ; } void SetOverlapParam(int a_val) { m_overlapParam = a_val; }// 0 means no overlap int GetOverlapParam() { return m_overlapParam; } void SetXrayStep(int val) { m_xrayStep = val; }; int GetXrayStep() { return m_xrayStep; }; protected: // cleanup void Cleanup(); // initialization void Init(); // duplication void Duplicate(const COTSImageProcessParam& a_oSource); private: CDoubleRange m_oIncArea; //夹杂物面积 CIntRange m_oBGGray; //背景灰度 CIntRange m_oParticleGray; //夹杂物灰度 int m_BGRemoveType; int m_autoBGRemoveType; int m_errodDilateParam; int m_overlapParam; int m_xrayStep; }; typedef std::shared_ptr __declspec(dllexport) COTSImageProcessParamPtr; typedef std::vector __declspec(dllexport) COTSImageProcessParamsList; }