Search code examples
matlabmatrixmathematical-morphology

details of function bwmorph(image, 'skel') and applylut


I want to understand some detaails of function bwmorph(image, 'skel').

When I typed in matlab console:

type bwmorph

I found such code about function SKEL

%
% Function SKEL
%
function [c,lut] = skel(a)

lut = [];
c = a;
for i = 1:8
    c = applylut(c, lutskel(i));
end

Can I get value of array 'lutskel'?

Second question:

Thanks in advance.


Solution

  • lut stands for look-up-table, and from MATLAB's documentation in the file bwmorph.m,

    The second output argument, LUT, is intentionally undocumented. In the initial release of the Image Processing Toolbox, all the operations supported by bwmorph used a single look-up table, which was returned as the second output argument. In subsequent releases, however, bug fixes and enhancements resulted in some operations no longer using a single look-up table. As a result, the second output argument no longer served the purpose envisioned in the original design of the bwmorph syntax. To reduce compatibility problems, the second output argument was retained in the code, but it has been removed from the documentation. For operations which do not use a single look-up table, the second output argument is returned as [].

    If you try using the second output argument for the 'skel' option, you get []. So there's more than one LUT being used and AFAIK they're unaccessible from functions (probably implemented at a low-level).