【图像提取】DNA编解码多尺度形态学提取眼前节组织【含Matlab源码 1191期】

⛄一、简介

基于matlab DNA编解码多尺度形态学提取眼前节组织

⛄二、部分源代码

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);


## ⛄三、运行结果
![在这里插入图片描述](https://img-blog.csdnimg.cn/84dd4681830e4a999ccca14b0fd21117.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RJUUNtYXRsYWI=,size_16,color_FFFFFF,t_70#pic_center)

## ⛄四、备注
**1 matlab版本**
2014a

**2 参考文献**
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.

**3 备注**
简介此部分摘自互联网,仅供参考,若侵权,联系删除

你可能感兴趣的:(Matlab图像处理(进阶版),matlab,图像处理,开发语言)