compute correlation with safe margins (from rotation near frame edges)s