#pragma once
|
|
#include "Pad.h"
|
#include "AssemDefect.h"
|
|
|
enum ConvMode { ConvMode_Float = 0, ConvMode_Pixel, ConvMode_Binalize, ConvMode_CompAvg };
|
enum ConvDir { ConvDir_Hori= 0, ConvDir_Vert= 1, ConvDir_Double= 2};
|
|
#define MAX_DEAD_ZONE_COUNT 10
|
|
class AFX_EXT_CLASS CConvParam
|
{
|
public:
|
virtual ~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 °Ë»ç
|
BOOL m_bIntrinsic;
|
BOOL m_bSkipBlock; // ÀÌÇü¼¿.
|
|
// 1.2. °Ë»ç À̹ÌÁö Á¤º¸
|
LPBYTE s_lpBuffer; // * °Ë»çÇÒ ¹öÆÛ
|
int s_nFrameWidth; // * °Ë»ç À̹ÌÁö ³ÐÀÌ
|
int s_nFrameHeight; // * °Ë»ç À̹ÌÁö ³ôÀÌ.
|
|
// 1.3. °Ë»ç ¿µ¿ª Á¤º¸.
|
CTrapezium m_Trapezium; // »ç´Ù¸®²Ã °Ë»ç ¿µ¿ª
|
CRect s_RectConv; // * ¹öÆÛ¿¡¼ ¿¬»êÇÒ »ç°¢Çü
|
CRect s_RectFilter; // * ¹öÆÛ¿¡¼ ÇÊÅ͸µ¿¡ ¾²ÀÏ ¼ö ÀÖ´Â »ç°¢Çü(¿ø·¡ ¼¿Å©±â µî °¡´É)
|
CRect s_RectDeadZone[MAX_DEAD_ZONE_COUNT];
|
CPoint* m_pptFreeForm; // ´Ù°¢Çü °Ë»ç ¿µ¿ª Æ÷ÀÎÆ® Á¤º¸
|
int m_nFFPointCount; // ´Ù°¢Çü °Ë»ç ¿µ¿ª Æ÷ÀÎÆ® °³¼ö
|
|
// 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_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¸¸ ±¸Çö)
|
|
// 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;
|
|
// 1.9. 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* m_pSpeedZoneTh;
|
int* m_pSpeedZoneThSlide;
|
|
// 2.0 CompareAverage Filter Size
|
int m_nBFilterSize;
|
int m_nDFilterSize;
|
|
|
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_bUseMarginFilter; //
|
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; // ¿µ¿ª - ¼³Á¤µÈ °ªÀ» °áÇÔ¿¡ ¾²±â À§ÇÔ
|
|
// ¼¼ÄÁ°Ë»ç Param
|
BOOL s_bUse2ndInspection;
|
int s_n2ndThres;
|
int s_n2ndThresSlide;
|
double s_d2ndPitch;
|
|
|
// Add by PJH
|
int s_nASGDynamicHi;
|
int s_nASGDynamicLow;
|
|
// 99. ±âŸ Àâ´Ù±¸¸®
|
// 200090612 size choigudal
|
BOOL s_bUseTrimmer;
|
int s_nTrimmerWidth;
|
int s_nTrimmerHeight;
|
|
|
// 20150811 °Å´ë CS
|
int m_nCSThres[MAX_ZONE_NUM];
|
int m_nOriThres[MAX_ZONE_NUM];
|
|
//Á¸°Ë»ç °ËÁõ ÅÂÇö[2018/6/5]
|
double m_nZoneVeriPitch[MAX_ZONE_NUM];
|
double m_nZoneVeriPitchVert[MAX_ZONE_NUM];
|
int m_nZoneVeriConvDir[MAX_ZONE_NUM];//0: Off , 1:hori, 2:vert, 3: both
|
|
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;
|
m_bIntrinsic = FALSE;
|
m_bSkipBlock = 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;
|
for(int i = 0 ; i < MAX_DEAD_ZONE_COUNT; i++)
|
s_RectDeadZone[i].SetRectEmpty();
|
m_pptFreeForm = NULL;
|
m_nFFPointCount = 0;
|
|
// 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_nThresholdSupress = 255;
|
s_nSideThreshold = 0;
|
s_nBWB_Main = 0;
|
s_nBWB_Slide = 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;
|
|
|
// 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;
|
m_pSpeedZoneTh = NULL;
|
m_pSpeedZoneThSlide = NULL;
|
|
m_nBFilterSize = 45;
|
m_nDFilterSize = 9;
|
|
//==================================
|
// 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;
|
m_bUseMarginFilter = TRUE;
|
|
// 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_bUse2ndInspection = FALSE;
|
s_n2ndThres = 255;;
|
s_n2ndThresSlide = 0;
|
s_d2ndPitch = 0;
|
|
// Add by PJH
|
s_nASGDynamicHi = 0;
|
s_nASGDynamicLow = 0;
|
|
// 200090612 size choigudal
|
s_bUseTrimmer = FALSE;
|
s_nTrimmerWidth = 0;
|
s_nTrimmerHeight = 0;
|
//.
|
// 20150811 °Å´ë CS
|
for(int i = 0; i < MAX_ZONE_NUM; i++)
|
{
|
m_nCSThres[i] = 0;
|
m_nOriThres[i] = 0;
|
|
m_nZoneVeriPitch[i] = 0;
|
m_nZoneVeriPitchVert[i] = 0;
|
m_nZoneVeriConvDir[i] = 0;
|
}
|
|
|
}
|
|
BOOL IsAllInspected(int endLine)
|
{
|
if(m_ConvDir == ConvDir_Hori)
|
return s_RectConv.bottom - endLine < 16;
|
return s_RectConv.right - endLine < 16;
|
}
|
};
|