Controller for automated milking devices, computer-based implementation method, computer program, and non-volatile data carrier

By configuring a controller in the automatic milking device to adjust the camera exposure and ISO settings according to the region of interest in the image data, the problem of inconsistent image quality is solved, achieving efficient and reliable image control and high-quality image capture, thus improving the accuracy and efficiency of the milking process.

CN122138754APending Publication Date: 2026-06-02DELAVAL HLDG AB

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

Technical Problem

Existing technologies struggle to ensure consistent image quality when controlling automated milking devices based on image data, resulting in unreliable and inefficient control.

Method used

By configuring the controller to adjust the camera's exposure and ISO settings, the exposure and ISO are automatically adjusted according to the size-shape and quality criteria of the region of interest in the image data to ensure that the image quality meets the requirements, thereby controlling the automatic milking device.

Benefits of technology

It achieves efficient and reliable image control of the automatic milking device, ensuring high-quality image data capture and improving the accuracy and efficiency of the milking process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122138754A_ABST
    Figure CN122138754A_ABST
Patent Text Reader

Abstract

Camera (140) registers image data (D) representing body parts (131, 132, 133, 134) of the milking animal (130). img At least one first frame. Image data (D) is registered using default exposure and / or ISO settings (xs). img Based on this image data, the controller (100) controls the automatic milking device (110) relative to body parts (131, 132, 133, 134). The controller (100) searches the image data (D) via a search process. img At least one region of interest is defined in at least one first frame of the image data. The search process is configured to detect at least one image object that satisfies at least one size-shape criterion, and the search process is performed in 3D image data. At least one region of interest is defined within the at least one image object that satisfies the at least one size-shape criterion. The controller (100) checks the data in each region of interest within the at least one region of interest to see if it satisfies a quality criterion. If the quality criterion is satisfied, the camera (140) continues to register the image data (D) using the default exposure and / or ISO settings (xs). img If the quality criteria are not met, the controller (100) controls the camera (140) to adjust its exposure and / or ISO settings (xs') so that the subsequently registered image data (D) img It is estimated to meet the quality criteria.
Need to check novelty before this filing date? Find Prior Art

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 known identifier vector 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 controls 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 efficient 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 acquire at least one first frame of image data from a camera, the image data representing at least one body part of the milking animal, and the image data is registered using default exposure and / or ISO settings. The controller is configured to control the automated milking apparatus based on the acquired image data relative to the at least one body part.

[0009] Specifically, the controller is configured to define at least one region of interest (ROI) in the at least one first frame of the image data, wherein each ROI comprises a corresponding set of pixels in the at least one first frame of the image data. The at least one ROI is defined by a search process performed in the at least one first frame of the image data. The search process is configured to detect at least one image object satisfying at least one size-shape criterion, which in turn relates to at least one of the following: the outline of a body or a part thereof; the length or length range of a body or a part thereof; the width or width range of a body or a part thereof; and / or the shape of a body part. The search process is performed in three-dimensional image data representing the corresponding distances between the image sensor plane in a specified camera and different imaging surfaces represented by the image data. The controller is configured to define the at least one ROI within the at least one image object satisfying the at least one size-shape criterion, and to check whether the corresponding set of pixels in each ROI satisfies at least one quality criterion. If a corresponding set of pixels in each of the at least one regions of interest satisfies the at least one quality criterion, the controller is configured to control the camera to continue registering image data using the default exposure and / or ISO settings, and in parallel, to control the automatic milking device relative to the at least one body part based on the image data registered using the default exposure and / or ISO settings. However, if a corresponding set of pixels in at least one region of interest in the at least one region of interest does not satisfy the 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 satisfy the at least one quality criterion. The controller is also configured to control the camera to register image data using the adjusted exposure and / or ISO settings, and in parallel, to control the automatic milking device relative to the at least one body part based on the image data registered using the adjusted exposure and / or ISO settings.

[0010] The controller is advantageous because it rapidly tunes the camera to capture high-quality image data of relevant body parts (such as nipples) of each animal in the herd.

[0011] According to one embodiment of this aspect of the invention, at least one first frame of the image data comprises at least one two-dimensional (2D) image, and the at least one quality criterion defines a predefined range of light intensity levels, within which at least a threshold portion of pixels in a corresponding set of pixels in each of the at least one region of interest must represent the light intensity level. Here, the controller is configured to examine a corresponding set of pixels in each of the at least one region of interest against the predefined range of light intensity levels. If the threshold portion of pixels in a corresponding set of pixels in each of the 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 in the 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 set of pixels in each of the 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 in the 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.

[0012] According to another embodiment of this aspect of the invention, the camera includes an image sensor having a color filter array configured to register the image data in a plurality of color channels. Here, the controller is also configured to examine a predefined range of light intensity levels relative to each of the plurality of color channels and a corresponding set of pixels in each of the at least one region of interest. If a threshold portion of a pixel in the corresponding set of pixels in each of the at least one region of interest in each of the plurality of color channels does not represent a light intensity level within the predefined range, and the pixel in at least one region of interest in the at least one region of interest represents a light intensity level primarily below the predefined range, then 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 the at least one first frame. Similarly, if the threshold portion of a pixel in a corresponding set of pixels within each of the at least one region of interest in each of the plurality of color channels does not represent a light intensity level within the predefined range, and the pixel in at least one region of interest within the at least one region of interest represents a light intensity level primarily above the predefined range, then the controller is configured to control the camera to adjust its exposure and / or ISO settings to reduce the light intensity of the image data registered after the at least one first frame. Therefore, the camera can be efficiently tuned to register high-quality color image data, and the automatic milking device can be controlled based on this high-quality color image data.

[0013] According to another embodiment of this aspect of the invention, the examination of the corresponding set of pixels in each of the at least one region of interest against the predefined range of light intensity levels involves performing at least one statistical analysis of the light intensity level represented by the corresponding set of pixels in each of the at least one 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, the at least one first frame of the image data comprises at least one three-dimensional (3D) image having range data specifying the corresponding distances between the image sensor plane in the camera and different imaging surfaces represented by the image data. Here, at least one quality criterion defines a threshold granularity level that the 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, the controller is configured to examine a corresponding set of pixels in each of the at least one 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 the next time the considered animal interacts with the automated milking device.

[0015] According to another embodiment of this aspect of the invention, examining a corresponding set of pixels in each of at least one region of interest against a threshold granularity involves performing at least one statistical analysis of the distances represented by the corresponding set of pixels in each of the at least one region of interest. Therefore, the controller may, for example, be configured to calculate the mean, median, and / or standard deviation of the distance values ​​defined by the corresponding set of pixels in each of the at least one region of interest, and based thereon determine whether at least one quality criterion is met.

[0016] According to one embodiment of this aspect of the invention, at least one of the image objects satisfying the at least one size-shape criterion is the nipple tip, the entire nipple, and / or the transition area between the nipple and the mammary gland. That is, this is very useful in controlling automated milking devices (such as milking robots), for example, when attaching milk cups to animals.

[0017] According to another embodiment of this aspect of the invention, the controller is configured to control the automated milking device relative to at least one body part by controlling the robotic arm to attach a milk cup to the nipple of the animal represented by the image data for at least one body part and / or to select a nipple pad for the animal represented by the image data for at least one body part. This means that the invention can be actively used for both the actual milk extraction itself and the adjustment process prior to milk extraction.

[0018] According to another embodiment of this aspect of the invention, the controller is configured to perform a voting process, wherein the adjustment of the exposure and / or ISO setting requested by each region of interest is weighted by a centering factor. The centering factor is defined within a predefined range, such as between 1 and 5, and is based on the distance between the corresponding center of the region of interest and the center of the at least one first frame of the image data. The centering factor influences the exposure and / or ISO setting requested by each region of interest through an inverse relationship with said distance. The controller is configured to count votes from all regions of interest, each vote reflecting a corresponding adjustment amount and direction weighted by the centering factor, and the controller is configured to determine, based on the majority decision of said votes, the adjustment of the exposure and / or ISO setting relative to its current setting, i.e., brighter or darker. Therefore, pixels located at the center of the frame have a greater influence on any adjustment of the exposure and / or ISO setting 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, the 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, the first weighting factor being greater than the second weighting factor, and the second weighting factor being greater than the third weighting factor. The controller is also configured to count votes from all ROIs, each vote reflecting a corresponding adjustment amount and direction, and to determine the 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).

