An arrangement, which isprovided for determining the position of ananimal, comprises a three-dimensional cameradirected towards the animal and providedto record a three-dimensional image of theanimal, and image processing means providedfor detecting the animal and determiningits position in at least one spatial dimensionbased on the three-dimensional image ofthe animal. The image processing means isprovided to form a three-dimensional surfacerepresentation of a portion of the animal fromthe three-dimensional image of the animal, toanalyze the surface of the three-dimensionalsurface representation, and to determine theposition of the animal based on the analysisof the surface of the three-dimensional surfacerepresentation.