如何使用Matlab提取图像的一部分

dev1234

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

这是我的形象 在此处输入图片说明

在此处输入图片说明

根据形态运算,这是我想出的,

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

有什么更好的办法吗?

维亚德科勋爵

如果您发现解决方案在大多数情况下都可以正常工作,那么这项任务是一项艰巨的任务,值得发表学术文章。我的建议是:搜索有关该主题的文章,然后尝试“ Matlab文件交换”(http://www.mathworks.com/matlabcentral/fileexchange/)。如果您很幸运,可能有人已经解决了该问题并发布了解决方案。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章