mrDarker
2025-08-22 a569f6895e7ea624b869609a41ad4e39ea0f041a
1. NI添加计算Notch周长
已修改1个文件
15 ■■■■■ 文件已修改
EdgeInspector_App/Process/InspectCamera.cpp 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EdgeInspector_App/Process/InspectCamera.cpp
@@ -4443,6 +4443,21 @@
    strTemp.Format(_T("Notch\\Notch_%d_Defect_ProcBinImage"), nNotchIdx);
    SaveDebugImage(emDim, stFrame, pProcBinImage, strTemp);
    CvSeq* pContours = nullptr;
    CvMemStorage* pStorage = cvCreateMemStorage(0);
    cvFindContours(pProcBinImage, pStorage, &pContours, sizeof(CvContour), CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);
    for (CvSeq* c = pContours; c != nullptr; c = c->h_next) {
        double dLength = cvArcLength(c);
        if (dLength < 2000) {
            continue;
        }
        if (std::abs(dLength - 7000) > 1000) {
            g_pLog->DisplayMessage(_T("[WARN] Notch defect contour length deviates significantly from expected: %f"), dLength);
            break;
        }
    }
#if    MINI_LED == 0
    // 掘齡툇郞늴鑒,렝岺법댕돔鈴봬珂샀코닸狂痙
    int nDilateCount = pNotchParam->m_nNotch_Inspect_Defect_dilate;