123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #pragma once
- #include "OTSParticle.h"
- //#define PI 3.1416
- namespace OTSIMGPROC {
- using namespace OTSDATA;
- // cal image data size expand size by rectangle
- const int nExpand_Size = 1;
- // cirlcle cal value
- //const double Pi = 3.14159265;
- //make matrix filled with 255
- //const int nBlackColor = 255;
- //make matrix filled with 0
- const int nWhiteColor = 0;
- // divide the sum of the half diameter
- const int nDivide = 36;
- // divide the sum of the total diameter
- const int nCircleDivide = 18;
- // the start cal angle
- const double dStartAngle = 0.17;
- // thickness Line thickness
- const int nThickness = 1;
- // lineType Type of the line
- const int nLineType = 8;
- // tg10~tg80
- const long ANGLE_MAX = 8;
- const double TAN_VALUES[ANGLE_MAX] =
- {
- // 10, 20, 30, 40, 50, 60, 70, 80
- 0.176,0.364,0.577,0.839,1.192,1.732,2.747,5.671
- };
- const double VALUE_MIN = 0.9;
- typedef enum class AXIAS_DIRECTION
- {
- INVALID = -1,
- MIN = 0,
- XAX = 0,
- YAX = 1,
- MAX = 1
- }AXIAS_DIRECTION;
- // calculate image properties
- class __declspec(dllexport) CGBImgPropCal
- {
- public:
- CGBImgPropCal(); // construct
- ~CGBImgPropCal(); // destruct
- // get particle ferret diameter
- static BOOL GetParticleFTD(COTSParticlePtr a_pOTSPart, double a_PixelSize, double &dPartFTD, double &dMinWidth, double &dMaxLength, double &dRatio);
- protected:
- // initialisation
- void Init();
- // clear
- void Clear();
- // get distance from 3 points
- static double GetDisFrom3(double a_s1, double a_s2, double a_s3);
- static BOOL GetDisFrom2list(std::vector<CPoint> a_list1, std::vector<CPoint> a_list2, std::vector<double>& a_listFlt);
- static BOOL GetDisFrom4list(std::vector<CPoint> a_list1, std::vector<CPoint> a_list2,
- std::vector<CPoint> a_list3, std::vector<CPoint> a_list4, std::vector<double>& a_listFlt);
- static double GetDisFromRLNeigbor(std::vector<CPoint> a_Yaxislist, std::vector<CPoint> a_YaxisRightlist, std::vector<CPoint> a_YaxisLeftlist);
- static double GetDisFromUDNeigbor(std::vector<CPoint> a_Xaxislist, std::vector<CPoint> a_XaxisUplist, std::vector<CPoint> a_XaxisDownlist);
- static BOOL GetMaxMin(std::vector<CPoint> a_Xaxislist, AXIAS_DIRECTION a_nDirection, int& a_nMax, int& a_nMin);
- static double GetRadiusAsK(std::vector<CPoint> a_Ptlist, double a_k);
- static BOOL GetDisFrom13list(std::vector<CPoint> a_list1,
- std::vector<CPoint> a_list3, std::vector<double>& a_listFlt);
- static BOOL GetDisFrom24list(std::vector<CPoint> a_list2,
- std::vector<CPoint> a_list4, std::vector<double>& a_listFlt);
- static BOOL GetSuperParticleSize(COTSParticlePtr a_pOTSPart,
- double &a_dMinWidth,double &a_dMaxLength, double &a_dAveDia);
- };
- }
|