Mercurial > hg > octave-image
changeset 458:4778ab266ab5
Undoing some changes from 8235 which were committed by accident
author | carandraug |
---|---|
date | Thu, 28 Apr 2011 15:12:52 +0000 |
parents | f6cebe09d9d2 |
children | cc35e6a37642 |
files | inst/imopen.m |
diffstat | 1 files changed, 30 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/inst/imopen.m +++ b/inst/imopen.m @@ -9,33 +9,33 @@ ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. - -## -*- texinfo -*- -## @deftypefn {Function File} @var{B} = imopen (@var{A}, @var{se}) -## Perform morphological opening on a given image. -## The image @var{A} must be a grayscale or binary image, and @var{se} must be a -## structuring element. -## -## The opening corresponds to an erosion followed by a dilation of the image, i.e. -## @example -## B = imdilate(imerode(A, se), se); -## @end example -## @seealso{imdilate, imerode, imclose} -## @end deftypefn - -function retval = imopen(im, se) - ## Checkinput - if (nargin != 2) - print_usage(); - endif - if (!ismatrix(im) || !isreal(im)) - error("imopen: first input argument must be a real matrix"); - endif - if (!ismatrix(se) || !isreal(se)) - error("imopen: second input argument must be a real matrix"); - endif - - ## Perform filtering - retval = imdilate(imerode(im, se), se); - -endfunction + +## -*- texinfo -*- +## @deftypefn {Function File} @var{B} = imopen (@var{A}, @var{se}) +## Perform morphological opening on a given image. +## The image @var{A} must be a grayscale or binary image, and @var{se} must be a +## structuring element. +## +## The opening corresponds to an erosion followed by a dilation of the image, i.e. +## @example +## B = imdilate(imerode(A, se), se); +## @end example +## @seealso{imdilate, imerode, imclose} +## @end deftypefn + +function retval = imopen(im, se) + ## Checkinput + if (nargin != 2) + print_usage(); + endif + if (!ismatrix(im) || !isreal(im)) + error("imopen: first input argument must be a real matrix"); + endif + if (!ismatrix(se) || !isreal(se)) + error("imopen: second input argument must be a real matrix"); + endif + + ## Perform filtering + retval = imdilate(imerode(im, se), se); + +endfunction