timholy/Images.jl — pull request #226 by meggart (2014-11-25 16:19:11+00:00)
Title: Suggestion: changes to label_components function

There are basically 2 changes in this PR.

1. The function signature of `label_components` is extended to work with `Albl::AbstractArray{Int}`.
2. In addition the `Albl` is initialized (zeroed) by the caller and not within the function anymore.

In my typical use cases most of the data is background, so a lot of memory is wasted by allocating the whole output array. I suggest these changes to be able to use other array-like containers like a sparse matrix, a memory-mapped array etc, to write the labels to. A small example would be in this gist https://gist.github.com/meggart/20503e86e18ad21c9bbd