matlab:纹理分类(matlab: texture classification)

编程入门 行业动态 更新时间:2024-10-24 10:20:05
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:

enter image description here

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:

enter image description here

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

enter image description here

更多推荐

本文发布于:2023-07-23 18:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1235707.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:纹理   matlab   classification   texture

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!