Controller for an automatic milking arrangement, computer-implemented method, computer program and non-volatile data carrier

The controller for automatic milking arrangements addresses the challenge of inconsistent image data by adjusting camera settings to meet quality criteria, ensuring reliable and efficient control of the milking process.

WO2025101108A1PCT designated stage expired Publication Date: 2025-05-15DELAVAL HLDG AB
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/SE2024/050946
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-10
Filing Date
2024-11-05
Publication Date
2025-05-15

AI Technical Summary

Technical Problem

Existing technologies face challenges in ensuring reliable image-based control of automatic milking arrangements, as image data registered in parallel with control can be inconsistent and of varying quality.

Method used

A controller that obtains image data from a camera, defines regions of interest based on size-shape criteria, and adjusts camera exposure and ISO settings to ensure that the image data meet predefined quality criteria, thereby enabling efficient and reliable control of automatic milking arrangements.

Benefits of technology

The controller effectively tunes the camera to capture high-quality image data of relevant body parts, such as teats, allowing for precise and reliable control of automatic milking arrangements, even under varying light conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SE2024050946_15052025_PF_FP_ABST
    Figure SE2024050946_15052025_PF_FP_ABST
Patent Text Reader

Abstract

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.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Controller for an Automatic Milking Arrangement, Computer- Implemented Method, Computer Program and Non-Volatile Data Carrier

[0002] TECHNICAL FIELD

[0003] The present invention relates generally to automatic milking of dairy animals. Especially, the invention relates to a controller according to the preamble of claim 1 and a corresponding computer- implemented method. The invention also relates to a computer program and a non-volatile data carrier storing such a computer program.

[0004] BACKGROUND

[0005] Modern dairy industry is highly dependent on advanced technologies both in terms of how the milk is processed and with respect to livestock handling. In particular, advanced image processing often plays an important role in today’s management of cattle. Below follow some examples of such solutions.

[0006] WO 2021 / 032890 shows a rotary milking platform that comprises a plurality of stalls and an RFID animal identifying system for identifying animals entering the stalls of the platform. A microprocessor reads signals from an image capturing device and computes a feature vector from the captured image of each animal. A plurality of reference feature vectors comprising respective matrices of metrics already derived from images of the respective animals captured by the image capturing device are stored and cross-referenced with the identity of the respective animals. The microprocessor compares computed feature vectors of each animal with the stored reference feature vectors until a best match has been determined with one of the reference feature vectors. The identity of the animal of that matching reference feature vector is then determined as the identity of the animal of that computed feature vector. The determined identity of the animal in the relevant stall is compared with the identity of the animal determined for that stall by the RFID system. On a favorable comparison the identity of the animal determined from the captured image of that animal is confirmed as the identity of the animal. In the event of a conflict between the two identities being determined, a conflict alert signal is produced.

[0007] EP 4 187 505 describes a method and a system for determining an identity of an animal. The method comprises obtaining, via an animal recording module, data associated with an animal moving through a space, the data comprising a video from a two-dimensional imaging sensor; extracting, from the data, a set of parameters by performing the steps comprising: determining a visual feature of the animal from the data; determining instances representing the shape of the animal in the data to form detected instances; identifying a set of reference points in each of the detected instances; determining one or more characteristics of the animal by processing at least some of the sets of identified reference points in a first module, the first module comprising a trained neural network; and generating the set of parameters comprising the visual feature and the determined one or more characteristics; generating an identification vector from the generated set of parameters; selecting known identification vectors from a first database of known identification vectors, each known identification vector corresponding to a unique registered animal; determining a list of matching scores by comparing the generated identification vector with the selected known identification vectors; responsive to determining at least one selected known identification vector has a matching score exceeding a threshold; selecting one of the at least one known identification vector based on at least one criterion; associating the animal using the selected known identification vector; and identifying the animal as the unique registered animal of the selected known identification vector; and responsive to determining that no selected known identification vector has a matching score that exceeds the threshold, identifying the animal as unknown. US 11 ,080,522 discloses a system and a method for identification of individual animals based on images, such as 3D-images, of the animals, especially of cattle and cows. When animals live in areas or enclosures where they freely move around, it can be complicated to identify the individual animal. In a first aspect the present disclosure relates to a method for determining the identity of an individual animal in a population of animals with known identity, the method comprising the steps of acquiring at least one image of the back of a preselected animal, extracting data from said at least one image relating to the anatomy of the back and / or topology of the back of the preselected animal, and comparing and / or matching said extracted data against reference data corresponding to the anatomy of the back and / or topology of the back of the animals with known identity, thereby identifying the preselected animal. The method and system can be used to monitor feed intake, such as feed intake for dairy cows as well as health status.

[0008] Thus, various kinds of image-based methods are known for identifying dairy animals in different milking-related situations. However, it may be challenging to ensure a reliable control of an automatic milking arrangement based on image data that are registered in parallel with such control.

[0009] SUMMARY

[0010] The object of the present invention is therefore to offer a solution that mitigates the above problem, and thus allows efficient and reliable imaged-based control of an automatic milking arrangement.

[0011] According to one aspect of the invention, the object is achieved by a controller for an automatic milking arrangement where the controller is configured to obtain at least one first frame of image data from a camera, which image data represent at least one body part of a milking animal, and which image data are registered using default exposure and / or ISO settings. The controller is configured to control the automatic milking arrangement with respect to the at least one body part based on the obtained image data.

[0012] Specifically, the controller is configured to define at least one region of interest in the at least one first frame of the image data, wherein each of the at least one region of interest includes a respective set of pixels of the at least one first frame of the image data. The at least one region of is defined through a search procedure, which is performed in the at least one first frame of the image data. The search procedure is configured to detect at least one image object that fulfils at least one size-shape criterion, for example relating to a contour of a body, or part thereof; a length, or range of lengths of a body, or part thereof; a width, or range of widths of a body, or part thereof and / or a shape of a body part. The search procedure is performed in three-dimensional image data specifying respective distances between an image sensor plane in the camera and different imaged surfaces represented by the image data. The controller is configured to define the at least one region of interest within the at least one image object that fulfils said at least one size-shape criterion, and check, in each of the at least one region of interest, if the respective set of pixels fulfil at least one quality criterion. If the respective set of pixels in each of the at least one region of interest fulfil the at least one quality criterion, the controller is configured to control the camera to continue to register image data using the default exposure and / or ISO settings, and in parallel, control the automatic milking arrangement with respect to the at least one body part based on the image data registered using the default exposure and / or ISO settings. If, however, the respective set of pixels in at least one of the at least one region of interest do not fulfil the at least one quality criterion, the controller is configured to control the camera to adjust its exposure and / or ISO settings such that image data that are registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion. The controller is also configured to control the camera to register image data using the adjusted exposure and / or ISO settings, and in parallel, control the automatic milking arrangement with respect to the at least one body part based on the image data registered using the adjusted exposure and / or ISO settings.

