This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
ml_findobjsfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
76
[L,num] = bwlabelnmex(A,conn);
4044.426 s97.1%
74
[A,conn] = parse_inputs(vararg...
4040.120 s2.6%
All other lines  0.010 s0.2%
Totals  4.556 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
images/private/bwlabelnmexMEX-file4044.416 s96.9%
bwlabeln>parse_inputssubfunction4040.110 s2.4%
Self time (built-ins, overhead, etc.)  0.030 s0.7%
Totals  4.556 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function76
Non-code lines (comments, blank lines)74
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 [L,num] = bwlabeln(varargin)
2 %BWLABELN Label connected components in binary image.
3 % L = BWLABELN(BW) returns a label matrix, L, containing labels for the
4 % connected components in BW. BW can have any dimension; L is the same
5 % size as BW. The elements of L are integer values greater than or equal
6 % to 0. The pixels labeled 0 are the background. The pixels labeled 1
7 % make up one object, the pixels labeled 2 make up a second object, and
8 % so on. The default connectivity is 8 for two dimensions, 26 for three
9 % dimensions, and CONNDEF(NDIMS(BW),'maximal') for higher dimensions.
10 %
11 % [L,NUM] = BWLABELN(BW) returns the number of connected objects found in
12 % BW.
13 %
14 % [L,NUM] = BWLABELN(BW,CONN) specifies the desired connectivity. CONN
15 % may have the following scalar values:
16 %
17 % 4 two-dimensional four-connected neighborhood
18 % 8 two-dimensional eight-connected neighborhood
19 % 6 three-dimensional six-connected neighborhood
20 % 18 three-dimensional 18-connected neighborhood
21 % 26 three-dimensional 26-connected neighborhood
22 %
23 % Connectivity may be defined in a more general way for any dimension by
24 % using a 3-by-3-by- ... -by-3 matrix of 0s and 1s. The 1-valued
25 % elements define neighborhood locations relative to the center element
26 % of CONN. CONN must be symmetric about its center element.
27 %
28 % Note: On the use of BWLABEL, BWLABELN, BWCONNCOMP, and REGIONPROPS
29 % ------------------------------------------------------------------
30 % The functions BWLABEL, BWLABELN, and BWCONNCOMP all compute connected
31 % components for binary images. BWCONNCOMP is the most recent addition
32 % to the Image Processing Toolbox and is intended to replace the use
33 % of BWLABEL and BWLABELN. It uses significantly less memory and is
34 % sometimes faster than the older functions.
35 %
36 % Input Output Memory Connectivity
37 % Dim Form Use
38 % ----------------------------------------------
39 % BWLABEL 2-D Double-precision High 4 or 8
40 % label matrix
41 %
42 % BWLABELN N-D Double-precision High Any
43 % label matrix
44 %
45 % BWCONNCOMP N-D CC struct Low Any
46 %
47 % To extract features from a binary image using REGIONPROPS using the
48 % default connectivity, just pass BW directly into REGIONPROPS, i.e.,
49 % REGIONPROPS(BW).
50 %
51 % To compute a label matrix having a more memory-efficient data type
52 % (e.g., uint8 versus double), use the LABELMATRIX function on the output
53 % of BWCONNCOMP.
54 %
55 % See the documentation for more information.
56 %
57 % Class Support
58 % -------------
59 % BW can be numeric or logical, and it must be real and nonsparse. L
60 % is of class double.
61 %
62 % Example
63 % -------
64 % BW = cat(3,[1 1 0; 0 0 0; 1 0 0],...
65 % [0 1 0; 0 0 0; 0 1 0],...
66 % [0 1 1; 0 0 0; 0 0 1])
67 % bwlabeln(BW)
68 %
69 % See also BWCONNCOMP,BWLABEL,LABELMATRIX,LABEL2RGB,REGIONPROPS.
70
71 % Copyright 1993-2008 The MathWorks, Inc.
72 % $Revision: 1.8.4.4 $ $Date: 2008/09/13 06:55:41 $
73
0.12 404 74 [A,conn] = parse_inputs(varargin{:});
75
4.43 404 76 [L,num] = bwlabelnmex(A,conn);

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