Distorted image processing method for weight estimation of caged animals
By employing image distortion processing methods, including validity screening, perspective correction, and data augmentation, the problems of perspective distortion and insufficient data quantification in captive animal weight estimation have been solved, achieving highly accurate and stable weight estimation that meets the needs of modern aquaculture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WENS FOODSTUFF GROUP CO LTD
- Filing Date
- 2026-02-12
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies for estimating the weight of captive animals suffer from image quality issues due to perspective distortion caused by camera installation limitations and space constraints. Furthermore, the lack of quantitative description in training data makes it difficult to achieve accuracy and stability, thus failing to meet the real-time, non-contact, and large-scale management requirements of modern aquaculture.
The effectiveness of the data is screened by collecting original image frames of captive animals, and the homography matrix is calculated in blocks for perspective correction and stitching to build a corrected sample set. Then, an enhanced sample set is generated through data augmentation processing, and finally, the target training sample set is formed to ensure the sample size and diversity.
It significantly improves the accuracy of animal body shape feature extraction and the reliability of weight estimation, reduces animal stress response and the intensity of manual operation, and meets the needs of modern large-scale breeding management.
Smart Images

Figure CN122289086A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for processing distorted images for estimating the weight of captive animals. Background Technology
[0002] In large-scale captive animal farming, animal weight is a crucial parameter for feeding management, slaughter decisions, and production assessment. Traditional methods of obtaining weight mainly rely on manual weighing or empirical estimation, which is not only inefficient and labor-intensive but also prone to causing stress in animals, failing to meet the demands of modern farming for real-time, non-contact, and large-scale management. Existing image-based weight estimation techniques typically acquire images of captive animals using fixed camera devices, extracting animal contours, body shape features, or key dimensional parameters, and then combining these with statistical or deep learning models to predict weight. However, in real captive environments, due to limitations in camera installation height and angle, and limited space, the acquired animal images generally exhibit perspective distortion, especially noticeable at image edges, directly affecting the accuracy of body shape feature extraction. Furthermore, existing technologies often only qualitatively expand the training data scale during sample construction, lacking a quantitative description of the relationship between the number of original valid samples and correction samples. This makes it difficult to establish a reproducible and evaluable data processing workflow, hindering model training stability and the widespread application of the method. Summary of the Invention
[0003] Therefore, it is necessary for the present invention to provide a distorted image processing method for estimating the weight of captive animals, in order to solve at least one of the above-mentioned technical problems.
[0004] To achieve the above objective, a distorted image processing method for estimating the weight of captive animals includes the following steps: Step S1: Collect original image frames of captive animals, and screen the original image frames for validity to form an original valid sample set; Step S2: Divide the image into blocks based on the original valid sample set, calculate the homography matrix block by block, and perform perspective correction and stitching to generate a global corrected image; construct a corrected sample set using the global corrected image; Step S3: Perform data augmentation on the calibration sample set to generate an augmented sample set; Step S4: Calculate the sample augmentation factor based on the original valid sample set and the correction sample set. When the sample augmentation factor reaches 3 times, the target training sample set is formed.
[0005] This invention significantly improves the accuracy of animal body shape feature extraction and the reliability of weight estimation in a realistic captive environment by systematically processing distorted images. First, through effective sample selection and global perspective correction, the impact of perspective distortion caused by camera installation limitations and spatial constraints on image quality is mitigated, ensuring geometric consistency between the animal's outline and key dimensions in the image. Second, through quantitative expansion and enhancement of the sample set, the scale, distribution, and diversity of the training data are guaranteed, enabling the weight prediction model to have better generalization ability and robustness in complex environments. Simultaneously, this method clarifies the quantitative relationship between the original effective samples and the correction samples, providing a reproducible and evaluable quantitative basis for the data processing flow, thereby improving the stability of model training and facilitating the widespread application of the method. Furthermore, this method achieves non-contact, real-time weight estimation, reducing animal stress and the intensity of manual operation, significantly adapting to the needs of modern large-scale animal husbandry management. Attached Figure Description
[0006] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the steps in a distorted image processing method for estimating the weight of captive animals according to the present invention. Figure 2 for Figure 1 A detailed flowchart of step S1; Figure 3 These are the original image frames of captive animals. Detailed Implementation
[0007] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0008] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0009] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0010] To achieve the above objectives, please refer to Figures 1 to 3 This invention provides a method for processing distorted images for estimating the weight of captive animals, the method comprising the following steps: Step S1: Collect original image frames of captive animals, and screen the original image frames for validity to form an original valid sample set; Step S2: Divide the image into blocks based on the original valid sample set, calculate the homography matrix block by block, and perform perspective correction and stitching to generate a global corrected image; construct a corrected sample set using the global corrected image; Step S3: Perform data augmentation on the calibration sample set to generate an augmented sample set; Step S4: Calculate the sample augmentation factor based on the original valid sample set and the correction sample set. When the sample augmentation factor reaches 3 times, the target training sample set is formed.
[0011] Preferably, step S1 includes the following steps: Step S11: Acquire continuous raw image frames using an image acquisition device fixedly positioned above the activity area of the captive animals, and perform resolution and sharpness detection on the raw image frames to remove blurry or severely jittery image frames, forming a set of clear candidate image frames. Step S12: In the set of clear candidate image frames, the validity of the image frames is filtered based on the animal outline integrity and occlusion ratio to obtain the original set of valid image frames. Step S13: Perform a quantity count on the original valid image frame set, record the original valid sample count, and form the original valid sample set and the corresponding sample count baseline value.
[0012] In this embodiment of the invention, an image acquisition device is fixedly installed at the top of the activity area of the captive animals. The installation height of the image acquisition device is limited to the range of 2.5 meters to 4 meters. The acquisition direction is vertically downward or the downward angle is no more than 60°. The original image frames of the captive animals are acquired continuously. The resolution of the original image frames is limited to no less than 1920×1080 pixels.
[0013] For each acquired original image frame, resolution and sharpness detection are performed frame by frame. Sharpness is achieved by calculating the average value of the image grayscale gradient. When the average grayscale gradient is lower than a preset threshold of 0.3, the image frame is determined to be a blurry image frame and is removed. At the same time, the degree of jitter is determined by the pixel displacement amplitude of consecutive frames. When the overall pixel displacement ratio of two adjacent frames exceeds 5%, it is determined to be a severely jittery image frame and is removed. The remaining image frames constitute a set of clear candidate image frames.
[0014] Within the set of clear candidate image frames, each image frame is evaluated for animal outline integrity and occlusion ratio. Outline integrity is determined by statistically analyzing the proportion of the length of the continuous identifiable boundary of the animal subject in the image to the expected boundary length. If this proportion is less than 70%, the image frame is discarded. Occlusion ratio is determined by calculating the coverage ratio of the non-animal region to the projected area of the animal subject. If the occlusion ratio exceeds 30%, the image frame is discarded. The retained image frames constitute the original set of valid image frames.
[0015] The number of image frames in the original valid image frame set is counted frame by frame to obtain the original valid sample count. The original valid image frame set and the corresponding sample count baseline value are recorded together to form the original valid sample set.
[0016] Preferably, step S2, which involves image segmentation based on the original valid sample set, includes: A single frame of original valid image is read from the original valid sample set and used as the image to be corrected. The image to be corrected is divided into multiple 3×3 sub-block regions according to the preset grid rules, forming a set of sub-block images.
[0017] In this embodiment of the invention, single frames of original valid images are read sequentially from the original valid sample set, and these read single frames of original valid images are used as images to be corrected in subsequent processing. The image size of the image to be corrected is limited to a fixed resolution size, with a width denoted as W pixels and a height denoted as H pixels, where W and H are both positive integers and consistent with the output resolution of the image acquisition device.
[0018] When performing block processing on the image to be corrected, the image coordinate system is first divided according to a preset grid rule. The preset grid rule limits the image to be corrected to be divided into three equal regions in both the horizontal and vertical directions, thus forming a total of nine sub-block regions. Specifically, the division method is as follows: taking the upper left corner of the image as the origin, the horizontal direction is divided into W / 3 and 2W / 3 as dividing boundaries, and the vertical direction is divided into H / 3 and 2H / 3 as dividing boundaries, thus dividing the image to be corrected into nine rectangular sub-block regions.
[0019] After the grid division is completed, a cropping operation is performed on the image to be corrected according to the spatial location of the sub-block regions in the image, extracting pixel data from the corresponding regions to form a set of sub-block images. Each sub-block image in the set retains the original pixel values, only matching the corresponding region of the original image in spatial range.
[0020] Preferably, the block-by-block calculation of the homography matrix in step S2 includes: In each sub-block region of the sub-block image set, feature point information for describing the geometric structure is extracted to form a sub-block feature point set; Based on the set of feature points of each sub-block, calculate the 3×3 homography matrix used to describe the perspective mapping relationship of the sub-block, and form a set of homography matrices.
[0021] In this embodiment of the invention, the sub-block image set is processed one by one. For each sub-block image in the sub-block image set, feature point information for describing the geometric structure is first extracted within the corresponding pixel region of the sub-block image. Feature points are obtained by calculating the local gradient of pixel grayscale changes. When the grayscale change amplitude of a pixel in both the horizontal and vertical directions exceeds a preset threshold of 15, the pixel is recorded as a candidate feature point. The candidate feature points are then filtered according to their spatial distribution, removing pixels located within a 10-pixel width of the sub-block edge, and retaining feature points located within the sub-block's internal region, forming a sub-block feature point set.
[0022] After obtaining the set of feature points for the sub-block, a correspondence is established between the set of feature points and the corresponding ideal geometric reference coordinates. The ideal geometric reference coordinates are determined based on the regular rectangular structure of the sub-block in the original image, with the coordinates of its four vertices defined as the upper left, upper right, lower right, and lower left positions of the sub-block, respectively. Based on at least four non-collinear feature points in the sub-block feature point set and their corresponding reference coordinates, a system of linear equations describing the planar perspective mapping relationship is constructed, and a 3×3 homography matrix describing the perspective mapping relationship of the sub-block is calculated using a matrix solving method.
[0023] Repeat the above feature point extraction and matrix solving process for each sub-block image to form a set of homography matrices that correspond one-to-one with the set of sub-block images.
[0024] Of particular importance, the perspective correction and stitching performed in step S2 includes: Perspective correction is performed on each sub-block image in the sub-block image set using the homography matrix set, generating a corrected sub-block image set; Based on the spatial relationship of each sub-block in the original image, the set of correction sub-block images is stitched together to generate a global correction image.
[0025] In this embodiment of the invention, perspective correction is performed block by block according to a one-to-one correspondence between the homography matrix set and the sub-block image set. For each sub-block image in the sub-block image set, the corresponding 3×3 homography matrix is read and applied to the pixel coordinate space of the sub-block image. Specifically, the two-dimensional coordinates of each pixel in the sub-block image are represented as homogeneous coordinates. Coordinate mapping calculation is performed through matrix multiplication, and the calculation result is then normalized to restore the two-dimensional pixel coordinates, thereby determining the target position of the pixel after correction. The pixel grayscale value is written to the target coordinate position through bilinear interpolation to form the corrected sub-block image. The above mapping and interpolation process is repeated for all sub-block images to obtain the corrected sub-block image set.
[0026] After constructing the set of correction sub-block images, a stitching operation is performed based on the spatial relationship of each sub-block in the original image. During stitching, a global pixel coordinate frame with the same size as the original image is first constructed, and nine stitching regions are pre-defined according to a 3×3 grid structure. Then, the correction sub-block images are written sequentially to their corresponding grid regions at their designated positions within the global pixel coordinate frame. For the boundary regions between adjacent sub-blocks, a fixed-width overlap band of 5 pixels is used, and the pixel values within the overlap region are weighted and averaged to ensure the continuity of the stitched region. After all correction sub-blocks are written, a global correction image is formed.
[0027] Preferably, the step S2 of constructing a correction sample set using the global correction image includes: Geometric consistency detection is performed on the global corrected image to determine that the distortion error in the edge region is reduced to a preset range, thus forming an effective set of global corrected images; The effective global correction image set is compiled to form a correction sample set; The number of samples in the corrected sample set is counted to obtain the corrected sample size.
[0028] In this embodiment of the invention, geometric consistency detection is performed on each element of the globally corrected image. Geometric consistency detection uses the edge regions of the globally corrected image as the detection target, with the edge regions defined as a set of pixels within a 30-pixel range from each of the image's four boundaries. Within the edge regions, multiple equally spaced reference lines are extracted along both the horizontal and vertical directions, with the spacing between the reference lines limited to 20 pixels. For each reference line, its pixel coordinate sequence in the globally corrected image is calculated, and the corresponding line equation is fitted using a least-squares method.
[0029] After completing the line fitting, the maximum vertical distance from the actual pixel point in each reference line to the fitted line is calculated, and the maximum vertical distance is used as the edge region distortion error value. When the edge region distortion error value is less than or equal to 2% of the shorter side length of the image, the corresponding global corrected image is marked as a valid global corrected image; when the distortion error value exceeds this threshold, the global corrected image is determined to not meet the consistency requirements and is discarded. After the above detection, a set of valid global corrected images is formed.
[0030] After obtaining the set of valid globally corrected images, all valid globally corrected images in the set are summarized and stored in the order of their generation to form a correction sample set. Subsequently, the number of images in the correction sample set is counted one by one, and the count result is recorded as the number of corrected samples.
[0031] Preferably, step S3 includes the following steps: Step S31: Read the global correction image from the correction sample set as the image to be enhanced; Step S32: Perform geometric transformation enhancement on the image to be enhanced to generate a geometrically enhanced image; perform occlusion enhancement processing on the geometrically enhanced image to generate a dirt-enhanced image; Step S33: Combine the geometrically enhanced image and the dirt-enhanced image to form an enhanced sample set; count the number of samples in the enhanced sample set to obtain the number of enhanced samples.
[0032] In this embodiment of the invention, global correction images are read sequentially from the correction sample set, and each read global correction image is used as an image to be enhanced in subsequent processing. The resolution of the image to be enhanced is consistent with that of the global correction image, and the pixel value range is limited to 0 to 255.
[0033] When performing geometric transformation enhancement on the image to be enhanced, rotation and scaling operations are performed along the image center point. The rotation angle is limited to three fixed values: −5°, 0°, and +5°, and the scaling ratio is limited to three fixed ratios: 0.95, 1.00, and 1.05. The rotation and scaling are performed by performing a two-dimensional affine transformation on the pixel coordinates, and the transformed pixel values are filled using bilinear interpolation to form the geometrically enhanced image.
[0034] After generating the geometrically enhanced image, occlusion enhancement is performed on it. Occlusion enhancement is achieved by generating elliptical occlusion regions in the image. The sum of the major and minor axes of the ellipse occupies 5% to 15% of the total image area, and the center point of the ellipse is located in the central region of the image. The pixel values within the occlusion regions are uniformly assigned a fixed grayscale value of 0, forming a dirty enhanced image.
[0035] After completing the above enhancement processing, the geometrically enhanced images and their corresponding dirt-enhanced images are aggregated and stored in the order of generation to form an enhanced sample set. Then, the number of images in the enhanced sample set is counted one by one, and the count result is recorded as the number of enhanced samples.
[0036] Of particular importance, the geometric transformation enhancement of the image to be enhanced in step S32 includes: Apply random rotation to the image to be enhanced, with a rotation angle range of ±15°, to generate a rotated enhanced image; Apply random scaling to the rotation-enhanced image, with a scaling factor ranging from 0.8 to 1.2, to generate a geometrically enhanced image.
[0037] In this embodiment of the invention, rotation enhancement and scaling enhancement processes are sequentially performed on the image to be enhanced. The image to be enhanced is a globally corrected image, whose image coordinate system has the upper left pixel as the origin, the horizontal direction as the x-axis, the vertical direction as the y-axis, and the coordinates of the image center point as (x0, y0).
[0038] When performing rotation enhancement, the rotation angle parameters are first generated. Rotation angle The range is limited to -15° to +15°, with a step size of 1°. Around the image center point (x0, y0), the coordinates of each pixel in the image to be enhanced are calculated using planar rotation. The rotation calculation is based on the two-dimensional coordinate rotation relationship. The rotated pixel coordinates are reassigned grayscale values using bilinear interpolation. Areas outside the original image boundary are uniformly filled with a grayscale value of 0, thus forming a rotated enhanced image.
[0039] After generating the rotation-enhanced image, scaling enhancement is performed. The scaling factor 's' is limited to the range of 0.8 to 1.2, with value intervals of 0.05. Using the center point of the rotation-enhanced image as the scaling center, pixel coordinates are linearly scaled according to the ratio 's'. The scaled pixel coordinates are then determined using bilinear interpolation to determine the corresponding grayscale values. When scaling results in an image size larger than the original size, the excess area is cropped; when scaling results in an image size smaller than the original size, boundary areas with grayscale values of 0 are added around the image.
[0040] Preferably, performing occlusion enhancement processing on the geometrically enhanced image in step S32 includes: Locate the animal's torso region in the geometrically enhanced image and generate a torso region mask; An elliptical region is randomly generated within the torso region mask, with its area accounting for 5%–15% of the animal's torso region in the geometrically enhanced image; Fill the elliptical area with black to generate a masking layer; The occlusion mask is superimposed on the corresponding position of the geometric enhancement image to generate a dirt enhancement image.
[0041] In this embodiment of the invention, trunk region localization processing is performed on a geometrically enhanced image. First, based on the grayscale distribution characteristics of the geometrically enhanced image, the foreground region is extracted using a fixed threshold segmentation method, with the threshold set at 0.6 times the global average grayscale value of the image. Connectivity analysis is then performed on the segmented foreground region, and the largest connected region is selected as the animal's main body region. Subsequently, the minimum bounding rectangle of the animal's main body region is calculated, and within this minimum rectangle, the upper 20% and lower 15% of the region are removed longitudinally, retaining the middle region as the animal's trunk region, thus forming a trunk region mask.
[0042] After obtaining the torso region mask, an elliptical region is generated within the mask's coverage area. The center point of the elliptical region is confined to the internal coordinate range of the torso region mask. The lengths of the major and minor axes of the ellipse are calculated based on the area of the torso region mask. The area of the elliptical region is limited to between 5% and 15% of the torso region area. The orientation angle of the elliptical region is limited to an integer angle within the range of 0° to 180°.
[0043] After determining the parameters of the elliptical region, an occlusion mask is constructed within the corresponding region. The pixel values of the mask within the elliptical region are uniformly assigned a value of 1, while those in other regions are assigned a value of 0. Subsequently, the occlusion mask is overlaid pixel-by-pixel with the geometric enhancement image. When the occlusion mask pixel value is 1, the corresponding pixel grayscale value in the geometric enhancement image is uniformly replaced with 0, while the unoccluded areas retain their original grayscale values. After this overlay process, a dirt-enhanced image is formed.
[0044] Preferably, step S4 includes: The sample augmentation factor is calculated based on the number of original valid samples in the original valid sample set and the number of corrected samples in the corrected sample set. When the sample augmentation factor is greater than or equal to 3, the original effective sample set, the corrected sample set, and the augmented sample set are merged to form the target training sample set; The target training sample set is used to train a visual model for estimating the weight of captive animals. When the sample augmentation factor is less than 3, return to step S2 and reselect images from the original valid sample set to perform block perspective correction until the sample augmentation factor is greater than or equal to 3.
[0045] In this embodiment of the invention, the number of original valid samples in the original valid sample set is first read. and the number of corrected samples in the corrected sample set. The sample augmentation factor is calculated based on the quantity. Determined according to the following relationship: ,in and All values are positive integers, and the calculation result is rounded to one decimal place.
[0046] When the sample augmentation factor When the value is greater than or equal to 3.0, the original valid sample set, the correction sample set, and the enhancement sample set are read sequentially in chronological order, and the image data of the three sets are written into the same storage space to form the target training sample set. Each image sample in the target training sample set retains its source identifier for subsequent visual feature learning and weight estimation parameter fitting.
[0047] When the sample augmentation factor When the value is less than 3.0, the control flow returns to step S2, and continues to read image frames that have not participated in the correction process from the original valid sample set, repeating the block perspective correction, correction sample set update, and sample count operation. This loop continues until the sample augmentation factor is reached. Once the target score reaches or exceeds 3.0, the target training sample set construction phase will begin.
[0048] Please see Figure 3 The image shows the original collected images of captive animals, corresponding to the candidate images in the "construction of original valid sample set" step. The image records the state of the captive animal group at different times and includes the outlines of multiple captive animals. However, there are problems such as perspective distortion (e.g., shape stretching in the edge area) and partial occlusion. These problems need to be addressed by methods such as block perspective correction and data augmentation to eliminate distortion and enrich the sample for training the weight estimation model.
[0049] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is not limited by the foregoing description. Thus, all changes falling within the meaning and scope of the equivalents of the application are intended to be included within the scope of the invention.
[0050] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A method for processing distorted images for estimating the weight of captive animals, characterized in that, Includes the following steps: Step S1: Collect original image frames of captive animals, and screen the original image frames for validity to form an original valid sample set; Step S2: Divide the image into blocks based on the original valid sample set, calculate the homography matrix block by block, and perform perspective correction and stitching to generate a globally corrected image; Construct a calibration sample set using globally calibrated images; Step S3: Perform data augmentation on the calibration sample set to generate an augmented sample set; Step S4: Calculate the sample augmentation factor based on the original valid sample set and the correction sample set. When the sample augmentation factor reaches 3 times, the target training sample set is formed.
2. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: Acquire continuous raw image frames using an image acquisition device fixedly positioned above the activity area of the captive animals, and perform resolution and sharpness detection on the raw image frames to remove blurry or severely jittery image frames, forming a set of clear candidate image frames. Step S12: In the set of clear candidate image frames, the validity of the image frames is filtered based on the animal outline integrity and occlusion ratio to obtain the original set of valid image frames. Step S13: Perform a quantity count on the original valid image frame set, record the original valid sample count, and form the original valid sample set and the corresponding sample count baseline value.
3. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S2, which involves image segmentation based on the original valid sample set, includes: A single frame of original valid image is read from the original valid sample set and used as the image to be corrected. The image to be corrected is divided into multiple 3×3 sub-block regions according to the preset grid rules, forming a set of sub-block images.
4. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S2, which calculates the homography matrix block by block, includes: In each sub-block region of the sub-block image set, feature point information for describing the geometric structure is extracted to form a sub-block feature point set; Based on the set of feature points of each sub-block, calculate the 3×3 homography matrix used to describe the perspective mapping relationship of the sub-block, and form a set of homography matrices.
5. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S2, which involves perspective correction and stitching, includes: Perspective correction is performed on each sub-block image in the sub-block image set using the homography matrix set, generating a corrected sub-block image set; Based on the spatial relationship of each sub-block in the original image, the set of correction sub-block images is stitched together to generate a global correction image.
6. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S2, which involves constructing a correction sample set using the globally corrected image, includes: Geometric consistency detection is performed on the global corrected image to determine that the distortion error in the edge region is reduced to a preset range, thus forming an effective set of global corrected images; The effective global correction image set is compiled to form a correction sample set; The number of samples in the corrected sample set is counted to obtain the corrected sample size.
7. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S3 includes the following steps: Step S31: Read the global correction image from the correction sample set as the image to be enhanced; Step S32: Perform geometric transformation enhancement on the image to be enhanced to generate a geometrically enhanced image; perform occlusion enhancement processing on the geometrically enhanced image to generate a dirt-enhanced image; Step S33: Combine the geometrically enhanced image and the dirt-enhanced image to form an enhanced sample set; count the number of samples in the enhanced sample set to obtain the number of enhanced samples.
8. The distorted image processing method for estimating the weight of captive animals according to claim 7, characterized in that, Step S32, which involves performing geometric transformation enhancement on the image to be enhanced, includes: Apply random rotation to the image to be enhanced, with a rotation angle range of ±15°, to generate a rotated enhanced image; Apply random scaling to the rotation-enhanced image, with a scaling factor ranging from 0.8 to 1.2, to generate a geometrically enhanced image.
9. The distorted image processing method for estimating the weight of captive animals according to claim 7, characterized in that, Step S32, which involves performing occlusion enhancement processing on the geometrically enhanced image, includes: Locate the animal's torso region in the geometrically enhanced image and generate a torso region mask; An elliptical region is randomly generated within the torso region mask, with its area accounting for 5%–15% of the animal's torso region in the geometrically enhanced image; Fill the elliptical area with black to generate a masking layer; The occlusion mask is superimposed on the corresponding position of the geometric enhancement image to generate a dirt enhancement image.
10. The distorted image processing method for estimating the weight of captive animals according to claim 1, characterized in that, Step S4 includes: The sample augmentation factor is calculated based on the number of original valid samples in the original valid sample set and the number of corrected samples in the corrected sample set. When the sample augmentation factor is greater than or equal to 3, the original effective sample set, the corrected sample set, and the augmented sample set are merged to form the target training sample set; The target training sample set is used to train a visual model for estimating the weight of captive animals. When the sample augmentation factor is less than 3, return to step S2 and reselect images from the original valid sample set to perform block perspective correction until the sample augmentation factor is greater than or equal to 3.