1. An image processing method performed during a medical procedure, comprising: obtaining an image, wherein the image is generated using a camera, the image having marker images of markers and a background image, the markers being for determining a position associated with a patient; identifying presence of an object in the background image using a processor; and providing a signal for stopping the medical procedure if the presence of the object is identified, so that the object is prevented from being mistakenly used as a marker for determining the position; wherein the method further comprises setting a plurality of foreground pixels in the image that are to be excluded from detection to have a certain grayscale; and wherein the act of providing the signal is performed using the processor.