A method to update an operation pathway for a robotic arm assembly to perform an operation on a patient having a predetermined spatial relationship with a frame including a tag (121, 200) in response to a movement of the patient, comprising: processing a two-dimensional image associated with the tag (121, 200) having the spatial relationship with the patient, wherein a corresponding movement of the tag (121, 200) in response to the movement of the patient is determined based on the spatial relationship, and wherein the tag (121, 200) includes a first point and a second point, and the two-dimensional image includes a first point image and a second point image; associating the first point image with the first point and the second point image with the second point; and identifying the movement of the patient and updating the operation pathway, characterized in that said method comprises using a conversion matrix which describes a mathematical relationship between coordinates of said first and second points (201, 202) of tag (121, 200) in a three-dimensional coordinate system and their corresponding first and second point images (301, 303); and in that the processing the two-dimensional image comprises: discarding blocks not including any pixel having an intensity greater than a threshold from further processing, and enlarging a region including said first and second point images (301, 302) with an enlargement factor, applying additional thresholding techniques to the enlarged first and second point images to identify one or more pixels that have a greater intensity, and shrinking the image with the identified pixels back based on a shrinkage factor, thereby providing new first and second point images (301', 302') with higher intensity. processing a two-dimensional image associated with the tag (121, 200) having the spatial relationship with the patient, wherein a corresponding movement of the tag (121, 200) in response to the movement of the patient is determined based on the spatial relationship, and wherein the tag (121, 200) includes a first point and a second point, and the two-dimensional image includes a first point image and a second point image; associating the first point image with the first point and the second point image with the second point; and identifying the movement of the patient and updating the operation pathway, characterized in that said method comprises using a conversion matrix which describes a mathematical relationship between coordinates of said first and second points (201, 202) of tag (121, 200) in a three-dimensional coordinate system and their corresponding first and second point images (301, 303); and in that the processing the two-dimensional image comprises: discarding blocks not including any pixel having an intensity greater than a threshold from further processing, and enlarging a region including said first and second point images (301, 302) with an enlargement factor, applying additional thresholding techniques to the enlarged first and second point images to identify one or more pixels that have a greater intensity, and shrinking the image with the identified pixels back based on a shrinkage factor, thereby providing new first and second point images (301', 302') with higher intensity. discarding blocks not including any pixel having an intensity greater than a threshold from further processing, and enlarging a region including said first and second point images (301, 302) with an enlargement factor, applying additional thresholding techniques to the enlarged first and second point images to identify one or more pixels that have a greater intensity, and shrinking the image with the identified pixels back based on a shrinkage factor, thereby providing new first and second point images (301', 302') with higher intensity.