This is a static copy of a profile reportHome
bwunpack (202 calls, 0.100 sec)
Generated 05-Nov-2014 07:52:45 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/images/images/bwunpack.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
38 | iptcheckinput(varargin{1}, {'u... | 202 | 0.030 s | 30.0% |  |
48 | BW = bwunpackc(BWP,M); | 202 | 0.020 s | 20.0% |  |
45 | iptcheckinput(varargin{2}, {'n... | 202 | 0.010 s | 10.0% |  |
42 | if nargin ~= 2 | 202 | 0.010 s | 10.0% |  |
37 | iptchecknargin(1,2,nargin,mfil... | 202 | 0.010 s | 10.0% |  |
All other lines | | | 0.020 s | 20.0% |  |
Totals | | | 0.100 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 49 |
Non-code lines (comments, blank lines) | 39 |
Code lines (lines that can run) | 10 |
Code lines that did run | 9 |
Code lines that did not run | 1 |
Coverage (did run/can run) | 90.00 % |
Function listing
time calls line
1 function BW = bwunpack(varargin)
2 %BWUNPACK Unpack binary image.
3 % BW = BWUNPACK(BWP,M) unpacks the packed binary image BWP. BWP is a
4 % uint32 array. When it unpacks BWP, BWUNPACK maps the least
5 % significant bit of the first row of BWP to the first pixel in the
6 % first row of BW. The most significant bit of the first element of
7 % BWP maps to the first pixel in the 32nd row of BW, and so on. BW is
8 % M-by-N, where N is the number of columns of BWP. If M is omitted,
9 % its default value is 32*SIZE(BWP,1).
10 %
11 % Binary image packing is used to accelerate some binary morphological
12 % operations, such as dilation and erosion. If the input to IMDILATE or
13 % IMERODE is a packed binary image, the functions use a specialized
14 % routine to perform the operation faster.
15 %
16 % BWPACK is used to create packed binary images.
17 %
18 % Class Support
19 % -------------
20 % BWP must be uint32, and it must be real, 2-D, and nonsparse. M must be a
21 % positive integer. BW is logical.
22 %
23 % Example
24 % -------
25 % Pack, dilate, and unpack a binary image:
26 %
27 % bw = imread('text.png');
28 % bwp = bwpack(bw);
29 % bwp_dilated = imdilate(bwp,ones(3,3),'ispacked');
30 % bw_dilated = bwunpack(bwp_dilated, size(bw,1));
31 %
32 % See also BWPACK, IMDILATE, IMERODE.
33
34 % Copyright 1993-2003 The MathWorks, Inc.
35 % $Revision: 1.8.4.4 $ $Date: 2004/08/10 01:38:50 $
36
0.01 202 37 iptchecknargin(1,2,nargin,mfilename);
0.03 202 38 iptcheckinput(varargin{1}, {'uint32'}, {'real','2d','nonsparse'}, ...
39 mfilename, 'BWP', 1);
202 40 BWP = varargin{1};
41
0.01 202 42 if nargin ~= 2
43 BW = bwunpackc(BWP);
202 44 else
0.01 202 45 iptcheckinput(varargin{2}, {'numeric'}, {'scalar','integer','nonnegative'}, ...
46 mfilename, 'M', 2);
202 47 M = varargin{2};
0.02 202 48 BW = bwunpackc(BWP,M);
202 49 end