From 1aa192eb15c86740acf54cc3c8a6c0aeb5be22cd Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 10 七月 2025 11:08:19 +0800
Subject: [PATCH] 重构:移除文件保存中的班别逻辑,改为基于玻璃Loading Time的按小时/按天保存 优化:缺陷图片中的标注文本,针对Notch Dimension和Notch Chamfer类型,增加特殊标记,便于区分
---
EdgeInspector_App/Process/InspectCamera.cpp | 60 +++++++++++++++++++++++++++++++++---------------------------
1 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/EdgeInspector_App/Process/InspectCamera.cpp b/EdgeInspector_App/Process/InspectCamera.cpp
index ed0c25f..7c6fa50 100644
--- a/EdgeInspector_App/Process/InspectCamera.cpp
+++ b/EdgeInspector_App/Process/InspectCamera.cpp
@@ -3934,7 +3934,7 @@
double th = (double) m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_nReferece_Line_Threshold;
int nNotchCenterOffset = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_nNotchCenter_Offset_pxl;
- cvThreshold(scr, img_Bin_MeasureLine, th, 50, CV_THRESH_BINARY);
+ cvThreshold(scr, img_Bin_MeasureLine, th, 255, CV_THRESH_BINARY);
// 1. Find Seed
CvPoint ptSeed;
@@ -6240,46 +6240,52 @@
BOOL CInspectCamera::ProcessFrame(int iThread,DimensionDir emDim,stFrameIndex stFrame)
{
- // 1. Find End Line.. (Corner甫 力寇茄 Side扼牢阑 茫扁 困秦 End Line何磐 茫绰促)
- FindEndLine(iThread, emDim, stFrame);
+ try {
+ // 1. Find End Line.. (Corner甫 力寇茄 Side扼牢阑 茫扁 困秦 End Line何磐 茫绰促)
+ FindEndLine(iThread, emDim, stFrame);
- // 2. Find Side Line.. (秦寸 橇饭烙俊辑 Corner/Notch 甫 力寇茄 Side 扼牢 茫扁)
+ // 2. Find Side Line.. (秦寸 橇饭烙俊辑 Corner/Notch 甫 力寇茄 Side 扼牢 茫扁)
#if USE_AI_DETECT
- FindSideLine(iThread, emDim, stFrame);
+ FindSideLine(iThread, emDim, stFrame);
#else
- FindSideLine_ExceptNotch(iThread, emDim, stFrame);
+ FindSideLine_ExceptNotch(iThread, emDim, stFrame);
#endif // USE_AI_DETECT
- // 3. Find Top Corner
- FindTopCorner(iThread,emDim,stFrame);
+ // 3. Find Top Corner
+ FindTopCorner(iThread, emDim, stFrame);
- // 4. Find Top Align Mark
- FindTopAlignMark(iThread,emDim,stFrame);
+ // 4. Find Top Align Mark
+ FindTopAlignMark(iThread, emDim, stFrame);
- // 5. Find Bot Corner
- FindBotCorner(iThread,emDim,stFrame);
+ // 5. Find Bot Corner
+ FindBotCorner(iThread, emDim, stFrame);
- // 6. Find Bot Align Mark
- FindBotAlignMark(iThread,emDim,stFrame);
-
+ // 6. Find Bot Align Mark
+ FindBotAlignMark(iThread, emDim, stFrame);
+
#if USE_AI_DETECT
- SendFrameScanDataOverAI(iThread, emDim, stFrame);
+ SendFrameScanDataOverAI(iThread, emDim, stFrame);
#else
- // 7. Inspect Defect
- InspectDefect_Side(iThread, emDim, stFrame);
+ // 7. Inspect Defect
+ InspectDefect_Side(iThread, emDim, stFrame);
- // 8. Notch Process
- Notch_Process(iThread, emDim, stFrame);
+ // 8. Notch Process
+ Notch_Process(iThread, emDim, stFrame);
#endif // USE_WEBSOCKET
- // 9. Measure
- Measure(iThread,emDim,stFrame);
-
- // 10. User Defect
- UserDefect_Process(iThread,emDim,stFrame);
+ // 9. Measure
+ Measure(iThread, emDim, stFrame);
- // 11. Exception Area Process
- ExceptionArea_Process(iThread,emDim,stFrame);
+ // 10. User Defect
+ UserDefect_Process(iThread, emDim, stFrame);
+
+ // 11. Exception Area Process
+ ExceptionArea_Process(iThread, emDim, stFrame);
+ }
+ catch (const std::exception&) {
+ g_pLog->DisplayMessage(_T("Exception in ProcessFrame for Camera %d, Dimension %d"), m_iCamera, (int)emDim);
+ return FALSE;
+ }
return TRUE;
}
--
Gitblit v1.9.3