欢迎来到本博客❤️❤️
博主优势:博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
本文目录如下:
1 概述
2 运行结果
3 参考文献
4 Matlab代码实现
针对水下光的吸收和散射作用,水下图像往往存在颜色失真、对比度低、细节模糊等现象,提出了一种新的水下图像增强算法。首先,以颜色校正的方式改进了一种基于暗通道先验(DCP)的水上图像增强方法,使其可以更好地用于水下图像,并将增强后的图像作为图像融合的一个输入。然后,利用非锐化掩蔽(USM)增强图像的纹理特征,并将再次增强的图像作为图像融合的另一个输入。最后,采用小波融合的方式对以上两个输入图像进行融合,进一步提升图像质量。与其他方法的比较结果表明,利用所提方法增强的图像具有更自然的外观、更高的清晰度、更多的细节和边缘信息,所提方法对水下图像有良好的增强效果。基于颜色校正方法对水下图像进行颜色均衡化预处理;对亮度分量L进行Gamma校正,获得对比度提升的亮度图像;对两个亮度分量进行三层小波分解,提出对分解所得的低频分量及高频分量分别采用线性融合和自适应融合策略进行融合。多尺度融合保证了增强图像细节的丰富性,自适应融合策略体现了融合过程的可控性。实验结果表明,增强的水下图像呈现出高对比度和清晰的细节。
部分代码:
clc;
clear all;
close all;
im = imread('./image/8.jpg');
figure,imshow(im),xlabel('origin image');
% red channel recover
im1 = redCompensate(im,5);
figure, subplot(2,2,1)
imshow(im1);
xlabel('red channel compensate');
% blue channel recover
% In murky waters or high water levels or the presence of plankton in abundance that causes the blue channel to attenuate strongly,Supplement the blue channel
% im1 = blueCompensate(im1);
% subplot(2,3,3)
% imshow(im1);
% xlabel('blue channel compensate')
% white balance enhancement
im2 = simple_color_balance(im1);
subplot(2,2,2)
imshow(im2);
xlabel('white balance');
% gamma correction
input1 = gammaCorrection(im2,1,1.2);
subplot(2,2,3)
imshow(input1);
xlabel('gamma correction');
% sharpen
input2 = sharp(im2);
subplot(2,2,4)
imshow(input2);
xlabel('sharp');
%.................................................%
% calculate weight
%.................................................%
lab1 = rgb_to_lab(input1);
lab2 = rgb_to_lab(input2);
R1 = double(lab1(:, :, 1)/255);
R2 = double(lab2(:, :, 1)/255);
% 1. Laplacian contrast weight (Laplacian filiter on input luminance channel)
WL1 = abs(imfilter(R1, fspecial('Laplacian'), 'replicate', 'conv'));
WL2 = abs(imfilter(R2, fspecial('Laplacian'), 'replicate', 'conv'));
% 2. Saliency weight
WS1 = saliency_detection(input1);
WS2 = saliency_detection(input2);
% 3. Saturation weight
WSat1 = Saturation_weight(input1);
WSat2 = Saturation_weight(input2);
% normalized weight
[W1, W2] = norm_weight(WL1, WS1, WSat1, WL2 , WS2, WSat2);
%.................................................%
% image fusion
% R(x,y) = sum G{W} * L{I}
%.................................................%
level = 3;
% weight gaussian pyramid
Weight1 = gaussian_pyramid(W1, level);
Weight2 = gaussian_pyramid(W2, level);
% image laplacian pyramid
% input1
r1 = laplacian_pyramid(double(double(input1(:, :, 1))), level);
g1 = laplacian_pyramid(double(double(input1(:, :, 2))), level);
b1 = laplacian_pyramid(double(double(input1(:, :, 3))), level);
% input2
r2 = laplacian_pyramid(double(double(input2(:, :, 1))), level);
g2 = laplacian_pyramid(double(double(input2(:, :, 2))), level);
b2 = laplacian_pyramid(double(double(input2(:, :, 3))), level);
% fusion
for i = 1 : level
R_r{i} = Weight1{i} .* r1{i} + Weight2{i} .* r2{i};
G_g{i} = Weight1{i} .* g1{i} + Weight2{i} .* g2{i};
B_b{i} = Weight1{i} .* b1{i} + Weight2{i} .* b2{i};
end
% pyramin reconstruct
R = pyramid_reconstruct(R_r);
G = pyramid_reconstruct(G_g);
B = pyramid_reconstruct(B_b);
fusion = cat(3, R,G,B);
uiqm = UIQM(fusion)
uciqe = UCIQE(fusion)
figure,imshow(fusion),title("fusion image");
部分理论来源于网络,如有侵权请联系删除。
[1]刘志强,朱大奇.一种新型小波图像融合的水下目标增强算法[J].控制工程,2022,29(12):2235-2243.DOI:10.14107/j.cnki.kzgc.20210128.
[2]李秋实. 基于像素级图像融合增强的全局式水下多视图重建[D].吉林大学,2022.DOI:10.27162/d.cnki.gjlin.2022.001192.