Scattering and edge enhancement are the key steps to solve the problems of contrast attenuation, color deviation and edge blur of underwater images. This paper presents a better method of underwater image enhancement. Firstly, an end-to-end trained convolutional neural network is used to measure the input image, and an adaptive bilateral filter is used to process the transmitted image. Then a white balance based strategy is proposed to eliminate the color deviation of the image, and Laplacian pyramid fusion is used to obtain the fusion results of fog-free and color corrected images. Finally, the output image is converted to a hybrid wavelet and directional filter bank (HWD) domain for denoising and edge enhancement. Experimental results show that this method can eliminate color distortion and improve the definition of underwater image.
clc; clear; addpath('codes\') addpath('Images\') FileName = uigetfile({'*.jpg; *.bmp; *.png'},'Optional images','Images'); input = imread(FileName); output = underwater(input); underwaterimage2(input); %i=40; %Saved images number %saveas(1,['./myresults/',num2str(i),'.jpg']); function sum_img = window_sum_filter(image, r) % sum_img(x, y) = = sum(sum(image(x-r:x+r, y-r:y+r))); [h, w] = size(image); sum_img = zeros(size(image)); % Y axis im_cum = cumsum(image, 1); sum_img(1:r+1, :) = im_cum(1+r:2*r+1, :); sum_img(r+2:h-r, :) = im_cum(2*r+2:h, :) - im_cum(1:h-2*r-1, :); sum_img(h-r+1:h, :) = repmat(im_cum(h, :), [r, 1]) - im_cum(h-2*r:h-r-1, :); % X axis im_cum = cumsum(sum_img, 2); sum_img(:, 1:r+1) = im_cum(:, 1+r:2*r+1); sum_img(:, r+2:w-r) = im_cum(:, 2*r+2:w) - im_cum(:, 1:w-2*r-1); sum_img(:, w-r+1:w) = repmat(im_cum(:, w), [1, r]) - im_cum(:, w-2*r:w-r-1); endCopy the code
Complete code or simulation consulting to add QQ1575304183