Controller for automated milking devices, computer-based implementation method, computer program, and non-volatile data carrier
By adjusting camera exposure and ISO settings, and optimizing image capture based on animal identification and image quality standards, the problem of unstable image data capture in automated milking devices was solved, enabling efficient and reliable animal identification and milking processes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DELAVAL HLDG AB
- Filing Date
- 2024-11-05
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies in the control of imaging-based automated milking devices struggle to ensure reliable identification of dairy animals and high-quality image data capture, leading to instability in the automated milking process.
By configuring the controller to adjust the camera's exposure and ISO settings, and optimizing the image capture process based on the animal's unique identity and image data quality standards, including defining regions of interest and performing statistical analysis, high-quality image data capture can be ensured.
It enables rapid, high-quality image data capture for each animal, improves the reliability and efficiency of automated milking devices, reduces image adjustment delay, and adapts to the visual characteristics of different animals.
Smart Images

Figure CN122138753A_ABST
Abstract
Description
Technical Field
[0001] This invention relates generally to automated milking of dairy animals. In particular, it relates to the controller and corresponding computer-implemented method as described in the preamble of claim 1. The invention also relates to computer programs and non-volatile data carriers storing such computer programs. Background Technology
[0002] The modern dairy industry relies heavily on advanced technologies in milk processing and livestock management. Specifically, advanced image processing often plays a crucial role in cattle management today. Below are some examples of such solutions.
[0003] WO 2021 / 032890 discloses a rotary milking platform comprising multiple pens and an RFID animal identification system for identifying animals entering the pens on the platform. A microprocessor reads signals from an image capture device and calculates a feature vector based on a captured image of each animal. Multiple reference feature vectors are stored, each including a corresponding metric matrix derived from the image captured by the image capture device and cross-referenced with the identity of the corresponding animal. The microprocessor compares the calculated feature vector of each animal with the stored reference feature vectors until a best match is determined. The identity of the animal matching the reference feature vector is then determined as the identity of the animal with the calculated feature vector. The determined identity of the animal in the relevant pen is compared with the identity of the animal determined by the RFID system for that pen. In a favorable comparison, the identity of the animal determined based on the captured image of the animal is confirmed as the animal's identity. If a conflict is determined between the two identities, a conflict alarm signal is generated.
[0004] EP 4 187 505 describes a method and system for identifying an animal. The method includes the steps of: acquiring data associated with an animal moving through space via an animal recording module, the data including video from a two-dimensional imaging sensor; extracting a set of parameters from the data by performing the steps of: determining visual features of the animal based on the data; identifying instances in the data representing the shape of the animal 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 identified reference points in a first module, the first module including a trained neural network; and generating multiple sets of parameters including the visual features and the determined one or more characteristics; based on... The generated multiple sets of parameters generate identifier vectors; a known identifier vector is selected from a first database of known identifier vectors, each known identifier vector corresponding to a unique registered animal; a list of matching scores is determined by comparing the generated identifier vectors with the selected known identifier vectors; in response to determining that at least one of the selected known identifier vectors has a matching score exceeding a threshold; a known identifier vector is selected from at least one of the known identifier vectors based on at least one criterion; the animal is associated using the selected known identifier vector; and the animal is identified as a unique registered animal of the selected known identifier vector; and in response to determining that no selected known identifier vector has a matching score exceeding a threshold, the animal is identified as unknown.
[0005] US 11,080,522 discloses a system and method for identifying individual animals based on images (such as 3D images) of animals, particularly cattle and dairy cows. Identifying individual animals can be complex when they live in areas or enclosures where they move freely. In a first aspect, this disclosure relates to a method for identifying individual animals within a group of animals with known identities, 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 anatomical structure and / or topological structure of the back of the preselected animal; and comparing and / or matching said extracted data with reference data corresponding to the anatomical structure and / or topological structure of the back of an animal with known identities, thereby identifying the preselected animal. This method and system can be used to monitor feed intake, such as feed intake in dairy cows, and health status.
[0006] Therefore, various image-based methods are known for identifying dairy animals in different milking-related situations. However, ensuring reliable control of automated milking devices based on image data registered in parallel with such control can be challenging. Summary of the Invention
[0007] Therefore, the object of the present invention is to provide a solution that alleviates the above-mentioned problems and thus allows for effective and reliable image-based control of automated milking devices.
[0008] According to one aspect of the invention, this objective is achieved by a controller for an automated milking apparatus, wherein the controller is configured to obtain an identification from an identification system, the identification reflecting the unique identity of the animal. The controller is further configured to obtain exposure and / or ISO settings from a data storage device, the exposure and / or ISO settings being selected for capturing image data of at least one body part of the animal whose unique identity is reflected by the identification. According to an embodiment of the invention, the exposure and / or ISO settings include the camera's exposure time, aperture value, and / or ISO value. Additionally, the at least one body part may be, for example, the tip of a teat, the entire teat, and / or the transition area between at least one teat and the udder of a milking animal. The selected exposure and / or ISO settings are such that these settings are estimated to make the camera suitable for capturing high-quality image data of at least one body part of the animal in question, because the exposure and / or ISO settings constitute a well-founded default selection, or because these settings are derived based on early imaging of the animal. The controller is configured to obtain image data from a camera representing at least one body part, and the image data is registered using stored exposure and / or ISO settings obtained from the data storage device. Furthermore, the controller is configured to control the automated milking device based on the acquired image data relative to at least one body part. Specifically, the controller is configured to: control the camera to register at least one first frame of image data using exposure and / or ISO settings obtained from a data storage device; define at least one region of interest (ROI) within the at least one first frame of image data, wherein each ROI within the at least one ROI contains a corresponding set of pixels from the at least one first frame of image data; and check whether the corresponding set of pixels within each ROI in the at least one ROI meets at least one quality criterion. Assuming that the corresponding set of pixels in each ROI within the at least one ROI meets at least one quality criterion, the controller is configured to keep the exposure and / or ISO settings of the animal whose unique identity is reflected by the identifier unchanged in the data storage device. However, if the corresponding set of pixels in at least one ROI within the at least one ROI does not meet at least one quality criterion, the controller is configured to control the camera to adjust its exposure and / or ISO settings such that the image data registered after the at least one first frame is estimated to meet at least one quality criterion.
[0009] The advantage of this controller is that it can quickly adjust camera parameters to capture high-quality image data of relevant body parts (e.g., nipples) of each animal in the herd—even if optimization is not achieved immediately upon first contact with the animal, this goal can at least be achieved on subsequent contact.
[0010] 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 a data memory, replacing the exposure and / or ISO settings stored therein for the animal whose unique identity is reflected by an identifier. Thus, the next time the animal interacts with the automated milking device, the camera may be able to capture high-quality image data of at least one body part already captured in the first frame.
[0011] Preferably, the data storage contains exposure and / or ISO settings for multiple animals (e.g., hundreds), each animal associated with a unique identity reflected by a corresponding identifier, which is stored in the data storage in association with the exposure and / or ISO settings for that animal. In other words, this allows the controller to quickly adapt the camera settings to the specific visual characteristics of each animal, enabling the recording of its image data in high quality.
[0012] According to one embodiment of this aspect of the invention, at least one first frame of image data comprises at least one two-dimensional image, and at least one quality standard defines a predefined range of light intensity levels, within which at least a threshold portion of pixels in a corresponding pixel set within each of at least one region of interest must represent the light intensity level. Here, a controller is configured to check the corresponding pixel set within each of at least one region of interest against the predefined range of light intensity levels. If the threshold portion of pixels in a corresponding pixel set within each of at least one region of interest does not represent a light intensity level within the predefined range, and pixels in at least one region of interest within at least one region of interest represent a light intensity level primarily below the predefined 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 registered after at least one first frame. Similarly, if the threshold portion of pixels in a corresponding pixel set within each of at least one region of interest does not represent a light intensity level within the predefined range, and pixels in at least one region of interest within at least one region of interest represent a light intensity level primarily above the predefined range, the controller is alternatively configured to control the camera to adjust its exposure and / or ISO settings to decrease the light intensity of the image data registered after at least one first frame. Therefore, sufficient camera adjustments can be achieved with very low latency.
[0013] According to another embodiment of this aspect of the invention, checking the corresponding pixel set in each region of interest against a predefined range of light intensity levels involves performing at least one statistical analysis of the light intensity level represented by the corresponding pixel set in each region of interest. For example, the controller may be configured to calculate the mean, median, and / or standard deviation of the light intensity level in each region of interest, and based thereon determine whether at least one quality criterion is met.
[0014] According to another embodiment of this aspect of the invention, at least one first frame of the image data comprises at least one three-dimensional image having range data of corresponding distances between an image sensor plane in a specified camera and different trans-imaging surfaces represented by the image data. Here, at least one quality criterion defines a threshold granularity level that at least one first frame of the image data must not exceed. Granularity represents the signal-to-noise ratio (SNR), where a high degree of granularity is equivalent to a relatively low SNR, and vice versa. In this embodiment of the invention, a controller is configured to examine the corresponding set of pixels in each region of interest against the threshold granularity level, and if the threshold granularity level is exceeded, the controller is configured to control the camera to adjust its exposure and / or ISO settings such that the granularity level is expected to decrease. This means that the controller is configured to increase a first parameter specifying the exposure time for the camera, increase a second parameter specifying the aperture value for the camera, and / or decrease a third parameter specifying the ISO value for the camera. Thus, the camera may be able to capture high-quality 3D image data of at least one body part already in the first frame when the animal under consideration interacts with the automated milking device next time.
[0015] According to another embodiment of this aspect of the invention, examining the corresponding pixel set in each of the at least one region of interest against a threshold granularity involves performing at least one statistical analysis of the distance represented by the corresponding pixel set in each of the at least one region of interest. Therefore, the controller may be configured, for example, to calculate the mean, median, and / or standard deviation values of the distance values defined by the corresponding pixel set in each of the at least one region of interest, and based thereon, to determine whether at least one quality criterion is met.
[0016] According to another embodiment of this aspect of the invention, the identifier obtained from the identification system includes a first timestamp, and the image data obtained from the camera includes a second timestamp. Here, the controller is configured to determine that the animal whose unique identity is reflected by the identifier is imaged from the image data if the first timestamp and the second timestamp are within a predefined time interval. Thus, the controller can directly associate the image data with the correct animal identity.
[0017] According to another embodiment of this aspect of the invention, for each animal whose identifier is stored in a data memory, the data memory contains corresponding exposure and / or ISO settings for at least two different distances between the camera and at least one body part. Furthermore, 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 such that for each of at least one other distance besides said one distance, a corresponding correction factor is stored in the data memory, the corresponding correction factor being based on the adjustment made for said one distance. Therefore, any adjustment to the exposure and / or ISO settings for one distance will automatically also have an effect on any other stored distance where such adjustment is relevant.
[0018] According to another embodiment of this aspect of the invention, regions of interest (ROIs) are organized into a first group of ROIs, a second group of ROIs, and a third group of ROIs, wherein the first group of ROIs is located in the central region of the image data, the second group of ROIs is located in the outer region surrounding the central region, and the third group of ROIs is located in the peripheral region surrounding the outer region. Here, the controller is configured to perform a voting process, wherein adjustments to exposure and / or ISO settings requested by each ROI in the central region are given a first weighting factor, adjustments to exposure and / or ISO settings requested by each ROI in the outer region are given a second weighting factor, and adjustments to exposure and / or ISO settings requested by each ROI in the peripheral region are given a third weighting factor, wherein the first weighting factor is greater than the second weighting factor, and the second weighting factor is greater than the third weighting factor. The controller is further configured to count votes from all ROIs, each vote reflecting a corresponding adjustment amount and direction, and to determine the amount and direction of adjustment of the exposure and / or ISO settings relative to their current settings based on the majority decision of the votes. Therefore, pixels located at the center of the frame have a greater impact on any adjustments to exposure and / or ISO settings compared to pixels located relatively far from the center of the frame (e.g., near the edge of the frame).
[0019] According to another embodiment of this aspect of the invention, after the camera has reached a predefined position relative to the milking animal, the controller is configured to define at least one region of interest by performing a search process in at least one first frame of image data. The search process is configured to detect at least one image object that satisfies at least one size-shape criterion. The search process is performed in three-dimensional image data specifying the distances between the image sensor plane in the camera and the corresponding distances between different imaging surfaces represented by the image data. The controller is configured to define at least one region of interest within the at least one image object that satisfies the at least one size-shape criterion, which is related, for example, to the outline of a body or body part, the length or length range of a body or body part, the width or width range of a body or body part, the shape of the body part, and / or the fur / skin pattern. Therefore, relevant image objects (such as the tip of a nipple, the entire nipple, and / or the transition area between the nipple and the mammary gland) can be detected and have an impact on exposure and / or ISO settings.
[0020] According to one embodiment of this aspect of the invention, the identification system includes an RFID reader and / or a camera-independent image registration unit configured to register image data representing at least one body part. Therefore, the invention is flexible in terms of specific animal identification devices.
[0021] According to another embodiment of this aspect of the invention, the controller is specifically configured to control the robotic arm to attach the milk cup to the nipple of an animal whose unique identity is reflected by an identifier and / or to select a nipple pad for the animal whose unique identity is reflected by an identifier. This means that the invention can be used actively in actual milk collection as well as in the adjustment process prior to milk collection.
[0022] According to another aspect of the invention, this objective is achieved by a computer-implemented method executed in a processing unit in a controller, which is then arranged to control an automated milking apparatus. The method includes obtaining an identifier from an identification system, the identifier reflecting the unique identity of an animal. The method also includes obtaining exposure and / or ISO settings from a data storage device, the exposure and / or ISO settings being selected to capture image data of at least one body part of the animal whose unique identity is reflected by the identifier. Subsequently, the method includes obtaining image data from a camera representing at least one body part, and registering the image data using stored exposure and / or ISO settings obtained from the data storage device. In parallel, the method includes controlling the automated milking apparatus relative to the at least one body part based on the obtained image data. Specifically, the method includes: controlling the camera to register at least one first frame of image data using the exposure and / or ISO settings obtained from the data storage device; defining at least one region of interest in the at least one first frame of image data, wherein each region of interest comprises a corresponding set of pixels of the at least one first frame of image data; and checking in each of the at least one region whether the corresponding set of pixels meets at least one quality criterion. If the corresponding set of pixels in each region of interest within at least one region of interest satisfies at least one quality criterion, the method includes maintaining the exposure and / or ISO settings of the animal whose unique identity is reflected by the identifier in the data memory, i.e., unchanged. However, if the corresponding set of pixels in each region of interest within at least one region of interest does not satisfy at least one quality criterion, the method includes controlling the camera to adjust its exposure and / or ISO settings such that image data registered after at least one first frame is estimated to satisfy at least one quality criterion.
[0023] The advantages of this method and its preferred implementation are evident from the discussion of the system proposed in the above references.
[0024] According to another aspect of the invention, this objective is achieved by a computer program capable of being loaded into a non-volatile data carrier communicatively connected to a processing unit. The computer program includes software for executing the described method when the program is run on the processing unit.
[0025] According to another aspect of the invention, this objective is achieved by a non-volatile data carrier containing the aforementioned computer program.
[0026] Other advantages, beneficial features and applications of the invention will become apparent from the following description and dependent claims. Attached Figure Description
[0027] The invention will now be explained in more detail by way of preferred embodiments disclosed as examples and with reference to the accompanying drawings.
[0028] Figure 1 An automatic milking apparatus capable of being controlled by a controller according to one embodiment of the present invention is illustrated schematically;
[0029] Figure 2 This illustrates how different regions of interest can be defined in image data according to embodiments of the present invention;
[0030] Figures 3a to 3b This illustrates one aspect of a quality standard related to the granularity of image data according to an embodiment of the present invention;
[0031] Figures 4a to 4d Examples of quality standards related to the light intensity level range of image data according to embodiments of the present invention are illustrated.
[0032] Figures 5a to 5c An example of adjusting exposure and / or ISO settings for different distances between the camera and at least one body part according to an embodiment of the invention is illustrated; and
[0033] Figure 6 The general method according to the invention is illustrated by a flowchart. Detailed Implementation
[0034] Figure 1 A simplified automated milking apparatus 110 is shown, on which the present invention can be implemented. Here, according to one embodiment of the invention, the automated milking apparatus 110 is represented by a robotic arm that can be controlled by a controller 100. The robotic arm can be configured to carry one or more milk cups.
[0035] Controller 100 is configured to be based on image data D img An automatic milking device 110 is controlled relative to at least one body part of the animal. Figure 1 In the illustrated embodiment, the controller 100 is specifically configured to control the robotic arm 110 to attach milk cups to the nipples 131, 132, 133 and 134 of the animal's udder 130, respectively.
[0036] For this purpose, controller 100 is configured to obtain identification ID1 from identification system 150 (e.g., a radio frequency identification (RFID) reader that extracts identification ID1 from an RFID tag attached to an animal), which in turn reflects the unique identity of the animal.
[0037] The controller 100 is further configured to obtain exposure and / or ISO setting ID1:xs1 from the data storage 120, which is selected to capture image data D of at least one body part 131, 132, 133, and 134 of an animal whose unique identity is reflected by the identifier ID1. img .
[0038] Exposure and / or ISO settings ID1:xs1 affect the image data D generated by the image sensor array in camera 140. img The brightness. Exposure and / or ISO setting ID1:xs1 may contain one or more of three variable parameters, where the exposure time of camera 140 represents the first parameter. The aperture value represents the second parameter. Exposure time and aperture value are similar to each other because they both determine the amount of light reaching the image sensor array in camera 140. The amount of light reaching the image sensor array can be increased by increasing the exposure time or increasing the aperture value, or both.
[0039] For example, each photodetector in an image sensor array can generate a voltage proportional to the amount of light striking the photodetector. Therefore, an overall increase in the amount of light results in a higher voltage output from the photodetectors in the image sensor array.
[0040] Change image data D img Another way to adjust brightness is by modifying the camera's so-called ISO (International Organization for Standardization) setting. Therefore, the ISO value is the third of the three variable parameters. The ISO value is a mapping that indicates the brightness of the resulting image that the image sensor array should give in terms of exposure time and aperture value for a particular exposure setting. Slightly simplified, the ISO value can be viewed as the image data D... img The offset level of dynamic range between full black and full white. Increasing the ISO value shifts the entire dynamic range upward toward white, while decreasing the ISO value shifts the entire dynamic range downward toward black.
[0041] Each of the parameters—exposure time, aperture value, and ISO value—has its own specific advantages and disadvantages. While a longer exposure time is advantageous because it increases the amount of light reaching the image sensor array, it is disadvantageous because it risks causing motion artifacts in the form of blur. An increased aperture value is advantageous because it also increases the amount of light reaching the image sensor array. However, the larger the aperture value, the shallower the depth of field. That is, with a large aperture value, only objects within a very short distance from the camera will be in focus. Compared to the other two parameters, changes in the ISO value do not affect the amount of light reaching the image sensor array. Each image sensor array has a so-called base ISO value, which represents the technically optimal mapping of light read from the image sensor array to image data. Typically, the base ISO value represents the minimum recommended ISO value for a given image sensor array. Any ISO value higher than the base ISO value will make the image data brighter, but at the cost of reduced dynamic range, potentially even overexposure / cropping in highlights, and a decreased signal-to-noise ratio (SNR), which typically manifests as increased 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.
[0042] The controller 100 is configured to acquire image data D from the camera 140. img The image data D img At least one body part is represented, such as nipples 131, 132, 133, and 134 respectively. Image data D is registered using the stored exposure and / or ISO settings ID1:xs1 obtained from data memory 120. img As mentioned above, the stored exposure and / or ISO settings ID1:xs1 are selected to capture image data D of at least one body part 131, 132, 133, and 134 of the animal whose unique identity is reflected by the identifier ID1. img The selection of exposure and / or ISO setting ID1:xs1 can therefore mean that exposure and / or ISO setting ID1:xs1 has a default value that is estimated to be sufficient for most animals to be depicted. However, as will be explained below, the selection can also mean that exposure and / or ISO setting ID1:xs1 has been determined as the result of adjustments based on previous imaging of at least one body part 131, 132, 133, and 134 of the animal in question.
[0043] Preferably, the data storage 120 includes exposure and / or ISO settings ID1:xs1, ..., ID1:xs for multiple animals (e.g., hundreds of animals). n Each of the multiple animals is associated with a corresponding identifier ID1, ..., ID. nThe corresponding unique identity is associated with the corresponding animal's exposure and / or ISO settings ID1:xs1, ..., ID1:xs n The data is stored in the data storage 120 in a related manner. Therefore, whenever the identification system 150 identifies a given animal, the appropriate camera settings for each animal can be retrieved directly.
[0044] Furthermore, the controller 100 is configured to control the camera 140 to register image data D using the exposure and / or ISO settings ID1:xs1 obtained from the data memory 120. img At least one first frame, i.e., a still image.
[0045] According to the present invention, the controller 100 is configured to [process image data D]. img At least one region of interest is defined in at least one first frame. Figure 2 An example of how to process image data D according to one embodiment of the present invention is illustrated. img Different regions of interest are defined within the definition.
[0046] According to one embodiment of the invention, after the camera 140 has reached a predefined position relative to the milking animal 130, the controller 100 is configured to transmit image data D img The search process is performed in at least one of the first frames of the image data D. img At least one region of interest (ROI) is defined in at least one first frame, such as ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6. The search process is configured to detect image objects that satisfy at least one size-shape criterion. The search process is performed in the image sensor plane 540 of the designated camera 140 and is based on image data D. img The process is performed using three-dimensional image data representing the corresponding distances between different imaging surfaces. This means that TOF camera data can be used. Alternatively, two-dimensional image data supplemented with distance data can be used, such as image data determined via laser measurement or stereo imaging. Based on the results of the search process, the controller 100 is then configured to define one or more regions of interest within one or more image objects that satisfy at least one size-shape criterion. The controller 100 is configured to define at least one region of interest within at least one image object that satisfies at least one size-shape criterion.
[0047] According to embodiments of the invention, the size-shape criteria may relate to: the outline of the body or body part; the length or length range of the body or body part; the width or width range of the body or body part; the shape of the body part; and / or fur / skin patterns. Thus, for example, the search process can detect nipples represented by image objects that are 1 to 4 cm wide and extend from a relatively large object (approximately the size of a breast).
[0048] Figure 2 Image data D is illustrated in the form of still image frames. img The still image frame includes regions of interest (ROIs) 1, 2, 3, 4, 5, and 6. Specifically: the first set of ROIs 3 and 4 are located in the central region 203 of the still image frame; the second set of ROIs 1 and 2 are located in the outer region 202 of the still image frame, surrounding the central region 203; and the third set of ROIs 5 and 6 are located within the peripheral region 201 of the still image frame, surrounding the outer region 202. Each ROI contains image data D. img The corresponding pixel sets, which may contain the same number of pixels or may not contain the same number of pixels. In any case, when registering image data D... img In at least one first frame, it is assumed that the camera 140 has such a positioning and field of view relative to the animal that at least one body part 131, 132, 133, and 134 is located relatively close to the center of the still image frame. Therefore, it is generally preferred that pixels located at the center of the frame have a greater influence on any adjustments to exposure and / or ISO settings than pixels located relatively far from the center of the frame (e.g., pixels located near the edge of the still image frame).
[0049] like Figure 2 As illustrated, at least one body part 131, 132, 133, and 134 in the form of nipples may have different skin tones and may more or less obscure each other, thus affecting their depiction by camera 140 and / or at least partially blocking light reflection to camera 140. For example, one or more illuminators on camera 140 may emit infrared (IR) light toward at least one body part. Depending on the spatial relationship between the illuminators, camera 140, and at least one body part, different body parts or portions thereof may not be adequately illuminated by IR light.
[0050] To mitigate this problem, the controller 100 is configured to check whether the corresponding pixel set in each region of interest meets at least one quality criterion, for example, related to the light intensity level represented by the pixels in the corresponding pixel set in each region of interest and / or the SNR of the image data in each region of interest.
[0051] If the corresponding pixel set in each of the regions of interest (ROIs) ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 satisfies at least one quality criterion, then the controller 100 is configured such that the exposure and / or ISO setting ID1:xs1 of the animal whose unique identity is reflected by the identifier ID1 remains unchanged in the data storage 120. In other words, the controller 100 simply avoids changing the stored exposure and / or ISO setting ID1:xs1.
[0052] However, if one or more pixel sets in the corresponding pixel sets within the regions of interest ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 do not meet at least one quality criterion, then the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings for use with the image data D registered after at least one first frame. img Specifically, according to the present invention, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings, such that image data D img It is estimated to meet at least one quality criterion. This will be referenced below. Figure 3a , Figure 3b , Figure 4a , Figure 4b , Figure 4c , Figure 4d , Figure 5a , Figure 5b and Figure 5c Further detailed discussion.
[0053] In some cases, the light conditions and / or light reflection characteristics of at least one body part 131, 132, 133, and 134 can be obtained from image data D. imgThe light intensity is substantially altered throughout at least one first frame. For example, pixels in one or more regions of interest may be underexposed, while pixels in one or more other regions of interest may be overexposed. In such cases, it is preferable to assign different weights to the regions of interest based on their respective distances from the center of the frame. For example, to address situations where pixel values in some regions of interest indicate that the light intensity should be increased and pixel values in other regions of interest indicate that the light intensity should be decreased, the controller 100 may perform a voting process in which adjustments requested by each region of interest in the central region 203 are given a first weight factor, adjustments requested by each region of interest in the outer region 202 are given a second weight factor, and adjustments requested by each region of interest in the peripheral region 201 are given a third weight factor, the first weight factor being greater than the second weight factor, and the second weight factor being greater than the third weight factor. For example, the first weight factor could be 3, the second weight factor could be 2, and the third weight factor could be 1. However, of course, any other specific weight factor is equally conceivable, provided that they have the relative proportions indicated above.
[0054] The controller 100 counts votes from all regions of interest, each vote reflecting a corresponding adjustment amount and direction, i.e., upward or downward light intensity. Here, the majority decision determines the final adjustment of the exposure and / or ISO settings relative to their current settings in terms of amount and direction.
[0055] According to one embodiment of the invention, if the camera 140 adjusts its exposure and / or ISO settings, the controller 100 is further configured such that the adjusted exposure and / or ISO setting ID1:xs1' is stored in the data memory 120, replacing the exposure and / or ISO setting ID1:xs1 stored therein for the animal whose unique identity is reflected by the identifier ID1. Therefore, the next time the same animal is identified, i.e., when the controller 100 obtains the identifier ID1 from the identification system 150, the camera 140 will register the image data D already obtained from the first frame. img The image data has a high probability of meeting at least one quality standard.
[0056] If in image data D img In designating the nipple tips and / or the entire nipple 131, 132, 133, and 134, and controlling the robotic arm to attach milk cups 111, 112, 113, and 114 to the nipples of animals whose unique identities are reflected by identifier ID1, it is generally advantageous to define regions of interest covering the nipple tips and / or the nipples respectively. Control of the robotic arm is typically performed after the exposure and / or ISO settings of camera 140 have been adjusted according to the invention.
[0057] Now for reference Figures 4a to 4d According to one embodiment of the present invention, image data D img At least one first frame contains one or more two-dimensional (2D) images. Here, at least one quality criterion defines a predefined range R of light intensity level I, within which at least a threshold portion of the pixels in the corresponding pixel set of each of the regions ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 must respectively represent a light intensity level that satisfies the quality criterion. To test the quality criterion, controller 100 is configured to examine the corresponding pixel set of each of the at least one region of interest ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 against the predefined range R of light intensity level I.
[0058] If the threshold portion of the pixels in the corresponding pixel set in each region of interest does not represent the light intensity level in the predefined range R, then the controller 100 is further configured to determine whether the pixels in the region of interest represent a light intensity level I that is primarily below or above the predefined range R. Figure 4a An example is shown where histogram 410 represents a light intensity level I that is primarily below a predefined range R, and Figure 4b An example is shown in which histogram 420 represents a light intensity level I that is primarily above a predefined range R.
[0059] Figure 4c A monochrome example of histogram 430 is shown, which represents the light intensity level I mainly within a predefined range R, i.e., where no adjustment of the exposure or ISO settings of camera 140 is required. Figure 4d It shows the relationship with Figure 4c The examples in the example correspond to the examples in the example, however, the three separate histograms 441, 442 and 443 respectively reflect the corresponding color channels, such as red, green and blue, and histogram 440 reflects the combined channels, wherein all said channels represent light intensity levels I mainly within a predefined range R.
[0060] If the pixels in the regions of interest ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 represent light intensity levels I that are primarily below a predefined range R, then controller 100 is configured to control camera 140 to adjust its exposure and / or ISO settings to increase the image data D registered after at least one first frame. img The light intensity. In practice, this may involve increasing one or more of the following parameters of the camera 140: a first parameter specifying the exposure time, a second parameter specifying the aperture value, and / or a third parameter specifying the ISO value.
[0061] If the pixels in the regions of interest ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 represent light intensity levels I that are primarily above a predefined range R, then the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings to reduce the image data D registered after at least one first frame. img The light intensity. In practice, this may involve reducing one or more of the first, second, and / or third parameters of the camera 140.
[0062] Naturally, checking the threshold portion of pixels in the corresponding pixel set in each region of interest against the light intensity level in the predefined range R can also involve the voting process described above.
[0063] Furthermore, checking whether the corresponding pixel set in each of the regions of interest (ROIs) ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 meets a quality standard related to a predefined range R of light intensity level I preferably involves performing at least one statistical analysis on the light intensity level I represented by the corresponding pixel set in each of the ROIs. Therefore, the controller 100 can be configured to calculate the mean, median, and / or standard deviation values of the light intensity level in each ROI and determine whether at least one quality standard is met. If, for example, one or more ROIs contain pixel values with a light intensity level I, which is related to the light intensity level I defined by image data D... img It may be advantageous if the light intensity level I represented by pixels in at least one other region of interest in the first frame is substantially different. That is, thus, regions of interest representing outlier data can be given less weight or ignored entirely, rather than risking making the image data D... img The risk of data quality degradation in the remaining regions of interest.
[0064] Now for reference Figure 3a and Figure 3b We will discuss other quality standards, which, according to embodiments of the invention, can be used as alternatives to or in combination with the quality standards described above.
[0065] In addition to, or as a substitute for, 2D image data D img At least one first frame may contain at least one three-dimensional (3D) image, which has an image sensor plane in the designated camera 140 and is composed of image data D. img This represents the range of corresponding distances between different imaging surfaces. In this case, at least one quality standard defines the image data D. imgAt least one first frame must not exceed a threshold granularity level. The granularity level is then typically related to the image data D. img The SNR is related to this. This could mean, for example, that an SNR below a certain value is equivalent to a granularity level above a threshold level.
[0066] Here, the controller 100 is configured to examine the corresponding set of pixels in each of the regions of interest (ROIs) ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 for a threshold granularity level, respectively.
[0067] If the threshold granularity is exceeded, i.e., if the SNR drops below a certain value, the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO settings, such that the image data D registered after at least one first frame... img It is estimated to meet the quality standards. To this end, the controller 100 may increase a first parameter of the exposure time of the specified camera 140, increase a second parameter of the aperture value of the specified camera 140, and / or decrease a third parameter of the ISO value of the specified camera 140.
[0068] Figure 3b It shows Figure 3a Region of interest R in 19 A magnified view of a portion of the image, containing only pixels representing the tip of the nipple, with the region of interest R... 19 It contains only the minimum number of pixels representing non-papillary surfaces. Ideally, all pixels representing the nipple tip should be assigned substantially the same distance to the image sensor plane. More precisely, due to the roughly cylindrical shape of the nipple, the distances assigned to pixels in each pixel column representing the nipple should have very similar values to each other. However, due to the sharp features of the nipple tip, slightly larger distance variations are expected within each pixel column near the tip. In any case, disregarding any pixels that might represent non-papillary surfaces, the distances represented by pixels in the region of interest (ROI2) should only show variations within a relatively short distance span. As previously mentioned, image data D... img Low SNR can manifest as high granularity. High granularity can then be equivalent to unusually large variations in the distances specified by adjacent pixels.
[0069] Therefore, image data D img The degree of granularity in the image can be studied as a quality metric, for example, by comparing the distances specified by adjacent pixels representing the same surface of an object—here illustrated by the first distance d11 and the second distance d12 represented by the first pixel px11 and the second pixel px12, respectively, and the third distance d21 and the fourth distance d22 represented by the third pixel px21 and the fourth pixel px22, respectively.
[0070] However, generally speaking, at least in the initial stages of the process, the image data D is unknown. img Each pixel represents a surface. Therefore, according to one embodiment of the invention, the controller 100 is configured to examine the corresponding pixel sets in the regions of interest against a threshold granularity by performing at least one statistical analysis on the distances represented by the corresponding pixel sets in the regions of interest ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6. Thus, the controller 100 may be configured to calculate the average, median, and / or standard deviation values of the distance values defined by the corresponding pixel sets in each of the at least one regions of interest, and based on these, determine whether a granularity level has been exceeded.
[0071] Similar to the above, the controller can perform a voting process to resolve pixel values in some regions of interest that exceed the granularity level and are within the same image data D. img The pixel values in some other regions of interest indicate cases where the granularity level is not exceeded.
[0072] Figures 5a to 5c Examples of different distances d between the image sensor 540 in the camera 140 and at least one imaged body part 131 according to one embodiment of the invention are illustrated. S , d and d L The exposure and / or ISO settings are adjusted. As mentioned above, the data storage 120 preferably includes exposure and / or ISO settings ID1:xs1, ..., ID1:xs for multiple animals. n In this embodiment of the invention, the data storage 120 includes corresponding exposure and / or ISO settings for each of at least two distances between the image sensor 540 and at least one body part, the at least two distances being... Figure 5a , Figure 5b and Figure 5c The middle is composed of d respectively S , d and d L For example, the at least one body part is illustrated here by nipple 131.
[0073] In response to the control camera 140 adjusting its exposure and / or ISO settings for one distance, namely d, as described above, the controller 100 is further configured to adjust for at least one other distance besides said one distance d (here, d). S and d L Each distance in the data storage 120 is such that a corresponding correction factor is stored in the data memory 120. For example, the first distance d may represent a typical distance between the image sensor 540 and the body part 131, while the second distance d Sand the third distance d L These represent the shorter and longer distances between the image sensor 540 and the body part 131, respectively. In any case, the corresponding correction for other distances is based on the adjustment made for the first distance d, with which the camera 140 adjusts its exposure and / or ISO settings. For example, the second distance d... S It can have a correction factor of 0.8, and a third distance d L It can have a correction factor of 1.2.
[0074] Return to Figure 1 As a replacement or supplement to the RFID reader mentioned above, the identification system 150 may include an image registration unit independent of the camera 140. That is, today, image-based identification constitutes a reliable and cost-effective solution for identifying individual animals in a herd.
[0075] Furthermore, according to one embodiment of the present invention, in order to match the identifier ID1 with the correct image data D img Relatedly, the identifier ID1 obtained from the identifier system 150 includes a first timestamp, and the image data D obtained from the camera 140... img The first and second timestamps are generated based on a common time reference and include a second timestamp. Controller 100 is further configured to determine the unique identity of the animal reflected by identifier ID1 from image data D if the first and second timestamps are within a predefined time interval. img Imaging. The range of the predefined interval preferably depends on the specific implementation. In automated milking devices that include a rotating milking platform, the predefined interval should be relatively short to allow for differentiation of different animals entering the platform, while in implementations of milking robots, the predefined interval can be relatively long.
[0076] It is generally advantageous that the controller 100 is configured to perform the above-described processes automatically by executing a computer program. Thus, the controller 100 may include a memory unit 105 (i.e., a non-volatile data carrier) storing a computer program 103, which in turn includes software for causing processing circuitry in the controller 100, in the form of at least one processor 101, to perform the actions mentioned in this disclosure when the computer program 103 is run on at least one processor 101.
[0077] For the purpose of summarizing and reference Figure 6 The flowchart in the diagram will now be used to describe a computer-implemented method according to the present invention, which is executed in at least one processor 101 of the controller 100.
[0078] In the first step 610, an identification tag is obtained from an identification system (e.g., an RFID reader or an image registration unit). This tag reflects the unique identity of the animal (typically a dairy animal).
[0079] Then, in step 620, exposure and / or ISO settings are obtained from the data storage, which are selected to capture image data of at least one body part of the animal whose unique identity is reflected by the identifier. This means that the exposure and / or ISO settings are default values that are expected to provide sufficient quality image data for most animals, or that the exposure and / or ISO settings have been adjusted in previous work on the method relative to the animal in question to be specifically suited to the identified animal.
[0080] Subsequently, in step 630, image data representing at least one body part is obtained from the camera, the image data being registered using stored exposure and / or ISO settings obtained from the data storage, and the image data containing at least one first frame.
[0081] The next step, 640, defines at least one region of interest (ROI) in at least one first frame of the image data. This at least one ROI contains a corresponding set of pixels from the at least one first frame of the image data. In step 640, it is further checked whether the corresponding set of pixels in each ROI meets at least one quality criterion. If yes, the process continues to step 670; otherwise, step 650 is executed.
[0082] In step 650, the camera is controlled to adjust its exposure and / or ISO settings such that image data registered after at least one first frame is estimated to meet at least one quality criterion. For example, if at least one first frame of image data is underexposed, the camera is controlled to increase the light intensity of image data registered after at least one first frame, i.e., to make the recorded image data brighter.
[0083] Subsequently, in step 660, the adjusted exposure and / or ISO settings are stored in the data memory to replace the previously stored exposure and / or ISO settings for the animal whose unique identity is reflected by the identifier.
[0084] The next step is step 670, where the image data is registered using the stored exposure and / or ISO settings (i.e., previously stored settings or settings adjusted in step 650). Therefore, if at least one quality criterion is met in step 640, the exposure and / or ISO settings of the animal, whose unique identity is reflected by the identifier, are retained in the data storage. In practice, this typically means that no operation is required on the data storage.
[0085] In step 680, following step 670, it is checked whether control of the automated milking device relative to at least one body part has been completed, based on the acquired image data. Here, control may, for example, involve controlling a robotic arm to attach a milk cup to the teat of an animal whose unique identity is reflected by an identifier, or to select a teat liner for an animal whose unique identity is reflected by an identifier. If the control has been completed, the process loops back to step 610; otherwise, the process loops back to step 670 to continue image registration and control of the automated milking device.
[0086] refer to Figure 6 The described process steps can be controlled by a programmable processor. Furthermore, although the embodiments of the invention described above with reference to the accompanying drawings include a processor and processing executed in at least one processor, the invention is therefore extended to computer programs suitable for practicing the invention, particularly computer programs on or within a carrier. The program can be in the form of source code, object code, intermediate source code, and object code such as partially compiled form, or any other form suitable for use in a specific implementation of the process according to the invention. The program can be part of an operating system or a separate application. The carrier can be any entity or device capable of carrying the program. For example, the carrier can include storage media such as flash memory, ROM (read-only memory), such as DVD (Digital Video / Universal Disc), CD (compressed disc), or semiconductor ROM, EPROM (erasable programmable read-only memory), EEPROM (electrically erasable programmable read-only memory), or magnetic recording media such as floppy disks or hard disks. Furthermore, the carrier can be a transmissible carrier, such as electrical or optical signals, which can be transmitted via cables or optical fibers, or through radio components or other components. When the program is embodied in a signal, the signal can be transmitted directly via a cable or other device or component, and the carrier can be constituted by such a cable or device or component. Alternatively, the carrier may be an integrated circuit in which a program is embedded, the integrated circuit being adapted to perform related processing or to perform related processing.
[0087] By studying the accompanying drawings, the disclosure, and the appended claims, those skilled in the art can understand and implement variations of the disclosed embodiments when practicing the claimed invention.
[0088] When used in this specification, the term "comprising" is used to specify the presence of a stated feature, integer, step, or component. This term does not exclude the presence or addition of one or more additional elements, features, integers, steps, or components, or groups thereof. The indefinite article "a" does not exclude a plurality. In the claims, the word "or" should not be interpreted as an exclusive OR (sometimes referred to as "XOR"). Rather, expressions such as "A or B" cover all cases of "A and not B", "B and not A", and "A and B", unless otherwise indicated. The fact that certain measures are recited in mutually different dependent claims does not imply that combinations of these measures cannot be advantageously used. Any reference marks in the claims should not be interpreted as limiting the scope.
[0089] It should also be noted that the features from the various implementation schemes described herein can be freely combined unless it is explicitly stated that such a combination would be unsuitable.
[0090] The present invention is not limited to the embodiments described in the accompanying drawings, but can be freely varied within the scope of the claims.
Claims
1. A controller (100) for an automatic milking apparatus (110), said controller (100) being configured to: An identifier (ID1) is obtained from the identification system (150), which reflects the unique identity of the animal. Exposure and / or ISO settings (ID1:xs1) are obtained from data storage (120), said exposure and / or ISO settings (ID1:xs1) being selected to capture image data D of at least one body part (131, 132, 133, 134) of the animal whose unique identity is reflected by said identifier (ID1). img , Image data (D) is obtained from the camera (140). img The image data (D) img ) represents the at least one body part (131, 132, 133, 134), and the image data (D) img ) is registered using the stored exposure and / or ISO settings (ID1:xs1) obtained from the data storage (120), and Based on the obtained image data (D img The automatic milking device (110) is controlled relative to at least one body part (131, 132, 133, 134). Its features are, The controller (100) is configured to: The camera (140) is controlled to register the image data (D) using the exposure and / or ISO settings (ID1:xs1) obtained from the data memory (120). img At least one first frame of ) In the image data (D img At least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) is defined in at least one first frame, wherein each region of interest in the at least one region of interest includes the image data (D). img The corresponding set of pixels of at least one first frame, In each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6), check whether the corresponding set of pixels meets at least one quality criterion. If the corresponding set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) satisfies the at least one quality criterion, then the exposure and / or ISO settings (ID1:xs1) of the animal, whose unique identity is reflected by the identifier (ID1), are maintained in the data memory (120), and If the corresponding pixel set in at least one of the at least one regions of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) does not meet the at least one quality criterion, then the camera (140) is controlled to adjust its exposure and / or ISO settings such that the image data (D) registered after the at least one first frame... img It is estimated to meet at least one of the quality criteria.
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 such that the adjusted exposure and / or ISO settings (ID1:xs1') are stored in the data memory (120) to replace the exposure and / or ISO settings (ID1:xs1) stored therein for the animal whose unique identity is reflected by the identifier (ID1).
3. The controller (100) according to any one of claims 1 or 2, wherein the image data (D img The at least one first frame comprises at least one two-dimensional image, the at least one quality criterion defines a predefined range (R) of light intensity level (I), within the predefined range (R), at least a threshold portion of pixels in the corresponding pixel set of each region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) must represent the light intensity level, and the controller (100) is configured to: The corresponding set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) is examined against the predefined range (R) of the light intensity level (I). If the threshold portion of the pixels in the corresponding pixel set of each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) does not represent the light intensity level 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, ROI6) represent a light intensity level (I) that is primarily lower than (410) the predefined range (R). The camera (140) is then controlled to adjust its exposure and / or ISO settings to increase the image data (D) registered after the at least one first frame. img The light intensity, and If the threshold portion of the pixels in the corresponding pixel set of each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) does not represent the light intensity level 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, ROI6) represent a light intensity level (I) that is primarily higher than (420) the predefined range (R). The camera (140) is then controlled to adjust its exposure and / or ISO settings to reduce the image data (D) registered after the at least one first frame. img The light intensity of the light.
4. The controller (100) of claim 3, wherein the examination of the corresponding pixel set in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) against the predefined range (R) of the light intensity level (I) comprises performing at least one statistical analysis of the light intensity level (I) represented by the corresponding pixel set in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6).
5. The controller (100) according to any one of the preceding claims, wherein the image data (D) img The at least one first frame of the image sensor (540) comprises at least one three-dimensional image having range data, the range data specifying the image sensor plane (540) in the camera (140) and the image data (D) img The image data (D) represents the corresponding distances between different imaging surfaces, and the at least one quality criterion defines the image data. img The threshold granularity level that the at least one first frame must not exceed, and the controller (100) is configured to: The corresponding pixel set in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) is examined against the threshold granularity level, and if it exceeds the threshold granularity level, Then control the camera (140) to adjust its exposure and / or ISO settings such that a first parameter specifying the exposure time of the camera (140) increases, a second parameter specifying the aperture value of the camera (140) increases, and / or a third parameter specifying the ISO value of the camera (140) decreases.
6. The controller (100) of claim 5, wherein the inspection of the corresponding pixel set in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) against the threshold granularity level comprises performing at least one statistical analysis on the distance represented by the corresponding pixel set in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6).
7. The controller (100) according to any one of the preceding claims, wherein the identifier (ID1) obtained from the identifier system (150) includes a first timestamp, and the image data (D) obtained from the camera (140) img The first timestamp includes a second timestamp, and the controller (100) is configured to determine the unique identity of the animal reflected by the identifier (ID1) from the image data (D) if the first timestamp and the second timestamp are within a predefined time interval. img Imaging.
8. The controller (100) according to any one of the preceding claims, wherein the data storage (120) includes exposure and / or ISO settings (ID1:xs1, ..., ID1:xs1) for multiple animals. n Each of the multiple animals is associated with a corresponding identifier (ID1, ..., ID). n The corresponding unique identity reflected by the ID is associated with the corresponding animal's exposure and / or ISO settings (ID1:xs1, ..., ID1:xs). n The data is associated with and stored in the data storage (120).
9. The controller (100) of claim 8, wherein for each of the plurality of animals, the data storage (120) includes at least two distances (d) between the camera (140) and the at least one body part (131, 132, 133, 134). S , d, d L The controller (100) is further configured to adjust the exposure and / or ISO settings of the camera (140) for one of the at least two distances (d), 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 adjust the exposure and / or ISO settings for at least one other distance (d) other than the one said distance. S , d L For each distance in the data memory (120), a corresponding correction factor is stored in the data memory (120), the corresponding correction factor being based on the adjustment made for the distance.
10. The controller (100) according to any one of the preceding claims, wherein the regions of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) are organized into a first group of regions of interest, a second group of regions of interest, and a third group of regions of interest, wherein the first group of regions of interest (ROI3, ROI4) is located within the image data (D). img In the central region (203), the second set of regions of interest (ROI1, ROI2) is located in the outer region (202) surrounding the central region (203), and the third set of regions of interest (ROI5, ROI6) is located in the peripheral region (201) surrounding the outer region (202), and the controller (100) is configured to: A voting process is conducted in which the adjustment of the exposure and / or ISO setting (xs') required by each region of interest in the central region (203) is given a first weighting factor, the adjustment of the exposure and / or ISO setting (xs') required by each region of interest in the outer region (202) is given a second weighting factor, and the adjustment of the exposure and / or ISO setting (xs') required by each region of interest in the peripheral region (201) is given a third weighting factor, wherein the first weighting factor is greater than the second weighting factor, and the second weighting factor is greater than the third weighting factor. The votes from all regions of interest are counted, each vote reflecting a corresponding adjustment amount and direction, and The majority decision of the vote determines the adjustment of the exposure and / or ISO settings (xs') relative to their current settings in terms of quantity and direction.
11. The controller (100) according to any one of the preceding claims, wherein after the camera (140) has reached a predefined position relative 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: In the image data (D img The search process is performed in at least one first frame of the image sensor plane (540) of the camera (140) and configured to detect at least one image object that meets at least one size-shape criterion, and the search process is performed in the image sensor plane (540) of the camera (140) and the image data (D) img The different distances between the imaging surfaces are represented by the three-dimensional image data, and the corresponding distances between them are used in the process. Define the at least one region of interest within the at least one image object that satisfies the at least one size-shape criterion.
12. The controller (100) of claim 11, wherein the at least one size-shape criterion relates to at least one of the following: The outline of the body or body parts; The length or range of length of the body or a body part; The width or width range of the body or body part; The shape of body parts; and Fur / skin pattern.
13. The controller (100) according to any one of the preceding claims, wherein the identification system (150) includes at least one of an RFID reader and an image registration unit independent of the camera (140).
14. The controller (100) according to any of the preceding claims, wherein the at least one body part includes at least one nipple tip, the entire nipple (131, 132, 133, 134) and / or at least one transition area between at least one nipple (131) and the mammary gland (130) in a milk-producing animal.
15. The controller (100) according to any one of the preceding claims, wherein the control of the automatic milking device (110) relative to the at least one body part (131, 132, 133, 134) includes at least one of the following operations: The robotic arm (110) is controlled to attach milk cups (111, 112, 113, 114) to the nipples of the animals whose unique identities are reflected by the identifier (ID1), and The animal is selected for its nipple pads, which are uniquely identified by the identifier (ID1).
16. The controller (100) according to any one of the preceding claims, wherein the exposure and / or ISO settings include at least one of the following parameters for the camera (140): The first parameter that specifies the exposure time. The second parameter that specifies the aperture value, and The third parameter that specifies the ISO value.
17. A computer-implemented method for an automated milking apparatus (110), the method being executed in a processing unit (101) within a controller (100), the method comprising: An identifier (ID1) is obtained from the identification system (150), which reflects the unique identity of the animal. Exposure and / or ISO settings (ID1:xs1) are obtained from data storage (120), said exposure and / or ISO settings (ID1:xs1) being selected to capture image data D of at least one body part (131, 132, 133, 134) of the animal whose unique identity is reflected by said identifier (ID1). img , Image data (D) is obtained from the camera (140). img The image data (D) img ) represents the at least one body part (131, 132, 133, 134), and the image data (D) img ) is registered using the stored exposure and / or ISO settings (ID1:xs1) obtained from the data storage (120), and Based on the obtained image data (D img The automatic milking device (110) is controlled relative to at least one body part (131, 132, 133, 134). Its features are: The camera (140) is controlled to register the image data (D) using the exposure and / or ISO settings (ID1:xs1) obtained from the data memory (120). img At least one first frame of ) In the image data (D img At least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) is defined in at least one first frame, wherein each region of interest in the at least one region of interest includes the image data (D). img The corresponding set of pixels of at least one first frame, In each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6), check whether the corresponding set of pixels meets at least one quality criterion. If the corresponding set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) satisfies the at least one quality criterion, then the exposure and / or ISO settings (ID1:xs1) of the animal, whose unique identity is reflected by the identifier (ID1), are maintained in the data memory (120), and If the corresponding pixel set in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) does not meet the at least one quality criterion, then the camera (140) is controlled to adjust its exposure and / or ISO settings such that the image data (D) registered after the at least one first frame... img It is estimated to meet at least one of the quality criteria.
18. A computer program (103) capable of being loaded into a non-volatile data carrier (105) communicatively connected to a processing unit (101), the computer program (103) comprising software for performing the method according to claim 16 when the computer program (103) is run on the processing unit (101).
19. A non-volatile data carrier (105) comprising the computer program (103) according to claim 18.