• 大小: 13.07MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-29
  • 语言: 其他
  • 标签: 遥感图像  

资源简介

基于超像素合并的遥感图像多尺度分割,先将图像进行分割成超像素区域。然后按照一定的合并准则进行合并,参考文献《A Bilevel Scale-Sets Model for Hierarchical Representation of Large RemoteSensing Images》发表在2016年TGRS上

资源截图

代码片段和文件信息

addpath(‘SCoW‘);
addpath(‘SLIC_mex‘);
addpath(‘MergeTool‘);

[filenamepathname]=uigetfile({‘*.bmp‘}‘choose the picture‘);
str=[pathname filename];

%% File Paths and Parameters
MergeTool = ‘SuperPixelMerge.exe‘;
SP_label = [pathname‘Superpixel.tif‘];
SPMG_label = [pathname‘Merge.tif‘];
MG_Criterion = 0;  % 0 1 2 3
Num_of_Region = 120; % the number of regions after region merging
MG_Shape = 0.3;
MG_Compact = 0.5;
%% 

img = imread(str);

%% Spatially-constrained Watershed Superpixel
%Watershed Superpixel IEEE ICIP 2015.
%img = im2double(img);
%[boundarylabels] = SCoW(img(::1)img(::2)img(::3)0.5100);
%% SLIC Superpixel
[labels numlabels] = slicmex(img1000015);
%you can replace this function use other superpixel method
%% save superpixel map as TIF image
data = uint32(labels);
t = Tiff(SP_label‘w‘);
% Setup tags
tagstruct.ImageLength     = size(data1);
tagstruct.ImageWidth      = size(data2);
tagstruct.Photometric     = Tiff.Photometric.MinIsBlack;
tagstruct.BitsPerSample   = 32;
tagstruct.SamplesPerPixel = 1;
tagstruct.RowsPerStrip    = 16;
tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
tagstruct.Software        = ‘MATLAB‘;
t.setTag(tagstruct)
t.write(data);
t.close();
%% 
ShowContours(strSP_label);
%% Call the Superpixel Merge tool

%format the command line input
cd MergeTool;
cmd_line = sprintf(‘%s %s %s %s %s %s %s‘MergeToolstrSP_labelSPMG_labelnum2str(MG_Criterion)num2str(Num_of_Region) num2str(MG_Shape) num2str(MG_Compact));
%call the Superpixel Merge Tool
system(cmd_line);
cd ..;
%% 
ShowContours(strSPMG_label);


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件     2202678  2017-03-21 10:42  demo.bmp
     文件        1651  2017-06-06 16:02  Demo_Matlab.m
     目录           0  2017-03-21 10:26  GraphSeg\
     文件        5295  2014-02-12 12:59  GraphSeg\binaryHeap.h
     文件        9216  2017-03-21 10:17  GraphSeg\BuildGLTree.mexw64
     目录           0  2017-03-21 10:16  GraphSeg\coherenceFilter\
     文件        9898  2014-02-12 12:59  GraphSeg\coherenceFilter\CoherenceFilter.m
     文件        1007  2014-02-12 12:59  GraphSeg\coherenceFilter\compile_c_files.m
     目录           0  2017-03-21 10:16  GraphSeg\coherenceFilter\functions\
     目录           0  2017-03-21 10:16  GraphSeg\coherenceFilter\functions2D\
     文件        6148  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\CoherenceFilterStep2D.c
     文件         618  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\CoherenceFilterStep2D.m
     文件       13418  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\CoherenceFilterStep2D_functions.c
     文件         687  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\ConstructDiffusionTensor2D.m
     文件        2279  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\diffusion_scheme_2D_implicit.m
     文件        1925  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\diffusion_scheme_2D_non_negativity.m
     文件        1103  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\diffusion_scheme_2D_rotation_invariant.m
     文件        1475  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\diffusion_scheme_2D_standard.m
     文件         879  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\EigenVectors2D.m
     文件         667  2014-02-12 12:59  GraphSeg\coherenceFilter\functions2D\StructureTensor2D.m
     目录           0  2017-03-21 10:16  GraphSeg\coherenceFilter\functions3D\
     文件        6372  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\CoherenceFilterStep3D.c
     文件         625  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\CoherenceFilterStep3D.m
     文件       36356  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\CoherenceFilterStep3D_functions.c
     文件        3328  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_implicit.m
     文件        8099  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_non_negativity.c
     文件        3076  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_non_negativity.m
     文件       13234  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_rotation_invariant.c
     文件        1164  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_rotation_invariant.m
     文件        5912  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_standard.c
     文件        2653  2014-02-12 12:59  GraphSeg\coherenceFilter\functions3D\diffusion_scheme_3D_standard.m
............此处省略202个文件信息

评论

共有 条评论