资源简介
图割算法,基于连续凸优化的一个变种,绝对能运行,不需要什么动态链接库之类的,纯matlab实现
代码片段和文件信息
function [u erriter i timet] = CMF_Cut
%
% Performing the continuous max-flow algorithm to solve the
% continuous min-cut problem in 2D
%
% Usage: [u erriter i timet] = CMF_Cut;
%
% Inputs: there is no input since all data and parameters can be
% adjusted within the program
%
% Outputs:
% - u: the final results u(x) in [01]. As the following paper
% the global binary result can be available by threshholding u
% by any constant alpha in (01):
%
% Nikolova M.; Esedoglu S.; Chan T. F.
% Algorithms for Finding Global Minimizers of Image Segmentation and Denoising Models
% SIAM J. App. Math. 2006 66 1632-1648
%
% - erriter: it returns the error evaluation of each iteration
% i.e. it shows the convergence rate. One can check the algorithm
% performance.
%
% - i: gives the total number of iterations when the algorithm converges.
%
% - timet: gives the total computation time.
%
% Example:
% >> [u erriter i timet] = CMF_Cut;
%
% >> us = max(u beta); % where beta in (01)
%
% >> imagesc(us) colormap gray axis image axis off;figure(gcf)
%
% >> figure loglog(erriter‘DisplayName‘‘erriterN‘);figure(gcf)
%
%
%
% The original algorithm was proposed in the following papers:
%
% [1] Yuan J.; Bae E.; Tai X.-C.
% A Study on Continuous Max-Flow and Min-Cut Approaches
% CVPR 2010
%
% [2] Yuan J.; Bae E.; Tai X.-C.; Boycov Y.
% A study on continuous max-flow and min-cut approaches. Part I: Binary labeling
% UCLA CAM Technical Report 10-61 2010
%
% The mimetic finite-difference discretization method was proposed for
% the total-variation function in the paper:
%
% [1] Yuan J.; Schn{\“o}rr C.; Steidl G.
% Simultaneous Optical Flow Estimation and Decomposition
% SIAM J.~Scientific Computing 2007 vol. 29 page 2283-2304 number 6
%
% This software can be used only for research purposes you should cite ALL of
% the aforementioned papers in any resulting publication.
%
% Please email cn.yuanjing@gmail.com for any questions suggestions and bug reports
%
% The Software is provided “as is“ without warranty of any kind.
%
%
% Version 1.0
% https://sites.google.com/site/wwwjingyuan/
%
% Copyright 2011 Jing Yuan (cn.yuanjing@gmail.com)
%
close all
clear all
clc
figure;
subplot(121);
ur = double(imread(‘cameraman.jpg‘))/255;
imshow(ur[]);
[rows cols] = size(ur);
imgSize = rows*cols;
% define the required parameters:
%
% - alpha: the penalty parameter to the total-variation term.
% For the case without incorporating image-edge weights alpha is given
% by the constant everywhere. For the case with image-edge weights
% alpha is given by the pixelwise wei
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 38291 2014-02-12 13:45 Graph-Cut\cameraman.jpg
文件 5724 2014-12-26 15:20 Graph-Cut\CMF_Cut.m
文件 100129 2014-02-12 13:45 Graph-Cut\CMF_README.pdf
目录 0 2014-12-26 15:21 Graph-Cut
----------- --------- ---------- ----- ----
144144 4
- 上一篇:Multisim课程设计-数字时钟
- 下一篇:Allan方差计算程序Matlab版
评论
共有 条评论