[0013] This controller is advantageous because it quickly tunes the camera for capturing high-quality image data of relevant body parts, for instance the teats, of each animal in a heard.

[0014] According to one embodiment of this aspect of the invention, the at least one first frame of the image data contains at least one two-dimensional (2D) image, and the at least one quality criterion defines a pre-defined range of light intensity levels within which pre-defined range at least a threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest must represent a light intensity level. Here, the controller is configured to check the respective set of pixels in each of the at least one region of interest against the pre-defined range of light intensity levels. If not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest represent light intensity levels in the pre-defined range, and the pixels in at least one of the at least one region of interest represent light intensity levels predominantly below the pre-defined range, the controller is configured to control the camera to adjust its exposure and / or ISO settings to increase the light intensity of the image data that are registered subsequent to the at least one first frame. Analogously, if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest represent light intensity levels in the pre-defined range, and the pixels in at least one of the at least one region of interest represent light intensity levels predominantly above the pre-defined range, the controller is instead configured to control the camera to adjust its exposure and / or ISO settings to decrease the light intensity of the image data that are registered subsequent to the at least one first frame. Consequently, adequate camera adjustments may be effected at very low latency.

[0015] According to another embodiment of this aspect of the invention, the camera contains an image sensor with a color filter array confi- gured to register the image data in a number of color channels. Here, the controller is further configured to check, with respect to each color channel of said number of color channels and the respective set of pixels in each of the at least one region of interest against the pre-defined range of light intensity levels, if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest in each color channel of said number of color channels represent light intensity levels in the pre-defined range, and the pixels in at least one of the at least one region of interest represent light intensity levels predominantly below the pre-defined range, the controller is configured to control the camera to adjust its exposure and / or ISO settings to increase the light intensity of the image data that are registered subsequent to the at least one first frame. Analogously, if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest in each color channel of said number of color channels represent light intensity levels in the pre-defined range, and the pixels in at least one of the at least one region of interest represent light intensity levels predominantly above the pre-defined range, the controller is configured to control the camera to adjust its exposure and / or ISO settings to decrease the light intensity of the image data that are registered subsequent to the at least one first frame. Hence, the camera may efficiently be tuned to register high-quality color image data based on which the automatic milking arrangement may be controlled.

[0016] According to yet another embodiment of this aspect of the invention, the check of the respective set of pixels in each of the at least one region of interest against the pre-defined range of light intensity levels involves performing at least one statistical analysis of the light intensity levels represented by the respective set of pixels in each of the at least one region of interest. For example, the controller may be configured to calculate mean, median and / or standard deviation values for the light intensity levels in each region of interest, and based thereon, conclude whether or not the at least one quality criterion is fulfilled. According to yet another embodiment of this aspect of the invention, the at least one first frame of the image data contains at least one three-dimensional (3D) image with range data specifying respective distances between an image sensor plane in the camera and different imaged surfaces represented by the image data. Here, the at least one quality criterion defines a threshold degree of graininess that the at least one first frame of the image data must not exceed. The graininess represents a signal-to-noise ratio (SNR), where a high degree of graininess is equivalent to a relatively low SNR, and vice versa. In this embodiment of the invention, the controller is configured to check the respective set of pixels in each of the at least one region of interest against the threshold degree of graininess, and if the threshold degree of graininess is exceeded, the controller is configured to control the camera to adjust its exposure and / or ISO settings, such that the degree of graininess is expected to decrease. This means that the controller is configured to increase a first parameter specifying an exposure time for the camera, increase a second parameter specifying an aperture value for the camera and / or decrease a third parameter specifying an ISO value for the camera. As a result, next time the animal in question interacts with the automatic milking arrangement, it is likely that the camera is able to capture high-quality 3D image data of the at least one body part already in the first frame.

[0017] According to still another embodiment of this aspect of the invention, the checking of the respective set of pixels in each of the at least one region of interest against the threshold degree of graininess involves performing at least one statistical analysis of the distances represented by the respective set of pixels in each of the at least one region of interest. Thus, the controller may for example be configured to calculate mean, median and / or standard deviation values for the distance values defined by the respective set of pixels in each of the at least one region of interest, and based thereon, conclude whether or not the at least one quality criterion is fulfilled.

[0018] According to one embodiment of this aspect of the invention, the at least one image object that fulfils said at least one size-shape criterion, is a teat tip, an entire teat and / or a transition region between a teats and an udder. Namely, this is very useful when controlling an automatic milking arrangement, such as a milking robot, for example to attach teatcups to an animal.

[0019] According to another embodiment of this aspect of the invention, the controller is configured control of the automatic milking arrangement with respect to the at least one body part by controlling a robot arm to attach teatcups to the teats of the animal whose at least one body part is represented by the image data and / or selecting a teat liner for the animal whose at least one body part is represented by the image data. This means that the invention may both be actively employed in the actual milk extraction as such, and in an adjustment procedure preceding the milk extraction.

