1. An object detection sensor which comprises: means capable of taking an image of a predetermined image space; means for calculating a distance between the image pickup means and an object observed in the image of the image space, the distance calculation means operating on receiving an output from the image pickup means; means for detecting a three-dimensional position of an object in the image space, the object position detection means operating on receiving an output from the distance calculation means, wherein the position of an object is detected with respect to the object for which the distance from the image taking means is calculated, based on the calculated distance; means for registering a detection space, which is capable of setting an optional mask space in the image space covered by the image taking means, and which registers a space in the image space, excluding the mask space, as an object detection space; means for judging whether the detected three-dimensional position of the object locates within or outside the registered object detection space, the judgement means operating on receiving outputs from the position detection means and the detection space registration means; and means for outputting an object detection signal, the output means operating on receiving an output from the judgement means, wherein the object detection signal is produced, with a proviso that the detected three-dimensional position of the object locates within the registered object detection space.