segmentation with loopy bp