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 (22, 22', 22') of the detection zone, with the measurement values (22, 22', 22') 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 (26, 26') on the basis of the object detection data and of the reference detection data to detect objects (24, 24') in the detection zone, with a respective model object (26, 26') 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 (26, 26') 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 (42, 44), with the difference values being weighted (46, 48) 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 (26, 26') on the basis of the object detection data and of the reference detection data to detect objects (24, 24') in the detection zone, with a respective model object (26, 26') representing a respective object (24, 24") in the detection zone;