Demo entry 6639172

dark_road_5

   

Submitted by anonymous on Sep 09, 2017 at 13:28
Language: Matlab. Code size: 755 Bytes.

%%Histogram equalization(直方图均衡)
%dark_road_5
im_input = medfilt2(im2double(rgb2gray(imread('dark_road_5.jpg'))),[3 3]);%读取图片
 im_output_gamma = imadjust(im_input,[min(im_input(:)) max(im_input(:))], [0 1],1.5); %gamma校正
im_output = adapthisteq(im_output_gamma,'NumTiles',[100 100], 'ClipLimit',0); %CLAHE校正
subplot(3,2,1); imshow(im_input); title('原图');  %图像显示
subplot(3,2,2); imhist(im_input); title('原图直方图');
subplot(3,2,3);imshow(im_output_gamma);title('原图gamma变换')
subplot(3,2,4);imhist(im_output_gamma);title('原图gamma变换直方图')
subplot(3,2,5); imshow(im_output); title('最终结果');
subplot(3,2,6); imhist(im_output); title('最后直方图');
figure, imshow([im_output]); title('Gamma correction');  %输出
imwrite(im_output,'dark_road_5_result.jpg');  %写入图片

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).