This is a static copy of a profile reportHome
strel>MakeArbitraryStrel (1721 calls, 0.651 sec)
Generated 05-Nov-2014 07:53:18 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/strel.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 |
703 | se = strel; | 1721 | 0.551 s | 84.6% |  |
704 | se.nhood = nhood ~= 0; | 1721 | 0.060 s | 9.2% |  |
707 | if (~isempty(nhood) &&... | 1721 | 0.020 s | 3.1% |  |
705 | se.height = height; | 1721 | 0.010 s | 1.5% |  |
726 | end | 1721 | 0 s | 0% |  |
All other lines | | | 0.010 s | 1.5% |  |
Totals | | | 0.651 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
strel>strel.strel | subfunction | 1721 | 0.461 s | 70.8% |  |
Self time (built-ins, overhead, etc.) | | | 0.190 s | 29.2% |  |
Totals | | | 0.651 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 9 |
Code lines (lines that can run) | 17 |
Code lines that did run | 5 |
Code lines that did not run | 12 |
Coverage (did run/can run) | 29.41 % |
Function listing
time calls line
701 function se = MakeArbitraryStrel(nhood,height)
702
0.55 1721 703 se = strel;
0.06 1721 704 se.nhood = nhood ~= 0;
0.01 1721 705 se.height = height;
706
0.02 1721 707 if (~isempty(nhood) && all(nhood(:)) && ~any(height(:)))
708 % Strel is flat with an all-ones neighborhood. Decide whether to decompose
709 % it.
710 size_nhood = size(nhood);
711 % Heuristic --- if theoretical computation advantage is
712 % at least a factor of two, then assume that the advantage
713 % is worth the overhead cost of performing dilation or erosion twice.
714 advantage = prod(size_nhood) / sum(size_nhood);
715 if (advantage >= 2)
716 num_dims = ndims(nhood);
717 se.decomposition = strel;
718 for k = 1:ndims(nhood)
719 size_k = ones(1,num_dims);
720 size_k(k) = size(nhood,k);
721 se.decomposition(k) = strel(ones(size_k));
722 end
723 end
724 end
725
1721 726 end
Other subfunctions in this file are not included in this listing.