-
大小: 3KB文件类型: .rar金币: 1下载: 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
相关资源
- cuda开发cutilDLL
-
failed to execute sc
ript 解决方案+命令行 - GrabCut-opencv源码注释
- opencv实现背景分离
- 图像分割ncut代码
- Boykov的GraphCut算法
- ncut图像分割算法
- cutterman2.6.1_offline_绿色版
- openCV中grabcut图像分割函数使用VS2017
- cuteEditor 授权文件
- cut_log.sh
- 多标签图割算法
- Complete and robust no-fit polygon generation
- cutecom-0.20.0.tar.gz
- gacutil.exe
-
Flexible Workflow Execution and Desc
ription - Shortcut to Si9000-能用到2038年的授权li
- VTK修炼之道56中的资源文件fran_cut.vt
- Photoshop之Cutterman一键切图插件
- 从plist和png图片中分离小图片工具--
- iCute多功能串口调试助手(v1.1)
- Vericut创建刀具库
- CuteFTP XP5.0.2 序列号破解版
- CuteFTP XP5.0.2 简体中文完美破解版绿色
- Final_Cut_Pro_10.4.8_TNT_app4mac.net_3.21G.dmg
- mp3cutter MP3切割工具 绿色小剪刀 无插
- ShellExecuteHook
- Ncut聚类算法
- Shortcut.exe 命令行创建快捷方式1.0
- ubuntu下串口通信Modbus RTU 协议 + 串口程
评论
共有 条评论