matlab:纹理分类(matlab: texture classification)
我有这样的组织学图像:
从图像中我们可以观察到有两种不同的细胞。
和
有什么方法可以将这两种类型的细胞分成两组吗?
I have a histology image like this:
From the image, we can observe there are two kinds of different cells.
and
Is there any way that I can separate these two types of cells into two groups?
最满意答案
如何使用原始图像和以前的代码来实现这一目标?
% % % your old code I=imread(file); t1=graythresh(I); k1=im2bw(I,t1); k1=~k1; se = strel('disk',1); k0=imfill(~k1,'holes'); cc = conncomp(k0); k0(cc.PixelIdxList{1})=0; k1=imfill(k1,'holes'); mask=k0 | k1; %%%%%%%%%%%%%%%%%%这会给你:
I=rgb2hsv(I); I=double(I); I1=I(:,:,1); % again, the channel that can maximizing the margin between donut and full circle Imask=(I1-0.2).*(I1-0.9)<0; k2=mask-Imask; k2=bwareaopen(k2,100);这会给你:
k2=mask-Imask; I2=zeros(size(I1,1),size(I1,2),3); I2(:,:,1)=(k2==1)*255; I2(:,:,3)=((I1-0.2).*(I1-0.9)<0)*255; imshow(I2)最后会给你(这两种类型存储在rgb图像中的两个通道中):
How about using your raw image and previous code to achieve this?
% % % your old code I=imread(file); t1=graythresh(I); k1=im2bw(I,t1); k1=~k1; se = strel('disk',1); k0=imfill(~k1,'holes'); cc = conncomp(k0); k0(cc.PixelIdxList{1})=0; k1=imfill(k1,'holes'); mask=k0 | k1; %%%%%%%%%%%%%%%%%%This will give you:
I=rgb2hsv(I); I=double(I); I1=I(:,:,1); % again, the channel that can maximizing the margin between donut and full circle Imask=(I1-0.2).*(I1-0.9)<0; k2=mask-Imask; k2=bwareaopen(k2,100);This will give you:
k2=mask-Imask; I2=zeros(size(I1,1),size(I1,2),3); I2(:,:,1)=(k2==1)*255; I2(:,:,3)=((I1-0.2).*(I1-0.9)<0)*255; imshow(I2)will finally give you (the two types are stored in two channels in the rgb image):
更多推荐
发布评论