Efficient Algorithms to Implement the Confinement Tree

The aim of this paper is to present a new algorithm to calculate the confinement tree of an image - also known as component tree or dendrone - for which we can prove that its worst-case complexity is O(n log n) where n is the number of pixels. More precisely, in a first part, we present an algorithm which separates the different kinds of operations - which we call scanning, fusion, propagation, and attribute operations - such that we can separately apply complexity analysis on them and such that all operations except propagation stay in O(n). The implementation of the propagation operations is presented in a second part, first in O(nn2), where nn is the number of nodes in the tree (nn ≤ n). This is sufficient if the number of pixels is much larger than the number of nodes (nn ≪ n). Else, we show how to obtain O(nn lognn) complexity for propagation. We construct two example images to investigate the behavior of two known algorithms for which we can show worst-case complexity of O(n2 log n) and O(n2), respectively, and we compare it to our algorithm. Finally, a practical evaluation will be opposed to the theoretical results. Several variations of the implementation will show which operations are time consuming in practice.