[0020] According to yet another embodiment of this aspect of the invention, the controller is configured to conduct a voting procedure, wherein an adjustment of the exposure and / or ISO settings called for by each region of interest is weighted by a centering factor. The centering factor is delimited within a predefined range, say 1 to 5, and is based on a distance between a respective center of the region of interest and a center of the at least one first frame of the image data. The centering factor influences the exposure and / or ISO settings called for by each region of interest by a relationship that is inversely proportional to said distance. The controller is configured to count the votes from all the regions of interest, each of which votes reflects a respective amount and direction of adjustment weighted by the centering factor, The controller is the configured to determine an adjustment of the exposure and / or ISO settings with respect to an amount and direction, i.e. brighter or darker, in relation to a current setting thereof based on a majority ruling of said votes. Thus, pixels located centrally in the frame have greater influence on any adjustment of the exposure and / or ISO settings than pixels located relatively far from a center of the frame, by for instance being located near the edges of the frame. According to still another embodiment of this aspect of the invention, the regions of interest are organized in first, second and third sets of regions of interest, where the first set of regions of interest are located in a central zone of the image data, the second set of regions of interest are located in an outer zone surrounding the central zone and the third set of regions of interest are located in peripheral zone surrounding the outer zone. Here, the controller is configured to conduct a voting procedure, wherein an adjustment of the exposure and / or ISO settings called for by each region of interest in the central zone is given a first weight factor, an adjustment of the exposure and / or ISO settings called for by each region of interest in the outer zone is given a second weight factor and an adjustment of the exposure and / or ISO settings called for by each region of interest in the peripheral zone is given a third weight factor, which first weight factor is larger than the second weight factor and which second weight factor is larger than the third weight factor. The controller is further configured to count the votes from all the regions of interest, each of which votes reflects a respective amount and direction of adjustment, and determine an adjustment of the exposure and / or ISO settings with respect to an amount and direction in relation to a current setting thereof based on a majority ruling of said votes. Thus, pixels located centrally in the frame have greater influence on any adjustment of the exposure and / or ISO settings than pixels located relatively far from a center of the frame, by for instance being located near the edges of the frame.

[0021] According to another aspect of the invention, the object is achieved by a computer-implemented method, which is performed in a processing unit in a controller, which controller, in turn, is arranged to control an automatic milking arrangement. The method involves obtaining at least one first frame of image data from a camera, which image data represent at least one body part of a milking animal, and which image data are registered using default exposure and / or ISO settings. The method further involves controlling the automatic milking arrangement with respect to the at least one body part based on the obtained image data. In particular, the method involves defining at least one region of interest in the at least one first frame of the image data, wherein each of the at least one region of interest includes a respective set of pixels of the at least one first frame of the image data. The at least one region of interest is defined by performing a search procedure in the at least one first frame of the image data, which search procedure is configured to detect at least one image object that fulfils at least one size-shape criterion. The search procedure is performed in 3D image data specifying respective distances between an image sensor plane in the camera and different imaged surfaces represented by the 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 method further involves checking, in each of the at least one region of interest, if the respective set of pixels fulfil at least one quality criterion. If the respective set of pixels in each of the at least one region of interest fulfil the at least one quality criterion, the camera is controlled to register image data subsequent to the at least one first frame of image data, and in parallel, the automatic milking arrangement is controlled with respect to the at least one body part based on the image data registered using the default exposure and / or ISO settings. If, however, the respective set of pixels in at least one of the at least one region of interest do not fulfil the at least one quality criterion, the camera is controlled to adjust its exposure and / or ISO settings such that image data that are registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion. Moreover, the camera is controlled to register image data using the adjusted exposure and / or ISO settings, and in parallel, the automatic milking arrangement is controlled with respect to the at least one body part based on the image data registered using the adjusted exposure and / or ISO settings.

[0022] The advantages of this method, as well as the preferred embodiments thereof, are apparent from the discussion above with reference to the proposed system. According to a further aspect of the invention, the object is achieved by a computer program loadable into a non-volatile data carrier communicatively connected to a processing unit. The computer program includes software for executing the above method when the program is run on the processing unit.

[0023] According to another aspect of the invention, the object is achieved by a non-volatile data carrier containing the above computer program.

[0024] Further advantages, beneficial features and applications of the present invention will be apparent from the following description and the dependent claims.

[0025] BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The invention is now to be explained more closely by means of preferred embodiments, which are disclosed as examples, and with reference to the attached drawings.

[0027] Figure 1 schematically illustrates an automatic milking arrangement that is controllable by a controller according to one embodiment of the invention;

[0028] Figures 2a-b illustrate how different regions of interest may be defined in the image data according to embodiments of the invention;

[0029] Figures 3a-d illustrate aspects of a quality criterion related to ranges of light intensity levels of the image data according to embodiments of the invention; and

[0030] Figure 4 illustrates, by means of a flow diagram, the general method according to the invention.

[0031] DETAILED DESCRIPTION

[0032] Figure 1 shows a simplified automatic milking arrangement 110 in respect of which the invention may be implemented. Here, the automatic milking arrangement 110 is represented by a robot arm that is controllable by a controller 100 according to one embodiment of the invention. The robot arm may be configured to carry one or more teatcups.

[0033] The controller 100 is configured to control the automatic milking arrangement 1 10 with respect to at least one body part of an animal based on image data Dimg. In the embodiment shown in Figure 1 , the controller 100 is specifically configured to control the robot arm 1 10 to attach teatcups to the teats 131 , 132, 133 and 134 respectively of the animal’s udder 130.

[0034] To this aim, the controller 100 is configured to obtain image data Dimg from a camara 140, which image data Dimg are registered using default exposure and / or ISO settings xs in the camera 140. Preferably, the default exposure and / or ISO settings xs are selected to values estimated to be suitable for registering image data Dimg of relevant body parts, such as the teats 131 , 132, 133 and 134 and / or the udder 130 of a dairy animal.

[0035] The exposure and / or ISO settings IDi :xsi influence the brightness of the image data Dimg produced by an image sensor array in a camera 140. The exposure and / or ISO settings IDi :xsi may contain one or more of three variable parameters of which exposure time for the camera 140 represents a first parameter. An aperture value represents a second parameter. The exposure time and the aperture value are similar to one another in that they both determine an amount of light that reaches an image sensor array in the camera 140. The amount of light that reaches the image sensor array may either be increased by prolonging the exposure time or increasing the aperture value, or both.

[0036] For example, each photosensor in the image sensor array may produce a voltage that is proportional to the amount of light hitting the photosensor. Thus, an overall increased amount of light results in higher voltage outputs from the photosensors in the image sensor array.

[0037] Another way to alter the brightness of the image data Dimg is to modify the so-called ISO (International Organization for Standardization) setting of the camera. The ISO value is thus the third parameter of said three variable parameters. The ISO value is a mapping, which instructs the image sensor array how bright a resulting image shall be given a particular exposure setting in terms of exposure time and aperture value. Somewhat simplified, the ISO value may be seen as a bias level for a dynamic range of the image data Dimgbetween completely black and completely white. An increase of the ISO value shifts the entire dynamic range upwards toward white, whereas decrease of the ISO value shifts the entire dynamic range downwards toward black.

