| | |
| | | g_pLog->DisplayMessage(_T("%s Re Align Mark Find[%d] Fail x %.2f, y %.2f"),PANEL_SIDE[emDim],iPos,m_iSideLine[stFrame.nScanIdx] + m_dMark2MarkX[stFrame.nScanIdx][iPos], pResInfo->nGlassStartLine + m_dMark2MarkY[stFrame.nScanIdx][iPos]); |
| | | } |
| | | |
| | | #if MARKIMG_NOTSAVE |
| | | CString strFile; |
| | | CvRect saveRect = cvRect((int)matchResut.pt.x - rectAlign.Width() / 2, (int)(matchResut.pt.y + rectAlign.top) - rectAlign.Height() / 2, rectAlign.Width(), rectAlign.Height()); |
| | | strFile.Format(_T("%sIMG_MARK\\%s\\%s\\%s\\Align_%s_%s_%s.jpg"), PATH_INSPECTION_DATA, g_pBase->m_strLoadingDay, g_pBase->m_strHPanelID, g_pBase->m_strLoadingTime, strPos, PANEL_SIDE[emDim], strRes); |
| | | |
| | | CString strFile; |
| | | CvRect saveRect = cvRect((int)matchResut.pt.x-rectAlign.Width()/2,(int)(matchResut.pt.y + rectAlign.top)-rectAlign.Height()/2,rectAlign.Width(),rectAlign.Height()); |
| | | strFile.Format(_T("%sIMG_MARK\\%s\\%s\\%s\\Align_%s_%s_%s.jpg"),PATH_INSPECTION_DATA,g_pBase->m_strLoadingDay,g_pBase->m_strHPanelID,g_pBase->m_strLoadingTime,strPos,PANEL_SIDE[emDim],strRes); |
| | | |
| | | SaveCvAlignImage(saveRect,strFile,stFrame.nScanIdx,nFrameWidth,nFrameHeight); |
| | | SaveCvAlignImage(saveRect, strFile, stFrame.nScanIdx, nFrameWidth, nFrameHeight); |
| | | #endif // 0 |
| | | |
| | | return TRUE; |
| | | } |
| | |
| | | continue; |
| | | CopyBuffer.SetPixel((int)ptChamferEdgePos.u,v,128); |
| | | } |
| | | |
| | | #if MARKIMG_NOTSAVE |
| | | CString str; |
| | | str.Format(_T("%sIMG_MARK\\%s\\%s\\%s\\ChamferRes_%s_%d.bmp"),PATH_INSPECTION_DATA,g_pBase->m_strLoadingDay,g_pBase->m_strHPanelID,g_pBase->m_strLoadingTime,PANEL_SIDE[eDimension],index); |
| | | str.Format(_T("%sIMG_MARK\\%s\\%s\\%s\\ChamferRes_%s_%d.bmp"), PATH_INSPECTION_DATA, g_pBase->m_strLoadingDay, g_pBase->m_strHPanelID, g_pBase->m_strLoadingTime, PANEL_SIDE[eDimension], index); |
| | | CBufferAttach attach(str); |
| | | attach.AttachToFile(CopyBuffer); |
| | | } |
| | | #endif // 0 |
| | | } |
| | | |
| | | return TRUE; |
| | | } |
| | |
| | | int nStartLine = pEdgeInfo->nGlassStartLine - nOffset / 2; |
| | | int nEndLine = nSetEnd + nOffset / 2; |
| | | int nDefectIdx = 0; |
| | | int nChamferAlarmResultCount = 0; |
| | | int nProAlarmResultCount_MinDiff = 0; |
| | | |
| | | CINSPECT_JUDGEMENT_PARM* pJudge = m_pRecipe->GetJudgePrm(); |
| | | for (int i = 0; i < ngNum; i++) { |
| | | NgInfo ng = ngArray[i]; //侶쟁警속댄轎홧屈 |
| | | if (ng.eDir > 8 || ng.eDir < 0) continue; |
| | |
| | | int offy = ng.y2 - ps.y; |
| | | |
| | | if (m_pDefectControl != NULL/* && nDefectIdx < 1*/) |
| | | m_pDefectControl->ExtractDefect_Hole(eDim, m_iCamera, stFrame.nScanIdx, vecList, ngNum, DefectLoc_Hole, CRect(offx, offy, 2 * offx,2 * offy)); |
| | | |
| | | { |
| | | m_pDefectControl->ExtractDefect_Hole(eDim, m_iCamera, stFrame.nScanIdx, vecList, ngNum, DefectLoc_Hole, CRect(offx, offy, 2 * offx, 2 * offy)); |
| | | g_pLog->m_nHoleAlarmState = 1; |
| | | } |
| | | } |
| | | if (5 == ng.ngType) |
| | | { |
| | |
| | | { |
| | | pProfileResult->ProfileData[59+i].bUseJudge = TRUE; |
| | | pProfileResult->ProfileData[59 + i].bProfileJudge = FALSE; |
| | | if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result)) |
| | | { |
| | | nProAlarmResultCount_MinDiff = 1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (5<ng.id&& ng.id < 11) |
| | | { |
| | |
| | | { |
| | | pProfileResult->ProfileData[69 + i].bUseJudge = TRUE; |
| | | pProfileResult->ProfileData[69+i].bProfileJudge = FALSE; |
| | | |
| | | if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result)) |
| | | { |
| | | nProAlarmResultCount_MinDiff = 1; |
| | | } |
| | | } |
| | | } |
| | | else if (10<ng.id && ng.id < 16) |
| | | { |
| | | pProfileResult->ResultChamfer[49 +i][1].nChamferCalThick = ng.result; |
| | | if (ng.maxValue<ng.result || ng.minValue>ng.result) |
| | | { |
| | | pProfileResult->ResultChamfer[49 + i][1].bUseJudge = TRUE; |
| | | pProfileResult->ResultChamfer[49+i][1].bChamferJudge= FALSE; |
| | | } |
| | | pProfileResult->ResultChamfer[49 + i][1].nChamferCalThick = ng.result; |
| | | if (ng.maxValue<ng.result || ng.minValue>ng.result) |
| | | { |
| | | pProfileResult->ResultChamfer[49 + i][1].bUseJudge = TRUE; |
| | | pProfileResult->ResultChamfer[49 + i][1].bChamferJudge = FALSE; |
| | | nChamferAlarmResultCount = 1; |
| | | } |
| | | } |
| | | else if (15<ng.id && ng.id < 21) |
| | | { |
| | |
| | | { |
| | | pProfileResult->ResultChamfer[59 + i][1].bUseJudge = TRUE; |
| | | pProfileResult->ResultChamfer[59+i][1].bChamferJudge = FALSE; |
| | | nChamferAlarmResultCount = 1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (ng.eDir == 5) |
| | |
| | | { |
| | | pProfileResult->ProfileData[64 + i].bUseJudge = TRUE; |
| | | pProfileResult->ProfileData[64 + i].bProfileJudge = FALSE; |
| | | |
| | | if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result)) |
| | | { |
| | | nProAlarmResultCount_MinDiff = 1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (5 < ng.id && ng.id < 11) |
| | | { |
| | |
| | | { |
| | | pProfileResult->ResultChamfer[59 + i][1].bUseJudge = TRUE; |
| | | pProfileResult->ResultChamfer[59 + i][1].bChamferJudge = FALSE; |
| | | |
| | | nChamferAlarmResultCount = 1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (ng.eDir == 7) |
| | | { |
| | |
| | | { |
| | | pProfileResult->ProfileData[69 + i].bUseJudge = TRUE; |
| | | pProfileResult->ProfileData[69 + i].bProfileJudge = FALSE; |
| | | |
| | | if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result)) |
| | | { |
| | | nProAlarmResultCount_MinDiff = 1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (5 < ng.id && ng.id < 11) |
| | | { |
| | |
| | | { |
| | | pProfileResult->ResultChamfer[64 + i][1].bUseJudge = TRUE; |
| | | pProfileResult->ResultChamfer[64+i][1].bChamferJudge = FALSE; |
| | | nChamferAlarmResultCount = 1; |
| | | } |
| | | } |
| | | } |
| | |
| | | USES_CONVERSION; |
| | | char str_filename[1024]; |
| | | sprintf_s(str_filename, "%s", W2A(strFile)); |
| | | cvSaveImage(str_filename,IpImg); |
| | | |
| | | #if MARKIMG_NOTSAVE |
| | | cvSaveImage(str_filename, IpImg); |
| | | #endif // 0 |
| | | |
| | | cvReleaseImage(&IpImg); |
| | | } |
| | | |