CLAHE源码解析:
ContrastLimitAHE .h:
#ifndef _CONTRAST_LIMIT_AHE_H_
#define _CONTRAST_LIMIT_AHE_H_
#include "stdafx.h"
#include
using namespace std;
class ContrastLimitAHE
{
public:
ContrastLimitAHE();
~ContrastLimitAHE();
int m_nGridX; /* CLAHE 宽网格的个数 */
int m_nGridY; /* CLAHE 高网格的个数 */
unsigned char m_aLUT[256]; /* CLAHE lookup table used for scaling of input image 输入图像缩放的查找表*/
int Initial(int nMaxPixel, int nMinPixel, int uiNrBins, int nX, int nY, int nWidth, int nHeight,float fCliplimit);
int m_nWidth; /* CLAHE 宽 */
int m_nHeight; /* CLAHE 高 */
int m_nCliplimit;
int m_nHistBins;
int m_nGridSize_X;
int m_nGridSize_Y;
int *m_pMapArray;
int m_nGridSize; /* Actual size of contextual regions实际周边区域大小 */
int ProcessCLAHE(unsigned char* pImage);
void MakeHistogram(unsigned char* pImage,int* pulHistogram);
void ClipHistogram(int* pulHistogram);
void MapHistogram(int* pulHistogram);
void Interpolate (unsigned char * pImage);
int m_nMaxPixel;
int m_nMinPixel;
void ShiftInterpolate(unsigned char* pImage, int nSizeX, int nSizeY, int* pulMapLU, int* pulMapRU, int *pulMapLB, int *pulMapRB);
int LineInterpolate(unsigned char* pImage, int nSizeX, int nSizeY, int* pLU, int* pRU, int* pLB, int* pRB);
};
#endif