Просмотр исходного кода

Merge branch 'OTSRelease3_0' into cxs

cxs 1 год назад
Родитель
Сommit
4725b6559a

+ 6 - 6
OTSCPP/OTSImagePro/BaseFunction.cpp

@@ -389,7 +389,7 @@ void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing
 		{
 			//提取暗物体
 			cv::Mat black_t;
-			int min_gray = 1;
+			int min_gray = 0;
 			float segma_b = 1.5;
 			int max_gray = int(a - d * segma_b);
 			max_gray = std::min(max_gray, 255);
@@ -399,7 +399,7 @@ void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing
 			{
 				if (i >= min_gray && i <= max_gray)
 				{
-					lutvalues[i] = i;
+					lutvalues[i] = 255;
 				}
 				else
 				{
@@ -412,7 +412,7 @@ void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing
 			//提取亮物体
 			cv::Mat bright_t;
 			int min_gray_bright = int(a + d * segma_b);
-			int max_gray_bright = 254;
+			int max_gray_bright = 255;
 			min_gray_bright = std::max(min_gray_bright, 120);
 
 			uchar lutvalues1[256];
@@ -420,7 +420,7 @@ void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing
 			{
 				if (i >= min_gray_bright && i <= max_gray_bright)
 				{
-					lutvalues1[i] = i;
+					lutvalues1[i] = 255;
 				}
 				else
 				{
@@ -430,7 +430,7 @@ void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing
 			cv::Mat lutpara1(1, 256, CV_8UC1, lutvalues1);
 			cv::LUT(dst_adapt, lutpara1, bright_t);
 			out_thresh = black_t + bright_t;
-			cv::threshold(out_thresh, out_thresh, 1, 255, cv::ThresholdTypes::THRESH_BINARY);
+			//cv::threshold(out_thresh, out_thresh, 1, 255, cv::ThresholdTypes::THRESH_BINARY);
 		}
 		else
 		{
@@ -456,7 +456,7 @@ void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing
 			// binaryImage二值图像;去除部分扩大区域
 			cv::Mat binaryImage = cv::Mat::zeros(image_Negate.size(), image_Negate.type());
 			//筛选系数
-			int segma = 2;
+			int segma = 4;
 			float filter_gray = (mean0 + std0 / segma);
 			//filter_gray = result_THRESH_TRIANGLE;
 			for (int y = 0; y < extractedImage.rows; ++y) {

+ 6 - 2
OTSIncAMeasureApp/ServiceCenter/FEIAutoScript/FEIEDSController.cs

@@ -17,6 +17,10 @@ namespace OTSMeasureApp.ServiceCenter
         private string strResolution = "";
         private int width = 0;
         private int height = 0;
+        /// <summary>
+        /// fei面扫这个参数作用是达到这个数值后采集xray操作停止,而ots期望计数率是lowcount的判断标准,两者概念不同,所以此处用常数5000而非ots期望计数率
+        /// </summary>
+        const int maxCounts = 8000;
 
         public FEIEDSController(int MaxCounts)
         {
@@ -35,7 +39,7 @@ namespace OTSMeasureApp.ServiceCenter
                 {
                     List<Point> points = CImageHandler.FindContoursBySegment(width, height, a_listParticles[i].GetFeature().GetSegmentsList());
 
-                    if (!ApiClass.GetXRayByPolygon(points, strResolution, a_nXRayAQTime, AnalyExpCount, a_bElementInfo, ref eleItems, ref spectrumItems))
+                    if (!ApiClass.GetXRayByPolygon(points, strResolution, a_nXRayAQTime, maxCounts, a_bElementInfo, ref eleItems, ref spectrumItems))
                     {
                         return false;
                     }
@@ -43,7 +47,7 @@ namespace OTSMeasureApp.ServiceCenter
                 else
                 {
                     Rectangle rectangle = (Rectangle)a_listParticles[i].GetParticleRect();
-                    if (!ApiClass.GetXRayByRect(rectangle, strResolution, a_nXRayAQTime, AnalyExpCount, a_bElementInfo, ref eleItems, ref spectrumItems))
+                    if (!ApiClass.GetXRayByRect(rectangle, strResolution, a_nXRayAQTime, maxCounts, a_bElementInfo, ref eleItems, ref spectrumItems))
                     {
                         return false;
                     }