Add functions to apply an area opening and to compute granulometry.