[0038] Each of the parameters: exposure time, aperture value and ISO value is associated with its particular pros and cons. While a prolonged exposure time is advantageous because it increases the amount of light that reaches the image sensor array, a prolonged exposure time is disadvantageous because it risks causing motion artefacts in the form of blur. An increased aperture value is advantageous because it also increases the amount of light that reaches the image sensor array. However, the larger the aperture value, the shallower the depth of field. Le. for large aperture values, only objects within a very short distance range from the camera will be depicted in focus. In contrast to the other two parameters, a variation of the ISO value does not influence the amount of light that reaches the image sensor array. Each image sensor array has a so-called base ISO value, which represents a technically optimal mapping of the light-to-image data readout from the image sensor array. Typically, the base ISO value represents a lowest recommended ISO value for a given image sensor array. Any ISO value above the base ISO value renders the image data brighter, however at the expense of a reduced dynamic range, possibly even clipped / blown out highlights, and a deteriorated sig- nal-to-noise ratio (SNR), which often appears as an increased degree of graininess in the image data. In other words, the higher the ISO value, the higher the light intensity and the lower the SNR of the image data. The controller 100 is configured to obtain image data Dimgfrom the camera 140, which image data Dimg represent the at least one body part, such as the teats 131 , 132, 133 and 134 respectively. The image data D img are registered using the default exposure and / or ISO settings xs. Specifically, the controller 100 is configured to control the camera 140 to register at least one first frame, i.e. still image, of the image data D img using the default exposure and / or ISO settings xs.

[0039] According to the invention, the controller 100 is configured to define at least one region of interest in the at least one first frame of the image data Dimg . Figures 2a and 2b illustrate how different regions of interest ROI 1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively may be defined in the image data D img according to embodiments of the invention.

[0040] According to one embodiment of the invention, after that the camera 140 has attained a predefined position in relation to the milking animal 130, the controller 100 is configured to define at least one region of interest, e.g. ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively in the at least one first frame of the image data D img by performing a search procedure in the at least one first frame of the image data Dimg . The search procedure is configured to detect image objects that fulfil at least one size-shape criterion. The search procedure is performed in three-dimensional image data specifying respective distances between an image sensor plane in the camera 140 and different imaged surfaces represented by the image data Dimg . This means that a TOF camera data may be used. However, alternatively two-dimensional image data supplemented with distance data, for example determined via laser measurements or stereo imaging, may be used. Based on the results of the search procedure, in turn, the controller 100 is configured to define one or more regions of interest within one of more of the image object that fulfil the at least one size-shape criterion. The controller 100 is configured to define the at least one region of interest within the at least one image object that fulfils the at least one size-shape criterion. According to embodiments of the invention, the size-shape criterion may relate to: a contour of a body, or part thereof; a length, or range of lengths of a body, or part thereof; a width, or range of widths of a body, or part thereof; and / or a shape of a body part. Thus, for example, the search procedure may detect teats represented by image objects being 1 to 4 centimeters wide and extending from a relatively large object - presumably of a size and shape of a typical udder.

[0041] According to the invention, the controller 100 is configured to check, in each of the at least one region of interest ROI 1 , ROI2, ROI3, ROI4, ROI5 and ROI6, if the respective set of pixels fulfil at least one quality criterion, for example relating to light intensity and / or graininess / SNR. If the respective set of pixels in each of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 fulfil the at least one quality criterion, the controller 100 is configured to control the camera 140 to continue to register image data Dimgusing the default exposure and / or ISO settings xs, and in parallel, control the automatic milking arrangement 110 with respect to the at least one body part 131 , 132, 133 and / or 134 based on the image data Dimg registered using the default exposure and / or ISO settings xs.

[0042] If, however, the respective set of pixels in at least one of the at least one region of interest RO11 , ROI2, ROI3, ROI4, ROI5 and / or ROI6 do not fulfil the at least one quality criterion, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings xs’ such that image data D img that are registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion. The controller 100 is further configured to control the camera 140 to register image data Dimg using the adjusted exposure and / or ISO settings xs’, and in parallel, control the automatic milking arrangement 110 with respect to the at least one body part 131 , 132, 133 and / or 134 based on the image data Dimg registered using the adjusted exposure and / or ISO settings xs’. In some situations, the light conditions and / or the light reflecting characteristics of the at least one body part 131 , 132, 133 and / or 134 may vary substantively throughout the at least one first frame of image data Dimg. For instance, therefore, the pixels in one or more regions of interest may be underexposed while the pixels in one or more other regions of interest are overexposed. In such cases, the regions of interest are preferably weighted differently depending on their respective distance to the center of the frame. Referring to Figure 2a, to resolve a situation where the pixel values in some regions of interest indicate that the light intensity should be increased, and the pixel values in other regions of interest indicate that the light intensity should be decreased, the controller 100 may conduct a voting procedure, wherein an adjustment of the exposure and / or ISO settings called for by each region of interest is weighted by a centering factor. The centering factor is delimited within a pre-defined range, say between 1 and 5, and is based on a distance between a respective center of the region of interest and the center C of the at least one first frame of the image data Dimg. The centering factor influences the exposure and / or ISO settings called for by each region of interest by a relationship being inversely proportional to said distance, such that a region of interest located relatively close to the center C, for instance ROI4 attains a centering factor of a high value, say 4 or 5, and regions of interest located relatively far from the center C, for instance ROI1 , ROI5 and ROI6 attain centering factors of low value, say 1 or 2.

[0043] For example, in Figure 2a, a center C4 of the region of interest ROI4 is located at a distance d4 from the center C and a center C5 of the region of interest ROI5 is located at a distance ds from the center C, where ds is 2.5 times d4. Thus, if the region of interest ROI4 has a centering factor 3.5, the region of interest ROI5 may have a centering factor 1.5.

