A method for object detection using an optical sensor which has least one 3D camera having an illumination unit and having an image sensor, wherein the optical sensor is adapted to detect objects (20, 20', 20", 24, 24') in a detection zone of the 3D camera on the basis of measurement values of the detection zone , with the measurement values being determined separately for individual picture elements of the image sensor; wherein the method at least comprises the following steps: - determining object detection data at least comprising measurement values (22, 22', 22") of the detection zone which are determined when objects (20, 20', 20", 24, 24') are located in the detection zone and the detection zone is acted on by radiation transmitted by the illumination unit; - determining reference detection data at least comprising measurement values of the detection zone which are determined when no object (20, 20', 20", 24, 24') is located in the detection zone and/or the detection zone is not acted on by radiation transmitted by the illumination unit; and - determining model objects on the basis of the object detection data and of the reference detection data to detect objects in the detection zone , with a respective model object representing a respective object (24, 24") in the detection zone ; wherein the measurement values of the object detection data comprise distance values and intensity values of the detection zone , and wherein the measurement values of the reference detection data comprise reference distance values and reference intensity values of the detection zone , wherein the reference distance values are determined by distance values when no object is located in the detection zone , and wherein the reference intensity values are determined by intensity values when the detection zone is not acted on by radiation transmitted by the illumination unit; wherein difference values are determined which each represent a difference between a distance value of the object detection data and a reference distance value of the reference detection data, and wherein the determination of the respective model object is based on the difference values; and wherein relative values are determined on the basis of a predetermined relation between measurement values of the object detection data and measurement values of the reference detection data , with the difference values being weighted with the relative values. - determining object detection data at least comprising measurement values (22, 22', 22") of the detection zone which are determined when objects (20, 20', 20", 24, 24') are located in the detection zone and the detection zone is acted on by radiation transmitted by the illumination unit; - determining reference detection data at least comprising measurement values of the detection zone which are determined when no object (20, 20', 20", 24, 24') is located in the detection zone and/or the detection zone is not acted on by radiation transmitted by the illumination unit; and - determining model objects on the basis of the object detection data and of the reference detection data to detect objects in the detection zone , with a respective model object representing a respective object (24, 24") in the detection zone ; <EOS>