A method of controlling a milking implement for automatically milking a dairy animal with an udder, such as a cow, which milking implement includes a camera and a teat cup. More particularly, the method includes attaching the teat cup to a teat of the udder, followed by producing by the camera an image of at least a part of the udder and of at least a part of the teat cup, making an analysis of the image of the udder with the teat cup, and performing at least one control action by the milking implement, based on the analysis.