Hello Mat

 找回密码
 立即注册
查看: 5016|回复: 0

Kmeans图像分割

[复制链接]

1294

主题

1520

帖子

110

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22633
发表于 2018-6-13 21:48:26 | 显示全部楼层 |阅读模式
Kmeans图像分割:
运行环境:win7+32bit+matlab2014a
  1. %% 读图
  2. im=imread('tudou.jpg');
  3. % im=imread('sea.png');
  4. figure, imshow(im),title('原始图像');
  5. hsi = rgb2hsi(im);
  6. I = hsi(:,:,3);
  7. figure, imshow(I),title('亮度I图像');
  8. %% kmeans
  9. [height, width, depth] = size(hsi);
  10. % Label1 = kmeans_ysw(I(:), 3, 1e3);
  11. Label1 = kmeans(I(:), 3);
  12. I_kmeans1 = reshape( Label1, height, width );
  13. figure, imshow(I_kmeans1, []),title('Kmeans聚类图像3');
  14. colormap jet;   axis equal
复制代码



算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-4-20 09:00 , Processed in 0.211429 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表