[0020] 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 involves acquiring at least one first frame of image data from a camera, the image data representing at least one body part of a milking animal, and the image data being registered using default exposure and / or ISO settings. The method also involves controlling the automated milking apparatus based on the acquired image data relative to the at least one body part. Specifically, the method involves defining at least one region of interest (ROI) in the at least one first frame of the image data, wherein each ROI comprises a corresponding set of pixels of the at least one first frame of the image data. The at least one ROI is defined by performing a search process in the at least one first frame of the image data, the search process being configured to detect at least one image object satisfying at least one size-shape criterion. The search process is performed in 3D image data specifying the distances between the image sensor plane in the camera and different imaging surfaces represented by the image data. At least one ROI is defined within the at least one image object satisfying the at least one size-shape criterion. The method also involves checking whether the corresponding set of pixels in each ROI of the at least one ROI satisfies at least one quality criterion. If a corresponding set of pixels in each of the at least one regions of interest satisfies the at least one quality criterion, the camera is controlled to register image data after the at least one first frame of the image data, and in parallel, the automatic milking device is controlled relative to the at least one body part based on the image data registered using the default exposure and / or ISO settings. However, if a corresponding set of pixels in at least one region of interest does not satisfy the at least one quality criterion, the camera is controlled to adjust its exposure and / or ISO settings such that the image data registered after the at least one first frame is estimated to satisfy the at least one quality criterion. Furthermore, the camera is controlled to register image data using the adjusted exposure and / or ISO settings, and in parallel, the automatic milking device is controlled relative to the at least one body part based on the image data registered using the adjusted exposure and / or ISO settings.

