资源简介
谱聚类算法对图像进行分割的程序,可以直接运行,主程序为Demo,Demo_features,运行后可以对程序包中带的图片1和图片2进行分割。

代码片段和文件信息
% This code implemented a 搉ormalized-cut?segmentation using color and texture information
% This code segment an image using color texture and spatial data
% RGB color is used as an color data
% Four texture features are used: 1. mean 2. variance 3. skewness 4. kurtosis
% Normalized Cut (inherently uses spatial data)
% ncut parameters are “SI“ Color similarity “ST“ Texture similarity “SX“ Spatial similarity “r“ Spatial threshold (less than r pixels apart) “sNcut“ The smallest Ncut value (threshold) to keep partitioning and “sArea“ The smallest size of area (threshold) to be accepted as a segment
% an implementation by “Naotoshi Seo“ with a small modification is used for 搉ormalized-cut?segmentation available online at: “http://note.sonots.com/SciSoftware/NcutImageSegmentation.html“ It is sensitive in choosing parameters.
% Alireza Asvadi
% Department of ECE SPR Lab
% Babol (Noshirvani) University of Technology
% http://www.a-asvadi.ir
% 2013
%% clear command windows
clc
clear all
close all
tic
%% initialize
Im = imread(‘1.jpg‘);
[nRownColdim] = size(Im); % Image row & col
N = nRow*nCol; % Number of pixels
Vx = reshape(ImNdim); % Vertices of Graph
% figure(); imshow(Im);
%% Texture
m = 1; % window width for texture extraction is 2*m+1
ST = 10; % texture similarity
dim2 = 4; % number of texture features
In = im2double(rgb2gray(Im));
T = zeros(nRownColdim2); % initialize variance image
for i = 1:nRow % central pixel (in image coordinate)
for j = 1:nCol
Vi = (i-floor(m)):(i+floor(m)); %% neighbourhood pixels (in image coordinate)
Vj = ((j-floor(m)):(j+floor(m)));
Vi = Vi(Vi>=1 & Vi<=nRow); % keep pixels that are inside image
Vj = Vj(Vj>=1 & Vj<=nCol);
blk = In(ViVj); %% image block
T(ij1) = mean(blk(:)); % mean
T(ij2) = var(blk(:)); % variance
T(ij3) = skewness(blk(:)); % skewness
T(ij4) = kurtosis(blk(:)); % kurtosis
end
end
T(::1) = (T(::1)-min(min(T(::1))))/(max(max(T(::1)))-min(min(T(::1))));
T(::2) = (T(::2)-min(min(T(::2))))/(max(max(T(::2)))-min(min(T(::2))));
T(::3) = (T(::3)-min(min(T(::3))))/(max(max(T(::3)))-min(min(T(::3))));
T(::4) = (T(::4)-min(min(T(::4))))/(max(max(T(::4)))-min(min(T(::4))));
T = uint8(255*T); % normalization
% figure(); imshow(T)
%% Compute weight matrix W
r = 1.5; % Spatial threshold (less than r pixels apart)
SI = 5; % Color similarity
SX = 6; % Spatial similarity
sNcut = 0.22; % The smallest Ncut value (threshold) to keep partitioning
sArea = 30;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3033 2013-09-15 06:42 NcutPartition.m
文件 1374 2013-09-15 06:43 NcutValue.m
文件 16869 2013-07-04 00:11 1.jpg
文件 13507 2013-09-15 05:47 2.jpg
文件 6803 2015-08-27 18:17 Demo.m
文件 2462 2013-09-15 14:51 Demo_features.m
文件 1307 2015-09-09 08:21 license.txt
- 上一篇:魔兽世界插件制作指南
- 下一篇:谱聚类算法对图像进行分割
相关资源
- 基于OpenCV的数字识别468815
- 带式输送机托辊红外图像分割与定位
- 基于libsvm的图像分割代码
- 基于朴素贝叶斯分类法的图像分割
- 复杂背景与天气条件下的棉花叶片图
- 舌图像分割
- 图像分割方法在遥感图像分析中的应
-
Accurate subpixel edge location ba
sed on pa - 图像分割算法研究区域分割,数学形
- 基于图切算法的交互式图像分割技术
- 纹理图像分割论文+代码
- Dence CRF 条件随机场图像分割
- 图像分割-章毓晋
- Matalb图像分割边缘检测算子比较
- 交互式图像分割——算法与系统
- ITK入门教程_医学图像分割与配准_高清
- Canny算子分割遥感影像
- 分水岭图像分割算法C++程序源代码
- 基于形态学的图像分割 图片版
- CrackForest数据集
- 基于粒子群优算法的最大熵多阈值图
- 医学图像分割与配准(ITK实现 全2册)
- 章毓晋《图像分割》.PDF
- image segmentor source code and release 图像分
- 图像分割算法的实现
- 经典纹理图像分割论文+代码
- 医学图像分割全部代码
- 基于PCNN的彩色图像自动分割毕业论文
- CUDA的图像分割并行算法的设计与实现
- 马尔科夫随机场图像分割ICM代码
评论
共有 条评论