[0044] Figure 2b also exemplifies image data Dimg in the form of a still image frame with regions of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively. Here, however, the regions of inte- rest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 are organized in first, second and third sets of regions of interest. The first set of regions of interest ROI3 and ROI4 are located in a central zone 203 of the still image frame, the second set of regions of interest ROI1 and ROI2 are located in an outer zone 202 of the still image frame, which outer zone 202 surrounds the central zone 203, and the third set of regions of interest ROI5 and ROI6 are located in a peripheral zone 201 of the still image frame, which peripheral zone 201 surrounds the outer zone 202. Each of said regions of interest contains a respective set of pixels of the image data Dimg, where the respective sets of pixels may contain different numbers of pixels depending on the result of the above discussed search procedure. In any case, when registering the at least one first frame of the image data Dimg, it is presumed that the camera 140 has such a position and field of view in relation to the animal that the at least one body part 131 , 132, 133 and 134 are located relatively close to the center C of the still image frame. It is therefore generally preferable that pixels located centrally in the frame have greater influence on any adjustment of the exposure and / or ISO settings than pixels located relatively far from a center of the frame, e.g. pixels located near the edges of the still image frame.

[0045] As exemplified in Figure 2b, the depicted at least one body part 131 , 132, 133 and 134 in the form of teats may have mutually different skin tones and may hide one another more or less from being depicted by the camera 140 and / or at least partially obstruct light from being reflected to the camera 140. For example, one or more illuminators on the camera 140 may emit infrared (IR) light towards the at least one body part. Depending on the spatial relationship between the illuminators, the camera 140 and the at least one body part, different body parts, or portions thereof, may not be sufficiently illuminated by the IR light.

[0046] To mitigate this problem, the controller 100 is configured to check, in each of the regions of interest respectively, if the respective set of pixels fulfil at least one quality criterion, e.g. relating to the light intensity levels represented by the pixels in the respective set of pixels in each of the regions of interest, and / or the SNR of the image data in each of the regions of interest.

[0047] In some situations, the light conditions and / or the light reflecting characteristics of the at least one body part 131 , 132, 133 and 134 may vary substantively throughout the at least one first frame of image data Dimg. For instance, therefore, the pixels in one or more regions of interest may be underexposed while the pixels in one or more other regions of interest are overexposed. In such cases, the regions of interest are preferably weighted differently depending on their respective distance to the center of the frame. For example, to resolve a situation where the pixel values in some regions of interest indicate that the light intensity should be increased, and the pixel values in other regions of interest indicate that the light intensity should be decreased, the controller 100 may conduct a voting procedure, where an adjustment called for by each region of interest in the central zone 203 is given a first weight factor, an adjustment called for by each region of interest in the outer zone 202 is given a second weight factor, and an adjustment called for by each region of interest in the peripheral zone 201 is given a third weight factor, which first weight factor is larger than the second weight factor and which second weight factor is larger than the third weight factor. For example, the first weight factor may be 3, the second weight factor may be 2 and the third weight factor may be 1. However, of course, any other specific weight factors are equally well conceivable provided that they have the above indicated relative proportions.

[0048] The controller 100 counts the votes from all the regions of interest, each of which votes reflects a respective amount and direction of adjustment, i.e. light intensity up or down. Here, a majority ruling determines a final adjusting of the exposure and / or ISO settings with respect to the amount and direction in relation to a current setting thereof.

[0049] If the teat tips and / or the entire teats 131 , 132, 133 and 134 are identified in the image data Dimg, and a robot arm is controlled to attach teatcups 111 , 112, 113 and 114 to the teats of the animal whose unique identity is reflected by the identification IDi, it is generally advantageous to define regions of interest covering the teat tips and / or the teats respectively. Such control of the robot arm is normally made first after that the camera’s 140 exposure and / or ISO settings have been adjusted according to the present invention.

[0050] Referring now to Figures 3a to 3d, according to one embodiment of the invention, the at least one first frame of the image data Dimgcontains one or more two-dimensional (2D) images. Here, the at least one quality criterion defines a pre-defined range R of light intensity levels I within which pre-defined range R at least a threshold portion of the pixels in the respective set of pixels in each region of ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively must represent a light intensity level to fulfil the quality criterion. To test this quality criterion, the controller 100 is configured to check the respective set of pixels in each of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively against the pre-defined range R of light intensity levels I.

[0051] If not the threshold portion of the pixels in the respective set of pixels in each of said regions of interest represent light intensity levels in the pre-defined range R, the controller 100 is further configured to determine if the pixels in the regions of interest represent light intensity levels I predominantly below or above the predefined range R. Figure 3a shows an example where a histogram 310 represents light intensity levels I predominantly below the predefined range R, and Figure 3b shows an example where a histogram 320 represents light intensity levels I predominantly above the pre-defined range R.

[0052] Figure 3c shows a monochrome example of a histogram 330 that represents light intensity levels I predominantly within the pre-defined range R, i.e. where no adjustment of the exposure or ISO settings for the camera 140 is needed. Figure 3d shows an example corresponding to that in Figure 3c, however where three separate histograms 341 , 342 and 343 reflect a respective color channel, e.g. red, green and blue respectively, and a histogram 340 reflects a combined channel, where all of said channels represent light intensity levels I predominantly within the pre-defined range R.

[0053] If the pixels in the regions of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively represent light intensity levels I predominantly below the pre-defined range R, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings to increase the light intensity of the image data Dimgthat are registered subsequent to the at least one first frame. In practice, this may involve increasing one or more of the following parameters for the camera 140: the first parameter specifying the exposure time, the second parameter specifying the aperture value, and the third parameter specifying the ISO value.

[0054] If the pixels in the regions of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively represent light intensity levels I predominantly above the pre-defined range R, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings to decrease the light intensity of the image data Dimg that are registered subsequent to the at least one first frame. In practice, this may involve decreasing one or more of the first, second and / or third parameters for the camera 140.

[0055] Naturally, the checking of the threshold portion of the pixels in the respective set of pixels in each of the regions of interest against the light intensity levels in the pre-defined range R may also involve the above-described voting procedure.

