Hough Transform not working to recognize a line
What you want is just to find the function 

$$y(x) = mx + q$$

that fits through the centroids you've found.

You wouldn't do a Hough transform on that (since Hough transforms generally perform badly in presence of only few representatives of the full line, and are pretty computationally intense), but simply look for something like the least squared error fit of a $y(x)$ through the $(x_i, y_i)$ tuples given by the coordinates of your centroids.