Ongoing60 #3671 CF AOI Review 전설비 Align Matching 방법 개선
- 보조 템플릿 등록 Recipe Editor UI 수정
- GlassLoading시 메인 보조 템플릿 로딩
- Align Find시 메인으로 매칭 시도
- 실패시 보조 템플릿으로 매칭 시도
- 보조도 실패시 메인,보조로 찾은 얼라인 픽셀 위치가 일정수준이하이면 AlignFind성공 처리
| | |
| | | return findResult; |
| | | } |
| | | |
| | | /*< LYW 20211013 - #3671 Delete Start >*/ |
| | | // step2. edge find |
| | | if (FindAlignEdge(findResult)==1) |
| | | { |
| | | return findResult; |
| | | } |
| | | // if (FindAlignEdge(findResult) == 1) |
| | | // { |
| | | // return findResult; |
| | | // } |
| | | /*< LYW 20211013 - #3671 Delete End >*/ |
| | | |
| | | |
| | | return findResult; |
| | | } |
| | |
| | | CCHImageData tempImage; |
| | | CCHImageProcess::ImageNormalize(&resultImage, &m_BlobImage, 0, 255); |
| | | |
| | | if (findResult.dMatchValue<m_findParam.dMatchRate) |
| | | { |
| | | findResult.nResultCode = AlignMatch_LowScore; |
| | | return 0; |
| | | } |
| | | /*< LYW 20211013 - #3671 Delete Start >*/ |
| | | // if (findResult.dMatchValue < m_findParam.dMatchRate) |
| | | // { |
| | | // findResult.nResultCode = AlignMatch_LowScore; |
| | | // return 0; |
| | | // } |
| | | /*< LYW 20211013 - #3671 Delete End >*/ |
| | | |
| | | // step5. Make Result 이미지 |
| | | findResult.nResultCode = AlignMatch_Success; |
| | |
| | | m_ResultImage.DrawRectangle(CPoint((int)(dResultX+0.5), (int)(dResultY+0.5)), CPoint((int)(dResultX+m_pTempImage->GetWidth()+0.5), (int)(dResultY+m_pTempImage->GetHeight()+0.5)), RGB(255,255,255), 2); |
| | | } |
| | | |
| | | /*< LYW 20211013 - #3671 ADD Start >*/ |
| | | if (findResult.dMatchValue < m_findParam.dMatchRate) |
| | | { |
| | | findResult.nResultCode = AlignMatch_LowScore; |
| | | return 0; |
| | | } |
| | | /*< LYW 20211013 - #3671 ADD End >*/ |
| | | return 1; |
| | | } |
| | | |
| | |
| | | strItem.Format(_T("RCP_ALIGN_SECOND_IMAGE_FILE")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strSecondImageFile); |
| | | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | strItem.Format(_T("RCP_ALIGN_FIRST_ASSISTANT_IMAGE_FILE")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strFirstAssistantImageFile); |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_SECOND_ASSISTANT_IMAGE_FILE")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strSecondAssistantImageFile); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_TOTAL_PITCH_IMAGE_FILE")); |
| | | macroFile.SetItem(strItem, m_rsRcpAlignInfo.m_strTotalPitchImageFile); |
| | | |
| | |
| | | strItem.Format(_T("RCP_ALIGN_SECOND_IMAGE_FILE")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strSecondImageFile, _T("")); |
| | | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | strItem.Format(_T("RCP_ALIGN_FIRST_ASSISTANT_IMAGE_FILE")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strFirstAssistantImageFile, _T("")); |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_SECOND_ASSISTANT_IMAGE_FILE")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strSecondAssistantImageFile, _T("")); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | strItem.Format(_T("RCP_ALIGN_TOTAL_PITCH_IMAGE_FILE")); |
| | | macroFile.GetItem(strItem, m_rsRcpAlignInfo.m_strTotalPitchImageFile, _T("")); |
| | | |
| | |
| | | m_dMatchingRate = 0.9; |
| | | m_strFirstImageFile = _T(""); |
| | | m_strSecondImageFile = _T(""); |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | m_strFirstAssistantImageFile = _T(""); |
| | | m_strSecondAssistantImageFile = _T(""); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | m_strTotalPitchImageFile= _T(""); |
| | | // edge find param |
| | | m_bUseEdge = TRUE; |
| | |
| | | { |
| | | m_pFirstView = new CCHImageView(this); |
| | | m_pSecondView = new CCHImageView(this); |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | m_pFirstAssistantView = new CCHImageView(this); |
| | | m_pSecondAssistantView = new CCHImageView(this); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | } |
| | | |
| | | CDlgAlign::~CDlgAlign() |
| | |
| | | delete m_pSecondView; |
| | | m_pSecondView = NULL; |
| | | } |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | if (m_pFirstAssistantView) |
| | | { |
| | | delete m_pFirstAssistantView; |
| | | m_pFirstAssistantView = NULL; |
| | | } |
| | | |
| | | if (m_pSecondAssistantView) |
| | | { |
| | | delete m_pSecondAssistantView; |
| | | m_pSecondAssistantView = NULL; |
| | | } |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | } |
| | | |
| | | void CDlgAlign::DoDataExchange(CDataExchange* pDX) |
| | |
| | | { |
| | | m_pSecondView->Invalidate(TRUE); |
| | | } |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | else if (nIdx == 2 && m_pFirstAssistantView->LoadImage(strFilepath)) |
| | | { |
| | | m_pFirstAssistantView->Invalidate(TRUE); |
| | | } |
| | | else if (nIdx == 3 && m_pSecondAssistantView->LoadImage(strFilepath)) |
| | | { |
| | | m_pSecondAssistantView->Invalidate(TRUE); |
| | | } |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | |
| | | m_ctrlGridAlignImageInfo.SetItemText(nIdx, 1, strFilename); |
| | |
| | | CRect rect; |
| | | rect.left = 10; |
| | | rect.top = 550; |
| | | rect.right = rect.left + 232; |
| | | rect.bottom = rect.top + 232; |
| | | rect.right = rect.left + 150; |
| | | rect.bottom = rect.top + 150; |
| | | |
| | | m_pFirstView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY , rect, this, 0); |
| | | m_pFirstView->SetDrawType(DrawFit); |
| | |
| | | if (m_pSecondView) |
| | | { |
| | | CRect rect; |
| | | rect.left = 244; |
| | | rect.left = 161; |
| | | rect.top = 550; |
| | | rect.right = rect.left + 232; |
| | | rect.bottom = rect.top + 232; |
| | | rect.right = rect.left + 150; |
| | | rect.bottom = rect.top + 150; |
| | | |
| | | m_pSecondView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY , rect, this, 0); |
| | | m_pSecondView->SetDrawType(DrawFit); |
| | | m_pSecondView->SetViewName(_T("Second")); |
| | | m_pSecondView->ShowWindow(SW_SHOW); |
| | | } |
| | | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | if (m_pFirstAssistantView) |
| | | { |
| | | CRect rect; |
| | | rect.left = 10; |
| | | rect.top = 701; |
| | | rect.right = rect.left + 150; |
| | | rect.bottom = rect.top + 150; |
| | | |
| | | m_pFirstAssistantView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY, rect, this, 0); |
| | | m_pFirstAssistantView->SetDrawType(DrawFit); |
| | | m_pFirstAssistantView->SetViewName(_T("FirstAssistant")); |
| | | m_pFirstAssistantView->ShowWindow(SW_SHOW); |
| | | } |
| | | |
| | | if (m_pSecondAssistantView) |
| | | { |
| | | CRect rect; |
| | | rect.left = 161; |
| | | rect.top = 701; |
| | | rect.right = rect.left + 150; |
| | | rect.bottom = rect.top + 150; |
| | | |
| | | m_pSecondAssistantView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY, rect, this, 0); |
| | | m_pSecondAssistantView->SetDrawType(DrawFit); |
| | | m_pSecondAssistantView->SetViewName(_T("SecondAssistant")); |
| | | m_pSecondAssistantView->ShowWindow(SW_SHOW); |
| | | } |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다. |
| | |
| | | nRowIdx++; |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx); |
| | | nRowIdx++; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strFirstAssistantImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx); |
| | | nRowIdx++; |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondAssistantImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx); |
| | | nRowIdx++; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | strItemText = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx); |
| | | pRcpRsAlignManager->GetRsRcpAlignInfo()->m_dMatchingRate = _tcstod(strItemText, NULL); |
| | |
| | | Item.strText = strTemp; |
| | | m_ctrlGridAlignImageInfo.SetItem(&Item); |
| | | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | nRowIdx++; |
| | | Item.row = nRowIdx; |
| | | Item.col = nColIdx; |
| | | strTemp.Format(_T("1st Assist Mark")); |
| | | Item.strText = strTemp; |
| | | m_ctrlGridAlignImageInfo.SetItem(&Item); |
| | | |
| | | nRowIdx++; |
| | | Item.row = nRowIdx; |
| | | Item.col = nColIdx; |
| | | strTemp.Format(_T("2nd Assist Mark")); |
| | | Item.strText = strTemp; |
| | | m_ctrlGridAlignImageInfo.SetItem(&Item); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | nRowIdx++; |
| | | Item.row = nRowIdx; |
| | | Item.col = nColIdx; |
| | |
| | | m_ctrlGridAlignImageInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellButton)); |
| | | pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx); |
| | | pCellButton->SetText(_T("Browser")); |
| | | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | // first Assistant |
| | | nRowIdx = 2; |
| | | nColIdx = 1; |
| | | strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strFirstAssistantImageFile; |
| | | m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText); |
| | | |
| | | strFilename = ALIGN_IMAGE_PATH; |
| | | strFilename = strFilename + _T("\\") + strItemText; |
| | | m_pFirstAssistantView->LoadImage(strFilename); |
| | | /*m_pFirstView->Invalidate(TRUE);*/ |
| | | |
| | | nColIdx = 2; |
| | | m_ctrlGridAlignImageInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellButton)); |
| | | pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx); |
| | | pCellButton->SetText(_T("Browser")); |
| | | |
| | | // second Assistant |
| | | nRowIdx = 3; |
| | | nColIdx = 1; |
| | | strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondAssistantImageFile; |
| | | m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText); |
| | | strFilename = ALIGN_IMAGE_PATH; |
| | | strFilename = strFilename + _T("\\") + strItemText; |
| | | m_pSecondAssistantView->LoadImage(strFilename); |
| | | //m_pSecondView->Invalidate(TRUE); |
| | | |
| | | nColIdx = 2; |
| | | m_ctrlGridAlignImageInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellButton)); |
| | | pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx); |
| | | pCellButton->SetText(_T("Browser")); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | // |
| | | |
| | | nRowIdx = 2; |
| | | nRowIdx = 4; |
| | | nColIdx = 1; |
| | | strItemText.Format(_T("%.3lf"), pRcpRsAlignManager->GetRsRcpAlignInfo()->m_dMatchingRate); |
| | | m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText); |
| | | |
| | | // |
| | | nRowIdx = 3; |
| | | nRowIdx = 5; |
| | | nColIdx = 1; |
| | | strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strTotalPitchImageFile; |
| | | m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText); |
| | |
| | | class CCHImageData; |
| | | class CCHImageView; |
| | | |
| | | #define ALIGN_IMAGE_INFO_GRID_ROW_COUNT 4 |
| | | /*< LYW 20211012 - #3671 MOD Start >*/ |
| | | #define ALIGN_IMAGE_INFO_GRID_ROW_COUNT 6 |
| | | /*< LYW 20211012 - #3671 MOD End >*/ |
| | | /*< Origin Code >*/ |
| | | //#define ALIGN_IMAGE_INFO_GRID_ROW_COUNT 4 |
| | | #define ALIGN_IMAGE_INFO_GRID_COL_COUNT 3 |
| | | #define ALIGN_FIND_INFO_GRID_ROW_COUNT 2 |
| | | #define ALIGN_FIND_INFO_GRID_COL_COUNT 5 |
| | |
| | | |
| | | CCHImageView* m_pFirstView; |
| | | CCHImageView* m_pSecondView; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CCHImageView* m_pFirstAssistantView; |
| | | CCHImageView* m_pSecondAssistantView; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | CCHImageView* m_pTotalPitchView; |
| | | |
| | | virtual BOOL OnInitDialog(); |
| | |
| | | FONT 8, "MS Shell Dlg", 400, 0, 0x1 |
| | | BEGIN |
| | | PUSHBUTTON "Apply",IDC_BUTTON_RCP_ALIGN_APPLY,322,24,50,14 |
| | | LTEXT "Edge Find",IDC_STATIC,7,66,38,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_FIND_INFO,"MFCGridCtrl",WS_TABSTOP,7,82,311,30 |
| | | LTEXT "Light Setting",IDC_STATIC,9,143,49,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_LIGHT_INFO,"MFCGridCtrl",WS_TABSTOP,7,160,311,30 |
| | | LTEXT "Edge Find",IDC_STATIC,7,116,38,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_FIND_INFO,"MFCGridCtrl",WS_TABSTOP,7,128,311,30 |
| | | LTEXT "Light Setting",IDC_STATIC,9,170,49,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_LIGHT_INFO,"MFCGridCtrl",WS_TABSTOP,7,182,311,30 |
| | | PUSHBUTTON "Reset",IDC_BUTTON_RCP_ALIGN_RESET,322,7,50,14 |
| | | LTEXT "Auto Light Level",IDC_STATIC,7,195,52,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_AUTO_INFO,"MFCGridCtrl",WS_TABSTOP,7,212,311,44 |
| | | CONTROL "Operate",IDC_CHECK_AUTO_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,65,197,55,10 |
| | | CONTROL "Operate",IDC_CHECK_MANUAL_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,146,55,10 |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_ROTATE_INFO,"MFCGridCtrl",WS_DISABLED | WS_TABSTOP,7,277,311,30 |
| | | LTEXT "Rotation Correction",IDC_STATIC,7,263,64,14,SS_CENTERIMAGE | WS_DISABLED |
| | | CONTROL "Operate",IDC_CHECK_ROTATE_PROCESS,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,74,266,55,10 |
| | | LTEXT "Auto Light Level",IDC_STATIC,7,212,52,14,SS_CENTERIMAGE |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_AUTO_INFO,"MFCGridCtrl",WS_TABSTOP,7,226,311,44 |
| | | CONTROL "Operate",IDC_CHECK_AUTO_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,65,216,55,10 |
| | | CONTROL "Operate",IDC_CHECK_MANUAL_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,173,55,10 |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_ROTATE_INFO,"MFCGridCtrl",WS_DISABLED | WS_TABSTOP,7,284,311,30 |
| | | 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,44 |
| | | CONTROL "Custom1",IDC_GRID_RCP_ALIGN_IMAGE_INFO,"MFCGridCtrl",WS_TABSTOP,7,22,311,92 |
| | | 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,69,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 |
| | | PUSHBUTTON "Find Test",IDC_BUTTON_RCP_FIND_TEST,55,316,50,14 |
| | | LTEXT "EdgeAlign ",IDC_STATIC,9,121,49,14,SS_CENTERIMAGE |
| | | CONTROL "Operate",IDC_CHECK_EDGEALIGN_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46,124,55,10 |
| | | LTEXT "EdgeAlign ",IDC_STATIC,9,159,49,14,SS_CENTERIMAGE |
| | | CONTROL "Operate",IDC_CHECK_EDGEALIGN_PROCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46,162,55,10 |
| | | CONTROL "Align Skip",IDC_CHECK_ALIGN_SKIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,274,10,43,10 |
| | | 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 |
| | | END |
| | | |
| | | IDD_DIALOG_REVIEW_RCP_EDITOR_DEFECT_FIND DIALOGEX 0, 0, 379, 526 |
| | |
| | | 0 |
| | | END |
| | | |
| | | IDD_DIALOG_REVIEW_RCP_EDITOR_ALIGN AFX_DIALOG_LAYOUT |
| | | BEGIN |
| | | 0 |
| | | END |
| | | |
| | | #endif // 한국어(대한민국) resources |
| | | ///////////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | // |
| | | #ifdef APSTUDIO_INVOKED |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 154 |
| | | #define _APS_NEXT_RESOURCE_VALUE 155 |
| | | #define _APS_NEXT_COMMAND_VALUE 32771 |
| | | #define _APS_NEXT_CONTROL_VALUE 1122 |
| | | #define _APS_NEXT_SYMED_VALUE 106 |
| | |
| | | |
| | | CString strFilename = _T(""); |
| | | CCHImageData tempImage; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CCHImageData assistanttempImage; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | for (int i=0; i<2; i++) |
| | | { |
| | | if(m_vecCameraImage.size() <= i) continue; |
| | | (m_vecCameraImage[i]->GetImageData(View_Template))->ReleaseImage(); |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | (m_vecCameraImage[i]->GetImageData(View_AssistantTemplate))->ReleaseImage(); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | // load |
| | | CString strFilename = ALIGN_IMAGE_PATH; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CString strAssistantFilename = ALIGN_IMAGE_PATH; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | if (i==0) |
| | | { |
| | | strFilename += _T("\\") + m_AlignRecipe.strFirstImageFile; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | strAssistantFilename += _T("\\") + m_AlignRecipe.strFirstAssistantImageFile; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | } |
| | | else if (i==1) |
| | | { |
| | | strFilename += _T("\\") + m_AlignRecipe.strSecondImageFile; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | strAssistantFilename += _T("\\") + m_AlignRecipe.strSecondAssistantImageFile; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | } |
| | | |
| | | //strFilename += m_AlignRecipe.strTemplateName[i]; |
| | |
| | | continue; |
| | | } |
| | | |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | if (assistanttempImage.LoadImage(strAssistantFilename) == FALSE) |
| | | { |
| | | bAllLoad = bAllLoad && FALSE; |
| | | continue; |
| | | } |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | |
| | | bAllLoad = bAllLoad && tempImage.GetBandImage(BandTypeGray, m_vecCameraImage[i]->GetImageData(View_Template)); |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | bAllLoad = bAllLoad && assistanttempImage.GetBandImage(BandTypeGray, m_vecCameraImage[i]->GetImageData(View_AssistantTemplate)); |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | } |
| | | |
| | | return bAllLoad; |
| | |
| | | wcstombs_s(&CharactersConverted,CDitGlassRawClient::GetInstance()->GetGlassData()->m_strAlignMarkSecond, uploadAlignimage, _TRUNCATE); |
| | | }*/ |
| | | // find process |
| | | |
| | | |
| | | // find process 바슬러 카메라가 3채널짜리라서 시퀀스 돌때는 1채널로 바꿔서 돔 ksm |
| | | CCHImageData camImage; |
| | | |
| | | //#3671 TEST CODE Start |
| | | // CCHImageData TestImage; |
| | | // |
| | | // (m_vecCameraImage[nCameraIdx]->GetImageData(View_Camera))->ReleaseImage(); |
| | | // CString strFilename = ALIGN_IMAGE_PATH; |
| | | // if (nCameraIdx == 0) |
| | | // { |
| | | // strFilename += _T("\\Test3.BMP"); |
| | | // } |
| | | // else |
| | | // { |
| | | // strFilename += _T("\\Test4.BMP"); |
| | | // } |
| | | // TestImage.LoadImage(strFilename); |
| | | // TestImage.GetBandImage(BandTypeGray, m_vecCameraImage[nCameraIdx]->GetImageData(View_Camera)); |
| | | // (m_vecCameraImage[nCameraIdx]->GetImageData(View_Camera))->GetBandImage(BandTypeGray, &camImage); |
| | | //#3671 TEST CODE End |
| | | // find process 바슬러 카메라가 3채널짜리라서 시퀀스 돌때는 1채널로 바꿔서 돔 ksm |
| | | if ((pCameraImage->GetImageData(View_Camera))->GetChannels() > 1) |
| | | (pCameraImage->GetImageData(View_Camera))->GetBandImage(BandTypeGray, &camImage); |
| | | else |
| | |
| | | |
| | | //SAlignFindResult findResult = pAlignFinder->FindAlign(pCameraImage->GetImageData(View_Matching), findParam, pCameraImage->GetImageData(View_Template)); |
| | | SAlignFindResult findResult = pAlignFinder->FindAlign(&camImage, findParam, pCameraImage->GetImageData(View_Template)); |
| | | g_pLog->DisplayMessage(_T("Main TempleteMatching Result : %d Cam ResultCode = %d, PixelX = %d, PixelY = %d, MatchingRate = %.3lf"), nCameraIdx, findResult.nResultCode, int(findResult.dPosX + 0.5), int(findResult.dPosY + 0.5), findResult.dMatchValue); |
| | | |
| | | // result process |
| | | if (findResult.nResultCode==AlignMatch_Success) |
| | | { |
| | | g_pLog->DisplayMessage(_T("Main TempleteMatching 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; |
| | | } |
| | | /*< LYW 20211013 - #3671 ADD Start >*/ |
| | | |
| | | else |
| | | { |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | SAlignFindResult findAssistantResult = pAlignFinder->FindAlign(&camImage, findParam, pCameraImage->GetImageData(View_AssistantTemplate)); |
| | | g_pLog->DisplayMessage(_T("Assistant TempleteMatching Result : %d Cam ResultCode = %d, PixelX = %d, PixelY = %d, MatchingRate = %.3lf"), nCameraIdx, findAssistantResult.nResultCode, int(findAssistantResult.dPosX + 0.5), int(findAssistantResult.dPosY + 0.5), findAssistantResult.dMatchValue); |
| | | if (findAssistantResult.nResultCode == AlignMatch_Success) |
| | | { |
| | | g_pLog->DisplayMessage(_T("Assistant TempleteMatching Success!")); |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 1; |
| | | m_AlignResult.dFindPixelX[nCameraIdx] = int(findAssistantResult.dPosX + 0.5); |
| | | m_AlignResult.dFindPixelY[nCameraIdx] = int(findAssistantResult.dPosY + 0.5); |
| | | m_AlignResult.dFindScore[nCameraIdx] = findAssistantResult.dMatchValue; |
| | | } |
| | | |
| | | else |
| | | { |
| | | int dffmain2assistanstX = int(findResult.dPosX) - int(findAssistantResult.dPosX); |
| | | 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) |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | else |
| | | { |
| | | g_pLog->DisplayMessage(_T("Main Assistant Templete Don`t Find Same Point! Align Fail!")); |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | } |
| | | } |
| | | } |
| | | /*< LYW 20211013 - #3671 ADD End >*/ |
| | | |
| | | /*< LYW 20211013 - #3671 Delete Start >*/ |
| | | // else |
| | | // { |
| | | // m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | // m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | // } |
| | | /*< LYW 20211013 - #3671 Delete End >*/ |
| | | |
| | | // save threshold image |
| | | strPath.Format(_T("%s\\Cam%02d_AlignTH_%04d%02d%02d%02d%02d%02d.jpg"), m_strSaveImageBasePath, nCameraIdx, |
| | |
| | | typedef std::vector<SLightData*> VectorLightData; |
| | | typedef std::vector<SLightData*>::iterator VectorLightDataIt; |
| | | |
| | | |
| | | enum AlignViewMode { View_Camera=0, View_Result, View_Template, View_Matching }; |
| | | /*< LYW 20211012 - #3671 MOD Start >*/ |
| | | enum AlignViewMode { View_Camera = 0, View_Result, View_Template, View_AssistantTemplate, View_Matching }; |
| | | /*< LYW 20211012 - #3671 MOD End >*/ |
| | | /*< Origin Code >*/ |
| | | //enum AlignViewMode { View_Camera=0, View_Result, View_Template, View_Matching }; |
| | | enum AlignResult { Align_Fail=-2, Align_TempFail=-1, Align_None=0, Align_Success=1 }; |
| | | //#3357 KYH Align Image 초기화 ADD START |
| | | enum AlignFinderType { AlignFinderType_Normal = 0, AlignFinderType_Corner, AlignFinderType_Extend, AlignFinderType_count }; //210330 kyh 추가 |
| | |
| | | pGlassResult->m_AlignRecipe.dMatchingRate = pRsRcpAlignInfo->m_dMatchingRate; |
| | | pGlassResult->m_AlignRecipe.strFirstImageFile = pRsRcpAlignInfo->m_strFirstImageFile; |
| | | pGlassResult->m_AlignRecipe.strSecondImageFile = pRsRcpAlignInfo->m_strSecondImageFile; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | pGlassResult->m_AlignRecipe.strFirstAssistantImageFile = pRsRcpAlignInfo->m_strFirstAssistantImageFile; |
| | | pGlassResult->m_AlignRecipe.strSecondAssistantImageFile = pRsRcpAlignInfo->m_strSecondAssistantImageFile; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | pGlassResult->m_AlignRecipe.strTotalPitchImageFile = pRsRcpAlignInfo->m_strTotalPitchImageFile; |
| | | |
| | | // edge find param |
| | |
| | | pGlassResult->m_AlignRecipe.dMatchingRate = pRsRcpAlignInfo->m_dMatchingRate; |
| | | pGlassResult->m_AlignRecipe.strFirstImageFile = pRsRcpAlignInfo->m_strFirstImageFile; |
| | | pGlassResult->m_AlignRecipe.strSecondImageFile = pRsRcpAlignInfo->m_strSecondImageFile; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | pGlassResult->m_AlignRecipe.strFirstAssistantImageFile = pRsRcpAlignInfo->m_strFirstAssistantImageFile; |
| | | pGlassResult->m_AlignRecipe.strSecondAssistantImageFile = pRsRcpAlignInfo->m_strSecondAssistantImageFile; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | pGlassResult->m_AlignRecipe.strTotalPitchImageFile = pRsRcpAlignInfo->m_strTotalPitchImageFile; |
| | | |
| | | // edge find param |
| | |
| | | double m_dMatchingRate; |
| | | CString m_strFirstImageFile; |
| | | CString m_strSecondImageFile; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CString m_strFirstAssistantImageFile; |
| | | CString m_strSecondAssistantImageFile; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | CString m_strTotalPitchImageFile; |
| | | |
| | | // edge find param |
| | |
| | | double dMatchingRate; |
| | | CString strFirstImageFile; |
| | | CString strSecondImageFile; |
| | | /*< LYW 20211012 - #3671 ADD Start >*/ |
| | | CString strFirstAssistantImageFile; |
| | | CString strSecondAssistantImageFile; |
| | | /*< LYW 20211012 - #3671 ADD End >*/ |
| | | CString strTotalPitchImageFile; |
| | | |
| | | // edge find param |