A patient monitoring system for monitoring a patient undergoing radiotherapy comprising a projector operable to project a pattern of light onto a patient undergoing radiation treatment, a patient restraint operable to restrain the patient relative to a treatment apparatus, an image detector operable to obtain images of the patient, and a model generation module operable to process images of the patient obtained by the image detector to generate a model of the surface of a portion of the patient, wherein at least a portion of the patient restraint is colored and the model generation module is inhibited from generating a model of the colored portion of the patient restraint.