用MATLAB做图像的去雾处理,前几个需要的直方图和图像都出来了,最后一个处理后的直方图和图像还要加什么才能弄出来啊?
global im;
global orig;
[filename, pathname]=uigetfile(['C:\Program Files\Polyspace\R2021a\bin\3.jpg'],'insert image');
im=[pathname filename];
orig = imread(im);
Q = rgb2gray(orig);
figure;
subplot(1, 2, 1); imshow(orig); title('原图像')
subplot(1, 2, 2); imhist(Q, 64); title('原图像直方图')
global orig;
global U;
I = rgb2hsv(orig);
H = I(:,:,1);
S = I(:,:,2);
V = I(:,:,3);
M = histeq(S); % 对饱和度直方图均衡化
N = histeq(V); % 对亮度直方图均衡化
U = hsv2rgb(H, M, N);
figure;
subplot(2, 2, 1); imshow(orig); title('原图像')
subplot(2, 2, 2); imshow(U); title('均衡后图像')
Q = rgb2gray(orig);
W = rgb2gray(U);
subplot(2, 2, 3); imhist(Q, 64); title('原图像直方图')
subplot(2, 2, 4); imhist(W, 64); title('均衡变换后的直方图')
global im;
im1=double(imread(im));
sv=2*floor(max(size(im1))/25)+1;
res=visibresto1(im1,sv,-1);
figure;imshow([im1, res],[0,1]);