B. Serge and M. Beatriz, P algorithm, a dramatic enhancement of the waterfall transformation. CMM/Mines Paristech publication, 2009.

B. Nicolas, MAMBA documentation.(mambaApi Reference Manual)Web documents (available at http://www.mamba-image, pp.2009-2011

B. Serge, Watershed, hierarchical segmentation and waterfall algorithm, Proc

M. Beatriz, C. Beucher-serge-springer, L. Ronse, E. Najman, and . Decencière, logic(imWrk0, imWrk1, imWrk0, "sup") imOut.reset() nbLevels = 0 mamba.threshold(imWrk1, imWrk4, 1, 255) flag = not(mamba.checkEmptiness(imWrk4)) while flag: hierarchy(imWrk1, imWrk4, imWrk2, grid=grid) mamba.add(imOut, imWrk4, imOut) mC.valuedWatershed(imWrk2, imWrk3, grid=grid) mamba.threshold(imWrk3, imWrk4, 1, 255) flag = not(mamba.checkEmptiness(imWrk4)) hierarchy(imWrk3, imWrk4, imWrk2, grid=grid) mamba.generateSupMask(imWrk0, imWrk2, imWrk4, strict=False) mamba.convertByMask(imWrk4, imWrk3, 0, 255) mamba.logic(imWrk1, imWrk3, imWrk3, "inf") mamba.negate(imWrk4, imWrk4) mamba.label(imWrk4, imWrk5, grid=grid) mamba.watershedSegment(imWrk3, imWrk5, grid=grid) mamba.copyBytePlane(imWrk5, 3, imWrk3) mamba.logic(imWrk1, imWrk2, imWrk1, "sup") mamba.logic(imWrk1, imWrk3, imWrk1, "inf") mamba.threshold(imWrk1, imWrk4, 1, 255) nbLevels += 1 return nbLevels def generalSegment(imIn, imOut, gain=2.0, offset=1, grid=mamba.DEFAULT_GRID) General segmentation algorithm. This algorithm is controlled by two parameters: the 'gain' (identical to the gain used in standard and P segmentation) and a new one, the 'offset'. The 'offset' indicates which level of hierarchy is compared to the current hierarchical image. The 'offset' is relative to the current hierarchical level. If 'offset' is equal to 1, this operator corresponds to the standard segmentation, if 'offset' is equal to 255 (this value stands for the infinity), the operator is equivalent to P algorithm. Image 'imOut' contains all these hierarchies which are embedded. 'imIn' and 'imOut' must be greyscale images. 'imIn' and 'imOut' must be different. This transformation returns the number of hierarchical levels(imWrk6)[1]) mamba.copyBytePlane(imWrk6, 0, imWrk0) mamba.convert(imWrk4, imWrk2) mamba.logic(imWrk0, imWrk2, imWrk0, "sup") mamba.logic(imWrk0, imWrk1, imWrk0 Extended (experimental) segmentation algorithm This algorithm is controlled by image 'imTest'. The current hierarchical image is compared to image 'imTest'. This image must be a greyscale image. The 'offset' indicates which level of hierarchy is compared to the current hierarchical image. The 'offset' is relative to the current hierarchical level (by default, 'offset' is equal to 255, so that the initial segmentation is used), Mathematical Morphology: 40 Years on : Proceedings of the 7th ISMM, pp.1-1, 2005.