collect some basic stats while segmenting