scipy/scipy — pull request #3033 by thouis (2013-10-30 19:48:04+00:00)
Title: BUG: make ndimage.label properly merge adjacent objects (fixes #3025)

ndimage.label() uses a table of label values that should be merged in
a postprocess. The logic updating this table was faulty. In
particular, if objects A and B were to be marked for mergin, having
already been marked to merge to C and D, respectively, the implied
merge of C and D was not being inferred.