fixed a bug where when the input image has no segments the resulting label is all boundary values