ZSKKCalibration.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma once
  2. #define ZSKK_CALIBRATION_API
  3. #define FALSE 0
  4. #define TRUE 1
  5. #include <string>
  6. #include "GridSuppression.h"
  7. #include "GainMatrix.h"
  8. #include "PixMatrix.h"
  9. typedef unsigned short WORD;
  10. class ZSKK_CALIBRATION_API CZSKKCalibrationCtrl
  11. {
  12. public:
  13. CZSKKCalibrationCtrl();
  14. ~CZSKKCalibrationCtrl();
  15. //去栅影
  16. bool GridSuppressed(int nHeight, int nWidth, unsigned short* pImage);
  17. //图像预处理接口
  18. bool CreateEmptyMap(int nImgHeight, const char* pcRefPath);
  19. //int JudgeDarkImage(WORD* pOldData, WORD* pNewData, int nImgWidth, int nImgHeight);
  20. //int JudgeWhiteImage(WORD* pwData, int nWidth, int nHeight, int nWidthOffset, int nHeightOffset, unsigned short nCurrentTargetDV);
  21. bool CreateGainMatrix(CGainMatrix* pGainMatrix, int nWidth, int nHeight, int nWidthOffset, int nHeightOffset, int nRefrenceNum, WORD wMaxPv);
  22. bool BeginGainCalibration(CGainMatrix* pGainMatrix, int nWidth, int nHeight, int nWidthOffset, int nHeightOffset, int nRefrenceNum, WORD wMaxPv);
  23. //bool GetEffectiveImage(ZSKK_IMAGE_INFO* pOutImg, WORD* pInImg, int nInWidth);
  24. //增益校正接口
  25. bool LoadZSKKGainMap(bool bInit = true, std::string strSerial = "");
  26. bool UnLoadZSKKGainMap();
  27. bool ApplyZSKKGainMap(WORD* pImage);
  28. bool AverageZSKKGainMap(WORD* wImage, int, bool bStart);
  29. bool StoreZSKKGainMap(std::string strSerial = "");
  30. //坏点校正接口
  31. bool LoadZSKKPixelMap(bool bInit = true, std::string strSerial = "");
  32. bool UnLoadZSKKPixMap();
  33. bool ApplyZSKKPixMap(WORD* pImage);
  34. bool AddImageToPixMap(WORD* pImage);
  35. bool AbortZSKKPixMap(std::string strSerial = "");
  36. bool StoreZSKKPixMap(std::string strSerial = "");
  37. bool ApplyZSKKReference(int, int, WORD*);
  38. bool LoadZSKKLineMap(std::string strSerial = "");
  39. bool ApplyZSKKLineMap(WORD* pImage);
  40. bool GridBadLineCorrectFirst(int nHeight, int nWidth, unsigned short* pImage);
  41. bool GridBadLineCorrectSecond(int nHeight, int nWidth, unsigned short* pImage);
  42. bool SaveRawImage(const char* pImgName, const WORD* pRawImg, int nWidth, int nHeight);
  43. bool ApplyImageSaturation(WORD* pImage, int nWidth, int nHeight, int nSaturation);
  44. public:
  45. int m_nGridSuppressed;
  46. int m_nSaveRawDataMode;
  47. int m_nSaturationValue;
  48. std::string m_strRawImgPath; //保存Raw图的路径,以\\结尾
  49. std::string m_strRefFilePath; //保存校正文件的路径,以\\结尾
  50. int m_nHeightOffset;
  51. int m_nWidthOffset;
  52. int m_nFullImgWidth;
  53. int m_nFullImgHeight;
  54. bool m_bAutoBadPixel; //坏点校正开关,默认开启
  55. int m_nReferenceNum;
  56. private:
  57. CGainMatrix* m_pZSKKGainMatrix;
  58. CPixMatrix* m_pZSKKPixMatrix;
  59. };