Probabilistic Scene Grammars: A General-Purpose Framework For Scene Understanding