[0021] The advantages of this method and its preferred implementation are evident from the discussion of the system proposed in the above references.

[0022] 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.

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

[0024] Other advantages, beneficial features and applications of the invention will become apparent from the following description and dependent claims. Attached Figure Description

[0025] The invention will now be explained in more detail by way of preferred embodiments disclosed as examples and with reference to the accompanying drawings.

[0026] Figure 1 An automatic milking apparatus capable of being controlled by a controller according to one embodiment of the present invention is illustrated schematically;

[0027] Figures 2a to 2b This illustrates how different regions of interest can be defined in image data according to embodiments of the present invention;

[0028] Figures 3a to 3d Examples of quality criteria related to the light intensity level range of image data according to embodiments of the present invention are illustrated; and

[0029] Figure 4 The general method according to the invention is illustrated by a flowchart. Detailed Implementation

[0030] 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.

[0031] 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.

[0032] Therefore, the controller 100 is configured to acquire image data D from the camera 140. img The image data D img The registration is performed using the default exposure and / or ISO setting xs in camera 140. Preferably, the default exposure and / or ISO setting xs is selected as image data D that is estimated to be suitable for registering relevant body parts (such as nipples 131, 132, 133 and 134 and / or mammary glands 130 of dairy animals). img The value of .

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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.

[0037] The controller 100 is configured to acquire image data D from the camera 140. img The image data D img Representing at least one body part, such as nipples 131, 132, 133, and 134 respectively. Image data D img It is registered using the default exposure and / or ISO setting xs. Specifically, controller 100 is configured to control camera 140 to register image data D using the default exposure and / or ISO setting xs. img At least one first frame (i.e., a still image).

[0038] 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 2a and Figure 2b An example is illustrated of how, according to an embodiment of the present invention, image data D... img Different regions of interest (ROIs) are defined in the code: ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6.

[0039] 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 the image data D... img The search process is performed in at least one of the first frames while in the image data D imgAt 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 of the specified 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.

[0040] According to embodiments of the invention, the size-shape criteria may involve: the outline of the body or its parts; the length or length range of the body or its parts; the width or width range of the body or its parts; and / or the shape of the body parts. Thus, for example, the search process can detect nipples represented by image objects ranging from 1 cm to 4 cm in width and extending from relatively large objects, generally representing the size and shape of a typical breast.

[0041] According to the present invention, the controller 100 is configured to check whether a corresponding set of pixels in each of at least one region of interest (ROI) ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 meets at least one quality criterion, such as a quality criterion related to light intensity and / or graininess / SNR. If a corresponding set of pixels in each of at least one ROI ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 meets at least one quality criterion, then the controller 100 is configured to control the camera 140 to continue using the default exposure and / or ISO setting xs to register image data D. img And in parallel, based on image data D registered using default exposure and / or ISO settings xs. img The automatic milking device 110 is controlled relative to at least one body part 131, 132, 133 and / or 134.

