Method of controlling a milking implement for automatically milking a dairy animalwith an udder, such as a cow, which milking implement comprises a camera (100)and a teat cup (28), which method comprises the following steps: attaching theteat cup (28) to a teat (46) of the udder, followed by producing by means of the camera(100) an image of at least a part of the udder and of at least a part of the teat cup(28), making an analysis of the image of the udder with the teat cup,1 and performing atleast one control action by means of the milking implement, based on the analysis.