A computer implemented method for determining a center of rotation of a bone, comprising the steps of: a) acquiring image data representing a plurality of images taken by a camera while the bone is being rotated about the center of rotation, wherein the images show a marker device attached to the bone; b) forming a plurality of image pairs from the image data, wherein each image pair comprises two different images; c) determining a first relative position of the marker device relative to the camera from a first image of an image pair; d) determining a second relative position of the marker device relative to the camera from a second image of the same image pair; e) calculating a transformation of the first relative position into the second relative position; f) repeating steps c) to e) for all image pairs to obtain a plurality of transformations; and calculating the location of the center of rotation of the bone relative to the marker device from the plurality of transformations.