A computer-implemented method to determine the dimensions (a, b, c) and distance (D1, D2) of a number of objects (O1, O2) in an environment comprising the steps: - providing a number of objects (O1, O2), each comprising a marking element (M1, M2), in the environment, - recording a visual image-dataset (ID) of at least one of the number of objects (O1, O2) with a camera , wherein in the course of recording a visual image-dataset (ID), an image with different focus points is recorded, - determining a parameter value (V) from the image of a marking element (M1 i , M2 i ) in the image-dataset (ID), wherein the parameter value (PV) is a value depending on the distance (D1, D2) of an object of the number of objects (O1, O2) each comprising a marking element (M1, M2) to the camera , - calculating the relative distance between the object (O1, O2) and the camera based on this parameter value (PV), - calculating dimensions (a, b, c) of the object (O1, O2) from at least a part of the image of the object (O1, O2) in the image-dataset (ID) and the calculated distance (D1, D2), wherein the dimensions (a, b, c) of the object (O1, O2) is determined by - slicing the area around a marking element (M1, M2) wherein the slices comprise images recorded with different focus points (FP), and - observing the depth of the recorded light field and/or the sharpness of the image in the slices and calculating image-dimensions of the image of the object (O1, O2) based on the depth of the recorded light field and/or the sharpness of the image, - determining the dimensions (a, b, c) of the object (O1, O2) based on the image- dimensions of the image of the object (O1, O2), the dimensions of the marking element (M1, M2) and the known values of a focusing optic of the camera . - providing a number of objects (O1, O2), each comprising a marking element (M1, M2), in the environment, - recording a visual image-dataset (ID) of at least one of the number of objects (O1, O2) with a camera , wherein in the course of recording a visual image-dataset (ID), an image with different focus points is recorded, - determining a parameter value (V) from the image of a marking element (M1 i , M2 i ) in the image-dataset (ID), wherein the parameter value (PV) is a value depending on the distance (D1, D2) of an object of the number of objects (O1, O2) each comprising a marking element (M1, M2) to the camera , - calculating the relative distance between the object (O1, O2) and the camera based on this parameter value (PV), - calculating dimensions (a, b, c) of the object (O1, O2) from at least a part of the image of the object (O1, O2) in the image-dataset (ID) and the calculated distance (D1, D2), - slicing the area around a marking element (M1, M2) wherein the slices comprise images recorded with different focus points (FP), and - observing the depth of the recorded light field and/or the sharpness of the image in the slices and calculating image-dimensions of the image of the object (O1, O2) based on the depth of the recorded light field and/or the sharpness of the image, - determining the dimensions (a, b, c) of the object (O1, O2) based on the image- dimensions of the image of the object (O1, O2), the dimensions of the marking element (M1, M2) and the known values of a focusing optic of the camera . <EOS>