如何使用Matlab提取部分图像

时间:2014-07-12 03:13:02

标签: matlab image-processing image-segmentation morphological-analysis

我没有多使用matlab,我需要从给定的心脏图像中提取心脏左右冠状动脉的一部分。

这是我的图片,enter image description here

enter image description here

基于形态学操作,这就是我提出的,

f=imread('heart.jpg');
diam=strel('diamond',19);
line=strel('line',10,90);
linef=imclose(f,line);
line120=strel('line',10,120);
line120f= imclose(f,line120);
bothline=linef+line120f;
diamf=imclose(f,diam);
arterybm=diamf-bothline;
binaryartery= im2bw(arterybm,0);
mask=cast(binaryartery,class(f));
redPlane=f(:,:,1);
greenPlane=f(:,:,2);
bluePlane=f(:,:,3);
maskedRed=redPlane.*mask;
maskedGreen=greenPlane.*mask;
maskedBlue=bluePlane.*mask;
maskedRGBImage=cat(3,maskedRed,maskedGreen,maskedBlue);
subplot(2,3,1);imshow(f);title('Input Image');subplot(2,3,2);imshow(diamf);title('imclose with Diamond Mask');subplot(2,3,3);imshow(bothline);title('imclose with Line 120 and 90 mask');subplot(2,3,4);imshow(arterybm);title('Difference of line and diamond');subplot(2,3,5);imshow(binaryartery);title('Convert to binary image');subplot(2,3,6);imshow(maskedRGBImage);title('Apply mask to input image');

有更好的方法吗?

2 个答案:

答案 0 :(得分:2)

这项任务非常困难,如果您在大多数情况下发现解决方案能够完美运行,那么值得学术文章。我的建议:搜索关于该主题的文章,并尝试“Matlab文件交换”(http://www.mathworks.com/matlabcentral/fileexchange/)。如果你很幸运,有人可能已经解决了这个问题并发布了解决方案。

答案 1 :(得分:2)

查看Frangi过滤器(又名脊检测过滤器),它用于检测血管。 文件交换上有一个实现:

http://www.mathworks.com/matlabcentral/fileexchange/24409-hessian-based-frangi-vesselness-filter