Structured learning for social group detection in crowds