[0042] However, if a corresponding set of pixels in at least one of the regions of interest (ROIs) ROI1, ROI2, ROI3, ROI4, ROI5, and / or ROI6 does 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 setting xs' such that the image data D registered after at least one first frame...img It is estimated to meet at least one quality criterion. The controller 100 is also configured to control the camera 140 to register image data D using the adjusted exposure and / or ISO settings xs'. img And in parallel, based on the image data D registered using the adjusted exposure and / or ISO settings xs' img The automatic milking device 110 is controlled relative to at least one body part 131, 132, 133 and / or 134.

[0043] In some cases, the light conditions and / or light reflection characteristics of at least one body part 131, 132, 133 and / or 134 can be seen in image data D. img The exposure varies substantially 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. (Reference) Figure 2a To address situations where pixel values ​​in some regions of interest indicate an increase in light intensity while pixel values ​​in other regions of interest indicate a decrease in light intensity, the controller 100 can perform a voting process, where adjustments to the exposure and / or ISO settings required for each region of interest are weighted by a centering factor. The centering factor is defined within a predefined range, such as between 1 and 5, and is based on the corresponding center of the region of interest and image data D. img The distance between at least one center C of the first frame. The centering factor affects the exposure and / or ISO settings required by each region of interest by being inversely proportional to the distance, such that regions of interest relatively close to the center C (e.g., ROI4) achieve a high centering factor (e.g., 4 or 5), and regions of interest relatively far from the center C (e.g., ROI1, ROI5, and ROI6) achieve a low centering factor (e.g., 1 or 2).

[0044] For example, in Figure 2a In the diagram, the center C4 of region of interest ROI4 is located at a distance d4 from the center C, and the center C5 of region of interest ROI5 is located at a distance d5 from the center C, where d5 is 2.5 times d4. Therefore, if region of interest ROI4 has a centering factor of 3.5, then region of interest ROI5 can have a centering factor of 1.5.

[0045] Figure 2b The example also includes image data D in the form of still image frames, each with a region of interest (ROI) of ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6. imgHowever, here, regions of interest (ROIs) 1, 2, 3, 4, 5, and 6 are organized into a first group of ROIs, a second group of ROIs, and a third group of ROIs. The first group of ROIs 3 and 4 are located in the central region 203 of the still image frame; the second group 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 group of ROIs 5 and 6 are located in the peripheral region 201 of the still image frame, surrounding the outer region 202. Each of the ROIs contains image data D. img The corresponding set of pixels, where the corresponding set of pixels may contain different numbers of pixels, depending on the results of the search process discussed above. In any case, in registering image data D img In at least one first frame, it is assumed that the camera 140 has a position and field of view relative to the animal such that at least one body part 131, 132, 133, and 134 are relatively close to the center C 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).

[0046] like Figure 2b As illustrated, at least one body part 131, 132, 133, and 134, depicted in the form of nipples, may have different skin tones and may more or less conceal each other from being depicted by camera 140 and / or at least partially prevent light from being reflected 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.

[0047] To mitigate this problem, the controller 100 is configured to check whether a corresponding set of pixels 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 set of pixels in each region of interest and / or the SNR of the image data in each region of interest.

[0048] In some cases, the light conditions and / or light reflection characteristics of at least one body part 131, 132, 133, and 134 can be seen in image data D. imgThe light intensity varies substantially 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, wherein the first weight factor is greater than the second weight factor, and the second weight factor is greater 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 factor is equally conceivable, provided that they have the relative proportions indicated above.

[0049] 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.

[0050] If in image data D img If the nipple tips and / or the entire nipple 131, 132, 133, and 134 are identified, and the robotic arm is controlled to attach milk cups 111, 112, 113, and 114 to the nipples of animals whose unique identities are reflected by the identifier ID1, then it is generally advantageous to define regions of interest covering the nipple tips and / or the nipples respectively. Such control of the robotic arm is typically performed first after the exposure and / or ISO settings of the camera 140 have been adjusted according to the invention.

[0051] Now for reference Figures 3a to 3d According to one embodiment of the present invention, image data D imgAt 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 pixels in a corresponding set of pixels in 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 a corresponding set of pixels in each of the at least one region of interest ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 against the predefined range R of light intensity level I.

