split up some stuff in SetSegmentation into separate methods
fixed issue where the FrameGrabber thread would not terminate