This is a static copy of a profile report

Home

images/private/morphop>PadSize (12524 calls, 4.707 sec)
Generated 05-Nov-2014 07:53:22 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/private/morphop.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
images/private/morphopfunction12524
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
363
offsets{k} = [offsets{k} zeros...
739321.001 s21.3%
373
pad_ul = pad_ul + max(0, -min(...
739320.621 s13.2%
374
pad_lr = pad_lr + max(0, max(o...
739320.431 s9.1%
372
if ~isempty(offsets_k)
739320.360 s7.7%
360
num_dims = max(num_dims, size(...
614080.300 s6.4%
All other lines  1.993 s42.3%
Totals  4.707 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function34
Non-code lines (comments, blank lines)8
Code lines (lines that can run)26
Code lines that did run24
Code lines that did not run2
Coverage (did run/can run)92.31 %
Function listing
   time   calls  line
351 function [pad_ul, pad_lr] = PadSize(offsets,op_type)
352
0.06 12524 353 if isempty(offsets)
354 pad_ul = zeros(1,2);
355 pad_lr = zeros(1,2);
356
0.01 12524 357 else
0.05 12524 358 num_dims = size(offsets{1},2);
0.04 12524 359 for k = 2:length(offsets)
0.30 61408 360 num_dims = max(num_dims, size(offsets{k},2));
0.12 61408 361 end
0.07 12524 362 for k = 1:length(offsets)
1.00 73932 363 offsets{k} = [offsets{k} zeros(size(offsets{k},1),...
364 num_dims - size(offsets{k},2))];
0.27 73932 365 end
366
0.06 12524 367 pad_ul = zeros(1,num_dims);
0.08 12524 368 pad_lr = zeros(1,num_dims);
369
0.07 12524 370 for k = 1:length(offsets)
0.29 73932 371 offsets_k = offsets{k};
0.36 73932 372 if ~isempty(offsets_k)
0.62 73932 373 pad_ul = pad_ul + max(0, -min(offsets_k,[],1));
0.43 73932 374 pad_lr = pad_lr + max(0, max(offsets_k,[],1));
0.23 73932 375 end
0.21 73932 376 end
377
0.06 12524 378 if strcmp(op_type,'erode')
379 % Swap
0.05 6060 380 tmp = pad_ul;
0.03 6060 381 pad_ul = pad_lr;
0.02 6060 382 pad_lr = tmp;
6060 383 end
0.09 12524 384 end

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