📄 cvapproxpoly.m
字号:
function varargout = cvapproxpoly(varargin)
%CVAPPROXPOLY Approximate poligonal curve.
% SEQARRAY dst = cvApproxPoly(SEQARRAY contours, first, method,
% parameter, recursive);
% contours - struct array of contours
% first - number in struct array 'contours' of start contour
% method:
% 'dp' - Douglas-Peucker method
% parameter - desired accuracy
% recursive - {0} | 1
if nargin < 4 | nargin > 5
error 'Invalid number of parameters';
return;
end
if ~ischar(varargin{3})
error 'Invalid parameter ''method''';
return;
end;
method_t = {'dp'};
method_i = [0];
idx = strmatch(varargin{3}, method_t, 'exact');
if isempty(idx)
error 'Invalid parameter ''method''';
return;
end
varargin{3} = method_i(idx(1));
if nargin < 5
% default
varargin{5} = 0;
end % recursive
if nargout > 0
[varargout{1:nargout}] = feval('cvwrap', 'ApproxPoly', varargin{:});
else
feval('cvwrap', 'ApproxPoly', varargin{:});
end
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -