Scene Reconstruction using MRF Optimization with Image Content Adaptive Energy Functions