A solution for image orientation of close range blocks