| | |
| | | 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; |
| | | } |
| | |
| | | dConv = pCamera->m_dConvResolution[nStageNo]; |
| | | dScan = pCamera->m_dScanResolution[nStageNo]; |
| | | if(dConv <= 0 || dScan <= 0) |
| | | return FALSE; |
| | | return FALSE; |
| | | |
| | | if (m_pRecipe != nullptr) { |
| | | CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm; |
| | | double dConvRes = profile.m_dConvResolution[eDimension][nStageNo]; |
| | | if (dConvRes > 0.0) { |
| | | dConv = dConvRes; |
| | | } |
| | | |
| | | double dScanRes = profile.m_dScanResolution[eDimension][nStageNo]; |
| | | if (dScanRes > 0.0) { |
| | | dScan = dScanRes; |
| | | } |
| | | } |
| | | |
| | | srand((unsigned int)time(NULL)); |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | double dConv = pCamera->m_dConvResolution[g_pBase->m_nStageNo]; |
| | | if(dConv <= 0) |
| | | return FALSE; |
| | | return FALSE; |
| | | |
| | | if (m_pRecipe != nullptr) { |
| | | CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm; |
| | | double dConvRes = profile.m_dConvResolution[emDim][g_pBase->m_nStageNo]; |
| | | if (dConvRes > 0.0) { |
| | | dConv = dConvRes; |
| | | } |
| | | } |
| | | |
| | | double dProfileAvg; |
| | | double dChamferAvg; |
| | |
| | | |
| | | double dConv = pCamera->m_dConvResolution[g_pBase->m_nStageNo]; |
| | | if(dConv <= 0) |
| | | return FALSE; |
| | | return FALSE; |
| | | |
| | | if (m_pRecipe != nullptr) { |
| | | CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm; |
| | | double dConvRes = profile.m_dConvResolution[emDim][g_pBase->m_nStageNo]; |
| | | if (dConvRes > 0.0) { |
| | | dConv = dConvRes; |
| | | } |
| | | } |
| | | |
| | | INS_EDGE_RESULT_INFO *pResInfo = NULL; |
| | | pResInfo = m_pGlassData->GetEdgeResultInfo(emDim); |
| | |
| | | { |
| | | g_pLog->DisplayMessage(_T("%s MakeProfilePosition Res Null : Frame %d, %d,%.3f,%.3f"),PANEL_SIDE[emDim],stFrame.nFrameIdx,g_pBase->m_nStageNo,dConv,dScan); |
| | | return FALSE; |
| | | } |
| | | |
| | | if (m_pRecipe != nullptr) { |
| | | CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm; |
| | | double dConvRes = profile.m_dConvResolution[emDim][g_pBase->m_nStageNo]; |
| | | if (dConvRes > 0.0) { |
| | | dConv = dConvRes; |
| | | } |
| | | |
| | | double dScanRes = profile.m_dScanResolution[emDim][g_pBase->m_nStageNo]; |
| | | if (dScanRes > 0.0) { |
| | | dScan = dScanRes; |
| | | } |
| | | } |
| | | |
| | | ptOffset.x = (float)((double)ptOffset.x / dConv); |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | if(nStageNo < 0 || nStageNo > 1) |
| | | nStageNo = 0; |
| | | |
| | | int nChipInsArea = (int)((double)pChipPrm->m_nChippingInsArea/pCamera->m_dConvResolution[nStageNo]); |
| | | CRect rectChip = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height()); |
| | | int nCrackInsArea = (int)((double)pChipPrm->m_nCrackINsArea/pCamera->m_dConvResolution[nStageNo]); |
| | | CRect rectCrack = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height()); |
| | | int nBrokenInsArea = (int)((double)pChipPrm->m_nBrokenInsArea/pCamera->m_dConvResolution[nStageNo]); |
| | | CRect rectBroken = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height()); |
| | | double dConvRes = pCamera->m_dConvResolution[nStageNo]; |
| | | |
| | | //if (m_pRecipe != nullptr) { |
| | | // CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm; |
| | | // double dProfileRes = profile.m_dConvResolution[eDim][nStageNo]; |
| | | // if (dProfileRes > 0.0) { |
| | | // dConvRes = dProfileRes; |
| | | // } |
| | | //} |
| | | |
| | | int nChipInsArea = (int)((double)pChipPrm->m_nChippingInsArea / dConvRes); |
| | | CRect rectChip = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height()); |
| | | int nCrackInsArea = (int)((double)pChipPrm->m_nCrackINsArea / dConvRes); |
| | | CRect rectCrack = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height()); |
| | | int nBrokenInsArea = (int)((double)pChipPrm->m_nBrokenInsArea / dConvRes); |
| | | CRect rectBroken = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height()); |
| | | |
| | | rectChip.InflateRect(align_4byte(nChipInsArea)/2,0); |
| | | rectCrack.InflateRect(align_4byte(nCrackInsArea)/2,0); |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | |
| | | BOOL CInspectCamera::OnThreadEnd(int iThread, CInspectThread *pInspectThread) |
| | | { |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CInspectCamera::OnThreadEndAll() |
| | | { |
| | | |
| | | return TRUE; |
| | | } |
| | | |