Energy minimization for bonding panoramas