[0056] According to one embodiment of the invention, the camera 140 includes an image sensor with a color filter array configured to register the image data Dimg in a number of color channels 341 , 342 and 343, for example red green and blue. Here, the controller 100 is configured to check, with respect to each color channel of said number of color channels 341 , 342 and 343 respectively and the respective set of pixels in each of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 against the predefined range R of light intensity levels I. If not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 in each color channel of said number of color channels 341 , 342 and 343 respectively represent light intensity levels in the predefined range R, and the pixels in at least one of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 represent light intensity levels I predominantly below 310 the predefined range R, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings xs’ to increase the light intensity of the image data Dimgthat are registered subsequent to the at least one first frame. If not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 in each color channel of said number of color channels 341 , 342 and 343 respectively represent light intensity levels in the predefined range R, and the pixels in at least one of the at least one region of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 represent light intensity levels I predominantly above 320 the predefined range R, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings xs’ to decrease the light intensity of the image data Dimg that are registered subsequent to the at least one first frame.

[0057] Moreover, the check of whether the respective set of pixels in each of the regions of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively against the quality criterion pertaining to the pre-defined range R of light intensity levels I preferably involves performing at least one statistical analysis of the light intensity levels I represented by the respective set of pixels in each of said regions of interest. Thus, the controller 100 may be configured to calculate mean, median and / or standard deviation values for the light intensity levels in each region of interest, and based thereon, conclude whether or not the at least one quality criterion is fulfilled. This may be advantageous if for example one, or a few regions of interest contain pixel values with light intensity levels I that differ substantively from the light intensity levels I represented by the pixels in the other regions of interest in the at least one first frame of the image data Dimg. Namely, thereby regions of interest that represent outlier data may be given less weight, or be disregarded completely, instead of risking to deteriorate the data quality of the remaining regions of interest in the image data Dimg .

[0058] In addition to 2D image data, or as an alternative thereto, the at least one first frame of the image data Dimg may contain at least one three-dimensional (3D) image with range data specifying respective distances between an image sensor plane in the camera 140 and different imaged surfaces represented by the image data Dimg . In such a case, the at least one quality criterion defines a threshold degree of graininess that the at least one first frame of the image data Dimg must not exceed. The degree of graininess, in turn, is typically correlated with the SNR of the image data Dimg . This may for example mean that an SNR below a particular value is equivalent to a degree of graininess above a threshold level.

[0059] Here, the controller 100 is configured to check the respective set of pixels in each of the regions of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively against the threshold degree of graininess.

[0060] If the threshold degree of graininess is exceeded, i.e. if the SNR falls below the particular value, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings, such that image data Dimg that are registered subsequent to the at least one first frame are estimated to fulfil the quality criterion. To this effect, the controller 100 may increase the first parameter specifying the exposure time for the camera 140, increase the second parameter specifying the aperture value for the camera 140 and / or decrease the third parameter specifying the ISO value for the camera 140. Analogous to the above, the controller may conduct a voting procedure to resolve situations where the pixel values in some regions of interest indicate that the degree of graininess is exceeded and the pixel values in some other regions of interest in the same the image data Dimgindicate that the degree of graininess is not exceeded.

[0061] It is generally advantageous if the controller 100 is configured to effect the above-described procedure in in an automatic manner by executing a computer program. Therefore, the controller 100 may include a memory unit 105, i.e. non-volatile data carrier, storing a computer program 103, which, in turn, contains software for making processing circuitry in the form of at least one processor 101 in the controller 100 execute the actions mentioned in this disclosure when the computer program 103 is run on the at least one processor 101 .

[0062] In order to sum up, and with reference to the flow diagram in Figure 4, we will now describe the computer-implemented method according to the invention, which method is performed in the at least one processor 101 of the controller 100.

[0063] In a first step 410, at least one first frame of image data are obtained from a camera, which image data represent at least one body part of a milking animal, and which image data are registered using default exposure and / or ISO settings.

[0064] In a subsequent step 420, it is checked if at least one quality criterion is fulfilled. The checking involves defining at least one region of interest in the at least one first frame of the image data, wherein each of the at least one region of interest includes a respective set of pixels of the at least one first frame of the image data. The at least one region of interest, in turn, is defined by performing a search procedure in the at least one first frame of the image data, which search procedure is configured to detect at least one image object fulfilling at least one size-shape criterion. The search procedure is performed in 3D image data specifying respective dis- tances between an image sensor plane in the camera and different imaged surfaces represented by the 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. Finally, it is checked, in each of the at least one region of interest, if the respective set of pixels fulfil at least one quality criterion, e.g. relating to brightness and / or graininess / SNR as discussed above.

[0065] If the respective set of pixels in each of the at least one region of interest fulfil the at least one quality criterion, the default exposure and / or ISO settings are maintained unaltered, and a step 460 follows.

[0066] If the respective set of pixels in at least one of the at least one region of interest do not fulfil the at least one quality criterion because the set of pixels is too dark and / or too grainy, the procedure continues to a step 440.

[0067] If the respective set of pixels in at least one of the at least one region of interest do not fulfil the at least one quality criterion because the set of pixels is too bright and / or too grainy, the procedure continues to a step 450.

[0068] In step 440, the camera is controlled to adjust its exposure and / or ISO settings such that image data that are registered subsequent to the at least one first frame will be brighter and / or less noisy and thus estimated to fulfil the at least one quality criterion. Then, the procedure continues to step 460.

[0069] In step 450, the camera is controlled to adjust its exposure and / or ISO settings such that image data that are registered subsequent to the at least one first frame will be darker and / or less noisy and thus estimated to fulfil the at least one quality criterion. Then, the procedure continues to step 460.

[0070] In step 460, image data are registered using the stored exposure and / or ISO settings, i.e. the default ones, the ones produced in step 440, or the ones produced in step 450, and in parallel the automatic milking arrangement is controlled with respect to the at least one body part based on the registered image data. Thereafter, the procedure loops back to step 410 for a repeated quality check of the quality of the image data.