[0052] If the threshold portion of a pixel in a corresponding set of pixels within each region of interest does not represent a light intensity level within a predefined range R, the controller 100 is further configured to determine whether a pixel in the region of interest represents a light intensity level I that is primarily below or above the predefined range R. Figure 3a Histogram 310 is shown as an example representing a light intensity level I that is primarily below a predefined range R, and Figure 3b Histogram 320 is shown as an example representing a light intensity level I that is primarily above the predefined range R.

[0053] Figure 3c A monochrome example of histogram 330 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 3d It shows the relationship with Figure 3c The examples in the example correspond to the examples in the example, however, the three separate histograms 341, 342 and 343 respectively reflect the corresponding color channels, such as red, green and blue, and histogram 340 reflects the combined channels, wherein all said channels represent light intensity levels I mainly within a predefined range R.

[0054] 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.

[0055] 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.

[0056] Naturally, checking the threshold portion of the pixels in the corresponding set of pixels in each region of interest against the light intensity level in the predefined range R can also involve the voting process described above.

[0057] According to one embodiment of the invention, camera 140 includes an image sensor having a color filter array configured to register image data D in a plurality of color channels 341, 342, and 343 (e.g., red, green, and blue). img Here, controller 100 is configured to examine a predefined range R of light intensity level I relative to each of the plurality of color channels 341, 342, and 343 and relative to a corresponding set of pixels in each of at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6). If the threshold portion of the pixels in the corresponding set of pixels in each of at least one ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 in each of the plurality of color channels 341, 342, and 343 does not represent the light intensity level in the predefined range R, and the pixels in at least one ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 represent a light intensity level I that is primarily below the predefined range R, then controller 100 is configured to control camera 140 to adjust its exposure and / or ISO setting xs' to increase the image data D registered after at least one first frame. imgThe light intensity. If the threshold portion of pixels in a corresponding set of pixels in each of at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6) in each of the plurality of color channels 341, 342, and 343 does not respectively represent the light intensity level in the predefined range R, and pixels in at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6) represent a light intensity level I that is primarily higher than the predefined range R, then the controller 100 is configured to control the camera 140 to adjust its exposure and / or ISO setting xs' to reduce the image data D registered after at least one first frame. img The light intensity.

[0058] Furthermore, checking whether a corresponding set of pixels in each of the regions of interest (ROIs) ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 meets quality criteria 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 a corresponding set of pixels 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 criterion 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.

[0059] 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, the three-dimensional (3D) image having an image sensor plane in the designated camera 140 and an image data D img This represents the range of distances between different imaging surfaces. In this case, at least one quality criterion defines the image data D. img At 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.

[0060] Here, the controller 100 is configured to examine a corresponding set of pixels in each of the regions of interest (ROIs) ROI1, ROI2, ROI3, ROI4, ROI5, and ROI6 for a threshold granularity level.

[0061] 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 that the quality criteria are met. 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.

[0062] 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.

[0063] 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.

[0064] For the purpose of summarizing and reference Figure 4 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.

[0065] In the first step 410, at least one first frame of image data is acquired from the camera, the image data representing at least one body part of the milking animal, and the image data is registered using default exposure and / or ISO settings.

[0066] In subsequent step 420, it is checked whether at least one quality criterion is met. The check includes defining at least one region of interest (ROI) in at least one first frame of image data, wherein each ROI comprises a corresponding set of pixels from the at least one first frame of image data. The at least one ROI is then defined by performing a search procedure in the at least one first frame of image data, configured to detect at least one image object that satisfies at least one size-shape criterion. The search procedure is performed in 3D image data representing the corresponding distances between the image sensor plane in a specified camera and different imaging surfaces represented by the image data. At least one ROI is defined within the at least one image object that satisfies the at least one size-shape criterion. Finally, within each ROI, it is checked whether the corresponding set of pixels satisfies at least one quality criterion, such as those related to brightness and / or graininess / SNR as discussed above.

[0067] If a corresponding set of pixels in each region of interest in at least one region of interest meets at least one quality criterion, the default exposure and / or ISO settings remain unchanged, and then step 460 follows.

