I have a bunch of points that lay on a surface on a cylinder/tube. How can I calculate the properties of this tube (radius and direction)?
The only way I can come up with is to assume find the direction vector using a least square fit, but I cant come up with the correct minimizing function. Maybe there is a better way than least square fit?
It is ok to assume that the points are evently spaced/spread out around the tube.
Did you consider looking at the PCA of the point cloud? The eigen directions will show you where the long direction of the cylinder is pointing, and then you can project all the points to a plane that is orthogonal to the long axis and fit to a circle.