Current location - Education and Training Encyclopedia - Graduation thesis - What is the meaning of each sentence of dark channel algorithm in MATLAB code defogging algorithm? Which principles do they correspond to in the paper?
What is the meaning of each sentence of dark channel algorithm in MATLAB code defogging algorithm? Which principles do they correspond to in the paper?
Function dark = dark channel (imRGB)

r=imRGB(:,:, 1);

g=imRGB(:,:,2);

b=imRGB(:,:,3); Respectively extracting three-color gray-scale images

[m n] = size (r); Extract the width and length of monochrome graphics matrix

A = zero (m, n); Create a zero matrix a of m * n.

Because i = 1: m

For j = 1: n

a(i,j) = min(r(i,j),g(i,j));

a(i,j)= min(a(i,j),b(i,j)); The minimum values of the three color components are sequentially compared and extracted as a dark channel graph.

end

end

D = unit (15,15); Use 15* 15 to create identity matrix.

fun = @(block _ struct)min(min(block _ struct . data))* d;

dark = blockproc(a,[ 15 15],fun); Divide the picture into small blocks of 15* 15, and make each block take the minimum value.

Dark = dark (1:m,1:n);

I'm a novice, too, brother. I can only help you here.