[0071] The process steps described with reference to Figure 4 may be controlled by means of a programmed processor. Moreover, although the embodiments of the invention described above with reference to the drawings comprise processor and processes performed in at least one processor, the invention thus also extends to computer programs, particularly computer programs on or in a carrier, adapted for putting the invention into practice. The program may be in the form of source code, object code, a code intermediate source and object code such as in partially compiled form, or in any other form suitable for use in the implementation of the process according to the invention. The program may either be a part of an operating system, or be a separate application. The carrier may be any entity or device capable of carrying the program. For example, the carrier may comprise a storage medium, such as a Flash memory, a ROM (Read Only Memory), for example a DVD (Digital Video / Versatile Disk), a CD (Compact Disc) or a semiconductor ROM, an EPROM (Erasable Programmable Read-Only Memory), an EEPROM (Electrically Erasable Programmable Read-Only Memory), or a magnetic recording medium, for example a floppy disc or hard disc. Further, the carrier may be a transmissible carrier such as an electrical or optical signal which may be conveyed via electrical or optical cable or by radio or by other means. When the program is embodied in a signal, which may be conveyed, directly by a cable or other device or means, the carrier may be constituted by such cable or device or means. Alternatively, the carrier may be an integrated circuit in which the program is embedded, the integrated circuit being adapted for performing, or for use in the performance of, the relevant processes.

[0072] Variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a study of the drawings, the disclosure, and the ap- 2Q pended claims.

[0073] The term “comprises / comprising” when used in this specification is taken to specify the presence of stated features, integers, steps or components. The term does not preclude the presence or addition of one or more additional elements, features, integers, steps or components or groups thereof. The indefinite article "a" or "an" does not exclude a plurality. In the claims, the word “or” is not to be interpreted as an exclusive or (sometimes referred to as “XOR”). On the contrary, expressions such as “A or B” covers all the cases “A and not B”, “B and not A” and “A and B”, unless otherwise indicated. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. Any reference signs in the claims should not be construed as limiting the scope.

[0074] It is also to be noted that features from the various embodiments described herein may freely be combined, unless it is explicitly stated that such a combination would be unsuitable.

[0075] The invention is not restricted to the described embodiments in the figures, but may be varied freely within the scope of the claims.

Claims

Claims1. A controller (100) for an automatic milking arrangement (110), which controller (100) is configured to: obtain at least one first frame of image data (Dimg) from a camera (140), which image data (Dimg) represent at least one body part (131 , 132, 133, 134) of a milking animal (130), and which image data (Dimg) are registered using default exposure and / or ISO settings (xs), and control the automatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) based on the obtained image data (Dimg) , characterized in that the controller (100) is configured to: define at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) in the at least one first frame of the image data (Dimg) , wherein each of the at least one region of interest comprises a respective set of pixels of the at least one first frame of the image data (Dimg), and the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6, ROI7, ROI8, ROI9, ROI10, ROI1 1 ) is defined by: performing a search procedure in the at least one first frame of the image data (Dimg), which search procedure is configured to detect at least one image object fulfilling at least one size-shape criterion, and which search procedure is performed in three-dimensional image data specifying respective distances between an image sensor plane in the camera (140) and different imaged surfaces represented by the image data (Dimg), and defining the at least one region of interest within the at least one image object that fulfils said at least one size-shape criterion, check, in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6), if the respective set of pixels fulfil at least one quality criterion, if the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) fulfil the at least one quality criterion, control the camera(140) to continue to register image data (Dimg) using the default exposure and / or ISO settings (xs), and in parallel, control the automatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) based on the image data (Dimg) registered using the default exposure and / or ISO settings (xs), and if the respective set of pixels in at least one of the at least one region of interest (ROI 1 , ROI2, ROI3, ROI4, ROI5, ROI6) do not fulfil the at least one quality criterion, control the camera (140) to adjust its exposure and / or ISO settings (xs’) such that image data (Dimg) that are registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion, control the camera (140) to register image data (Dimg) using the adjusted exposure and / or ISO settings (xs’), and in parallel, control the automatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) based on the image data (D img) registered using the adjusted exposure and / or ISO settings (xs’).

2. The controller (100) according to claim 1 , wherein the at least one first frame of the image data (Dimg) comprises at least one two-dimensional image, the at least one quality criterion defines a pre-defined range (R) of light intensity levels (I) within which pre-defined range (R) at least a threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) must represent a light intensity level, and the controller (100) is configured to: check the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) against the pre-defined range (R) of light intensity levels (I), if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels in the pre-defined range (R), and the pixels in at least one of the at leastone region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels (I) predominantly below (410) the pre-defined range (R), control the camera (140) to adjust its exposure and / or ISO settings (xs’) to increase the light intensity of the image data (Dimg) that are registered subsequent to the at least one first frame, and if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels in the pre-defined range (R), and the pixels in at least one of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels (I) predominantly above (420) the predefined range (R), control the camera (140) to adjust its exposure and / or ISO settings (xs’) to decrease the light intensity of the image data (Dimg) that are registered subsequent to the at least one first frame.

3. The controller (100) according to claim 2, wherein the camera (140) comprises an image sensor with a color filter array configured to register the image data (Dimg) in a number of color channels (341 , 342, 343), and the controller (100) is further configured to: check, with respect to each color channel of said number of color channels (341 , 342, 343) and the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) against the pre-defined range (R) of light intensity levels (I), if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) in each color channel of said number of color channels (341 , 342, 343) represent light intensity levels in the pre-defined range (R), and the pixels in at least one of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels (I) predominantly below (410) thepre-defined range (R), control the camera (140) to adjust its exposure and / or ISO settings (xs’) to increase the light intensity of the image data (Dimg) that are registered subsequent to the at least one first frame, and if not the threshold portion of the pixels in the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) in each color channel of said number of color channels (341 , 342, 343) represent light intensity levels in the pre-defined range (R), and the pixels in at least one of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels (I) predominantly above (420) the pre-defined range (R), control the camera (140) to adjust its exposure and / or ISO settings (xs’) to decrease the light intensity of the image data (Dimg) that are registered subsequent to the at least one first frame.

4. The controller (100) according to any one of claims 2 or 3, wherein the check of the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) against the pre-defined range (R) of light intensity levels (I) comprises performing at least one statistical analysis of the light intensity levels (I) represented by the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6).

5. The controller (100) according to any of the preceding claims, wherein the at least one first frame of the image data (Dimg) comprises at least one three-dimensional image with range data specifying respective distances between an image sensor plane in the camera (140) and different imaged surfaces represented by the image data (Dimg), the at least one quality criterion defines a threshold degree of graininess that the at least one first frame of the image data (Dimg) must not exceed, and the controller (100) is configured to:check the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) against the threshold degree of graininess, and if the threshold degree of graininess is exceeded, control the camera (140) to adjust its exposure and / or ISO settings (xs’), such that a first parameter specifying an exposure time for the camera (140) is increased, a second parameter specifying an aperture value for the camera (140) is increased and / or a third parameter specifying an ISO value for the camera (140) is decreased.

