#pragma once #define ZSKK_CALIBRATION_API #define FALSE 0 #define TRUE 1 #include #include "GridSuppression.h" #include "GainMatrix.h" #include "PixMatrix.h" typedef unsigned short WORD; class ZSKK_CALIBRATION_API CZSKKCalibrationCtrl { public: CZSKKCalibrationCtrl(); ~CZSKKCalibrationCtrl(); //去栅影 bool GridSuppressed(int nHeight, int nWidth, unsigned short* pImage); //图像预处理接口 bool CreateEmptyMap(int nImgHeight, const char* pcRefPath); //int JudgeDarkImage(WORD* pOldData, WORD* pNewData, int nImgWidth, int nImgHeight); //int JudgeWhiteImage(WORD* pwData, int nWidth, int nHeight, int nWidthOffset, int nHeightOffset, unsigned short nCurrentTargetDV); bool CreateGainMatrix(CGainMatrix* pGainMatrix, int nWidth, int nHeight, int nWidthOffset, int nHeightOffset, int nRefrenceNum, WORD wMaxPv); bool BeginGainCalibration(CGainMatrix* pGainMatrix, int nWidth, int nHeight, int nWidthOffset, int nHeightOffset, int nRefrenceNum, WORD wMaxPv); //bool GetEffectiveImage(ZSKK_IMAGE_INFO* pOutImg, WORD* pInImg, int nInWidth); //增益校正接口 bool LoadZSKKGainMap(bool bInit = true, std::string strSerial = ""); bool UnLoadZSKKGainMap(); bool ApplyZSKKGainMap(WORD* pImage); bool AverageZSKKGainMap(WORD* wImage, int, bool bStart); bool StoreZSKKGainMap(std::string strSerial = ""); //坏点校正接口 bool LoadZSKKPixelMap(bool bInit = true, std::string strSerial = ""); bool UnLoadZSKKPixMap(); bool ApplyZSKKPixMap(WORD* pImage); bool AddImageToPixMap(WORD* pImage); bool AbortZSKKPixMap(std::string strSerial = ""); bool StoreZSKKPixMap(std::string strSerial = ""); bool ApplyZSKKReference(int, int, WORD*); bool LoadZSKKLineMap(std::string strSerial = ""); bool ApplyZSKKLineMap(WORD* pImage); bool GridBadLineCorrectFirst(int nHeight, int nWidth, unsigned short* pImage); bool GridBadLineCorrectSecond(int nHeight, int nWidth, unsigned short* pImage); bool SaveRawImage(const char* pImgName, const WORD* pRawImg, int nWidth, int nHeight); bool ApplyImageSaturation(WORD* pImage, int nWidth, int nHeight, int nSaturation); public: int m_nGridSuppressed; int m_nSaveRawDataMode; int m_nSaturationValue; std::string m_strRawImgPath; //保存Raw图的路径,以\\结尾 std::string m_strRefFilePath; //保存校正文件的路径,以\\结尾 int m_nHeightOffset; int m_nWidthOffset; int m_nFullImgWidth; int m_nFullImgHeight; bool m_bAutoBadPixel; //坏点校正开关,默认开启 int m_nReferenceNum; private: CGainMatrix* m_pZSKKGainMatrix; CPixMatrix* m_pZSKKPixMatrix; };