This is a static copy of a profile report

Home

imclose (6060 calls, 135.718 sec)
Generated 05-Nov-2014 07:53:22 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/images/images/imclose.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
find_cell_codesfunction6060
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
50
B = imerode(imdilate(A,SE,pack...
6060133.425 s98.3%
40
[A,SE,pre_pack] = ParseInputs(...
60602.083 s1.5%
48
end
60600.030 s0.0%
47
packopt = 'notpacked';
60600.030 s0.0%
43
if pre_pack
60600.030 s0.0%
All other lines  0.120 s0.1%
Totals  135.718 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
imdilatefunction606066.672 s49.1%
imerodefunction606066.592 s49.1%
imclose>ParseInputssubfunction60601.953 s1.4%
Self time (built-ins, overhead, etc.)  0.501 s0.4%
Totals  135.718 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function54
Non-code lines (comments, blank lines)42
Code lines (lines that can run)12
Code lines that did run8
Code lines that did not run4
Coverage (did run/can run)66.67 %
Function listing
   time   calls  line
1 function B = imclose(varargin)
2 %IMCLOSE Morphologically close image.
3 % IM2 = IMCLOSE(IM,SE) performs morphological closing on the
4 % grayscale or binary image IM with the structuring element SE. SE
5 % must be a single structuring element object, as opposed to an array
6 % of objects.
7 %
8 % IMCLOSE(IM,NHOOD) performs closing with the structuring element
9 % STREL(NHOOD), where NHOOD is an array of 0s and 1s that specifies the
10 % structuring element neighborhood.
11 %
12 % The morphological close operation is a dilation followed by an erosion,
13 % using the same structuring element for both operations.
14 %
15 % Class Support
16 % -------------
17 % IM can be any numeric or logical class and any dimension, and must be
18 % nonsparse. If IM is logical, then SE must be flat. IM2 has the same
19 % class as IM.
20 %
21 % Example
22 % -------
23 % Use IMCLOSE on cirles.png image to join the circles together by filling
24 % in the gaps between the circles and by smoothening their outer edges.
25 % Use a disk structuring element to preserve the circular nature of the
26 % object. Choose the disk element to have a radius of 10 pixels so that
27 % the largest gap gets filled.
28 %
29 % originalBW = imread('circles.png');
30 % figure, imshow(originalBW);
31 % se = strel('disk',10);
32 % closeBW = imclose(originalBW,se);
33 % figure, imshow(closeBW);
34 %
35 % See also IMDILATE, IMERODE, IMOPEN, STREL.
36
37 % Copyright 1993-2010 The MathWorks, Inc.
38 % $Revision: 1.10.4.13.2.1 $ $Date: 2011/07/18 00:33:56 $
39
2.08 6060 40 [A,SE,pre_pack] = ParseInputs(varargin{:});
41
6060 42 M = size(A,1);
0.03 6060 43 if pre_pack
44 A = bwpack(A);
45 packopt = 'ispacked';
0.02 6060 46 else
0.03 6060 47 packopt = 'notpacked';
0.03 6060 48 end
49
133.42 6060 50 B = imerode(imdilate(A,SE,packopt,M),SE,packopt,M);
51
0.01 6060 52 if pre_pack
53 B = bwunpack(B,M);
54 end

Other subfunctions in this file are not included in this listing.