Ongoing80 #3671 CF AOI Review 전설비 Align Matching 방법 개선
- 메인 보조 모두 매칭률이 낮아 실패 후 찾은 Align 픽셀이 동일 위치로 판단할 기준 Pixel값 설정 기능 추가
- 메인 보조 모두 매칭률이 낮지만 위치 조건으로 Align 성공한 횟수 가 설정한 횟수보다 높아지면 알람 발생 기능 추가
| | |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_SECOND_ASSISTANT_IMAGE_FILE")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strSecondAssistantImageFile); |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_MATCHING_PIXEL_STANDARD")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strMatchingPixelStandard); |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_MATCHING_ALARM_CONDITION")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strMatchingAlarmCondition); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_TOTAL_PITCH_IMAGE_FILE")); |
| | |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_SECOND_ASSISTANT_IMAGE_FILE")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strSecondAssistantImageFile, _T("")); |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_MATCHING_PIXEL_STANDARD")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strMatchingPixelStandard, _T("0")); |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_MATCHING_ALARM_CONDITION")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strMatchingAlarmCondition, _T("0")); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_TOTAL_PITCH_IMAGE_FILE")); |
| | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | m_strFirstAssistantImageFile = _T(""); |
| | | m_strSecondAssistantImageFile = _T(""); |
| | | m_strMatchingPixelStandard = _T(""); |
| | | m_strMatchingAlarmCondition = _T(""); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | m_strTotalPitchImageFile= _T(""); |
| | | // edge find param |
| | |
| | | |
| | | CDlgAlign::CDlgAlign(CWnd* pParent /*=NULL*/) |
| | | : CDialog(CDlgAlign::IDD, pParent) |
| | | , m_dMatchingPixelStandard(0) |
| | | , m_dMatchingAlarmCondition(0) |
| | | { |
| | | m_pFirstView = new CCHImageView(this); |
| | | m_pSecondView = new CCHImageView(this); |
| | |
| | | DDX_Control(pDX, IDC_CHECK_EDGEALIGN_PROCESS, m_ctrlCheckEdgeAlignProcess); |
| | | DDX_Control(pDX, IDC_CHECK_ALIGN_SKIP, m_ctrlCheckAlignSkip); |
| | | DDX_Control(pDX, IDC_CHECK_TOTALPITCHMEASRE, m_ctrlTotalPitchMeasure); |
| | | DDX_Text(pDX, IDC_EDIT_MATCHONG_PIXEL_STANDARD, m_dMatchingPixelStandard); |
| | | DDX_Text(pDX, IDC_EDIT_MATCHING_ALARM_CONDITION, m_dMatchingAlarmCondition); |
| | | } |
| | | |
| | | |
| | |
| | | nRowIdx++; |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondAssistantImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx); |
| | | nRowIdx++; |
| | | |
| | | strItemText.Format(_T("%d"), m_dMatchingPixelStandard); |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strMatchingPixelStandard = strItemText; |
| | | |
| | | strItemText.Format(_T("%d"), m_dMatchingAlarmCondition); |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strMatchingAlarmCondition = strItemText; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | strItemText = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx); |
| | |
| | | pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx); |
| | | pCellButton->SetText(_T("Browser")); |
| | | |
| | | /*< LYW 20211014 - #3671 ADD Start >*/ |
| | | strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strMatchingPixelStandard; |
| | | m_dMatchingPixelStandard = _tcstod(strItemText, NULL); |
| | | |
| | | strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strMatchingAlarmCondition; |
| | | m_dMatchingAlarmCondition = _tcstod(strItemText, NULL); |
| | | |
| | | /*< LYW 20211014 - #3671 ADD End >*/ |
| | | |
| | | |
| | | m_ctrlCheckImageProcess.SetCheck(pRcpRsAlignManager->GetRsRcpAlignInfo()->m_bUseImage); |
| | | |
| | |
| | | FillAlignRotateInfo(); |
| | | FillAlignImageInfo(); |
| | | |
| | | /*< LYW 20211014 - #3671 ADD Start >*/ |
| | | UpdateData(FALSE); |
| | | /*< LYW 20211014 - #3671 ADD End >*/ |
| | | Invalidate(FALSE); |
| | | } |
| | | |
| | |
| | | CButton m_ctrlCheckAlignSkip; |
| | | CButton m_ctrlTotalPitchMeasure; |
| | | afx_msg void OnBnClickedButtonRcpFindTest(); |
| | | int m_dMatchingPixelStandard; |
| | | int m_dMatchingAlarmCondition; |
| | | }; |
| | |
| | | LTEXT "Rotation Correction",IDC_STATIC,7,271,64,14,SS_CENTERIMAGE | WS_DISABLED |
| | | CONTROL "Operate",IDC_CHECK_ROTATE_PROCESS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,74,273,55,10 |
| | | LTEXT "Image Matching",IDC_STATIC,7,7,53,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_IMAGE_INFO,"MFCGridCtrl",WS_TABSTOP,7,22,311,92 |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_IMAGE_INFO,"MFCGridCtrl",WS_TABSTOP,7,22,311,76 |
| | | CONTROL "Operate",IDC_CHECK_IMAGE_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,64,10,55,10 |
| | | CONTROL "Operate",IDC_CHECK_EDGE_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46,118,55,10 |
| | | LTEXT "Align Images",IDC_STATIC,7,315,48,14,SS_CENTERIMAGE |
| | |
| | | CONTROL "TotalPitchMeasure",IDC_CHECK_TOTALPITCHMEASRE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,192,10,74,10 |
| | | LTEXT "main Templete",IDC_STATIC,226,370,53,14,SS_CENTERIMAGE |
| | | LTEXT "Assistant Templete",IDC_STATIC,226,463,84,14,SS_CENTERIMAGE |
| | | LTEXT "보조 매칭 pixel 기준값:",IDC_STATIC,8,99,74,14,SS_CENTERIMAGE |
| | | LTEXT "알람 조건:",IDC_STATIC,132,99,38,14,SS_CENTERIMAGE |
| | | LTEXT "회 연속 발생시 ",IDC_STATIC,184,99,51,14,SS_CENTERIMAGE |
| | | EDITTEXT IDC_EDIT_MATCHONG_PIXEL_STANDARD,86,100,32,11,ES_AUTOHSCROLL |
| | | EDITTEXT IDC_EDIT_MATCHING_ALARM_CONDITION,167,101,16,10,ES_AUTOHSCROLL |
| | | END |
| | | |
| | | IDD_DIALOG_REVIEW_RCP_EDITOR_DEFECT_FIND DIALOGEX 0, 0, 379, 526 |
| | |
| | | #define IDC_EDIT_RRCP_REVIEW_USER_DEFECT_COUNT 1008 |
| | | #define IDC_EDIT_RCP_REVIEW_USER_DEFECT_COUNT 1008 |
| | | #define IDC_EDIT_WSI_COUNT 1008 |
| | | #define IDC_EDIT_MATCHING_ALARM_CONDITION 1008 |
| | | #define IDC_GRID_RRCP_REVIEW_USER_DEFECT_INFO 1009 |
| | | #define IDC_GRID_RCP_REVIEW_USER_DEFECT_INFO 1009 |
| | | #define IDC_EDIT_MAG_INDEX 1009 |
| | |
| | | #define IDC_REVIEW_DEFOCUS_VAL 1044 |
| | | #define IDC_REVIEW_DEFOCUS_VALUE 1044 |
| | | #define IDC_EDIT_RCP_JUDGE_CELL_JUDGE_COUNT 1044 |
| | | #define IDC_EDIT_MATCHONG_PIXEL_STANDARD 1044 |
| | | #define IDC_BUTTON_RCP_REVIEW_APPLY2 1045 |
| | | #define IDC_BUTTON_RCP_REVIEW_PRIORITY_APPLY 1045 |
| | | #define IDC_EDIT_RCP_MEASURE_COUNT 1045 |
| | |
| | | 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 >*/ |
| | |
| | | virtual void IACC2P_CameraControl(int nValue) = 0; |
| | | virtual BOOL IACC2P_SetLightLevel(int nCameraIndex, int nValue) = 0; |
| | | virtual BOOL IACC2P_GetLightLevel(int nCameraIndex, int& nValue) = 0; |
| | | /*< LYW 20211014 - #3671 ADD Start >*/ |
| | | virtual int IACC2P_GetAccumaulate() = 0; |
| | | virtual void IACC2P_SetAccumaulate(int dValue) = 0; |
| | | /*< LYW 20211014 - #3671 ADD End >*/ |
| | | }; |
| | | |
| | | class CCameraControlAlign : public CCameraController, |
| | |
| | | m_bFirstReviewLeft = 0; |
| | | m_bFirstReviewRight = 0; |
| | | |
| | | /*< LYW 20211014 - #3671 ADD Start >*/ |
| | | m_daccumulate = 0; |
| | | /*< LYW 20211014 - #3671 ADD End >*/ |
| | | |
| | | // cs init |
| | | InitializeCriticalSection(&m_csReviewResult); |
| | | InitializeCriticalSection(&m_csReviewSignal); |
| | |
| | | return AlignLight_GetLightLevel(nCameraIndex, nValue); |
| | | } |
| | | |
| | | int CReviewInterface::IACC2P_GetAccumaulate() |
| | | { |
| | | return m_daccumulate; |
| | | } |
| | | |
| | | void CReviewInterface::IACC2P_SetAccumaulate(int dValue) |
| | | { |
| | | m_daccumulate = dValue; |
| | | } |
| | | |
| | | BOOL CReviewInterface::IRCC2P_GetCurrentFrame(int nModuleIndex, int nCameraIndex, int nFrameWidth, int nFrameHeight, int nFrameChannels, CCHImageData* pImageData) |
| | | { |
| | | if (m_pVirtualGlassMap==NULL) return FALSE; |
| | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | pGlassResult->m_AlignRecipe.strFirstAssistantImageFile = pRsRcpAlignInfo->m_strFirstAssistantImageFile; |
| | | pGlassResult->m_AlignRecipe.strSecondAssistantImageFile = pRsRcpAlignInfo->m_strSecondAssistantImageFile; |
| | | pGlassResult->m_AlignRecipe.strMatchingPixelStandard = pRsRcpAlignInfo->m_strMatchingPixelStandard; |
| | | pGlassResult->m_AlignRecipe.strMatchingAlarmCondition = pRsRcpAlignInfo->m_strMatchingAlarmCondition; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | pGlassResult->m_AlignRecipe.strTotalPitchImageFile = pRsRcpAlignInfo->m_strTotalPitchImageFile; |
| | | |
| | |
| | | virtual void IACC2P_CameraControl(int nValue); |
| | | virtual BOOL IACC2P_SetLightLevel(int nCameraIndex, int nValue); |
| | | virtual BOOL IACC2P_GetLightLevel(int nCameraIndex, int& nValue); |
| | | /*< LYW 20211014 - #3671 ADD Start >*/ |
| | | virtual int IACC2P_GetAccumaulate(); |
| | | virtual void IACC2P_SetAccumaulate(int dValue); |
| | | /*< LYW 20211014 - #3671 ADD End >*/ |
| | | |
| | | // review camera control 2 parent |
| | | virtual BOOL IRCC2P_GetCurrentFrame(int nModuleIndex, int nCameraIndex, int nFrameWidth, int nFrameHeight, int nFrameChannels, CCHImageData *pImageData); |
| | |
| | | |
| | | BOOL m_bFirstReviewLeft; |
| | | BOOL m_bFirstReviewRight; |
| | | int m_daccumulate; |
| | | |
| | | virtual BOOL IRP2P_SaveDefectMap(const CString& strPath); |
| | | |
| | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | pGlassResult->m_AlignRecipe.strFirstAssistantImageFile = pRsRcpAlignInfo->m_strFirstAssistantImageFile; |
| | | pGlassResult->m_AlignRecipe.strSecondAssistantImageFile = pRsRcpAlignInfo->m_strSecondAssistantImageFile; |
| | | pGlassResult->m_AlignRecipe.strMatchingPixelStandard = pRsRcpAlignInfo->m_strMatchingPixelStandard; |
| | | pGlassResult->m_AlignRecipe.strMatchingAlarmCondition = pRsRcpAlignInfo->m_strMatchingAlarmCondition; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | pGlassResult->m_AlignRecipe.strTotalPitchImageFile = pRsRcpAlignInfo->m_strTotalPitchImageFile; |
| | | |
| | |
| | | // match |
| | | bMatchProcess = TRUE; |
| | | dMatchRate = 0.8; |
| | | dMatchingPixelStandard = 0; |
| | | dMatchingAlarmCondition = 0; |
| | | |
| | | // edge |
| | | bEdgeProcess = TRUE; |
| | |
| | | // match |
| | | BOOL bMatchProcess; |
| | | double dMatchRate; |
| | | /*< LYW 20211014 - #3671 ADD Start >*/ |
| | | int dMatchingPixelStandard; |
| | | int dMatchingAlarmCondition; |
| | | /*< LYW 20211014 - #3671 ADD End >*/ |
| | | |
| | | // edge |
| | | BOOL bEdgeProcess; |
| | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CString m_strFirstAssistantImageFile; |
| | | CString m_strSecondAssistantImageFile; |
| | | CString m_strMatchingPixelStandard; |
| | | CString m_strMatchingAlarmCondition; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | CString m_strTotalPitchImageFile; |
| | | |
| | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CString strFirstAssistantImageFile; |
| | | CString strSecondAssistantImageFile; |
| | | CString strMatchingPixelStandard; |
| | | CString strMatchingAlarmCondition; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | CString strTotalPitchImageFile; |
| | | |