Computer-implemented method for providing training image data (TBD) for training an object recognition function (F0), wherein the method comprises the following steps: S1 Providing at least one annotated image (AB), wherein the annotated image (AB) has a multiplicity of electronic components to be detected (O1, O2, 031, O32, 041, O42, O43, O5) on a background designed as a printed circuit board with annotations (L1, L2) assigned to the electronic components to be detected, wherein each annotation (L1, L2) describes an image area in which the corresponding electronic component to be detected (O1, O2, 031, O32, 041, O42, O43, O5) is contained, and a further image (HB), in which no electronic components to be detected (O1, O2, 031, O32, 041, O42, O43, O5) are contained, S2 Selecting an electronic component to be detected (O1, O2, 031, O32, 041, O42, O43, O5) in the annotated image (AB), S3 Replacing the image area described by the annotation (L1, L2) by overwriting said image area with an area of the further image (HB) that corresponds to said image area in order to remove the electronic component (O1, O2, 031, O32, 041, O42, O43, O5) together with the annotation (L1, L2) assigned to the selected electronic component (O1, O2, 031, O32, 041, O42, O43, O5) from the annotated image (AB) and produce a modified annotated image (MAB), wherein, in order to generate a plurality of different modified annotated images, the steps S2 and S3 are repeated until the modified annotated image (MAB) no longer has any more electronic components to be detected (O1, O2, 031, O32, 041, O42, O43, O5), wherein the different modified annotated images are added to the training image data (TBD), S4 Providing the training image data (TBD) containing the modified annotated image (MAB). S1 Providing at least one annotated image (AB), wherein the annotated image (AB) has a multiplicity of electronic components to be detected (O1, O2, 031, O32, 041, O42, O43, O5) on a background designed as a printed circuit board with annotations (L1, L2) assigned to the electronic components to be detected, wherein each annotation (L1, L2) describes an image area in which the corresponding electronic component to be detected (O1, O2, 031, O32, 041, O42, O43, O5) is contained, and a further image (HB), in which no electronic components to be detected (O1, O2, 031, O32, 041, O42, O43, O5) are contained, S2 Selecting an electronic component to be detected (O1, O2, 031, O32, 041, O42, O43, O5) in the annotated image (AB), S3 Replacing the image area described by the annotation (L1, L2) by overwriting said image area with an area of the further image (HB) that corresponds to said image area in order to remove the electronic component (O1, O2, 031, O32, 041, O42, O43, O5) together with the annotation (L1, L2) assigned to the selected electronic component (O1, O2, 031, O32, 041, O42, O43, O5) from the annotated image (AB) and produce a modified annotated image (MAB), wherein, in order to generate a plurality of different modified annotated images, the steps S2 and S3 are repeated until the modified annotated image (MAB) no longer has any more electronic components to be detected (O1, O2, 031, O32, 041, O42, O43, O5), wherein the different modified annotated images are added to the training image data (TBD), S4 Providing the training image data (TBD) containing the modified annotated image (MAB). <EOS>