[0068] If a corresponding set of pixels in at least one region of interest fails to meet at least one quality criterion because the set of pixels is too dark and / or too grainy, the process continues to step 440.

[0069] If a corresponding set of pixels in at least one region of interest fails to meet at least one quality criterion because the set of pixels is too bright and / or too grainy, the process continues to step 450.

[0070] In step 440, the camera is controlled to adjust its exposure and / or ISO settings such that the image data registered after at least one first frame will be brighter and / or less noisy, and thus estimated to meet at least one quality criterion. The process then continues to step 460.

[0071] In step 450, the camera is controlled to adjust its exposure and / or ISO settings such that the image data registered after at least one first frame will be darker and / or less noisy, and thus estimated to meet at least one quality criterion. The process then continues to step 460.

[0072] In step 460, image data is registered using stored exposure and / or ISO settings (i.e., default exposure and / or ISO settings, exposure and / or ISO settings generated in step 440, or exposure and / or ISO settings generated in step 450), and in parallel, the automatic milking device is controlled relative to at least one body part based on the registered image data. The process then loops back to step 410 to perform a repeated quality check on the image data.

[0073] refer to Figure 4 The described processing 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 (Compact 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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: Image data (D) is obtained from the camera (140). img At least one first frame of the image data (D) img The image data (D) represents at least one body part (131, 132, 133, 134) of a milking animal (130), and the image data (D) represents at least one body part (131, 132, 133, 134) of a milking animal (130). img ) is registered using the default exposure and / or ISO settings (xs), 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: 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 at least one set of pixels in the first frame, and the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6, ROI7, ROI8, ROI9, ROI10, ROI11) are defined as follows: In the image data (D img The search process is performed in at least one first frame of the image sensor in the camera (140), the search process being configured to detect at least one image object satisfying at least one size-shape criterion, and the search process is performed in the image sensor plane of the camera (140) and the image data (D) img The process is performed in three-dimensional image data representing the corresponding distances between different imaging surfaces, and... Define the at least one region of interest within the at least one image object that satisfies the at least one size-shape criterion. 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 camera (140) is controlled to continue using the default exposure and / or ISO settings (xs) to register image data (D). img ), and in parallel, based on the image data (D) registered using the default exposure and / or ISO settings (xs). img To control the automatic milking device (110) relative to at least one body part (131, 132, 133, 134), and If a corresponding set of pixels 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 (xs') such that the image data (D) registered after the at least one first frame... img The camera (140) is controlled to register image data (D) using the adjusted exposure and / or ISO settings (xs') to meet at least one of the quality criteria, as estimated to satisfy the criteria. img ), and in parallel, based on the image data (D) registered using the adjusted exposure and / or ISO settings (xs'). img The automatic milking device (110) is controlled relative to at least one body part (131, 132, 133, 134).

2. The controller (100) according to claim 1, 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 set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) must represent the light intensity level, and the controller (100) is configured to: Examine the corresponding 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 the light intensity level (I). If the threshold portion of the pixel in the corresponding set of pixels in 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 pixel in at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) represents a light intensity level (I) that is primarily lower than (410) the predefined range (R). The camera (140) is controlled to adjust its exposure and / or ISO settings (xs') 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 set of pixels in 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 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 controlled to adjust its exposure and / or ISO settings (xs') to reduce the image data (D) registered after the at least one first frame. img The light intensity of the light.

3. The controller (100) of claim 2, wherein the camera (140) includes an image sensor having a color filter array configured to register the image data (D) in a plurality of color channels (341, 342, 343). img ), and the controller (100) is further configured to: The predefined range (R) of the comparison light intensity level (I) is examined relative to each of the plurality of color channels (341, 342, 343) and the corresponding set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6). If the threshold portion of the pixels in the corresponding set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) in each of the plurality of color channels (341, 342, 343) does not represent the light intensity level in the predefined range (R), and the pixels in 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 controlled to adjust its exposure and / or ISO settings (xs') 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 set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) in each of the plurality of color channels (341, 342, 343) does not represent the light intensity level in the predefined range (R), and the pixels in 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 controlled to adjust its exposure and / or ISO settings (xs') 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) according to any one of claims 2 or 3, wherein the examination of the corresponding 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 the light intensity level (I) comprises performing at least one statistical analysis of the light intensity level (I) represented by the corresponding 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 one of the preceding claims, wherein the image data (D) img The at least one first frame of the image sensor (140) includes at least one three-dimensional image with range data, the range data specifying the plane of the image sensor in the camera (140) and the plane of the image data (D). img The image data (D) represents the corresponding distance between different imaging surfaces, and the at least one quality criterion defines the image data (D). img The threshold granularity level that the at least one first frame must not exceed, 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 threshold granularity level, and if the threshold granularity level is exceeded, Control the camera (140) to adjust its exposure and / or ISO settings (xs') 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 set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) relative to the threshold granularity comprises performing at least one statistical analysis on the distance represented by the corresponding set of pixels in each of the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6).

7. 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) of a dairy animal and the mammary gland (130).

