#pragma once #include "Pad.h" #include "AssemDefect.h" enum ConvMode { ConvMode_Float = 0, ConvMode_Pixel, ConvMode_Float_3By2 }; enum ConvDir { ConvDir_Hori= 0, ConvDir_Vert= 1, ConvDir_Double= 2}; class AFX_EXT_CLASS CConvParam { public: // 1.1. °Ë»ç ¹æ¹ý °ü·Ã ConvMode m_ConvMode; // 0 = ConvFloat(2*2), 1 = ConvPixel(1*1) int m_ConvDir; // 0 = Horizontal, 1= Vertical, 2, Hori and Vert int m_ReinspectCount; // Frame Overflow½Ã Àç°Ë»ç ȸ¼ö BOOL m_bZone2B2; // Zone 2 By 2 °Ë»ç // 1.2. °Ë»ç À̹ÌÁö Á¤º¸ LPBYTE s_lpBuffer; // * °Ë»çÇÒ ¹öÆÛ int s_nFrameWidth; // * °Ë»ç À̹ÌÁö ³ÐÀÌ int s_nFrameHeight; // * °Ë»ç À̹ÌÁö ³ôÀÌ. // 1.3. °Ë»ç ¿µ¿ª Á¤º¸. CTrapezium m_Trapezium; // »ç´Ù¸®²Ã °Ë»ç ¿µ¿ª CRect s_RectConv; // * ¹öÆÛ¿¡¼­ ¿¬»êÇÒ »ç°¢Çü CRect s_RectFilter; // * ¹öÆÛ¿¡¼­ ÇÊÅ͸µ¿¡ ¾²ÀÏ ¼ö ÀÖ´Â »ç°¢Çü(¿ø·¡ ¼¿Å©±â µî °¡´É) // 1.5. Convolution Á¤º¸. int s_nConvWidth; // * °Ë»ç ´ÜÀ§ ³ÐÀÌ int s_nConvHeight; // * °Ë»ç ´ÜÀ§ ³ôÀÌ double s_dPitchConvReal; // * °Ë»ç ÇÇÄ¡ int s_nPitchCycleConv; // ÇÑ ¼¿ÀÇ ÇÇÄ¡ double s_dPitchScanReal; // * °Ë»ç ÇÇÄ¡ int s_nPitchCycleScan; // ÇÑ ¼¿ÀÇ ÇÇÄ¡ float m_fTilt; // tilt °ª. // 1.6. ¹®Åΰª Á¤º¸. int s_nThreshold; // * ¸ÞÀÎ ¹®Åΰª int s_nDThSlide; // Dynamic Threshold ±â¿ï±â int s_nDThMin; // Dynamic Threshold Àû¿ë ÇÏÇÑ... ÇöÀç ¾È¾¸. int s_nThresholdSupress; // Suppress ¹®Åΰª. int s_nSideThreshold; // ÁÂ/¿ì/Unpair °Ë»ç ¹®Åΰª int s_nBWB_Main; // Black °áÇÔ ¾î¼À¿¡¼­ÀÇ ÇÊÅ͸µ DTh(ConvPixel VertSBW, VTDSBW¸¸ ±¸Çö), 0ÀÌ¸é ¾È¾¸. int s_nBWB_Slide; // Black °áÇÔ ¾î¼À¿¡¼­ÀÇ ÇÊÅ͸µ DTh(ConvPixel VertSBW, VTDSBW¸¸ ±¸Çö) int m_EchoThreshold; // Echo ÇÊÅ͸µ¿¡¼­ ÁÖº¯ ³ëÀÌÁî Àû¿ë ÃÖ¼Ò°ª. // 1.7. °Ë»ç Process Á¤º¸. BOOL m_bEchoConvolution; // ¿¬»ê ¼Óµµ ºÎÁ·À¸·Î ¾î¼À ³»ºÎ¿¡¼­ Thread ºÐÇÒ °Ë»ç ¿©ºÎ. BOOL m_bVertSpeedup; // Pixel°ú Zone ¼Óµµ ºÎÁ·À¸·Î °Ë»ç ·çƾÀÇ ¸Þ¸ð¸® ÀçÇØ¼® ¿©ºÎ BOOL m_bSelectiveDir; // ¿¬»ê ¹æÇâ¿¡¼­ 3ÇÇÄ¡ ºÎÁ·½Ã ¿¬»ê¹æÇâÀ» cross ¹æÇâÀ¸·Î º¯°æÈÄ °Ë»ç ÇÒÁö ¿©ºÎ. BOOL m_bUseUnpair; // Left¿Í RightÀÇ Unpair °áÇÔÀ» AssemÀÇ Pairing ´Ü°è¿¡¼­ »Ì¾Æ ³¿(TRUE) or ¹ö¸²(FALSE). ±âº» TRUE; BOOL s_bReverseFilter; // ReverseFilter »ç¿ë ¿©ºÎ int m_EdgeFilterTh; // ¼¿ Edge ¿µ¿ª¿¡¼­ ´ÜÁÖ±â ÇÊÅÍ Àû¿ëÇÒ ¼ö ¾ø´Â ±¸°£À» À§ÇÑ Ãß°¡ Th // 1.8. Dynamic Pitch Á¤º¸ int *m_pPitch16; // pitch¸¦ 16¹è ÇØ¼­ subpixel±îÁö Ç¥Çö, TrapeziumÀÌ¿ÜÀÇ Rect¿¡¼­´Â Vertical ¹æÇâÀÌ´Ù. short *m_pPitch; // Dynamic Pitch. Horizontal ¹æÇâÀ̰í short *m_pfSPR; // Dynamic Pitch. Horizontal ¹æÇâÀ̰í, Sub Pixel short *m_psSPR; // Dynamic Pitch. Horizontal ¹æÇâÀ̰í, Sub Pixel BOOL m_bUseDPC; int m_PitchWidth; // Pitch Table ÀÌ 2Â÷¿øÀÏ °æ¿ì Table width¸¦ ¼³Á¤ÇÑ´Ù.(2Â÷¿ø °Ë»ç¿¡ ´ëÇÑ flag ¿ªÇÒ±îÁö °âÇÔ, 0ÀÏ °æ¿ì 1Â÷¿ø) // 1.7. Zone Threshold °Ë»ç Á¤º¸ BOOL m_bZoneMulti; // Zone Multi Threshold °Ë»ç Àû¿ë ¼±ÅÃ. short* s_psZoneTable; // Zoneº° ThresholdingÀ» À§ÇÑ Index Table short* s_psZoneThTable; // Zoneº° ThresholdingÀ» À§ÇÑ Threshold Table short* s_psZoneAddTable; // Zoneº° ThresholdingÀ» À§ÇÑ DynamicThreshold Table short* s_psZoneMThTable; // 2Áß ZoneThresholdÀÇ µÎ¹øÂ° Base Threshold short* s_psZoneMAddTable; // 2Áß ZoneThresholdÀÇ µÎ¹øÂ° Threshold Slope short* s_psZoneMMinTable; // 2Áß ZoneThresholdÀÇ 2¹øÂ° Á÷¼±À» À§ÇÑ ÀÓ°èÄ¡(Çȼ¿ ¹à±â), 2Áß ZoneThresholdÀû¿ë ¿©ºÎÀÇ ±¸ºÐÀÚ ¿ªÇÒµµ °âÇÔ. int s_nThresTableWidth; // Threshold Table ³ÐÀÌ int s_nThresTableHeight; // Threshold Table ³ôÀÌ int s_nThresTableStartX; // XÃà ½ÃÀÛ Offset int s_nThresTableStartY; // YÃà ½ÃÀÛ Offset void* m_pGammaTable; // Zone Threshold µÎ¹øÂ° ¹öÀüÀ¸·Î ¸ÅĪ Å×À̺í Á¤º¸ º¸°ü. int m_nGammaXCount; // Gamma TableÀÇ X, Y ¹è¿­ÀÇ XÃà ¸ÅĪÆ÷ÀÌÆ® Ä«¿îÆ®(°³¼ö) int s_nZoneCycleConv; // Zone Reference À̹ÌÁöÀÇ ±âº»Áֱ⠹è¼ö int s_nZoneCycleScan; // Zone Reference À̹ÌÁöÀÇ ±âº»Áֱ⠹è¼ö int* m_pFilterThBlack; int* m_pFilterThBlack2; int* m_pFilterThWhite; int* m_pFilterThWhite2; int GetFilterThreshold(int iZone, int pixel, DefectType Type) { if(Type == DEFTYPE_WHITE) return ((m_pFilterThWhite2[iZone]*pixel)>>8)+ m_pFilterThWhite[iZone]; return ((m_pFilterThBlack2[iZone]*pixel)>>8)+ m_pFilterThBlack[iZone]; } //================================== // Assem ÀÌ ³¡³­ ÈÄó¸®¿Í °ü·ÃµÈ Á¤º¸. // 2.1. °áÇÔ °ü¸® Á¤º¸. int s_nFrameDefPixLimit; // ÇÑ Frame¿¡¼­ÀÇ ÃÖ´ë °áÇÔ Çȼ¿ ¼ö int s_nFrameDefBlobLimit; // ÇÑ Frame¿¡¼­ÀÇ ÃÖ´ë °áÇÔ ¼ö // 2.2. Çȼ¿ ´Ü°è ÇÊÅ͸µ Á¤º¸. BOOL m_bUsePixelFilter; // Pixel´Ü°è¿¡¼­ ÇÊÅ͸µÀ» ÇÒ °ÍÀΰ¡ ¸» °ÍÀΰ¡? BOOL m_bOnlyJumpFilter; // °Ë»ç ÃàÀÇ Cross ¹æÇâÀ¸·Î ÇÊÅ͸µ ¾øÀÌ JumpFiltering¸¸ ÇÒ °ÍÀΰ¡ .or. CrossFilter¸¦ ÇÒ °ÍÀΰ¡. BOOL m_bPairFilter; // Pair °áÇÔ¿¡µµ Cross&Jump ÇÊÅÍ Àû¿ë. // 2.2 Zone Measure Filter // ƯÁ¤ Á¸¿¡ ´ëÇØ ¹Ì¼¼ ¿µ¿ª Àç ¸ÅĪÈÄ ´Ù½Ã °Ë»ç ÇÊÅÍ Àû¿ë. BOOL m_bTiltFilter; // 2.3. ÈÄó¸® Á¤º¸. int m_nDefectMergePixel; // µðÆå ¸ÓÁö »çÀÌÁî // 2.4. Zone Sorting, Thresholding BYTE* s_pZoneData; // Zone Sort Table BYTE* s_pZoneThreshold; // Zone Threshold Table int s_nZoneDataWidth; // Zone Sort Table ³ÐÀÌ int s_nZoneBufferWidth; // Zone Data ¹öÆÛÀÇ À̹ÌÁö ¹öÆÛ Å©±â. int s_nZoneDataHeight; // Zone Sort Table ³ôÀÌ // 2.5. °áÇÔ Á¤º¸ °¡°ø Á¤º¸. double s_dScanResolution; // Scan Resolution double s_dConvResolution; // Conv Resolution //====================================== // 99. ¾È ¾²Áö¸¸ °³³ä»ó Áö¿ìÁö ¾ÊÀ» °Íµé. short s_sSkipSave; // °Ë»ç ÈÄ À̹ÌÁö ÀúÀå ¿©ºÎ UINT s_uiProcessing; // * °Ë»ç ¹æ¹ý int s_nRegionType; // ¿µ¿ª - ¼³Á¤µÈ °ªÀ» °áÇÔ¿¡ ¾²±â À§ÇÔ // ¾È¾²À̴µ¥ ´©°¡ ¾²´Â°ÇÁö??? ¾Æ´Â »ç¶÷ ½ÅÀϼ·Â÷Àå¿¡°Ô ÀüÈ­ Çϱâ. int s_nUseSize; int s_nSizeThres; // Add by PJH int s_nASGDynamicHi; int s_nASGDynamicLow; // 99. ±âŸ Àâ´Ù±¸¸® // 200090612 size choigudal BOOL s_bUseTrimmer; int s_nTrimmerWidth; int s_nTrimmerHeight; CConvParam() { Reset(); } double GetRealConvPitch(){return s_dPitchConvReal*s_nPitchCycleConv;} double GetRealScanPitch(){return s_dPitchScanReal*s_nPitchCycleScan;} double GetZoneConvPitch(){return s_dPitchConvReal*s_nZoneCycleConv;} double GetZoneScanPitch(){return s_dPitchScanReal*s_nZoneCycleScan;} void Reset() { // 1.1. °Ë»ç ¹æ¹ý °ü·Ã m_ConvMode = ConvMode_Float; m_ConvDir = 0; m_ReinspectCount = 3; m_bZone2B2 = FALSE; // 1.2. °Ë»ç À̹ÌÁö Á¤º¸ s_lpBuffer = NULL; s_nFrameWidth = 0; s_nFrameHeight = 0; // 1.3. °Ë»ç ¿µ¿ª Á¤º¸. s_RectConv.SetRect(0, 0, 0, 0); s_RectFilter= s_RectConv; // 1.5. Convolution Á¤º¸. s_nConvWidth = 0; s_nConvHeight = 0; s_dPitchConvReal = 0.0; s_nPitchCycleConv = 0; s_dPitchScanReal = 0.0; s_nPitchCycleScan = 0; m_fTilt = 0.0; // 1.6. ¹®Åΰª Á¤º¸. s_nThreshold = 10; s_nDThSlide = 20; s_nDThMin = 255; s_nThresholdSupress = 255; s_nSideThreshold = 0; s_nBWB_Main = 0; s_nBWB_Slide = 0; m_EchoThreshold = 0; // 1.7. °Ë»ç Process Á¤º¸. m_bEchoConvolution = TRUE; m_bVertSpeedup = TRUE; m_bSelectiveDir = FALSE; m_bUseUnpair = TRUE; s_bReverseFilter = FALSE; m_EdgeFilterTh = 0; // 1.8. Dynamic Pitch Á¤º¸ m_pPitch16 = NULL; m_pPitch = NULL; m_pfSPR = NULL; m_psSPR = NULL; m_bUseDPC = TRUE; m_PitchWidth = 0;// 0ÀÏ °æ¿ì 1Â÷¿ø, width °ªÀ» °®´Â °æ¿ì 2 Â÷¿ø DPC // 1.9. Zone Threshold °Ë»ç Á¤º¸ m_bZoneMulti = FALSE; s_psZoneTable = NULL; //0617 Ãß°¡ s_psZoneThTable = NULL; s_psZoneAddTable = NULL; s_psZoneMThTable = NULL; s_psZoneMAddTable = NULL; s_psZoneMMinTable = NULL; s_nThresTableWidth = 12000; s_nThresTableHeight = 1024; s_nThresTableStartX = 0; s_nThresTableStartY = 0; m_pGammaTable = NULL; m_nGammaXCount = 300; s_nZoneCycleConv = 1; s_nZoneCycleScan = 1; m_pFilterThBlack = NULL; m_pFilterThBlack2 = NULL; m_pFilterThWhite = NULL; m_pFilterThWhite2 = NULL; //================================== // Assem ÀÌ ³¡³­ ÈÄó¸®¿Í °ü·ÃµÈ Á¤º¸. // 2.1. °áÇÔ °ü¸® Á¤º¸. s_nFrameDefPixLimit = 10000;//MAX_DEFECTPIX_NUM; s_nFrameDefBlobLimit = 10000;//MAX_DEFECTBLOB_NUM; // 2.2. ÇÊÅ͸µ Á¤º¸. m_bUsePixelFilter = TRUE; m_bOnlyJumpFilter = FALSE; m_bPairFilter = FALSE; // 2.2. Zone Measure Filter // ƯÁ¤ Á¸¿¡ ´ëÇØ ¹Ì¼¼ ¿µ¿ª Àç ¸ÅĪÈÄ ´Ù½Ã °Ë»ç ÇÊÅÍ Àû¿ë. m_bTiltFilter = FALSE; // 2.3. ÈÄó¸® Á¤º¸. m_nDefectMergePixel = 4;// ¸ÓÁö 4 Çȼ¿ // 2.4. Zone Sorting, Thresholding, Zone ThresholdingÀÏ ¶§ÀÇ Zone Á¤º¸, RSCale ÃßÃâÀ» À§ÇÑ °ªµé s_pZoneData = NULL; s_pZoneThreshold = NULL; s_nZoneDataWidth = 0; s_nZoneBufferWidth = 0; s_nZoneDataHeight = 0; // 2.5. °áÇÔ Á¤º¸ °¡°ø Á¤º¸. s_dScanResolution = 0.0; s_dConvResolution = 0.0; //====================================== // 99. ¾²´ÂÁö ¾È ¾²´Â Áö ¸ð¸£´Â °Í. s_sSkipSave = 0; s_uiProcessing = 0; s_nRegionType = -1; s_nUseSize = FALSE; s_nSizeThres = 0; // Add by PJH s_nASGDynamicHi = 0; s_nASGDynamicLow = 0; // 200090612 size choigudal s_bUseTrimmer = FALSE; s_nTrimmerWidth = 0; s_nTrimmerHeight = 0; //. } BOOL IsAllInspected(int endLine) { if(m_ConvDir == ConvDir_Hori) return s_RectConv.bottom - endLine < 16; return s_RectConv.right - endLine < 16; } };