This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
region_seg>mask2phisubfunction404
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
36
iptchecknargin(1,2,nargin,mfil...
4040.020 s50.0%
37
iptcheckinput(img,{'double','l...
4040.010 s25.0%
45
d = img;
4040 s0%
44
if isa(img, 'double')
4040 s0%
40
if nargin == 2
4040 s0%
All other lines  0.010 s25.0%
Totals  0.040 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
iptcheckinputMEX-file4040.010 s25.0%
iptchecknarginfunction4040 s0%
Self time (built-ins, overhead, etc.)  0.030 s75.0%
Totals  0.040 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function64
Non-code lines (comments, blank lines)41
Code lines (lines that can run)23
Code lines that did run5
Code lines that did not run18
Coverage (did run/can run)21.74 %
Function listing
   time   calls  line
1 function d = im2double(img, typestr)
2 %IM2DOUBLE Convert image to double precision.
3 % IM2DOUBLE takes an image as input, and returns an image of class double. If
4 % the input image is of class double, the output image is identical to it. If
5 % the input image is not double, IM2DOUBLE returns the equivalent image of
6 % class double, rescaling or offsetting the data as necessary.
7 %
8 % I2 = IM2DOUBLE(I1) converts the intensity image I1 to double
9 % precision, rescaling the data if necessary.
10 %
11 % RGB2 = IM2DOUBLE(RGB1) converts the truecolor image RGB1 to
12 % double precision, rescaling the data if necessary.
13 %
14 % I = IM2DOUBLE(BW) converts the binary image BW to a double-
15 % precision intensity image.
16 %
17 % X2 = IM2DOUBLE(X1,'indexed') converts the indexed image X1 to
18 % double precision, offsetting the data if necessary.
19 %
20 % Class Support
21 % -------------
22 % Intensity and truecolor images can be uint8, uint16, double, logical,
23 % single, or int16. Indexed images can be uint8, uint16, double or
24 % logical. Binary input images must be logical. The output image is double.
25 %
26 % Example
27 % -------
28 % I1 = reshape(uint8(linspace(1,255,25)),[5 5])
29 % I2 = im2double(I1)
30 %
31 % See also DOUBLE, IM2SINGLE, IM2INT16, IM2UINT8, IM2UINT16.
32
33 % Copyright 1993-2010 The MathWorks, Inc.
34 % $Revision: 1.16.4.9.2.1 $ $Date: 2011/07/18 00:33:45 $
35
0.02 404 36 iptchecknargin(1,2,nargin,mfilename);
0.01 404 37 iptcheckinput(img,{'double','logical','uint8','uint16','int16','single'},{}, ...
38 mfilename,'Image',1);
39
404 40 if nargin == 2
41 iptcheckstrs(typestr, {'indexed'}, mfilename, 'type', 2);
42 end
43
404 44 if isa(img, 'double')
404 45 d = img;
46
47 elseif isa(img, 'logical') || isa(img, 'single')
48 d = double(img);
49
50 elseif isa(img, 'uint8') || isa(img, 'uint16')
51 if nargin==1
52 range = getrangefromclass(img);
53 d = double(img) / range(2);
54 else
55 d = double(img)+1;
56 end
57
58 else %int16
59 if nargin == 1
60 d = (double(img) + 32768) / 65535;
61 else
62 error(message('images:im2double:invalidIndexedImage', 'single, or logical.'));
63 end
64 end

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