1 function varargout = cverode(varargin)
\r
2 %CVERODE Apply minimum filter to the image
\r
3 % IMAGE dst = cvErode(IMAGE src, elementValues, elementSize, iterations);
\r
5 % elementValues - structuring element matrix
\r
6 % elementSize - [anchorRow, anchorCol]
\r
7 % iterations - default 1.
\r
9 % dst - destination image
\r
11 % IMAGE dst = cvErode(IMAGE src, elementType, elementSize, iterations);
\r
12 % src - source image
\r
13 % elementType - {'rect'} | 'cross' | 'ellipse'
\r
14 % elementSize - [nRows, nCols, anchorRow, anchorCol]. Default [3, 3, 2, 2].
\r
15 % iterations - default 1.
\r
17 % dst - destination image
\r
19 if nargin < 1 | nargin > 4
\r
20 error 'Invalid number of parameters';
\r
25 if ischar(varargin{2})
\r
26 elem_t = {'rect', 'cross', 'ellipse'};
\r
28 idx = strmatch(varargin{2}, elem_t, 'exact');
\r
30 error 'Invalid parameter ''elementType''';
\r
33 varargin{2} = elem_i(idx(1));
\r
40 varargin{3} = [3, 3, 2, 2]; % default elementSize
\r
44 varargin{4} = 1; % default iterations
\r
53 error 'Too many output parameters'
\r
57 [varargout{1:out}] = feval('cvwrap', 'Erode', varargin{:});
\r