This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
strel>MakeDiskStrelsubfunction404
imclosefunction6060
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
121
B = morphop(A,se,'dilate',mfil...
646468.515 s99.5%
119
iptchecknargin(2,4,nargin,mfil...
64640.260 s0.4%
All other lines  0.090 s0.1%
Totals  68.865 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
images/private/morphopfunction646468.345 s99.2%
iptchecknarginfunction64640.120 s0.2%
Self time (built-ins, overhead, etc.)  0.401 s0.6%
Totals  68.865 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function121
Non-code lines (comments, blank lines)119
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 = imdilate(A,se,varargin)
2 %IMDILATE Dilate image.
3 % IM2 = IMDILATE(IM,SE) dilates the grayscale, binary, or packed binary
4 % image IM, returning the dilated image, IM2. SE is a structuring element
5 % object, or array of structuring element objects, returned by the STREL
6 % function.
7 %
8 % If IM is logical (binary), then the structuring element must be flat
9 % and IMDILATE performs binary dilation. Otherwise, it performs
10 % grayscale dilation. If SE is an array of structuring element
11 % objects, IMDILATE performs multiple dilations, using each
12 % structuring element in SE in succession.
13 %
14 % IM2 = IMDILATE(IM,NHOOD) dilates the image IM, where NHOOD is a
15 % matrix of 0s and 1s that specifies the structuring element
16 % neighborhood. This is equivalent to the syntax IIMDILATE(IM,
17 % STREL(NHOOD)). IMDILATE determines the center element of the
18 % neighborhood by FLOOR((SIZE(NHOOD) + 1)/2).
19 %
20 % IM2 = IMDILATE(IM,SE,PACKOPT) or IMDILATE(IM,NHOOD,PACKOPT) specifies
21 % whether IM is a packed binary image. PACKOPT can have either of
22 % these values:
23 %
24 % 'ispacked' IM is treated as a packed binary image as produced
25 % by BWPACK. IM must be a 2-D uint32 array and SE
26 % must be a flat 2-D structuring element. If the
27 % value of PACKOPT is 'ispacked', SHAPE must be
28 % 'same'.
29 %
30 % 'notpacked' IM is treated as a normal array. This is the
31 % default value.
32 %
33 % IM2 = IMDILATE(...,SHAPE) determines the size of the output image.
34 % SHAPE can have either of these values:
35 %
36 % 'same' Make the output image the same size as the input
37 % image. This is the default value. If the value of
38 % PACKOPT is 'ispacked', SHAPE must be 'same'.
39 %
40 % 'full' Compute the full dilation.
41 %
42 % Class Support
43 % -------------
44 % IM can be logical or numeric and must be real and nonsparse. It can
45 % have any dimension. The output has the same class as the input. If
46 % the input is packed binary, then the output is also packed binary.
47 %
48 % Examples
49 % --------
50 % Dilate the binary image in text.png with a vertical line:
51 %
52 % originalBW = imread('text.png');
53 % se = strel('line',11,90);
54 % dilatedBW = imdilate(originalBW,se);
55 % figure, imshow(originalBW), figure, imshow(dilatedBW)
56 %
57 % Dilate the grayscale image in cameraman.tif with a rolling ball:
58 %
59 % originalI = imread('cameraman.tif');
60 % se = strel('ball',5,5);
61 % dilatedI = imdilate(originalI,se);
62 % figure, imshow(originalI), figure, imshow(dilatedI)
63 %
64 % Determine the domain of the composition of two flat structuring
65 % elements by dilating the scalar value 1 with both structuring
66 % elements in sequence, using the 'full' option:
67 %
68 % se1 = strel('line',3,0);
69 % se2 = strel('line',3,90);
70 % composition = imdilate(1,[se1 se2],'full')
71 %
72 % See also BWHITMISS, BWPACK, BWUNPACK, CONV2, FILTER2, IMCLOSE,
73 % IMERODE, IMOPEN, STREL.
74
75 % Copyright 1993-2004 The MathWorks, Inc.
76 % $Revision: 1.13.4.6 $ $Date: 2004/08/10 01:40:08 $
77
78 % Testing notes
79 % Syntaxes
80 % --------
81 % B = imdilate(A,se)
82 % B = imdilate(A,se,packopt)
83 % B = imdilate(...,padopt)
84 %
85 % A: numeric or logical, real, full, N-D array. May be empty.
86 % May contain Infs or NaNs. Required.
87 %
88 % se: A single STREL object, a STREL array, or a real, full, double,
89 % N-D array containing 0s and 1s. If se is an empty array of
90 % strels, then B should be the same as A, unless the input is
91 % logical and not packed, in which case B should be
92 % uint8(A ~= 0). If se contains no neighbors (e.g.,
93 % strel(zeros(3,3))), then B should be filled with the minimum
94 % value for its type. Must be flat if A is logical. Required.
95 %
96 % packopt: Either 'ispacked' or 'notpacked'. May be abbreviated; case
97 % insensitive match. Optional. Defaults to 'notpacked' if not
98 % specified.
99 %
100 % padopt: Either 'same' or 'full'. May be abbreviated; case insensitive
101 % match. Optional. Defaults to 'same' if not specified.
102 %
103 % B: Array of the same size and class as A. Exception: if A is
104 % logical and the strel is all flat and packopt is 'notpacked',
105 % then B is a logical uint8.
106 %
107 % Key logic branches:
108 %
109 % se: flat or nonflat?
110 % se: array or single strel?
111 % se: decomposed or nondecomposed?
112 % se: 2-D or N-D?
113 % A: logical or nonlogical?
114 % A: uint8 or not?
115 % A: uint32 or not?
116 % packopt: 'ispacked' or 'notpacked'?
117 % padopt: 'full' or 'same'?
118
0.26 6464 119 iptchecknargin(2,4,nargin,mfilename);
120
68.51 6464 121 B = morphop(A,se,'dilate',mfilename,varargin{:});