A method for improving the accuracy of a digital medical model of a part of a patient, the medical model comprising at least 2 medical images recorded with a cone beam computed tomography (CBCT) device, the method comprising: - obtaining a set of at least 2 medical images of the patient, where an element was attached to the patient during the recording of the medical images; - obtaining at least 2 tracking images taken during the acquisition of the medical images with at least one camera having a known positional relationship relative to the CBCT device, said tracking images depicting at least part of the element; - determining any movement of the element between acquisition of the at least 2 tracking images; and - generating the digital medical model from the acquired medical images, wherein the determined movement of the element is used to compensate for any movement of the patient between the acquisition of the medical images, characterized in that the element comprises a plurality of fiducial markers in a predefined pattern, size, shape and/or colour, and in that compensating for any movement of the patient between the acquisition of the medical images comprises: - associating a time stamp with each of the medical images, and each of the tracking images; - determining the position and orientation of the element at each time stamp and determining therefrom the movement of the element during medical image acquisition; and wherein compensating for any movement of the patient between the acquisition of the medical images further comprises: - adjusting the position of each pixel or voxel of the acquired medical image with an amount corresponding to the movement of the element, OR - generating the digital medical model from the acquired medical images, wherein the generating of the digital medical model comprises iteratively adjusting the digital medical model to account for the movement of the element during medical image acquisition. - obtaining a set of at least 2 medical images of the patient, where an element was attached to the patient during the recording of the medical images; - obtaining at least 2 tracking images taken during the acquisition of the medical images with at least one camera having a known positional relationship relative to the CBCT device, said tracking images depicting at least part of the element; - determining any movement of the element between acquisition of the at least 2 tracking images; and - generating the digital medical model from the acquired medical images, wherein the determined movement of the element is used to compensate for any movement of the patient between the acquisition of the medical images, - associating a time stamp with each of the medical images, and each of the tracking images; - determining the position and orientation of the element at each time stamp and determining therefrom the movement of the element during medical image acquisition; and - adjusting the position of each pixel or voxel of the acquired medical image with an amount corresponding to the movement of the element, OR - generating the digital medical model from the acquired medical images, wherein the generating of the digital medical model comprises iteratively adjusting the digital medical model to account for the movement of the element during medical image acquisition.