8. The controller (100) according to any one of the preceding claims, wherein the control of the automatic milking device (110) with respect to the at least one body part (131, 132, 133, 134) includes at least one of the following: The robotic arm (110) is controlled to attach milk cups (111, 112, 113, 114) to at least one of its body parts (131, 132, 133, 134) using the image data (D). img The nipple of the animal (130) represented by ) and The image data (D) is used to image at least one body part (131, 132, 133, 134). img The animal (130) indicated by the ) selected the nipple pad.

9. The controller (100) according to any one of the preceding claims, wherein the controller (100) is configured to: A voting process is performed, wherein the adjustments to the exposure and / or ISO settings required for each region of interest are weighted by a centering factor defined within a predefined range, based on the corresponding center (C4; C5) of the region of interest (ROI4; ROI5) and the image data (D). img The distance (d4, d5) between the centers (C) of at least one first frame, and the exposure and / or ISO settings required by each region of interest (ROI4; ROI5) are influenced by a relationship inversely proportional to the distance (d4, d5). Votes from all regions of interest are counted, each vote reflecting a corresponding adjustment amount and direction weighted by the centralization factor, and The majority decision of the vote determines the adjustment of the exposure and / or ISO settings in terms of quantity and direction relative to their current settings.

10. The controller (100) according to any one of claims 1 to 8, 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 area (203) is given a weighting factor of 3, the adjustment of the exposure and / or ISO setting (xs') required by each region of interest in the outer area (202) is given a weighting factor of 2, and the adjustment of the exposure and / or ISO setting (xs') required by each region of interest in the peripheral area (201) is given a weighting factor of 1. 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 the at least one size-shape criterion relates to at least one of the following: The outline of the body or its parts; The length or range of length of the body or its parts; The width or width range of the body or its parts; and The shape of body parts.

12. 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.

13. 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: Image data (D) is obtained from the camera (140). img At least one first frame of the image data (D) img The image data (D) represents at least one body part (131, 132, 133, 134) of a milking animal (130), and the image data (D) represents at least one body part (131, 132, 133, 134) of a milking animal (130). img ) is registered using the default exposure and / or ISO settings (xs), 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: 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 at least one set of pixels in the first frame of the first frame, wherein the at least one region of interest (ROI1, ROI2, ROI3, ROI4, ROI5, ROI6) is defined as follows: In the image data (D img The search process is performed in at least one first frame of the image sensor in the camera (140), the search process being configured to detect at least one image object satisfying at least one size-shape criterion, and the search process is performed in the image sensor plane of the camera (140) and the image data (D) img The process is performed in three-dimensional image data representing the corresponding distances between different imaging surfaces, and... Define the at least one region of interest within the at least one image object that satisfies the at least one size-shape criterion. 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 camera (140) is controlled to process the image data (D... img Image data (D) is registered after at least one first frame. img ), and in parallel, based on the image data (D) registered using the default exposure and / or ISO settings (xs). img To control the automatic milking device (110) relative to at least one body part (131, 132, 133, 134), and If a corresponding set of pixels 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 (xs') such that the image data (D) registered after the at least one first frame... img The camera (140) is controlled to register image data (D) using the adjusted exposure and / or ISO settings (xs') to meet at least one of the quality criteria, as estimated to satisfy the criteria. img ), and in parallel, based on the image data (D) registered using the adjusted exposure and / or ISO settings (xs'). img The automatic milking device (110) is controlled relative to at least one body part (131, 132, 133, 134).

14. 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 13 when the computer program (103) is run on the processing unit (101).

15. A non-volatile data carrier (105) comprising the computer program (103) according to claim 14.