rough_cal_3d function

Estimate scale factors and offsets