adapt perspective to the reference image