资 源 简 介
#include #include using namespace cv;using namespace std;int main(){Mat image, srt,dst;//原图、全局均衡化、局部均衡化image = imread("D:/ps/a.tif");//载入原图if (!image.data){std::cout << "请确认路径下存在图片";return -1;}cvtColor(image,image, COLOR_BGR2GRAY);//原图转化成8位灰度图equalizeHist(image, srt);Ptrclahe = createCLAHE(2.0, Size(8, 8));clahe->apply(image, dst);namedWindow("原图",CV_WINDOW_AUTOSIZE);namedWindow("全局均衡化",CV_WINDOW_AUTOSIZE);namedWindow("局部均衡化",CV_WINDOW_AUTOSIZE);imshow("原图", image);imshow("全局均衡化", srt);/*vector BGR;split(image, BGR);Ptr clahe = createCLAHE();clahe->apply(BGR[0], BGR[0]);//彩色clahe->apply(BGR[1], BGR[1]);clahe->apply(BGR[2], BGR[2]);Mat res;