An objective procedure for drainage network recognition