A sow hip area image processing method and system based on computer vision
The sow's hip area images are captured and processed by a 4K camera, and the image quality is improved by using brightness channel information and gradient anisotropic smoothness, which solves the image quality problem caused by unstable lighting and improves the accuracy of sow body condition assessment.
Patent Information
- Application Number
- CN202510905775.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-02
AI Technical Summary
The image acquisition process of the sow's buttocks area is affected by factors such as unstable lighting, shadow interference, and dirt obstruction, which leads to a decrease in image quality and affects the accuracy of body condition assessment.
A 4K high-definition camera was used to capture images. After preprocessing, the brightness channel information was extracted to determine the exposure compensation factor. The images were converted into filtered images through gradient anisotropic smoothing and input into a lightweight classification network for body condition classification.
It improves image quality, reduces the effects of uneven lighting and color cast, and increases the accuracy and reliability of sow condition classification.
Smart Images

Figure CN120452026B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and more specifically, to a method and system for processing images of a sow's buttocks based on computer vision. Background Art
[0002] Computer vision-based image processing of the sow's breech area is a crucial application in modern agricultural technology, particularly in areas such as sow body condition scoring, pregnancy detection, and health management. Traditional sow body condition scoring typically relies on manual visual inspection or contact equipment (such as ultrasonic probes), which can be inefficient, labor-intensive, and prone to stress. Furthermore, due to human subjectivity, scoring results can be unstable. With the advancement of computer vision technology, automated sow breech area assessment systems based on image processing have emerged as an effective solution. These systems primarily capture images of the sow's breech area and, through a combination of image processing, feature extraction, and machine learning algorithms, accurately assess the sow's body condition, enabling intelligent, non-invasive health monitoring.
[0003] During this process, the farm environment is complex and the lighting conditions are unstable. Factors such as light fluctuations, shadow interference, and obstruction by dirt may affect the captured breech area images, resulting in noise and color casts. Furthermore, sows move frequently in the pens, making it difficult to maintain a stable shooting angle and distance, which can easily cause image blur, distortion, or missing key areas. The piggery environment is complex, with uneven lighting and the potential for large amounts of dust and mist in the air. These factors significantly affect image quality, resulting in noise and color casts in the captured breech area images. Therefore, improving the quality of captured breech area images to increase the accuracy of sow condition classification is a challenge facing the industry. Summary of the Invention
[0004] The present application provides a computer vision-based sow hip area image processing method and system, which can improve the quality of the collected hip area images to improve the accuracy of the sow body condition classification.
[0005] In a first aspect, the present application provides a method for processing images of a sow's buttocks region based on computer vision, the processing method comprising the following steps:
[0006] collecting breech area images of sows in a piggery, and then preprocessing the breech area images;
[0007] extracting brightness channel information from the preprocessed hip region image, determining an image exposure compensation factor based on the brightness channel information, and correcting the preprocessed hip region image based on the image exposure compensation factor to obtain a hip region exposure compensated image;
[0008] obtaining a guide image of the gluteal region exposure-compensated image, determining a gradient anisotropic smoothness based on a gradient of the guide image and a gradient of the gluteal region exposure-compensated image, and converting the gluteal region exposure-compensated image into a filtered image of the gluteal region of a sow in a piggery based on the gradient anisotropic smoothness;
[0009] The breech-area filtered image is used to classify the body condition of sows in a piggery.
[0010] Furthermore, a 4K resolution camera is used to capture images of the hip area of sows in the pig house.
[0011] Furthermore, preprocessing the hip region image is performing color correction and space conversion on the hip region image.
[0012] Furthermore, determining the image exposure compensation factor according to the brightness channel information specifically includes:
[0013] determining the image brightness of the preprocessed hip region image using the brightness channel information;
[0014] Determining pixel brightness fluctuation of the preprocessed hip region image using the brightness channel information;
[0015] An image exposure compensation factor is determined according to the image brightness and the pixel brightness fluctuation.
[0016] Furthermore, correcting the pre-processed hip region image according to the image exposure compensation factor is to compensate each pixel in the pre-processed hip region image using the image exposure compensation factor.
[0017] Furthermore, obtaining the guide image of the hip area exposure compensation image is performing edge enhancement processing on the hip area exposure compensation image, and then using the processing result as the guide image of the hip area exposure compensation image.
[0018] Furthermore, determining the gradient anisotropic smoothness by the gradient of the guide image and the gradient of the hip area exposure compensation image specifically includes:
[0019] determining image structure similarity according to a gradient of the guide image and a gradient of the hip region exposure compensation image;
[0020] A gradient anisotropic smoothness is determined based on the image structure similarity and the gradient of the hip region exposure-compensated image.
[0021] Furthermore, converting the exposure-compensated image of the hip region into a filtered image of the hip region of the sow in the piggery based on the gradient anisotropic smoothness specifically includes:
[0022] determining a linearly similar image of the hip region exposure-compensated image;
[0023] The exposure-compensated image of the hip region is converted according to the gradient anisotropic smoothness and the linear similarity image, thereby obtaining a filtered image of the hip region of the sow in the pig house.
[0024] Furthermore, using the hip region filtered image to classify the body conditions of the sows in the pig house is to input the hip region filtered image into a lightweight classification network to classify the body conditions of the sows in the pig house.
[0025] In a second aspect, the present application provides a sow buttocks image processing system based on computer vision, which is used to perform a sow buttocks image processing method based on computer vision, and the processing system includes:
[0026] An image acquisition module, used for acquiring images of the gluteal region of sows in a piggery, and then preprocessing the images of the gluteal region;
[0027] an image correction module, configured to extract brightness channel information from the preprocessed hip image, determine an image exposure compensation factor based on the brightness channel information, and correct the preprocessed hip image based on the image exposure compensation factor to obtain a hip exposure-compensated image;
[0028] an image filtering module, configured to obtain a guide image of the gluteal region exposure-compensated image, determine a gradient anisotropic smoothness based on a gradient of the guide image and a gradient of the gluteal region exposure-compensated image, and convert the gluteal region exposure-compensated image into a filtered image of the gluteal region of a sow in a piggery based on the gradient anisotropic smoothness;
[0029] The body condition classification module is used to classify the body condition of sows in the pig house using the hip area filtered image.
[0030] The technical solutions disclosed in this application are as follows:
[0031] The method collects hip area images of sows in a pig house and then preprocesses the hip area images; extracts brightness channel information from the preprocessed hip area images, determines an image exposure compensation factor based on the brightness channel information, and corrects the preprocessed hip area images according to the image exposure compensation factor to obtain a hip area exposure compensated image; obtains a guide image of the hip area exposure compensated image, determines gradient anisotropic smoothness based on the gradient of the guide image and the gradient of the hip area exposure compensated image, and converts the hip area exposure compensated image into a hip area filtered image of the sows in the pig house based on the gradient anisotropic smoothness; and uses the hip area filtered image to classify the body conditions of the sows in the pig house.
[0032] It can be seen that the beneficial effects produced by this technical solution are:
[0033] First, by using a 4K high-definition camera to capture and preprocess the rump images of sows in a piggery, the image quality and analysis stability of the rump area can be guaranteed, and the effects of uneven illumination, color cast, and spatial deformation on sow body condition assessment can be effectively reduced, thereby improving the accuracy and reliability of computer vision analysis. Then, by extracting the brightness channel information from the preprocessed rump image and determining the exposure compensation factor of the image based on this information, further exposure correction can be performed. This can effectively eliminate problems such as uneven illumination, overexposure, or underexposure, and improve the brightness balance and contrast of the image. Furthermore, the gradient information of the guide image and the rump exposure compensation image is used to determine the gradient anisotropic diffusion. Based on this, the rump exposure compensation image is converted into a rump filtered image, which can effectively improve the image quality. The image is smoothed according to the structural features of the image, retaining important detail information and removing noise and background interference. Finally, the rump filtered image is input into a lightweight classification network for sow body condition classification. This network can fully utilize the structural information and detail features of the image, improve the performance of the classification model, and thus improve the accuracy of sow body condition classification.
[0034] In summary, the technical solution adopted in this application can improve the quality of the collected hip area images, so as to improve the accuracy of the sow's body condition classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 This is a flowchart of a method for processing images of a sow's buttocks area based on computer vision provided in this application;
[0037] Figure 2 is a schematic diagram of a process for determining an image exposure compensation factor according to the present application;
[0038] Figure 3 is a schematic diagram of a process for determining gradient anisotropic smoothness according to the present application;
[0039] Figure 4 This is a module structure diagram of a sow hip area image processing system based on computer vision provided by this application;
[0040] Figure 4 The reference numeral 100 shown in the figure is an image acquisition module, the reference numeral 200 is an image correction module, the reference numeral 300 is an image filtering module, and the reference numeral 400 is a body condition classification module. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0042] The present application provides a computer vision-based sow breech image processing method and system. The core of the method and system is to collect breech images of sows in a piggery, and then pre-process the breech images; extract brightness channel information from the pre-processed breech images, determine an image exposure compensation factor based on the brightness channel information, and correct the pre-processed breech images according to the image exposure compensation factor to obtain a breech exposure compensation image; obtain a guide image of the breech exposure compensation image, determine gradient anisotropic smoothness based on the gradient of the guide image and the gradient of the breech exposure compensation image, and convert the breech exposure compensation image into a filtered image of the breech of the sows in the piggery based on the gradient anisotropic smoothness; and use the filtered breech images to classify the body condition of the sows in the piggery. The above scheme can improve the quality of the collected breech images, thereby improving the accuracy of sow body condition classification.
[0043] Example 1: In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods. Figure 1 As shown in FIG, this figure is an exemplary flow chart of a method for processing images of a sow's buttocks region based on computer vision according to this embodiment of the present application, the processing method comprising the following steps:
[0044] In step S1, a hip area image of a sow in a pig house is collected, and then the hip area image is preprocessed.
[0045] In specific implementation, a 4K resolution camera can be used to collect images of the hip area of sows in the pig house. It should be noted that by adopting a 4K high-definition camera (resolution 3840×2160), the ability to retain details in the collected hip area images can be improved. In actual implementation, the camera can be installed at a height of 1.2~1.5m from the ground, with a depression angle of 30°~45° to ensure that the sow's hip area can be fully covered, and a fixed shooting area can be set. Using a fence or a visual guidance system, the sow can enter the shooting range with a suitable posture to avoid unnecessary obstruction.
[0046] In this embodiment, the preprocessing of the gluteal region image is to perform color correction and spatial conversion on the gluteal region image; in specific implementation, first, due to the complex lighting conditions in the pig house (such as uneven lighting, color cast, etc.), the collected gluteal region image needs to be color corrected to ensure the color consistency of the gluteal region image and improve the accuracy of subsequent analysis. In this application, the collected gluteal region image is color corrected by an adaptive Retinex algorithm; then, the color-corrected gluteal region image can be spatially converted, that is, the color-corrected gluteal region image can be converted from the RGB color space to the LAB color space, wherein the LAB color space includes the L channel (brightness information) and the A / B channel (color information).
[0047] It should be noted that by using a 4K high-definition camera to capture images of the sows' buttocks in the pig house and performing preprocessing, the image quality and analysis stability of the buttocks area can be guaranteed, and the impact of uneven lighting, color cast, and spatial deformation on the sow's body condition assessment can be effectively reduced, thereby improving the accuracy and reliability of computer vision analysis.
[0048] In step S2, brightness channel information is extracted from the preprocessed hip image, an image exposure compensation factor is determined according to the brightness channel information, and the preprocessed hip image is corrected according to the image exposure compensation factor to obtain a hip exposure compensated image.
[0049] In a specific implementation, brightness channel information can be extracted from the preprocessed hip image, that is, the data contained in the L channel of the preprocessed hip image is used as brightness channel information, and the brightness channel information includes the brightness value of each pixel in the preprocessed hip image.
[0050] Preferably, in this embodiment, the image exposure compensation factor is determined according to the brightness channel information, referring to Figure 2 As shown in FIG, this figure is a schematic diagram of a process for determining an image exposure compensation factor in some embodiments of the present application. In this embodiment, determining the image exposure compensation factor can be implemented using the following steps:
[0051] In step S21, the brightness of the pre-processed hip region image is determined using the brightness channel information;
[0052] In step S22, the pixel brightness fluctuation of the pre-processed hip area image is determined by using the brightness channel information;
[0053] In step S23, an image exposure compensation factor is determined according to the image brightness and the pixel brightness fluctuation.
[0054] In a specific implementation, first, the image brightness of the preprocessed hip region image can be determined through the brightness channel information, wherein the image brightness represents the overall brightness of the preprocessed hip region image, and the average of the brightness values of all pixels in the brightness channel information can be used as the image brightness of the preprocessed hip region image; then, the pixel brightness fluctuation of the preprocessed hip region image can be determined through the brightness channel information, wherein the pixel brightness fluctuation represents the overall fluctuation of the brightness values of the pixels in the preprocessed hip region image, and the variance of the brightness values of all pixels in the brightness channel information can be used as the pixel brightness fluctuation of the preprocessed hip region image; finally, the image exposure compensation factor can be determined based on the image brightness and the pixel brightness fluctuation, wherein the image exposure compensation factor represents the exposure compensation degree of the preprocessed hip region image. In actual implementation, the image exposure compensation factor can be determined by the following formula:
[0055] ,
[0056] in, represents the image exposure compensation factor, Indicates the brightness of the image, It represents the brightness fluctuation of pixels, and K represents the control coefficient. The control coefficient K can be set through historical experience and data analysis, which will not be described here.
[0057] In this embodiment, the pre-processed hip region image is corrected according to the image exposure compensation factor by compensating each pixel in the pre-processed hip region image using the image exposure compensation factor, thereby obtaining a hip region exposure-compensated image. In a specific implementation, compensating each pixel in the pre-processed hip region image using the image exposure compensation factor can be performed in the following manner, namely:
[0058] ,
[0059] in, represents the brightness value of the i-th pixel in the preprocessed hip area image, Represents the compensated brightness value corresponding to the i-th pixel, Represents the image exposure compensation factor, and C represents a constant, which can be preset based on historical experience.
[0060] It should be noted that by extracting the brightness channel information from the preprocessed hip image and determining the exposure compensation factor of the image based on this information, and further performing exposure correction, problems such as uneven lighting, overexposure or underexposure can be effectively eliminated, and the brightness balance and contrast of the image can be improved, thereby reducing image quality problems caused by lighting changes, environmental factors or equipment limitations, making the image details clearer and the contrast more appropriate. By optimizing the image quality, the model can more accurately extract the features of the hip area, and then more accurately assess the body condition, thereby improving the overall classification performance.
[0061] In step S3, a guide image of the hip area exposure compensation image is obtained, a gradient anisotropic smoothness is determined by the gradient of the guide image and the gradient of the hip area exposure compensation image, and the hip area exposure compensation image is converted into a filtered image of the hip area of the sow in the pig house based on the gradient anisotropic smoothness.
[0062] In this embodiment, obtaining the guide image of the hip area exposure compensation image is to perform edge enhancement processing on the hip area exposure compensation image, and then use the processing result as the guide image of the hip area exposure compensation image.
[0063] In a specific implementation, the Laplacian operator in the prior art can be used to perform edge enhancement processing on the hip area exposure compensation image, so that the processing result can be used as a guide image for the hip area exposure compensation image. It should be noted that the main purpose of edge enhancement processing is to highlight the edge information in the image, making the structural features in the image more obvious. By enhancing the edges of the image, a clear guide image can be better provided for the subsequent determination of gradient anisotropic smoothness, ensuring that the image can maintain detailed information in key areas (such as the hip area) during filtering, while effectively removing background noise.
[0064] Preferably, in this embodiment, the gradient anisotropic smoothness is determined by the gradient of the guide image and the gradient of the hip area exposure compensation image, referring to Figure 3 As shown in FIG, this figure is a schematic diagram of a process for determining gradient anisotropic smoothness in some embodiments of the present application. In this embodiment, determining gradient anisotropic smoothness can be achieved by using the following steps:
[0065] In step S31, image structure similarity is determined based on the gradient of the guide image and the gradient of the hip area exposure compensation image;
[0066] In step S32 , a gradient anisotropic smoothness is determined based on the image structure similarity and the gradient of the hip region exposure-compensated image.
[0067] In specific implementation, first, the Sobel operator can be used to calculate the gradient of each pixel in the guide image in the horizontal and vertical directions, and the total gradient intensity of each pixel can be calculated through the horizontal and vertical gradients, so that the average value of the total gradient intensity of all pixels can be used as the gradient of the guide image. The gradient of the hip exposure compensation image can be obtained in the above manner. The gradient represents the intensity and direction of the local brightness change of the image, which helps to reflect the edge and details of the image; then, the image structure similarity can be determined according to the gradient of the guide image and the gradient of the hip exposure compensation image, where the image structure similarity represents the similarity of the image structure between the guide image and the hip exposure compensation image, and the product of the gradient of the guide image and the gradient of the hip exposure compensation image can be used as the image structure similarity; finally, the gradient anisotropic smoothness can be determined based on the image structure similarity and the gradient of the hip exposure compensation image, where the gradient anisotropic smoothness represents the smoothness of the hip exposure compensation image. In actual implementation, the gradient anisotropic smoothness can be determined by the following formula:
[0068] ,
[0069] in, represents the gradient anisotropic smoothness, Represents the image structure similarity, represents the gradient of the hip area exposure compensation image y, Express request The Euclidean norm of , a represents a constant to prevent the denominator from being 0, and can be preset based on historical experience.
[0070] In this embodiment, the following method can be used to convert the exposure-compensated image of the hip region into a filtered image of the hip region of a sow in a piggery based on the gradient anisotropic smoothness:
[0071] determining a linearly similar image of the hip region exposure-compensated image;
[0072] The exposure-compensated image of the hip region is converted according to the gradient anisotropic smoothness and the linear similarity image, thereby obtaining a filtered image of the hip region of the sow in the pig house.
[0073] In a specific implementation, first, a linear similarity image of the hip area exposure compensation image can be determined, that is, linear similarity image = u × hip area exposure compensation image + v, where u and v are coefficients determined by the least squares method and are used to best fit the local characteristics of the hip area exposure compensation image; then, the hip area exposure compensation image can be transformed based on the gradient anisotropic smoothness and the linear similarity image. In actual implementation, the transformation process of the hip area exposure compensation image can be expressed as follows:
[0074] ,
[0075] Where x represents the filtered image of the hip area of the sow in the pig house, p represents the linear similarity image, and y represents the exposure compensation map of the hip area. Indicates the gradient anisotropic smoothness. The filtered image of the buttocks of the sow in the pig house can be obtained by the above method.
[0076] It should be noted that determining the gradient anisotropic diffusion through the gradient information of the guided image and the breech exposure compensation image, and converting the breech exposure compensation image into a breech filter image based on this, can effectively improve the image quality, perform smoothing according to the structural features in the image, retain important detail information, remove noise and background interference, thereby making the key features in the image more obvious and reducing errors caused by noise or low-quality images. This improvement in image quality provides more accurate and reliable input data for subsequent sow body condition classification, thereby helping to improve classification accuracy.
[0077] In step S4, the body condition of the sows in the piggery is classified using the hip area filtered image.
[0078] In this embodiment, using the hip region filtered image to classify the body conditions of the sows in the pig house is to input the hip region filtered image into a lightweight classification network to classify the body conditions of the sows in the pig house.
[0079] In the specific implementation, first, a lightweight deep learning classification network can be selected. The lightweight classification network selected in this application is MobileNetV2. The lightweight classification network is an efficient convolutional neural network suitable for resource-constrained devices, with fewer parameters and higher performance. In actual implementation, other lightweight classification networks can also be selected, such as SqueezeNet and EfficientNet, which are not limited here; then, the lightweight classification network can be trained; finally, the hip area filtered image can be input into the trained lightweight classification network to classify the body condition of the sows in the pig house, thereby obtaining the body condition classification results of the sows in the pig house.
[0080] It should be noted that feeding filtered breech images into a lightweight classification network for sow condition classification fully leverages the image's structural information and detailed features, improving the performance of the classification model. Filtering effectively removes noise and background interference from the breech images, improving image quality and enabling the classification network to more accurately identify key features within the image. The introduction of a lightweight classification network ensures efficient computation and low resource consumption, making it suitable for real-time analysis in practical applications.
[0081] It can be seen that in this application, first, by using a 4K high-definition camera to collect the buttocks image of the sow in the pig house and performing preprocessing, the image quality and analysis stability of the buttocks area can be guaranteed, and the impact of uneven illumination, color cast and spatial deformation on the sow's body condition assessment can be effectively reduced, thereby improving the accuracy and reliability of computer vision analysis; then, by extracting the brightness channel information from the preprocessed buttocks area image and determining the exposure compensation factor of the image based on the information, and further performing exposure correction, it is possible to effectively eliminate problems such as uneven illumination, overexposure or underexposure, and improve the brightness balance and contrast of the image; further, by determining the gradient anisotropic diffusion by the gradient information of the guide image and the buttocks area exposure compensation image, and based on this, converting the buttocks area exposure compensation image into a buttocks area filtered image, it is possible to effectively improve the image quality, perform smoothing according to the structural features in the image, retain important detail information, and remove noise and background interference; finally, the buttocks area filtered image is input into a lightweight classification network for sow body condition classification, which can make full use of the structural information and detail features of the image, improve the performance of the classification model, and thus improve the accuracy of sow body condition classification.
[0082] In summary, the technical solution adopted in this application can improve the quality of the collected hip area images, so as to improve the accuracy of the sow's body condition classification.
[0083] In the second embodiment, the present application provides a sow hip area image processing system based on computer vision, referring to Figure 4 As shown in FIG. 1 , this figure is a schematic diagram of a sow hip area image processing system based on computer vision according to this embodiment of the present application, wherein the processing system includes:
[0084] An image acquisition module 100 is used to acquire images of the gluteal region of sows in a piggery and then pre-process the images of the gluteal region;
[0085] An image correction module 200 is configured to extract brightness channel information from the pre-processed hip image, determine an image exposure compensation factor based on the brightness channel information, and correct the pre-processed hip image based on the image exposure compensation factor to obtain a hip exposure-compensated image.
[0086] an image filtering module 300 configured to obtain a guide image of the breech exposure-compensated image, determine a gradient anisotropic smoothness based on the gradient of the guide image and the gradient of the breech exposure-compensated image, and convert the breech exposure-compensated image into a filtered image of the breech area of a sow in a piggery based on the gradient anisotropic smoothness;
[0087] The body condition classification module 400 is configured to classify the body conditions of the sows in the piggery using the hip area filtered image.
[0088] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0089] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium, including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, magnetic disk storage, or magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0090] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
Claims
1. A method for processing images of sow hip area based on computer vision, characterized in that: The processing method comprises the following steps: collecting breech area images of sows in a piggery, and then preprocessing the breech area images; extracting brightness channel information from the preprocessed hip region image, determining an image exposure compensation factor based on the brightness channel information, and correcting the preprocessed hip region image based on the image exposure compensation factor to obtain a hip region exposure compensated image; obtaining a guide image of the gluteal region exposure-compensated image, determining a gradient anisotropic smoothness based on a gradient of the guide image and a gradient of the gluteal region exposure-compensated image, and converting the gluteal region exposure-compensated image into a filtered image of the gluteal region of a sow in a piggery based on the gradient anisotropic smoothness; classifying the body condition of sows in a piggery using the filtered image of the breech area; The image exposure compensation factor is determined by the following formula: , in, represents the image exposure compensation factor, Indicates the brightness of the image, Indicates the brightness fluctuation of pixels, K represents the control coefficient, the brightness of the image is represented by the brightness mean of all pixels in the brightness channel, and the brightness fluctuation of pixels is represented by the brightness variance of all pixels in the brightness channel; The use of the image exposure compensation factor to compensate each pixel in the pre-processed hip region image is specifically expressed as follows: , in, represents the brightness value of the i-th pixel in the preprocessed hip area image, Represents the compensated brightness value corresponding to the i-th pixel, represents the image exposure compensation factor, and C represents a constant; The Laplacian operator is used to enhance the edges of the compensated image to obtain the guide image. The Sobel operator is used to calculate the horizontal and vertical gradients of the guide image to obtain the total gradient intensity of the pixels. The gradient of the guide image is calculated as the average of the total gradient intensity of all pixels. The gradient of the hip area exposure compensation image is calculated in the same way. The image structure similarity is calculated as the gradient of the guide image * the gradient of the hip area exposure compensation image. The gradient anisotropic smoothness can be determined by the following formula: , in, represents the gradient anisotropic smoothness, Represents the image structure similarity, represents the gradient of the hip area exposure compensation image y, Express request The Euclidean norm of a is a constant; by calculating the linear similarity image = u × hip area exposure compensation image + v, where u and v are coefficients determined by the least squares method, according to Get the hip area filtered image, where x represents the hip area filtered image of the sow in the pig house, p represents the linear similarity image, and y represents the hip area exposure compensation map. Indicates the gradient anisotropic smoothness.
2. A computer vision-based sow hip area image processing method according to claim 1, characterized in that: A 4K resolution camera captures images of the breech area of sows in a piggery.
3. The method for processing images of the sow's buttocks based on computer vision according to claim 1, wherein: Preprocessing the hip region image is performing color correction and space conversion on the hip region image.
4. The method for processing images of the sow's buttocks based on computer vision according to claim 1, wherein: Using the hip area filtered image to classify the body conditions of sows in the pig house is to input the hip area filtered image into a lightweight classification network to classify the body conditions of the sows in the pig house.
5. A sow hip area image processing system based on computer vision, used to execute the sow hip area image processing method based on computer vision according to any one of claims 1 to 4, characterized in that: The processing system comprises: An image acquisition module, used for acquiring images of the gluteal region of sows in a piggery, and then preprocessing the images of the gluteal region; an image correction module, configured to extract brightness channel information from the preprocessed hip image, determine an image exposure compensation factor based on the brightness channel information, and correct the preprocessed hip image based on the image exposure compensation factor to obtain a hip exposure-compensated image; an image filtering module, configured to obtain a guide image of the gluteal region exposure-compensated image, determine a gradient anisotropic smoothness based on a gradient of the guide image and a gradient of the gluteal region exposure-compensated image, and convert the gluteal region exposure-compensated image into a filtered image of the gluteal region of a sow in a piggery based on the gradient anisotropic smoothness; The body condition classification module is used to classify the body condition of sows in the pig house using the hip area filtered image.
Citation Information
Patent Citations
Image evaluation method and system for sow body condition
CN118865073A
Intelligent weight monitoring method, system and device for bred pigs and storage medium
CN119919242A