rewrote OpSegmentation. Output has correct shape, and it is much faster now.