gtcvcore.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. //
  2. // Created by lloyd on 2020/9/28.
  3. //
  4. #ifndef GTCVR_GTCVCORE_H
  5. #define GTCVR_GTCVCORE_H
  6. #include "opencv2/opencv.hpp"
  7. #include "opencv2/highgui/highgui.hpp"
  8. #include "opencv2/imgproc/imgproc.hpp"
  9. #include "DataMapping/dgns_gtstandard.h"
  10. #include "DataMapping/dgns_gtbaseparam.h"
  11. class gtcvcore {
  12. public:
  13. void initSVM(int load);
  14. static cv::Ptr<cv::ml::SVM> MySvm1;
  15. static std::string GTYypes1;
  16. std::string
  17. HOGSVMPredict(std::vector<std::vector<int>> &gt1, std::vector<std::vector<int>> &gt2, int FuncType, int load,
  18. const char *CacheName);
  19. double C_GTSimillar_PSNR(std::vector<std::vector<int>> &gt1_1, std::vector<std::vector<int>> &gt1_2,
  20. std::vector<std::vector<int>> &gt2_1, std::vector<std::vector<int>> &gt2_2);
  21. double C_GTSimillar_MSSIM(std::vector<std::vector<int>> &gt1_1, std::vector<std::vector<int>> &gt1_2,
  22. std::vector<std::vector<int>> &gt2_1, std::vector<std::vector<int>> &gt2_2);
  23. double C_GTSimillar_HOG(std::vector<std::vector<int>> &gt1_1, std::vector<std::vector<int>> &gt1_2,
  24. std::vector<std::vector<int>> &gt2_1, std::vector<std::vector<int>> &gt2_2);
  25. class calgray {
  26. public:
  27. /****item****/
  28. double **Card;//[][2] ;
  29. /****item****/
  30. int **CardGray0;//[][][] ;
  31. /****item****/
  32. int **CardGray1;//[][][] ;
  33. /***iiiii****/
  34. int ***CardGray;
  35. /****item****/
  36. double *CardType;//[] ;
  37. /****item****/
  38. double *Card_Type;//[] ;
  39. /****item****/
  40. double **BCP;//[][] ;
  41. /****item****/
  42. int *Gray_max;//[] ;
  43. /****item****/
  44. int *Gray_min;//[] ;
  45. /****item****/
  46. double **DenseCard;//[][] ;
  47. /****item****/
  48. char *CardStr;
  49. /****item****/
  50. char *DenseCardStr;
  51. /****item****/
  52. double Cycle;
  53. /****item****/
  54. double Stroke;
  55. /****item****/
  56. int PointNum;
  57. /****item****/
  58. int DensePointNum;
  59. /****item****/
  60. double MaxLoadPoint;
  61. /****item****/
  62. double MinLoadPoint;
  63. /****item****/
  64. double MaxLoad;
  65. /****item****/
  66. double MinLoad;
  67. /****item****/
  68. double Maxshift;
  69. /****item****/
  70. double MaxshiftPoint;
  71. /****item****/
  72. double Minshift;
  73. /****item****/
  74. double MinshiftPoint;
  75. /****item****/
  76. double DenseMaxLoadPoint;
  77. /****item****/
  78. double DenseMinLoadPoint;
  79. /****item****/
  80. double DenseMaxLoad;
  81. /****item****/
  82. double DenseMinLoad;
  83. /****item****/
  84. double DenseMaxshift;
  85. /****item****/
  86. double DenseMaxshiftPoint;
  87. /****item****/
  88. double DenseMinshift;
  89. /****item****/
  90. double DenseMinshiftPoint;
  91. /****item****/
  92. double Power;
  93. /****item****/
  94. double SdBalanceDegree;
  95. /****item****/
  96. char const *SdBalanceResult;
  97. /****item****/
  98. char const *DiagnosisResult;
  99. /****item****/
  100. double MaxShiftLoad;
  101. /****item****/
  102. double MinShiftLoad;
  103. /****item****/
  104. char *L_RESULT;
  105. /****item****/
  106. double L_res1;
  107. /****item****/
  108. double L_Res2;
  109. /****item****/
  110. double L_EPS1;
  111. /****item****/
  112. double L_DLT1;
  113. /****item****/
  114. double L_EPS2;
  115. /****item****/
  116. double L_DLT2;
  117. /****item****/
  118. char *l_RefrenceJh;
  119. /****item****/
  120. char *l_Refrencewell_id;
  121. /****item****/
  122. char *l_Refrence_jhdm;
  123. /****item****/
  124. struct tm l_Refrencecjsj;
  125. /****item****/
  126. char *l_refrencesgt;
  127. /****item****/
  128. double l_refrencecycle;
  129. /****item****/
  130. double l_refrencestroke;
  131. public:
  132. /*********public method************/
  133. double
  134. C_GTSimillar_Gray(std::vector<std::vector<double>> gt1, int pointnum1, double S1, double N1,
  135. std::vector<std::vector<double>> gt2, int pointnum2, double S2,
  136. double N2);
  137. double compareCharacters(double *s_cha, double *k_cha, int method = 23);
  138. bool calGrayCharacters(dgns_gtstandard &cha_obj, dgns_gtbaseparam _baseparam);
  139. private:
  140. /*********private method************/
  141. calgray checkCardForCalGray(std::vector<std::vector<double>> gt, int gt_pointNum, double cycle);
  142. double * cal_cardgray_cha(std::vector<std::vector<double>> P_Card, int gt_PointNum, double S, double N);
  143. };
  144. };
  145. #endif //GTCVR_GTCVCORE_H