Automatic Scene Inference for 3D Object Compositing