Bugfix to potential inaccuracy in function:polyfit

1.Modify the default datatype(CV_32F) to CV_64F.
2.Re-write the generation of X matrix,reducing the times of multiplication.
The problem has been reported at http://code.opencv.org/issues/2887