6. The controller (100) according to claim 5, wherein the check of the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) against the threshold degree of graininess comprises performing at least one statistical analysis of the distances represented by the respective set of pixels in each of the at least one region of interest (RO11 , ROI2, ROI3, ROI4, ROI5, ROI6).

7. The controller (100) according to any of the preceding claims, wherein the at least one body part comprises at least one teat tip, an entire teat (131 , 132, 133, 134) and / or at least one transition region between at least one teat (131 ) and an udder (130) of a milk producing animal.

8. The controller (100) according to any of the preceding claims, wherein the control of the automatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) comprises at least one of: controlling a robot arm (110) to attach teatcups (111 , 112, 113, 114) to the teats of the animal (130) whose at least one body part (131 , 132, 133, 134) is represented by the image data (D img) , and selecting a teat liner for the animal (130) whose at least one body part (131 , 132, 133, 134) is represented by the image data (Dimg) .

9. The controller (100) according to any of the preceding claims, wherein the controller (100) is configured to: conduct a voting procedure, wherein an adjustment of the exposure and / or ISO settings called for by each region of interest is weighted by a centering factor, which is delimited within a predefined range, is based on a distance (d4, ds) between a respective center (C4; C5) of the region of interest (ROI4; ROI5) and a center (C) of the at least one first frame of the image data (Dimg) and influences the exposure and / or ISO settings called for by each region of interest (ROH; ROI5) by a relationship being inversely proportional to said distance (d4, ds), count the votes from all the regions of interest, each of which votes reflects a respective amount and direction of adjustment weighted by the centering factor, and determine an adjustment of the exposure and / or ISO settings with respect to an amount and direction in relation to a current setting thereof based on a majority ruling of said votes.

10. The controller (100) according to any of claims 1 to 8, wherein the regions of interest (ROI1 , ROI2, ROI3, ROH, ROI5, ROI6) are organized in first, second and third sets of regions of interest, which first set of regions of interest (ROI3, ROH) are located in a central zone (203) of the image data (Dimg), which second set of regions of interest (ROI1 , ROI2) are located in an outer zone (202) surrounding the central zone (203) and which third set of regions of interest (ROI5, ROI6) are located in peripheral zone (201 ) surrounding the outer zone (202), the controller (100) is configured to: conduct a voting procedure, wherein an adjustment of the exposure and / or ISO settings (xs’) called for by each region of interest in the central zone (203) is given a weight factor 3, an adjustment of the exposure and / or ISO settings (xs’) called for by each region of interest in the outer zone (202) is given a weight factor 2 and an adjustment of the exposure and / or ISO settings (xs’) called for by each region of interest in the peripheral zone (201 ) is given a weight factor 1 ,count the votes from all the regions of interest, each of which votes reflects a respective amount and direction of adjustment, and determine an adjustment of the exposure and / or ISO settings (xs’) with respect to an amount and direction in relation to a current setting thereof based on a majority ruling of said votes.

11. The controller (100) according to any of the preceding claims, wherein said at least one size-shape criterion relates to at least one of: a contour of a body, or part thereof; a length, or range of lengths of a body, or part thereof; a width, or range of widths of a body, or part thereof; and a shape of a body part.

12. The controller (100) according to any of the preceding claims, wherein the exposure and / or ISO settings comprise at least one of the following parameters for the camera (140): a first parameter specifying an exposure time, a second parameter specifying an aperture value, and a third parameter specifying an ISO value.

13. A computer-implemented method for an automatic milking arrangement (110), which method is performed in a processing unit (101 ) in a controller (100), the method comprising: obtaining at least one first frame of image data (Dimg) from a camera (140), which image data (Dimg) represent at least one body part (131 , 132, 133, 134) of a milking animal (130), and which image data (Dimg) are registered using default exposure and / or ISO settings (xs), and controlling the automatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) based on the obtained image data (Dimg), characterized by: defining at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) in the at least one first frame of the image data(Dimg), wherein each of the at least one region of interest comprises a respective set of pixels of the at least one first frame of the image data (Dimg), the at least one region of interest (ROI 1 , ROI2, ROI3, ROI4, ROI5, ROI6) being defined by: performing a search procedure in the at least one first frame of the image data (Dimg), which search procedure is configured to detect at least one image object fulfilling at least one size-shape criterion, and which search procedure is performed in three-dimensional image data specifying respective distances between an image sensor plane in the camera (140) and different imaged surfaces represented by the image data (Dimg), and defining the at least one region of interest within the at least one image object that fulfils said at least one size-shape criterion, checking, in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6), if the respective set of pixels fulfil at least one quality criterion, if the respective set of pixels in each of the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) fulfil the at least one quality criterion, controlling the camera (140) to register image data (Dimg) subsequent to the at least one first frame of image data (Dimg), and in parallel, controlling the automatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) based on the image data (Dimg) registered using the default exposure and / or ISO settings (xs), and if the respective set of pixels in at least one of the at least one region of interest (RO11 , ROI2, ROI3, ROI4, ROI5, ROI6) do not fulfil the at least one quality criterion, controlling the camera (140) to adjust its exposure and / or ISO settings (xs’) such that image data (Dimg) that are registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion, controlling the camera (140) to register image data (Dimg) using the adjusted exposure and / or ISO settings (xs’), and in parallel, controlling theautomatic milking arrangement (110) with respect to the at least one body part (131 , 132, 133, 134) based on the image data (Dimg) registered using the adjusted exposure and / or ISO settings (xs’).

14. A computer program (103) loadable into a non-volatile data carrier (105) communicatively connected to a processing unit (101 ), the computer program (103) comprising software for executing the method according to claim 13 when the computer program (103) is run on the processing unit (101 ).

15. A non-volatile data carrier (105) containing the computer program (103) of the claim 14.

Citation Information

Patent Citations

  • A method and system for the identification of animals

    EP4187505A1

  • System and method for identification of individual animals based on images of the back

    US11080522B2

  • A method and apparatus for determining the identity of an animal of a herd of animals

    WO2021032890A2

  • System and method for filtering data captured by a 2D camera

    US10127446B2

  • Systems and methods for image exposure

    US10630903B2