Hazy image equation implementation.
5 views (last 30 days)
Thiago Henrique Gomes Lobato on 20 Oct 2019
Edited: Thiago Henrique Gomes Lobato on 20 Oct 2019
Can it be possible that you are just making a wrong conversion of your image data? With the code below I show an example of what would be a right and wrong conversion, besides this the code seems to work :
% Image and parameters
I = imread('cameraman.tif');
A = 0.5;
t = randn(size(I)); % t must have same dimensions as I
t = abs(t)/max(abs(t(:)))*0.7+0.3; % Normalize so no division by zero value possible
Hazy = @(I,A,t) (I-A*(1-t))./t; % Define your function, make sure it is element-wise
% Wrong Image conversion
J1 = Hazy(double(I),A,t);
% Right image conversion
J2 = Hazy(im2double(I),A,t);
If you have a RGB image, make sure to apply it individually to every third dimension of your image matrix.