Structured learning for crowd motion segmentation