A camera (140) registers at least one first frame of image data (Dimg) represent a body part (131, 132, 133, 134) of a
milking animal (130). The image data (Dimg) are registered using default
exposure and / or ISO settings (xs), and based thereon, a controller (100) controls an
automatic milking arrangement (110) with respect to the body part (131, 132, 133, 134). The controller (100) defines at least one
region of interest in the at least one first frame of the image data (Dimg) via a
search procedure configured to detect at least one
image object fulfilling at least one size-shape criterion, and which
search procedure is performed in 3D image data. The at least one
region of interest is defined within the at least one
image object that fulfils said at least one size-shape criterion. The controller (100) checks, in each of the at least one
region of interest, if the data therein fulfil a quality criterion. If the quality criterion is fulfilled, the camera (140) continues to register image data (Dimg) using the default
exposure and / or ISO settings (xs). If the quality criterion is not fulfilled, the controller (100) controls the camera (140) to adjust its
exposure and / or ISO settings (xs') such that subsequently registered image data (Dimg) are estimated to fulfil the quality criterion.