2022-05-07 09:05:51 +00:00
|
|
|
|
/*
|
2022-05-03 03:56:07 +00:00
|
|
|
|
* ====================================================
|
|
|
|
|
|
2022-05-07 09:05:51 +00:00
|
|
|
|
* 功能:自定义伽马校正。原理为哈希表查值
|
|
|
|
|
* 作者:刘丁维
|
|
|
|
|
* 生成时间:2020/4/21
|
|
|
|
|
* 最近修改时间:2020/4/21
|
|
|
|
|
* 版本号:v1.0
|
2022-05-03 03:56:07 +00:00
|
|
|
|
|
|
|
|
|
* ====================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef IMAGE_APPLY_CUSTOM_CAMMA_H
|
|
|
|
|
#define IMAGE_APPLY_CUSTOM_CAMMA_H
|
|
|
|
|
|
|
|
|
|
#include "ImageApply.h"
|
|
|
|
|
|
|
|
|
|
class CImageApplyCustomGamma : public CImageApply
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
/*
|
2022-05-07 09:05:51 +00:00
|
|
|
|
* table [in]:自定义查值表
|
|
|
|
|
* length [in]:表的长度,灰度表256,彩色表768
|
2022-05-03 03:56:07 +00:00
|
|
|
|
* */
|
|
|
|
|
CImageApplyCustomGamma(unsigned char* table,int length);
|
|
|
|
|
|
|
|
|
|
virtual ~CImageApplyCustomGamma();
|
|
|
|
|
|
|
|
|
|
virtual void apply(cv::Mat& pDib, int side);
|
|
|
|
|
|
|
|
|
|
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
|
|
|
|
|
|
|
|
|
|
void setTableData(const unsigned char* data, int length);
|
|
|
|
|
private:
|
|
|
|
|
void init_gamma_table();
|
|
|
|
|
void setLUT(const unsigned char* table, int byteCount);
|
|
|
|
|
bool emptyPtr;
|
|
|
|
|
private:
|
|
|
|
|
unsigned char m_table_bit8[256];
|
|
|
|
|
|
|
|
|
|
unsigned char m_table_bit24[768];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // !IMAGE_APPLY_CUSTOM_CAMMA_H
|