Fix cv::kmeans function

Reshape input matrix, since the function works with `data` as with `[N x dims]` matrix.