This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
bwboundaries>FindHoleBoundariessubfunction1721
imfillfunction36354
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
35
im2 = imcomplementmex(im);
380752.343 s65.9%
36
end
380750.270 s7.6%
29
if isa(im, 'double') &&...
380750.220 s6.2%
34
else
380750.100 s2.8%
All other lines  0.621 s17.5%
Totals  3.555 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
images/private/imcomplementmexMEX-file380751.913 s53.8%
Self time (built-ins, overhead, etc.)  1.642 s46.2%
Totals  3.555 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function36
Non-code lines (comments, blank lines)31
Code lines (lines that can run)5
Code lines that did run4
Code lines that did not run1
Coverage (did run/can run)80.00 %
Function listing
   time   calls  line
1 function im2 = imcomplement(im)
2 %IMCOMPLEMENT Complement image.
3 % IM2 = IMCOMPLEMENT(IM) computes the complement of the image IM. IM
4 % can be a binary, intensity, or truecolor image. IM2 has the same class and
5 % size as IM.
6 %
7 % In the complement of a binary image, black becomes white and white becomes
8 % black. For example, the complement of this binary image, true(3), is
9 % false(3). In the case of a grayscale or truecolor image, dark areas
10 % become lighter and light areas become darker.
11 %
12 % Note
13 % ----
14 % If IM is double or single, you can use the expression 1-IM instead of this
15 % function. If IM is logical, you can use the expression ~IM instead of
16 % this function.
17 %
18 % Example
19 % -------
20 % I = imread('glass.png');
21 % J = imcomplement(I);
22 % figure, imshow(I), figure, imshow(J)
23 %
24 % See also IMABSDIFF, IMADD, IMDIVIDE, IMLINCOMB, IMMULTIPLY, IMSUBTRACT.
25
26 % Copyright 1993-2004 The MathWorks, Inc.
27 % $Revision: 1.12.4.6 $ $Date: 2009/01/16 11:02:44 $
28
0.22 38075 29 if isa(im, 'double') && ~isreal(im)
30 % Handle double complex case for backward compatibility only.
31 % Previous code version errored on complex input for all types
32 % except double.
33 im2 = 1 - im;
0.10 38075 34 else
2.34 38075 35 im2 = imcomplementmex(im);
0.27 38075 36 end

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