First time here? Check out the FAQ!
answered 2014-12-06 17:31:42 -0600
According to this SO answer, the OpenCV FitLine function already does this.