Controller for an automatic milking arrangement, computer-implemented method, computer program and non-volatile data carrier
The controller for automatic milking systems addresses the challenge of reliable image-based control by adjusting camera settings based on animal identification and real-time image quality, ensuring efficient and accurate milking operations.
Patent Information
- Application Number
- PCT/SE2024/050945
- 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
Existing technologies face challenges in ensuring reliable image-based control of automatic milking arrangements, as they struggle to consistently capture high-quality image data of dairy animals under varying conditions.
A controller for an automatic milking arrangement that obtains identification from an identification system and adjusts camera exposure and ISO settings based on pre-stored settings or real-time image data quality criteria, ensuring high-quality image capture of animal body parts like teat tips and entire teats.
The solution enables efficient and reliable image-based control of automatic milking systems by quickly adapting camera settings to capture high-quality images of individual animals, improving the accuracy and consistency of milking operations.
Smart Images

Figure SE2024050945_15052025_PF_FP_ABST
Abstract
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 identification from an identification system, which identification reflects a unique identity of an animal. The controller is further configured to obtain exposure and / or ISO settings from a data memory, which exposure and / or ISO settings are selected for capturing image data of at least one body part of the animal whose unique identity is reflected by the identification. According to embodiments of the invention, the exposure and / or ISO settings include an exposure time, an aperture value and / or ISO value for the camera. Additionally, the at least one body part body part may for example be a teat tip, an entire teat and / or a transition region between at least one teat and an udder of a milk producing animal. The selected exposure and / or ISO settings are such that these settings are estimated to render a camera adapted to capture high-quality image data of at least one body part of the animal in question, either because the exposure and / or ISO settings constitute a well-founded default choice, or because these settings have been derived based on an earlier imaging of said animal. The controller is configured to obtain image data from a camera, which image data represent the at least one body part, and which image data are registered using the stored exposure and / or ISO settings obtained from the data memory. Further, 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. In particular, the controller is configured to control the camera to register at least one first frame of the image data using the exposure and / or ISO settings obtained from the data memory; 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 contains a respective set of pixels of the at least one first frame of the image data; and check, in each of the at least one region of interest, if the respective set of pixels fulfil at least one quality criterion. Given that 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 cause the exposure and / or ISO settings for the animal whose unique identity is reflected by the identification to be maintained unaltered in the data memory. However, 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, 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.
[0012] 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, if not already at a first encounter with the animal at least in a following encounter.
[0013] Preferably, if the camera is controlled to adjust its exposure and / or ISO settings, the controller is configured to also cause the adjusted exposure and / or ISO settings to be stored in the data memory to replace the exposure and / or ISO settings stored therein for the animal whose unique identity is reflected by the identification. Thus, next time this animal interacts with the automatic milking arrangement, it is likely that the camera is able to capture high- quality image data of the at least one body part already in the first frame.
[0014] Preferably, the data memory contains exposure and / or ISO settings for a number of animals, e.g. many hundreds, which each is associated to a respective unique identity reflected by a respective identification that is stored the data memory in association with the exposure and / or ISO settings for the respective animal. This namely enables the controller to quickly adapt the camera’s settings to the specific visual characteristics of each animal, so that image data thereof may be recorded at high quality.
[0015] 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 image, and the at least one quality criterion defines a pre-defined range of light intensity levels within which predefined 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 rep- resent 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.
[0016] According to 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.
[0017] 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 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 relati- vely 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.
[0018] 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.
[0019] According to a further embodiment of this aspect of the invention, the identification obtained from the identification system contains a first time stamp and the image data obtained from the camera contains a second time stamp. Here, the controller is configured to determine that the animal whose unique identity is reflected by the identification is imaged by the image data if the first and second time stamps are within a predefined interval of time from one another. Thereby, it is straightforward for the controller to associate the image data to the correct animal identity. According to another embodiment of this aspect of the invention, for each animal whose identification is stored in the data memory, the data memory contains respective exposure and / or ISO settings for at least two different distances between the camera and the at least one body part. Further, in response to controlling the camera to adjust its exposure and / or ISO settings for one of the at least two distances, the controller is configured to cause a respective correction factor to be stored in the data memory for each of the at least one other distance in addition to said one distance, which respective correction factor is based on the adjustment made for said one distance. Consequently, any adjustments of the exposure and / or ISO settings for one distance will automatically have an impact also for any other stored distances where such adjustments are relevant.
[0020] 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 yet another embodiment of this aspect of the invention, after that the camera has attained predefined position in relation to the milking animal, the controller is configured to define the at least one region of interest by performing a search procedure 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. 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, 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, a shape of a body part and / or a fur / skin pattern. Consequently, relevant image objects, such as teat tips, entire teats and / or transition regions between teats and the udder may be detected and have an influence over the exposure and / or ISO settings.
[0022] According to one embodiment of this aspect of the invention, the identification system includes a radio-frequency-identification reader and / or an image registering unit that is independent from the camera configured to register the image data representing the at least one body part. Thus, the invention is flexible in terms of the specific animal identification means.
[0023] According to yet another embodiment of this aspect of the invention, the controller is specifically configured to control a robot arm to attach teatcups to the teats of the animal whose unique identity is reflected by the identification and / or selecting a teat liner for the animal whose unique identity is reflected by the identification. This means that the invention may both be actively employed in the actual milk extraction, and in an adjustment procedure preceding the milk extraction.
[0024] 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 identification from an identification system, which identification reflects a unique identity of an animal. The method further involves obtaining exposure and / or ISO settings from a data memory, which exposure and / or ISO settings are selected for capturing image data of at least one body part of the animal whose unique identity is reflected by the identification. Thereafter, the method involves obtaining image data from a camera, which image data represent the at least one body part, and which image data are registered using the stored exposure and / or ISO settings obtained from the data memory. In parallel, the method 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 controlling the camera to register at least one first frame of the image data using the exposure and / or ISO settings obtained from the data memory; 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 comprises a respective set of pixels of the at least one first frame of the image data; and checking, in each of the at least one region, whether 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 method involves causing the exposure and / or ISO settings for the animal whose unique identity is reflected by the identification to be maintained in the data memory, i.e. remain unaltered. If, however, the respective set of pixels in each of the at least one region of interest do not fulfil the at least one quality criterion, the method involves controlling 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.
[0025] The advantages of this method, as well as the preferred embodiments thereof, are apparent from the discussion above with reference to the proposed system.
[0026] 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.
[0027] According to another aspect of the invention, the object is achieved by a non-volatile data carrier containing the above computer program.
[0028] Further advantages, beneficial features and applications of the present invention will be apparent from the following description and the dependent claims.
[0029] BRIEF DESCRIPTION OF THE DRAWINGS
[0030] 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.
[0031] Figure 1 schematically illustrates an automatic milking arrangement that is controllable by a controller according to one embodiment of the invention;
[0032] Figure 2 illustrates how different regions of interest may be defined in the image data according to embodiments of the invention;
[0033] Figures 3a-b illustrate one aspect of a quality criterion related to a degree of graininess of the image data according to one embodiment of the invention; Figures 4a-d illustrate aspects of a quality criterion related to ranges of light intensity levels of the image data according to embodiments of the invention;
[0034] Figures 5a-c illustrate adjustments of the exposure and / or ISO settings for different distances between the camera and the at least one body part according to one embodiment of the invention; and
[0035] Figure 6 illustrates, by means of a flow diagram, the general method according to the invention.
[0036] DETAILED DESCRIPTION
[0037] 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.
[0038] The controller 100 is configured to control the automatic milking arrangement 110 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 110 to attach teatcups to the teats 131 , 132, 133 and 134 respectively of the animal’s udder 130.
[0039] To this aim, the controller 100 is configured to obtain identification IDi from an identification system 150, e.g. a radio-frequency-iden- tification (RFID) reader that extracts an identification IDi from an RFID tag attached to the animal, which identification IDi , in turn, reflects a unique identity of an animal.
[0040] The controller 100 is further configured to obtain exposure and / or ISO settings IDi :xsi from a data memory 120, which exposure and / or ISO settings IDi :xsi are selected for capturing image data Dimg of at least one body part 131 , 132, 133 and 134 of the animal whose unique identity is reflected by the identification IDi . The exposure and / or ISO settings IDi :xsi influence the brightness of the image data Dimgproduced 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.
[0041] 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.
[0042] 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 Dimg between 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.
[0043] 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.
[0044] 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 stored exposure and / or ISO settings IDi:xsi, which are obtained from the data memory 120. As mentioned above, the stored exposure and / or ISO settings IDi :xsi are selected for capturing image data Dimg of the at least one body part 131 , 132, 133 and 134 of the animal whose unique identity is reflected by the identification IDi . The selection of the exposure and / or ISO settings IDi:xsi, in turn, may mean that the exposure and / or ISO settings IDi :xsi have default values, which are estimated to be adequate for a majority of the animals to be depicted. However, as will be explained below, the selection may also mean that the exposure and / or ISO settings IDi :xsi have been determined as a result of an adjustment based on a previous imaging of the of the at least one body part 131 , 132, 133 and 134 of the animal in question. Preferably, the data memory 120 includes exposure and / or ISO settings IDi:xsi, IDi :xsnfor a number of animals, e.g. many hundreds of animals, which each is associated to a respective unique identity reflected by a respective identification I Di , ; IDnthat is stored the data memory 120 in association with the respective exposure and / or ISO settings IDi:xsi, ... , IDi :xsnfor that respective animal. Consequently, it is straightforward to retrieve the appropriate camera settings for each animal whenever a given animal is identified by the identification system 150.
[0045] Further, 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 Dimg using the exposure and / or ISO settings IDi :xsi obtained from the data memory 120.
[0046] 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. Figure 2 illustrates how different regions of interest may be defined in the image data Dimg according to one embodiment of the invention.
[0047] 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 540 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 or 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.
[0048] 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; a shape of a body part; and / or a fur / skin pattern. 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 udder-sized.
[0049] Figure 2 exemplifies image data Dimgin the form of a still image frame with regions of interest ROI1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively of which a first set of regions of interest ROI3 and ROI4 are located in a central zone 203 of the still image frame, a 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 a 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, which respective sets of pixels may or may not contain equally many pixels. 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 a center 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. As exemplified in Figure 2, 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.
[0050] 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.
[0051] If the respective set of pixels in each of the regions of interest RO1 1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively fulfil the at least one quality criterion, the controller 100 is configured to cause the exposure and / or ISO settings IDi :xsi for the animal whose unique identity is reflected by the identification I Di to be maintained unaltered in the data memory 120. In other words, the controller 100 simply refrains from altering the stored exposure and / or ISO settings IDi :xsi .
[0052] If, however, one or more of the respective sets of pixels in the regions of interest ROI 1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively 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 for image data Dimgthat are registered subsequent to the at least one first frame. Specifically, according to the invention, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings such that the image data Dimg are estimated to fulfil the at least one quality criterion. This will be discussed in further detail below referring to Figures 3a, 3b, 4a, 4b, 4c, 4d, 5a, 5b and 5c.
[0053] 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.
[0054] 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.
[0055] According to one embodiment of the invention, if the camera 140 is controlled to adjust its exposure and / or ISO settings, the controller 100 is further configured to cause the adjusted exposure and / or ISO settings IDi:xsi’ to be stored in the data memory 120 to replace the exposure and / or ISO settings IDi :xsi stored therein for the animal whose unique identity is reflected by the identification I Di . As a result, next time when the same animal is identified, i.e. when the controller 100 obtains the identification IDi from the identification system 150, the camera 140 will register image data Dimg that already from the first frame have a high probability of fulfilling the at least one quality criterion.
[0056] 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.
[0057] Referring now to Figures 4a to 4d, 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.
[0058] 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 pre- defined range R. Figure 4a shows an example where a histogram 410 represents light intensity levels I predominantly below the predefined range R, and Figure 4b shows an example where a histogram 420 represents light intensity levels I predominantly above the pre-defined range R.
[0059] Figure 4c shows a monochrome example of a histogram 430 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 4d shows an example corresponding to that in Figure 4c, however where three separate histograms 441 , 442 and 443 reflect a respective color channel, e.g. red, green and blue respectively, and a histogram 440 reflects a combined channel, where all of said channels represent light intensity levels I predominantly within the pre-defined range R.
[0060] 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.
[0061] 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. 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.
[0062] 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 .
[0063] Referring now to Figures 3a and 3b, we will discuss other quality criteria, which according to embodiments of the invention, may be employed as alternatives to or in combination with the above-described quality criterion.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] Figure 3b shows a partial enlargement of the region of interest R19 in Figure 3a, which partial enlargement exclusively contains pixels representing a teat tip, and the region of interest R19 only contains a minimum of pixels that represent non-teat surfaces. In an ideal situation, all the pixels representing the teat tip should specify essentially the same distances to the image sensor plane. More precisely, due to the general cylindric shape of the teat, the distances specified by the pixels in each pixel column representing the teat should have values being very similar to one another. However, close to the teat tip, somewhat larger distance variations would be expected also within each pixel column because of the pointiness of the tip. In any case, disregarding any pixels that possibly represent non-teat surfaces, the distances represented by the pixels in the region of interest ROI2 should only show variations within a relatively short span of distances. As mentioned earlier, a low SNR in the image data Dimg may appear as a high degree of graininess. A high degree of graininess, in turn, may be equivalent to abnormally large variations in the distances specified by the neighboring pixels.
[0068] Thus, the degree of graininess in the image data Dimgmay be investigated as a quality measure, e.g. by comparing the distances specified by the neighboring pixels that represent the same surface of an object, here exemplified by first and second distances d1 1 and d 12 represented by first and second pixels px1 1 and px12 respectively of third and fourth distances d21 and d22 represented by third and fourth pixels px21 and px22 respectively.
[0069] Nevertheless, in general, at least in an initial stage of the procedure, it is impossible to know which pixel that represents which surface in the image data Dimg. Therefore, according to one embodiment of the invention, the controller 100 is configured to check the respective set of pixels in regions of interest ROI 1 , ROI2, ROI3, ROI4, ROI5 and ROI6 respectively against the threshold degree of graininess by performing at least one statistical analysis of the distances represented by the respective set of pixels in said regions of interest. Thus, the controller 100 may 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 degree of graininess is exceeded.
[0070] 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 image data Dimg indicate that the degree of graininess is not exceeded.
[0071] Figures 5a to 5c illustrate adjustments of the exposure and / or ISO settings for different distances ds, d and di. respectively between an image sensor 540 in the camera 140 and at least one imaged body part 131 according to one embodiment of the invention. As mentioned above, the data memory 120 preferably includes expo- sure and / or ISO settings IDi:xsi, IDi :xsnfor a number of animals. In this embodiment of the invention, the data memory 120 includes respective exposure and / or ISO settings for each of at least two distances, here exemplified by ds, d and di. in Figures 5a, 5b and 5c respectively, between the image sensor 540 and the at least one body part, here exemplified by the teat 131.
[0072] In response to controlling the camera 140 to adjust its exposure and / or ISO settings as described above for one of the distances, say d, the controller 100 is further configured to cause a respective correction factor to be stored in the data memory 120 for each of the at least one other distances, here ds and di_, in addition to said one distance d. For example, a first distance d may represent a typical separation of the image sensor 540 from the body part 131 , whereas second and third distances ds and di. respectively represent shorter and longer separations of the image sensor 540 from the body part 131. In any case, the respective correction for the other distances are is based on the adjustment made for first distance d in respect of which the camera 140 to adjust its exposure and / or ISO settings. For instance, the second distance ds may have a correction factor 0.8 and the third distance di. may have a correction factor 1.2.
[0073] Returning again to Figure 1 , as an alternative or supplement to the above-mentioned RFID reader, the identification system 150 may contain an image registering unit, which is independent from the camera 140. Namely, today, image based identification constitutes a reliable and cost-efficient solution for identifying individual animals in a herd.
[0074] Moreover, according to one embodiment of the invention, to associate the identification I Di with correct image data Dimg, the identification IDi obtained from the identification system 150 includes a first time stamp and the image data Dimgobtained from the camera 140 contains a second time stamp, which first and second time stamps are produced based on a common time reference. The controller 100 is further configured to determine that the animal whose unique identity is reflected by the identification I Di is imaged by the image data Dimgif the first and second time stamps are within a predefined interval of time from one another. The extension of the predefined interval preferably depends on the implementation. In an automatic milking arrangement including a rotary milking platform the predefined interval should be relatively short to allow distinction between different animals entering the platform, whereas in a milking-robot implementation the predefined interval may be relatively long.
[0075] It is generally advantageous if the controller 100 is configured to effect the above-described procedure 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 .
[0076] In order to sum up, and with reference to the flow diagram in Figure 6, 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.
[0077] In a first step 610, identification is obtained from an identification system, for example an RFID reader or an image registering unit. The identification reflects a unique identity of an animal, typically a dairy animal.
[0078] Then, in a step 620, exposure and / or ISO settings are obtained from a data memory, which exposure and / or ISO settings are selected for capturing image data of at least one body part of the animal whose unique identity is reflected by the identification. This means that the exposure and / or ISO settings are either default values expected to provide image data of adequate quality for most animals, or the exposure and / or ISO settings have been 2Q adjusted to be specifically suitable for the identified animal in a previous completion of the method with respect to the animal in question.
[0079] Subsequently, in a step 630, image data are obtained from a camera, which image data represent the at least one body part, which image data are registered using the stored exposure and / or ISO settings obtained from the data memory, and which image data contain at least one first frame.
[0080] A following step 640 defines at least one region of interest in the at least one first frame of the image data, which at least one region of interest contains a respective set of pixels of the at least one first frame of the image data. In step 640, it is further checked if, in each of the at least one region of interest, the respective set of pixels fulfil at least one quality criterion. If so, the procedure continues to a step 670; and otherwise, a step 650 follows.
[0081] In step 650, the camera is controlled to adjust its exposure and / or ISO settings so that image data registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion. For example, if the at least one first frame of the image data was under exposed, the camera is controlled to increase the light intensity of the image data that are registered subsequent to the at least one first frame, i.e. render the recorded image data brighter.
[0082] Thereafter, in a step 660, the adjusted exposure and / or ISO settings are stored in a data memory to replace the exposure and / or ISO settings previously stored therein for the animal whose unique identity is reflected by the identification.
[0083] Subsequently, step 670 follows in which image data are registered using the stored exposure and / or ISO settings, i.e. either the previously stored settings or the settings adjusted in step 650. Thus, if the at least one quality criterion is fulfilled in step 640, the exposure and / or ISO settings for the animal whose unique identity is reflected by the identification are maintained in the data me- mory. In practice, this typically means that nothing is done in relation to the data memory.
[0084] In step 680 following step 670, it is checked if a controlling of the automatic milking arrangement with respect to the at least one body part has been completed, which controlling is based on the obtained image data. The controlling may here for example involve controlling a robot arm to attach teatcups to the teats of the animal whose unique identity is reflected by the identification, or selecting a teat liner for the animal whose unique identity is reflected by the identification. If said controlling has been completed, the procedure loops back to step 610; and otherwise, the procedure loops back to step 670 for continued image registration and control of the automatic milking arrangement.
[0085] The process steps described with reference to Figure 6 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.
[0086] 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 appended claims.
[0087] 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.
[0088] 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.
[0089] 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 identification (IDi) from an identification system (150), which identification (I Di ) reflects a unique identity of an animal, obtain exposure and / or ISO settings (IDi :xsi) from a data memory (120), which exposure and / or ISO settings (IDi :xsi) are selected for capturing image data (Dimg) of at least one body part (131 , 132, 133, 134) of the animal whose unique identity is reflected by the identification (I Di ) , obtain image data (Dimg) from a camera (140), which image data (Dimg) represent the at least one body part (131 , 132, 133, 134), and which image data (Dimg) are registered using the stored exposure and / or ISO settings (IDi :xsi) obtained from the data memory (120), 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: control the camera (140) to register at least one first frame of the image data (Dimg) using the exposure and / or ISO settings (IDi :xsi) obtained from the data memory (120), 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) , 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, cause the exposure and / or ISO settings (IDi :xsi) for the animal whose unique identity is reflected by the identification (IDi) to be main-tained in the data memory (120), 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 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.
2. The controller (100) according to claim 1 , wherein, if the camera (140) is controlled to adjust its exposure and / or ISO settings, the controller (100) is further configured to cause the adjusted exposure and / or ISO settings (IDi :xsi’) to be stored in the data memory (120) to replace the exposure and / or ISO settings (IDi :xsi) stored therein for the animal whose unique identity is reflected by the identification (IDi).
3. The controller (100) according to any of claims 1 or 2, 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 least one region of interest (RO11 , ROI2, ROI3, ROI4, ROI5, ROI6) represent light intensity levels (I) predominantly below (410) the predefined range (R),control the camera (140) to adjust its exposure and / or ISO settings 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 pre-defined range (R), 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.
4. The controller (100) according to claim 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 predefined 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 (540) 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 ofgraininess is exceeded, control the camera (140) to adjust its exposure and / or ISO settings, 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 identification (IDi) obtained from the identification system (150) comprises a first time stamp, the image data (Dimg) obtained from the camera (140) comprises a second time stamp, and the controller (100) is configured to determine that the animal whose unique identity is reflected by the identification (I Di ) is imaged by the image data (Dimg) if the first and second time stamps are within a predefined interval of time from one another8. The controller (100) according to any one of the preceding claims, wherein the data memory (120) comprises exposure and / or ISO settings (IDi:xsi, ... , IDi :xsn) for a number of animals, which each is associated to a respective unique identity reflected by a respective identification (IDi, IDn) that is stored the data memory (120) in association with the exposure and / or ISO settings (IDi:xsi, ... , IDi :xsn) for that respective animal.
9. The controller (100) according to claim 8, wherein for each animal of said number of animals, the data memory (120) comprises respective exposure and / or ISO settings for at least two dis-tances (ds, d, di.) between the camera (140) and the at least one body part (131 , 132, 133, 134), and, in response to controlling the camera (140) to adjust its exposure and / or ISO settings for one of the at least two distances (d), the controller (100) is further configured to cause a respective correction factor to be stored in the data memory (120) for each of the at least one other distance (ds, di.) in addition to said one distance, which respective correction factor is based on the adjustment made for said one distance.
10. The controller (100) according to any of the preceding claims, wherein the regions of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) are organized in first, second and third sets of regions of interest, which first set of regions of interest (ROI3, ROI4) 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 first weight factor, 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 second weight factor 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 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, 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, after that the camera (140) has attained a predefined position in relation to the milking animal (130), the controller (100) is configured to define the at least one region of interest (ROI1 , ROI2, ROI3, ROI4, ROI5, ROI6) 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 (540) 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,.
12. The controller (100) according to claim 11 , 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; a shape of a body part; and a fur / skin pattern.
13. The controller (100) according to any of the preceding claims, wherein the identification system (150) comprises at least one of a radio-frequency-identification reader and an image registering unit that is independent from the camera (140).
14. 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.
15. 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 whose unique identity is reflected by the identification (I Di ) , and selecting a teat liner for the animal whose unique identity is reflected by the identification (I Di ) .
16. 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.
17. A computer-implemented method for an automatic milking arrangement (110), which method is performed in processing unit (101 ) in a controller (100), the method comprising: obtaining identification (IDi) from an identification system (150), which identification (I Di ) reflects a unique identity of an animal, obtaining exposure and / or ISO settings (IDi :xsi) from a data memory (120), which exposure and / or ISO settings (IDi :xsi) are selected for capturing image data (Dimg) of at least one body part (131 , 132, 133, 134) of the animal whose unique identity is reflected by the identification (I Di ) , obtaining image data (Dimg) from a camera (140), which image data (Dimg) represent the at least one body part (131 , 132, 133, 134), and which image data (Dimg) are registered using the stored exposure and / or ISO settings (IDi :xsi) obtained from the data memory (120), 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: controlling the camera (140) to register at least one first fra-me of the image data (Dimg) using the exposure and / or ISO settings (IDi :xsi) obtained from the data memory (120), 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) , 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, causing the exposure and / or ISO settings (IDi :xsi) for the animal whose unique identity is reflected by the identification (I Di ) to be maintained in the data memory (120), and if the respective set of pixels in each 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 such that image data (Dimg) being registered subsequent to the at least one first frame are estimated to fulfil the at least one quality criterion.
18. 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 claims 16 when the computer program (103) is run on the processing unit (101 ).
19. A non-volatile data carrier (105) containing the computer program (103) of the claim 18.
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
Method of exposure control for an imaging system
US7548270B2