-
大小: 62KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-01-04
- 语言: 其他
- 标签:
资源简介
gabor提取纹理特征,k-means方法无监督聚类进行图像分割
代码片段和文件信息
%function demo_GaborTextureSegment
imfile = ‘data[1].20.png‘
I = imread(imfile);
K = 5;
tic;
%I = rgb2gray(I);
%I = imresize(I [256 256]);
[Nr Nc D] = size(I)
gamma = 1; b = 1; Theta = 0:pi/6:pi-pi/6; phi = 0; shape = ‘valid‘;
%[4 8 16 ...] sqrt(2) % Jain
% Lambda = Nc./((2.^(2:log2(Nc/4))).*sqrt(2));
% J. Zhang
J = (2.^(0:log2(Nc/8)) - .5) ./ Nc;
F = [ (.25 - J) (.25 + J) ]; F = sort(F); Lambda = 1 ./ F;
seg = GaborTextureSegment(I K gamma Lambda b Theta phi shape);
%imseg = uint8(seg) * floor(255 / K); % cluster id to gray scale (max 255)
[nRow nCol] = size(seg);
color = [0 0 0; 255 255 255; 255 0 0; 0 255 0; 0 0 255]; % 5 colors reserved
imseg = zeros(nRow*nCol 3);
for i=1:K
idx = find(seg == i);
imseg(idx :) = repmat(col
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 58267 2007-12-11 19:22 gabor\data[1].20.png
文件 1003 2007-12-11 19:22 gabor\demo_GaborTextureSegment.m
文件 1826 2007-12-11 19:28 gabor\gabor2.m
文件 4331 2007-12-11 19:21 gabor\GaborTextureSegment.m
文件 1147 2007-12-11 19:22 gabor\gauss2.m
文件 2567 2007-12-11 19:22 gabor\kmeans_light.m
目录 0 2007-12-17 20:56 gabor
----------- --------- ---------- ----- ----
69141 7
评论
共有 条评论