On errors-in-variables regression with arbitrary covariance and its application to optical flow estimation