【发布时间】:2015-07-10 01:33:17
【问题描述】:
我正在尝试使用细化算法提取静脉。到目前为止,我为图像增强做了很多代码,而且效果很好。但是当我计算二进制阈值时,我无法识别背景中的静脉。由于输出模糊,我无法进行进一步的细化处理。谁能告诉我这段代码有什么问题?还是因为阈值必须以其他方式完成。
a=imread('vein.jpg');
cform = makecform('srgb2lab');
for ii = 1:3
a(:,:,ii) = medfilt2(a(:,:,ii),[5 5]);
end
lab = applycform(a,cform);
b=lab(:,:,1);
c=im2bw(b,0.2);
neg=1-c;
color=a;
r=color(:,:,1);
r(~c)= 0;
g = color(:,:,2);
g(~c)= 0;
b = color(:,:,3);
b(~c)= 0;
color = cat(3,r,g,b);
gray=rgb2gray(color);
i1=imresize(gray,[256 256],'bilinear');
i2=histeq(i1,256);
e=medfilt2(i2,[5 5]);
figure(1),imshow(e);
f=medfilt2(e,[5 5]);
figure(2),imshow(f);
thresh_level = graythresh(g);
BW = im2bw(g, thresh_level);
figure(10),imshow(BW);
【问题讨论】:
-
你能把原图也发一下吗(在颜色处理之前)?