| | |
| | | CCameraImageData* pCameraImage = m_vecCameraImage[nCameraIdx]; |
| | | CAlignFinder* pAlignFinder = m_vecAlignFinder[nCameraIdx]; |
| | | |
| | | if (pCameraImage==NULL || pAlignFinder==NULL) return FALSE; |
| | | /*< LYW 20211014 - #index MOD Start >*/ |
| | | if (pCameraImage == NULL || pAlignFinder == NULL || m_pACC2P == NULL) return FALSE; |
| | | /*< LYW 20211014 - #index MOD End >*/ |
| | | /*< Origin Code >*/ |
| | | //if (pCameraImage == NULL || pAlignFinder == NULL) return FALSE; |
| | | |
| | | // set find param; |
| | | SAlignFindParam findParam; |
| | |
| | | findParam.nEdgeThreshold = m_AlignRecipe.nEdgeThreshold; |
| | | findParam.nMergeRange = m_AlignRecipe.nMergeRange; |
| | | findParam.dEdgeRate = m_AlignRecipe.dEdgeRate; |
| | | findParam.dMatchingPixelStandard = _tcstod(m_AlignRecipe.strMatchingPixelStandard,NULL); |
| | | findParam.dMatchingAlarmCondition = _tcstod(m_AlignRecipe.strMatchingAlarmCondition, NULL); |
| | | // findParam.m_nAlignMarkPos = m_AlignRecipe.nAlignMarkPosition; |
| | | |
| | | |
| | |
| | | // CString strFilename = ALIGN_IMAGE_PATH; |
| | | // if (nCameraIdx == 0) |
| | | // { |
| | | // strFilename += _T("\\Test3.BMP"); |
| | | // strFilename += _T("\\Test1.BMP"); |
| | | // } |
| | | // else |
| | | // { |
| | | // strFilename += _T("\\Test4.BMP"); |
| | | // strFilename += _T("\\Test2.BMP"); |
| | | // } |
| | | // TestImage.LoadImage(strFilename); |
| | | // TestImage.GetBandImage(BandTypeGray, m_vecCameraImage[nCameraIdx]->GetImageData(View_Camera)); |
| | |
| | | int dffmain2assistanstY = int(findResult.dPosY) - int(findAssistantResult.dPosY); |
| | | g_pLog->DisplayMessage(_T("Main, Assistant TempleteMatching All Low Score! differenceX = %d, differenceY = %d"), dffmain2assistanstX, dffmain2assistanstY); |
| | | |
| | | if (abs(dffmain2assistanstX) <= 10 && abs(dffmain2assistanstY) <= 10 && findResult.dMatchValue != 0.0) |
| | | if (abs(dffmain2assistanstX) <= findParam.dMatchingPixelStandard && abs(dffmain2assistanstY) <= findParam.dMatchingPixelStandard && findResult.dMatchValue != 0.0) |
| | | { |
| | | g_pLog->DisplayMessage(_T("Main Assistant Templete Find Same Point! Align Success!")); |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 1; |
| | | m_AlignResult.dFindPixelX[nCameraIdx] = int(findResult.dPosX + 0.5); |
| | | m_AlignResult.dFindPixelY[nCameraIdx] = int(findResult.dPosY + 0.5); |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | m_pACC2P->IACC2P_SetAccumaulate(m_pACC2P->IACC2P_GetAccumaulate() + 1); |
| | | g_pLog->DisplayMessage(_T("Main, Assistant Templete Find Same Point! Align Success! Accumaulate = %d"), m_pACC2P->IACC2P_GetAccumaulate()); |
| | | } |
| | | |
| | | else |
| | |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | } |
| | | |
| | | if (m_pACC2P->IACC2P_GetAccumaulate() > findParam.dMatchingAlarmCondition) |
| | | { |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | m_pACC2P->IACC2P_SetAccumaulate(0); |
| | | g_pLog->DisplayMessage(_T("Low Matching, But Align Same Point, Count is more Than MatchingAlarmCondition , Accumaulate = %d Reset"), m_pACC2P->IACC2P_GetAccumaulate()); |
| | | } |
| | | } |
| | | } |
| | | /*< LYW 20211013 - #3671 ADD End >*/ |