An optoelectronic sensor and a method for producing a positive or a negative
object
detection signal in dependence on the presence or non-presence of an object in
a foreground region or in a background region of a region monitored by the sensor.
Transmitted light is transmitted in the direction of the monitored region during
an operating phase. A plurality of received signals are produced in dependence
on the reflected and the received transmitted light which are associated with the
foreground region or with the background region. A difference of the received signals
is compared with a differential threshold to produce the positive or the negative
object detection signal, wherein a switching hysteresis is formed for a change
between the positive and the negative object detection signal. The association
of the received signals with the foreground region and the background region is
changed in dependence on a change in the object detection signal to form the switching hysteresis.