An arrangement for determining positions of the teats of a milking animal is provided in a milking system comprising a robot arm for automatically attaching teat cups to the teats of a milking animal when being located in a position to be milked, and a control device for controlling the movement of the robot arm based on determined positions of the teats of the milking animal. A first camera pair is directed towards the teats of the milking animal when being located in the position to be milked, wherein the first camera pair is provided to repeatedly record pairs of images, and an image processing device repeatedly detects the teats of the milking animal and determines their positions by a stereoscopic calculation method based on the repeatedly recorded pairs of images. The first camera pair is mounted below the teats of, and behind, the milking animal when being located in the position to be milked so that the first camera pair is directed diagonally upwards towards the teats of the milking animal when being located in the position to be milked.