-
大小: 3KB文件类型: .rar金币: 2下载: 0 次发布日期: 2021-05-29
- 语言: 其他
- 标签: Normalized Cut
资源简介
用Normalized Cut聚类方法实现 图像分割,据说效果不错,给大家做个参考

代码片段和文件信息
function W = CompW(data sigS sigR radius)
% COMPW compute weight matrix
%
% sigS spatial sigma
% sigR range sigma
% radius radius for truncated Gaussian kernel
%
% W weitht matrix
%
% By Jiarui Ding U of S
% Nov 14 2007
% Data preparing 3D(color) or 1D(grayscale) plus 2D spacial feature
[mRows nCols d] = size(data);
%
if d==3
cform = makecform(‘srgb2lab‘);
ILab = applycform(data cform);
data = single(ILab);
end
data = single(data);
d = d+2;
[gridR gridC] = ndgrid( 1:mRows 1:nCols );
% Normalize spacial and range kernel size to 1
spaGrid = cat( 3 gridR/sigS gridC/sigS);
data = cat( 3 spaGrid data/sigR );
N = mRows * nCols;
W = sparse(NN);
% Improvement exchange the order of the two for loops to in accordance with
% the way Matlab indexing matrix
for i=1:mRows
for j=1:nCols
newMean = data(ij:);
newMean = newMean(:)‘;
% Find data within the kernel window
r = round( newMean(1)*sigS );
c = round( newMean(2)*sigS );
% Restrict the coordiates in the domain of image grid
rBound = max(1r-radius):min(mRowsr+radius);
cBound = max(1c-radius):min(nColsc+radius);
% The Row and Column index
[rC cC] = meshgrid(rBound cBound);
idxC = sub2ind([mRows nCols] rC cC);
idxC = reshape(idxC‘ length(rBound) * length(cBound) 1);
idxR = i + (j - 1) * mRows;
kernelWindow = data( rBound cBound : );
kernelWindow = reshape( kernelWindow [] d ); % Get a d dimential vector
% Compute weight
n = size( kernelWindow 1);
D = sum( (repmat(newMean n 1) - kernelWindow ).^2 2 );
value = exp(-D);
% Get weight matrix
W(idxR idxC) = value;
end
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1926 2007-12-03 17:40 Ncut\CompW.m
文件 506 2007-11-17 21:49 Ncut\Ncut.m
文件 1134 2007-12-03 17:40 Ncut\NcutSeg.m
文件 1946 2007-12-03 17:40 Ncut\Segment.m
目录 0 2011-04-21 22:13 Ncut
----------- --------- ---------- ----- ----
5512 5
相关资源
- CuteFTP8.0绿色破解版免安装无需序列号
- CuteFTP8.0简体中文破解版
- D 6 R 4曲率校正,模块化图形函数和
- 狭义相对论变形中相互作用局部的时
- 使用半整数自旋发生器扩展Poinca
- Anti-de Sitter空间和AdS / CFT的两个P
- 从Poincaré代数的闭合中得
- 一回路的κ-Poincaré不变
- Kubo-Martin-Schwinger权重的κ-Poin
- 由κ-Poincarér矩阵产生
- 论文研究 - 科特迪瓦西部Duékou
- 论文研究 - 科特迪瓦西南部SASCA域中
- 论文研究 - Ngaoundéré地区医
- THE RAS/PI3K PATHWAY IS INVOLVED IN THE IMPAIR
- Acute effects of TGFβ1 on neuronal excita
- CutRite V9使用说明书中文培训课件
- 基于图切算法的交互式图像分割技术
- Executable UML: A Foundation for Model-Driven
- An Experimental Comparison of Min-Cut/Max-Flow
- cute slider v2.1
-
X-tile(v3.6.1)包含.NET fr
amework 2.zi - 基于QtOpenCV实现GraphCuts算法
- 东信和平测试平台Execution v5.0
- CuteFTP Pro 8.3 中文绿色注册版最好用的
- 编辑器cuteEditor6·0多语言版集成lic文件
- 绿色版CuteFTP
- A-PDF Page Cut 3.5
- CuteFTP8绿色版(FTP工具)
- SCUT fuse文件系统
- CuteFTP8 最简单好用的 FTP,免费不用注
评论
共有 条评论