资源简介

交互式对象分割算法,Grabcut(图割法)是微软公司出品的用于对象分割的算法,这里将其设计为GUI的交互式分割算法,分割精度很高,在MATLAB中编译后可用。亲测十分好用!!

资源截图

代码片段和文件信息

function compile_gc(debug_flag)
% v = regexp(version()‘\.‘‘split‘);
% mj = str2double(v{1});
% mn = str2double(v{2});
% % v = version();
% % di = find(v==‘.‘);
% % mj= str2double(v(1:di(1)-1));
% % mn= str2double(v(di(1)+1 :di(2)-1));

if strfind(computer()‘64‘)
    defs = ‘-DA64BITS ‘; % for 64bit machines - define pointer type
else
    defs = ‘‘;
end
% if mj < 7 || (mj==7 && mn < 3)
if verLessThan(‘matlab‘‘7.3‘)    
    defs = [defs ‘-DmwIndex=int -DmwSize=size_t ‘];
end

if nargin>0 && debug_flag
    debugs = ‘ -g ‘;
else
    debugs = ‘ -O ‘;
end

cmd = sprintf(‘mex %s -largeArrayDims %s GraphCutMex.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp‘...
    debugs defs);
eval(cmd);
cmd = sprintf(‘mex %s -largeArrayDims %s GraphCut3dConstr.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp‘...
    debugs defs);
eval(cmd);
cmd = sprintf(‘mex %s -largeArrayDims %s GraphCutConstrSparse.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp‘...
    debugs defs);
eval(cmd);
cmd = sprintf(‘mex %s -largeArrayDims %s GraphCutConstr.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp‘...
    debugs defs);
eval(cmd);
% clear cmd mj mn v di defs


% if strcmp(computer()‘GLNXA64‘)
%     mex -g  -DA64BITS GraphCutMex.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     mex -g  -DA64BITS GraphCut3dConstr.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     if v >= 7.3
%         mex -g  -largeArrayDims -DMAT73 -DA64BITS GraphCutConstrSparse.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     else
%         mex -g  -DA64BITS GraphCutConstrSparse.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     end
%     mex -g -DA64BITS GraphCutConstr.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
% else
%     mex -g GraphCutMex.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     mex -g  GraphCut3dConstr.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     if v >= 7.3
%         mex -g  -largeArrayDims -DMAT73 GraphCutConstrSparse.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     else
%         mex -g  GraphCutConstrSparse.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
%     end
%     mex -g  GraphCutConstr.cpp graph.cpp GCoptimization.cpp GraphCut.cpp linkedBlockList.cpp maxflow.cpp
% end    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        195  2012-03-11 20:23  grabcut\GrabCut\bagon_assert.h

     文件       8215  2009-02-05 22:19  grabcut\GrabCut\block.h

     文件        258  2012-10-12 16:24  grabcut\GrabCut\CHANGELOG.txt

     文件       2665  2012-06-17 20:32  grabcut\GrabCut\compile_gc.m

     文件       1000  2018-07-13 15:33  grabcut\GrabCut\dDSCF4107mask_l.png

     文件       9866  2012-03-14 14:16  grabcut\GrabCut\energy.h

     文件       6039  2012-11-22 05:33  grabcut\GrabCut\GCAlgo.m

     文件      60751  2012-10-12 16:21  grabcut\GrabCut\GCoptimization.cpp

     文件      23348  2012-03-11 20:46  grabcut\GrabCut\GCoptimization.h

     文件      14614  2012-09-11 20:00  grabcut\GrabCut\GC_GUI.fig

     文件      10007  2018-06-15 13:50  grabcut\GrabCut\GC_GUI.m

     文件      10875  2009-02-05 22:19  grabcut\GrabCut\graph.cpp

     文件       8746  2011-08-29 14:36  grabcut\GrabCut\graph.h

     文件        674  2009-02-03 19:50  grabcut\GrabCut\GraphCut.cpp

     文件       2186  2009-02-03 19:50  grabcut\GrabCut\GraphCut.h

     文件      15582  2012-06-17 20:57  grabcut\GrabCut\GraphCut.m

     文件       8134  2010-09-29 21:12  grabcut\GrabCut\GraphCut3dConstr.cpp

     文件      14848  2018-06-13 15:30  grabcut\GrabCut\GraphCut3dConstr.mexw64

     文件       4889  2010-09-29 21:14  grabcut\GrabCut\GraphCutConstr.cpp

     文件      11776  2018-06-13 15:30  grabcut\GrabCut\GraphCutConstr.mexw64

     文件       4123  2010-09-29 21:27  grabcut\GrabCut\GraphCutConstrSparse.cpp

     文件      11776  2018-06-13 15:30  grabcut\GrabCut\GraphCutConstrSparse.mexw64

     文件      17667  2012-03-12 15:27  grabcut\GrabCut\GraphCutMex.cpp

     文件      41472  2018-06-13 15:30  grabcut\GrabCut\GraphCutMex.mexw64

     文件      18349  2009-02-03 19:50  grabcut\GrabCut\LICENSE.TXT

     文件       1523  2009-02-05 22:23  grabcut\GrabCut\linkedBlockList.cpp

     文件       1765  2009-02-03 19:50  grabcut\GrabCut\linkedBlockList.h

     文件      20816  2009-02-03 19:50  grabcut\GrabCut\maxflow.cpp

     文件        929  2012-11-22 05:02  grabcut\GrabCut\README_GrabCut.txt

     文件      27615  2009-02-03 19:50  grabcut\GrabCut\README_GraphCut_Bagon.txt

............此处省略7个文件信息

评论

共有 条评论