A list,
The anterior segment tissue was extracted by multi-scale morphology based on MATLAB DNA encoding and decoding
Ii. Source code
clc; clear all; close all;
if exist(fullfile(pwd, 'dt.mat'), 'file')
load(fullfile(pwd, 'dt.mat'));
figure; imshow(result, []);
return;
end
Img = imread('images\image.bmp');
Gf1 = Main_Process(Img, 1);
Gf2 = Main_Process(Img, 2);
Gf3 = Main_Process(Img, 3);
Gf4 = Main_Process(Img, 4);
Gf5 = Main_Process(Img, 5);
G{1} = Gf1;
G{2} = Gf2;
G{3} = Gf3;
G{4} = Gf4;
G{5} = Gf5;
ua1 = Coef(Gf1, G);
ua2 = Coef(Gf2, G);
ua3 = Coef(Gf3, G);
ua4 = Coef(Gf4, G);
ua5 = Coef(Gf5, G);
u = [ua1, ua2, ua3, ua4, ua5];
u = u/sum(u);
Gf = Edge_One(G, u);
result = Gf5;
figure; imshow(result, []);
function Inversef = supoles(fa, f)
Inversef = 0;
N = length(f);
for i = 1 : N
fb = f{i};
diff_fab = usim(fa, f);
Inversef = Inversef + diff_fab;
end
function H = compute_infos(I)
level = 256;
dat = double(I);
p = zeros(1, level);
for i = 1 : size(dat, 1)
for j = 1 : size(dat, 2)
temp = dat(i,j);
p(1, temp+1) = p(1, temp+1) + 1;
end
end
p = p/(size(dat, 1)*size(dat, 2));
H = 0;
for i = 1 : level
if p(i) ~= 0
H = H + p(i)*log2(p(i));
end
end
H = -H;
function ua = Coef(fa, f)
N = length(f);
s = [];
for i = 1 : N
fi = f{i};
si = supoles(fi, f);
s = [s si];
end
sp = min(s(:));
sa = supoles(fa, f);
ka = sp/sa;
k = 0;
for i = 1 : N
fb = f{i};
s = [];
for i = 1 : N
fi = f{i};
si = supoles(fi, f);
s = [s si];
end
sp = min(s);
sb = supoles(fb, f);
kb = sp/sa;
k = k + kb;
end
ua = ka/k;
function [Gi, ng] = Multi_Process(I, g, n)
if nargin < 3
n = 6;
end
ng = g;
for i = 1:n
ng = imdilate(ng, g);
end
Gi1 = imopen(I, ng);
Gi1 = imdilate(Gi1, ng);
Gi2 = imclose(I, ng);
Gi2 = imerode(Gi2, ng);
Gi = imsubtract(Gi1, Gi2);
Copy the code
Third, the operation result
Fourth, note
Version: 2014 a