This is a static copy of a profile report

Home

imerode (7781 calls, 69.857 sec)
Generated 05-Nov-2014 07:52:43 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/images/images/imerode.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imclearborderfunction1721
imclosefunction6060
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
123
B = morphop(A,se,'erode',mfile...
778169.486 s99.5%
121
iptchecknargin(2,5,nargin,mfil...
77810.220 s0.3%
All other lines  0.150 s0.2%
Totals  69.857 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
images/private/morphopfunction778169.206 s99.1%
iptchecknarginfunction77810.050 s0.1%
Self time (built-ins, overhead, etc.)  0.601 s0.9%
Totals  69.857 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function123
Non-code lines (comments, blank lines)121
Code lines (lines that can run)2
Code lines that did run2
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function B = imerode(A,se,varargin)
2 %IMERODE Erode image.
3 % IM2 = IMERODE(IM,SE) erodes the grayscale, binary, or packed binary image
4 % IM, returning the eroded image, IM2. SE is a structuring element
5 % object, or array of structuring element objects, returned by the
6 % STREL function.
7 %
8 % If IM is logical and the structuring element is flat, IMERODE
9 % performs binary erosion; otherwise it performs grayscale erosion. If
10 % SE is an array of structuring element objects, IMERODE performs
11 % multiple erosions of the input image, using each structuring element
12 % in succession.
13 %
14 % IM2 = IMERODE(IM,NHOOD) erodes the image IM, where NHOOD is an array
15 % of 0s and 1s that specifies the structuring element. This is
16 % equivalent to the syntax IMERODE(IM,STREL(NHOOD)). IMERODE uses this
17 % calculation to determine the center element, or origin, of the
18 % neighborhood: FLOOR((SIZE(NHOOD) + 1)/2).
19 %
20 % IM2 = IMERODE(IM,SE,PACKOPT,M) or IMERODE(IM,NHOOD,PACKOPT,M) specifies
21 % whether IM is a packed binary image and, if it is, provides the row
22 % dimension, M, of the original unpacked image. PACKOPT can have
23 % either of these values:
24 %
25 % 'ispacked' IM is treated as a packed binary image as produced
26 % by BWPACK. IM must be a 2-D uint32 array and SE
27 % must be a flat 2-D structuring element. If the
28 % value of PACKOPT is 'ispacked', SHAPE must be
29 % 'same'.
30 %
31 % 'notpacked' IM is treated as a normal array. This is the
32 % default value.
33 %
34 % If PACKOPT is 'ispacked', you must specify a value for M.
35 %
36 % IM2 = IMERODE(...,SHAPE) determines the size of the output image.
37 % SHAPE can have either of these values:
38 %
39 % 'same' Make the output image the same size as the input
40 % image. This is the default value. If the value of
41 % PACKOPT is 'ispacked', SHAPE must be 'same'.
42 %
43 % 'full' Compute the full erosion.
44 %
45 % Class Support
46 % -------------
47 % IM can be numeric or logical and it can be of any dimension. If IM is
48 % logical and the structuring element is flat, then output will be
49 % logical; otherwise the output will have the same class as the input. If
50 % the input is packed binary, then the output is also packed binary.
51 %
52 % Examples
53 % --------
54 % Erode the binary image in text.png with a vertical line:
55 %
56 % originalBW = imread('text.png');
57 % se = strel('line',11,90);
58 % erodedBW = imerode(originalBW,se);
59 % figure, imshow(originalBW)
60 % figure, imshow(erodedBW)
61 %
62 % Erode the grayscale image in cameraman.tif with a rolling ball:
63 %
64 % originalI = imread('cameraman.tif');
65 % se = strel('ball',5,5);
66 % erodedI = imerode(originalI,se);
67 % figure, imshow(originalI), figure, imshow(erodedI)
68 %
69 % See also BWHITMISS, BWPACK, BWUNPACK, CONV2, FILTER2, IMCLOSE,
70 % IMDILATE, IMOPEN, STREL.
71
72 % Copyright 1993-2004 The MathWorks, Inc.
73 % $Revision: 1.14.4.5 $ $Date: 2004/08/10 01:40:10 $
74
75 % Testing notes
76 % Syntaxes
77 % --------
78 % B = imerode(A,se)
79 % B = imerode(A,se,packopt)
80 % B = imerode(A,se,packopt,M)
81 % B = imerode(...,padopt)
82 %
83 % A: numeric or logical, real, full, N-D array. May be empty.
84 % May contain Infs. May not contain NaNs. Required.
85 %
86 % se: A single STREL object, a STREL array, or a real, full, double,
87 % N-D array containing 0s and 1s. If se is an empty array of
88 % strels, then B should be the same as A, unless the input is
89 % logical and not packed, in which case B should be
90 % uint8(A ~= 0). If se contains no neighbors (e.g.,
91 % strel(zeros(3,3))), then B should be filled with the maximum
92 % value for its type. Required.
93 %
94 % packopt: Either 'ispacked' or 'notpacked'. May be abbreviated; case
95 % insensitive match. Optional. Defaults to 'notpacked' if not
96 % specified.
97 %
98 % M: Integer specifying the unpacked row dimension of the input
99 % image. Required if packopt is 'ispacked'; otherwise
100 % optional and not used.
101 %
102 % padopt: Either 'same' or 'full'. May be abbreviated; case insensitive
103 % match. Optional. Defaults to 'same' if not specified.
104 %
105 % B: Array of the same size and class as A. Exception: if A is
106 % logical and the strel is all flat and packopt is 'notpacked',
107 % then B is a logical array.
108 %
109 % Key logic branches:
110 %
111 % se: flat or nonflat?
112 % se: array or single strel?
113 % se: decomposed or nondecomposed?
114 % se: 2-D or N-D?
115 % A: logical or nonlogical?
116 % A: uint8 or not?
117 % A: uint32 or not?
118 % packopt: 'ispacked' or 'notpacked'?
119 % padopt: 'full' or 'same'?
120
0.22 7781 121 iptchecknargin(2,5,nargin,mfilename);
122
69.49 7781 123 B = morphop(A,se,'erode',mfilename,varargin{:});