1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- //---------------------------------------------------------------------------------------
- //
- // Copyright (c) 2023, E-COM All rights reserved.
- //
- // FileName: ZSKKCalibration.h
- // Description: Header file for class ZSKK calibration,
- // it is the base class of ZSKK calibration operation for commom detector
- // Version: 1.0
- // Author: Wangyuedong
- // Date: 2023/10/10
- //
- //---------------------------------------------------------------------------------------
- #pragma once
- #pragma warning(disable:26451) //算术溢出 : 使用 4 字节值上的运算符 * ,然后将结果转换到 8 字节值。在调用运算符 * 之前将值强制转换为宽类型可避免溢出(io.2)。
- #define ZSKK_CALIBRATION_API __declspec(dllexport)
- #define FALSE 0
- #define TRUE 1
- #include <string>
- #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;
- };
|