Use OpenCV to realize,
Here is the main Function
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 void menu(char* imageFilePath,int* patchSize);
2 void DCP(IplImage* src,CvMat* DarkChannelMat,int size);
3 void EAL(IplImage* src,CvMat* DarkChannelMat,int* maxRGB);
4 void ET(IplImage* src,CvMat* ETMat,int size,int* A);
5 void RSR(CvMat* ETMat,IplImage* JImg,int *A);
2 void DCP(IplImage* src,CvMat* DarkChannelMat,int size);
3 void EAL(IplImage* src,CvMat* DarkChannelMat,int* maxRGB);
4 void ET(IplImage* src,CvMat* ETMat,int size,int* A);
5 void RSR(CvMat* ETMat,IplImage* JImg,int *A);
Here is Result: