Repair method and system for incomplete image of stock ground

By combining the preprocessing method of threshold segmentation and channel analysis, and combining the symmetric restoration method and layered restoration method, the effective dark areas and damaged areas of the material field image are automatically identified, and the high-brightness color noise is suppressed. This solves the problems of dark texture information loss and low restoration efficiency in material field image processing, and achieves efficient and automated image restoration effects.

CN120672620APending Publication Date: 2025-09-19SHANGHAI BAOSIGHT SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510642433.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The existing technology in material field image processing is unable to adaptively distinguish between effective dark areas and damaged areas, resulting in the loss of dark texture information and the diffusion of bright color noise that pollutes surrounding pixels. In addition, the repair efficiency is limited by manually marked masks, making it difficult to meet automation requirements.

Method used

The preprocessing method combines threshold segmentation and channel analysis, automatically identifies effective dark areas and damaged areas, suppresses high-brightness color noise, and uses symmetrical repair and layered repair methods for image repair, reducing manual intervention and improving repair efficiency and quality.

Benefits of technology

It achieves efficient restoration of incomplete images in the material yard, restores image structure and edge continuity, reduces dependence on computing resources and hardware performance, is suitable for rapid on-site deployment, and solves the problem that traditional methods have unsatisfactory restoration effects in large-area missing areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672620A_ABST
    Figure CN120672620A_ABST
Patent Text Reader

Abstract

The invention provides a restoration method and system for a material field incomplete image, and the method comprises the steps: S1, judging whether the symmetric features in a collected original image meet a preset value or not, if yes, executing a step S2, and if not, executing a step S3; s2, restoring the original image by using a symmetric restoration method, and outputting a final restored image; and S3, restoring the original image by using a hierarchical restoration method, and outputting a final restored image. According to the method, a traditional pixel repairing algorithm and a specially-designed repairing strategy are combined, rapid deployment can be achieved on the site where computing resources are limited, and the image structure and edge continuity can be well restored; the problem that the repairing effect of the large-area missing area is not ideal is effectively relieved while the limited operation capability of the field server is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital image processing, and in particular to a method and system for repairing incomplete images of a material yard. Background Art

[0002] Image loss is a common problem in digital material yard image processing and 3D modeling. Due to equipment obstruction, angle issues, or sensor failure, black blocks or holes often appear in parts of the image, affecting subsequent image recognition, modeling, and volume estimation.

[0003] The traditional image restoration method based on the Telea algorithm is an image restoration technique based on the Fast Marching Method, proposed by Alexandru Telea in 2004. This method has been implemented in the OpenCV library as the cv::inpaint function. However, when applied to industrial scenarios such as material yard image restoration, it has the following limitations:

[0004] 1. Unable to adaptively distinguish between valid dark areas and damaged areas, resulting in loss of dark texture information: The Telea algorithm mainly relies on the information of neighboring pixels for restoration. It lacks a deep understanding of image content and may cause actual dark texture areas to be misjudged as damaged areas, resulting in the loss of important texture details during the restoration process.

[0005] 2. Lack of suppression mechanism for highlight color noise, resulting in abnormal colors contaminating surrounding pixels during the diffusion process: When processing high-brightness noise, the algorithm may diffuse abnormal highlight pixels to the surrounding area, resulting in unnatural bright spots or color distortion in the repaired image.

[0006] 3. Repair efficiency is limited by manually annotated masks, making it difficult to adapt to automated processing needs: Traditional methods usually require manual and precise marking of the areas that need to be repaired, which is inefficient in large-scale or real-time industrial applications and difficult to meet automation needs.

[0007] To this end, the present invention combines the actual application of material fields and proposes a preprocessing method that combines threshold segmentation and channel analysis. By automatically identifying and distinguishing effective dark areas from damaged areas, the influence of high-brightness color noise is suppressed, manual intervention is reduced, and the repair efficiency and quality are improved. Summary of the Invention

[0008] In view of the defects in the prior art, the purpose of the present invention is to provide a method and system for repairing incomplete images of a material yard.

[0009] According to the present invention, a method for repairing a defective image of a material yard is provided, comprising:

[0010] Step S1: Determine whether the symmetry feature in the collected original image meets the preset value. If so, execute step S2; otherwise, execute step S3;

[0011] Step S2: Use the symmetric restoration method to restore the original image and output the final restoration image;

[0012] Step S3: Use the layered restoration method to restore the original image and output the final restoration image.

[0013] Preferably, step S2 includes the following sub-steps:

[0014] Step S2.1: preprocessing the original image to obtain a preprocessed image;

[0015] Step S2.2: performing symmetry axis extraction on the preprocessed image to obtain the symmetry axis;

[0016] Step S2.3: Use the axis of symmetry to perform mirror filling on the image to be repaired. For each pixel in the defective area, calculate its symmetric point about the axis of symmetry. If the symmetric point is within the image range and valid, fill the current defective pixel with the pixel value of the symmetric point. If the symmetric point is invalid, mark the pixel as an area requiring further repair. Based on this, a preliminary repair image and a mask image of the pixel position information requiring further repair are obtained.

[0017] Step S2.4: The preliminary repaired image is repaired using the Telea algorithm based on the pixel position information mask to obtain the final repaired image.

[0018] Preferably, the step S2.1 includes the following sub-steps:

[0019] Step S2.1.1: Convert the original image to grayscale and set a threshold value, setting pixels below this threshold to black;

[0020] Step S2.1.2: Set the pixels in the green channel of the original image that are higher than the set value to black;

[0021] Step S2.1.3: Perform a closing operation on the original image using a rectangular structure element.

[0022] Preferably, the step S2.2 includes the following sub-steps:

[0023] Step S2.2.1: In the green channel of the original image, find the maximum value of the pixels in each row at regular intervals to construct an approximate central axis point set of the pile;

[0024] Step S2.2.2: Use the least squares method to fit the approximate central axis point set of the stockpile to generate the main symmetry axis of the image, and use it as the reference line for subsequent mirror symmetry.

[0025] Preferably, step S3 includes the following sub-steps:

[0026] Step S3.1: Preprocess the original image; convert the original image into a grayscale image, set a threshold, and set pixels below this threshold to black to obtain a preprocessed image;

[0027] Step S3.2: Obtain an elliptical outline of the missing area on the preprocessed image;

[0028] Step S3.3: Using the elliptical outline of the missing area, perform elliptical region layering and layer mean filling on the pre-processed image to obtain the repair mask of each layer and the preliminary repair image after mean filling;

[0029] Step S3.4: Use the repair mask to repair the preliminary repair image layer by layer to obtain the final repair image.

[0030] Preferably, the step S3.2 includes the following sub-steps:

[0031] Step S3.2.1: Binarize and perform morphological operations on the preprocessed image to obtain the maximum outer contour;

[0032] Step S3.2.2: Use the convex hull algorithm to construct the maximum outer contour boundary point set and fit a rotated ellipse as the reference shape of the missing area.

[0033] Preferably, the step S3.3 includes the following sub-steps:

[0034] Step S3.3.1: Scale the original ellipse proportionally to construct multiple elliptical regions that increase in size from the inside to the outside;

[0035] Step S3.3.2: Divide the original ellipse into multiple layers of masks, each layer representing the range of an image area, and obtain a repair mask for each layer;

[0036] Step S3.3.3: Calculate the average value of the RGB pixel values ​​of the non-missing areas in each layer;

[0037] Step S3.3.4: Use the average value of the pixel values ​​as the filling value of the missing area in the next layer to complete the preliminary repair and obtain the preliminary repaired image.

[0038] Preferably, the step S3.4 includes the following sub-steps:

[0039] Step S3.4.1: dilate and Gaussian blur each mask layer to enhance the boundary transition effect;

[0040] Step S3.4.2: Use the Telea algorithm to perform repair layer by layer using the repair mask to obtain the final repaired image.

[0041] According to the present invention, a repair system for a damaged image of a material yard is provided, comprising:

[0042] Module M1: Determine whether the symmetry features in the collected original image meet the preset value. If so, execute module M2; otherwise, execute module M3;

[0043] Module M2: Use the symmetric restoration method to repair the original image and output the final restoration image;

[0044] Module M3: Use the layered restoration method to repair the original image and output the final restoration image.

[0045] Preferably, the module M2 includes the following submodules:

[0046] Module M2.1: preprocess the original image to obtain a preprocessed image;

[0047] Module M2.2: Extract the symmetry axis on the preprocessed image to obtain the symmetry axis;

[0048] Module M2.3: Use the axis of symmetry to mirror the image to be repaired. For each pixel in the defective area, calculate its symmetric point about the axis of symmetry. If the symmetric point is within the image range and valid, fill the current defective pixel with the pixel value of the symmetric point. If the symmetric point is invalid, mark the pixel as an area requiring further repair. Based on this, a preliminary repair image and a mask image with information about the pixel positions that need further repair are obtained.

[0049] Module M2.4: Use the Telea algorithm to repair the preliminary repair image based on the pixel position information mask to obtain the final repair image.

[0050] Preferably, the module M2.1 includes the following submodules:

[0051] Module M2.1.1: Convert the original image to grayscale and set a threshold value, setting pixels below this threshold to black;

[0052] Module M2.1.2: Set the pixels in the green channel of the original image that are higher than the set value to black;

[0053] Module M2.1.3: Perform closing operations on the original image using a rectangular structuring element.

[0054] Preferably, the module M2.2 includes the following submodules:

[0055] Module M2.2.1: In the green channel of the original image, find the maximum value of pixels in each row and construct the approximate central axis point set of the pile;

[0056] Module M2.2.2: Use the least squares method to fit the approximate mid-axis point set of the stockpile to generate the main symmetry axis of the image, and use it as the reference line for subsequent mirror symmetry.

[0057] Preferably, the module M3 includes the following submodules:

[0058] Module M3.1: Preprocess the original image; convert the original image into a grayscale image and set a threshold, setting pixels below this threshold to black to obtain a preprocessed image;

[0059] Module M3.2: Obtain the elliptical outline of the missing area on the preprocessed image;

[0060] Module M3.3: Use the elliptical outline of the missing area to perform elliptical region layering and layer mean filling on the pre-processed image to obtain the repair mask of each layer and the preliminary repair image after mean filling;

[0061] Module M3.4: Use the repair mask to repair the preliminary repair image layer by layer to obtain the final repair image.

[0062] Preferably, the module M3.2 includes the following submodules:

[0063] Module M3.2.1: Binarize and perform morphological operations on the preprocessed image to obtain the maximum outer contour;

[0064] Module M3.2.2: Use the convex hull algorithm to construct the maximum outer contour boundary point set and fit a rotated ellipse as the reference shape of the missing area.

[0065] Preferably, the module M3.3 includes the following submodules:

[0066] Module M3.3.1: Scale the original ellipse to construct multiple elliptical regions that increase in size from the inside to the outside;

[0067] Module M3.3.2: Divide the original ellipse into multiple layers of masks, each layer representing the range of an image area, and obtain the repair mask of each layer;

[0068] Module M3.3.3: Calculate the average value of the RGB pixel values ​​in the non-missing area of ​​each layer;

[0069] Module M3.3.4: Use the average pixel value as the filling value of the missing area in the next layer to complete the preliminary repair and obtain the preliminary repaired image.

[0070] Preferably, the module M3.4 includes the following submodules:

[0071] Module M3.4.1: Dilate and Gaussian blur each mask layer to enhance the boundary transition effect;

[0072] Module M3.4.2: Use the Telea algorithm to perform repairs layer by layer using the repair mask to obtain the final repaired image.

[0073] Compared with the prior art, the present invention has the following beneficial effects:

[0074] 1. The present invention provides an efficient method for repairing incomplete images of material yards. It combines the traditional pixel repair algorithm (Telea algorithm) with specially designed repair strategies (symmetrical repair method and layered repair method). It can be quickly deployed on-site with limited computing resources and can better restore image structure and edge continuity.

[0075] 2. The present invention avoids the limitations of high computing resources and long training cycles of deep learning, achieves rapid repair on ordinary or on-site servers, and solves the problem of difficult deployment of deep learning methods.

[0076] 3. In order to solve the problem that traditional algorithms have unsatisfactory repair effects in large-area missing areas, this invention introduces symmetrical repair methods and layered repair methods to structurally improve the discontinuity and edge blurring problems of local repair.

[0077] 4. This invention combines traditional methods with targeted repair strategies, reducing the algorithm's dependence on hardware performance and improving its feasibility and stability in actual field applications.

[0078] Other beneficial effects of the present invention will be explained through the introduction of specific technical features and technical solutions in the specific implementation methods. Those skilled in the art should be able to understand the beneficial technical effects brought about by the introduction of these technical features and technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:

[0080] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION

[0081] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.

[0082] Reference Figure 1 As shown, a method for repairing a damaged image of a material yard includes:

[0083] Automatically analyze the structural characteristics of the image based on its defect features and select the appropriate repair method. Specifically including:

[0084] Step 1: Calculate the pixel symmetry ratio of the left and right regions of the image as a basis for determining whether it has a clearly symmetrical structure. The pixel symmetry ratio can be obtained by mapping the image symmetrically about the central axis and calculating the consistency ratio of the effective pixels in the symmetrical region;

[0085] Step 2: If the pixel symmetry rate is higher than the set threshold (e.g., 80%), and the missing area is mainly concentrated on one side of the image, it is automatically determined to be "symmetrical" and the symmetric repair method is used;

[0086] Step 3: If the pixel symmetry rate is lower than the threshold, or the missing area crosses the symmetry axis and is relatively dispersed, a layered repair method is used;

[0087] Step 4: If the image structure is in a boundary state (such as the symmetry rate is between 70% and 80%), the system generates a recommended solution and allows the user to manually specify the repair method.

[0088] The symmetrical repair method is suitable for material field images with strong structural symmetry, and is mainly achieved by combining symmetry axis calculation, symmetrical pixel value completion and image repair algorithm; the layered repair rule is suitable for images with complex structures or weak symmetry, and defect completion is completed by combining the image longitudinal layered mean coloring and image repair algorithm.

[0089] The specific steps are as follows:

[0090] 1) Symmetrical repair method:

[0091] Step 1: Preprocess the original image to obtain a preprocessed image;

[0092] Step 1.1: Convert the original image to grayscale and set a threshold. Pixels below this threshold are set to black (considered as missing areas).

[0093] Step 1.2: Set the pixels in the green channel of the original image that are higher than the set value (e.g., 110) to black to clean up irrelevant pixel information in the image and provide better image conditions for finding the central axis in step 2.

[0094] Step 1.3: Perform a closing operation on the original image using a rectangular structure element to fill small holes in the image, eliminate fragmented blank areas, and enhance edge continuity.

[0095] Step 2: Extract the symmetry axis on the preprocessed image to obtain the symmetry axis;

[0096] Step 2.1: In the green channel of the original image, find the point with the largest pixel value in every certain row, and construct the central axis point set P = {(x i ,y i )};

[0097] Step 2.2: Use the least squares method to perform straight line fitting on the point set P to obtain the main symmetry axis of the image. The fitting goal is to find a straight line y = kx + b such that the sum of the squares of the vertical distances from all points to the straight line is minimized, that is:

[0098] min{∑(y i -k*x i -b) 2}

[0099] Where k is the slope and b is the intercept. This method obtains a best-fit straight line, which serves as the reference axis for symmetric restoration.

[0100] Step 3: Use the axis of symmetry to mirror the image to be repaired. For each pixel in the defective area, calculate its symmetric point about the axis of symmetry. If the symmetric point is within the image range and valid, fill the current defective pixel with the pixel value of the symmetric point. If the symmetric point is invalid, mark the pixel as an area requiring further repair. Finally, the preliminary repair image and the mask image of the pixel position information that needs further repair are obtained;

[0101] Step 4: Use the position information mask to repair the preliminary repair image using the traditional pixel repair algorithm (Telea algorithm) to obtain the final repair image.

[0102] 2) Layered repair method

[0103] Step 1: Preprocess the original image. Convert the original image to a grayscale image and set a threshold. Pixels below this threshold are set to black (considered as missing areas) to obtain a preprocessed image.

[0104] Step 2: Obtain the elliptical outline of the missing area on the preprocessed image;

[0105] Step 2.1: Perform grayscale conversion and binarization on the preprocessed image to identify the valid area in the image, and eliminate holes and fine interference through morphological closing operation to obtain the target area with coherent edges.

[0106] Step 2.2: Use an image boundary tracking algorithm to scan and identify the outer contours of all foreground areas from the binary image pixel by pixel. This method forms a set of contour points by recording the foreground area pixel boundaries and performing adjacency tracking.

[0107] Step 2.3: Traverse all contours, calculate the area of ​​each contour, and select the contour with the largest area as the main boundary of the target area.

[0108] Step 2.4: Apply a two-dimensional convex hull construction algorithm to the maximum contour to extract its minimum convex boundary. Specifically, use the lowest point in the boundary point set as the starting point, sort the remaining points by the polar angle of the line connecting them to this point, and connect each point in sequence to construct the polygonal boundary. During the construction process, exclude points that would otherwise be concave to ensure that the resulting polygonal boundary is convex. Ultimately, a complete set of convex hull boundary points is obtained.

[0109] Step 2.5: Fit a quadratic curve to the convex hull boundary point set, and calculate the elliptic curve that is the closest to the point set in a geometric sense by the least squares method.

[0110] Step 2.5.1: Represent the boundary point set as a set of two-dimensional coordinates;

[0111] Step 2.5.1: Assume the equation of the fitted ellipse is:

[0112] Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0

[0113] Step 2.5.1: Construct the design matrix D so that each row

[0114] Step 2.5.1: Solve the problem that satisfies the ellipse constraint B 2 -4AC<0, so that ||D·p|| 2 The smallest parameter vector [Δ,B,C,D,E,F] T ;

[0115] Step 2.5.1: Extract the ellipse center position, major and minor axes, rotation angle and other parameters to obtain the ellipse outline.

[0116] Step 3: Use the elliptical contour of the missing area to perform elliptical region layering and layer mean filling on the pre-processed image to obtain the repair mask of each layer and the preliminary repair image after mean filling;

[0117] Step 3.1: Scale the original ellipse proportionally to construct multiple elliptical regions that increase in size from the inside to the outside;

[0118] Step 3.2: Use these ellipses to divide the multi-layer mask, each layer represents the range of an image area, and obtain the repair mask of each layer;

[0119] Step 3.3: Calculate the average RGB pixel value of the non-missing area in each layer;

[0120] Step 3.4: Use these average values ​​as the filling values ​​of the missing areas in the next layer to complete the preliminary restoration and obtain the preliminary restored image.

[0121] Step 4: Use the repair mask to repair the preliminary repair image layer by layer to obtain the final repair image.

[0122] Step 4.1: Dilate and Gaussian blur each mask layer to enhance the boundary transition effect;

[0123] Step 4.2: Use the repair mask layer by layer using the traditional pixel repair algorithm (Telea algorithm) to obtain the final repaired image.

[0124] The present invention also provides a repair system for incomplete images of a material yard. The repair system for incomplete images of a material yard can be implemented by executing the process steps of the repair method for incomplete images of a material yard. That is, those skilled in the art can understand the repair method for incomplete images of a material yard as an optimal implementation of the repair system for incomplete images of a material yard.

[0125] Specifically, a repair system for incomplete images of a material yard includes:

[0126] Module M1: Determine whether the symmetry features in the collected original image meet the preset value. If so, execute module M2; otherwise, execute module M3;

[0127] Module M2: Use the symmetric restoration method to repair the original image and output the final restoration image;

[0128] Module M3: Use the layered restoration method to repair the original image and output the final restoration image.

[0129] The module M2 includes the following submodules:

[0130] Module M2.1: preprocess the original image to obtain a preprocessed image;

[0131] Module M2.2: Extract the symmetry axis on the preprocessed image to obtain the symmetry axis;

[0132] Module M2.3: Use the axis of symmetry to mirror the image to be repaired. For each pixel in the defective area, calculate its symmetric point about the axis of symmetry. If the symmetric point is within the image range and valid, fill the current defective pixel with the pixel value of the symmetric point. If the symmetric point is invalid, mark the pixel as an area requiring further repair. Based on this, a preliminary repair image and a mask image with information about the pixel positions that need further repair are obtained.

[0133] Module M2.4: Use the Telea algorithm to repair the preliminary repair image based on the pixel position information mask to obtain the final repair image.

[0134] The module M2.1 includes the following submodules:

[0135] Module M2.1.1: Convert the original image to grayscale and set a threshold value, setting pixels below this threshold to black;

[0136] Module M2.1.2: Set the pixels in the green channel of the original image that are higher than the set value to black;

[0137] Module M2.1.3: Perform closing operations on the original image using a rectangular structuring element.

[0138] The module M2.2 includes the following submodules:

[0139] Module M2.2.1: In the green channel of the original image, find the maximum value of pixels in each row and construct the approximate central axis point set of the pile;

[0140] Module M2.2.2: Use the least squares method to fit the approximate mid-axis point set of the stockpile to generate the main symmetry axis of the image, and use it as the reference line for subsequent mirror symmetry.

[0141] The module M3 includes the following submodules:

[0142] Module M3.1: Preprocess the original image; convert the original image into a grayscale image and set a threshold, setting pixels below this threshold to black to obtain a preprocessed image;

[0143] Module M3.2: Obtain the elliptical outline of the missing area on the preprocessed image;

[0144] Module M3.3: Use the elliptical outline of the missing area to perform elliptical region layering and layer mean filling on the pre-processed image to obtain the repair mask of each layer and the preliminary repair image after mean filling;

[0145] Module M3.4: Use the repair mask to repair the preliminary repair image layer by layer to obtain the final repair image.

[0146] The module M3.2 includes the following submodules:

[0147] Module M3.2.1: Binarize and perform morphological operations on the preprocessed image to obtain the maximum outer contour;

[0148] Module M3.2.2: Use the convex hull algorithm to construct the maximum outer contour boundary point set and fit a rotated ellipse as the reference shape of the missing area.

[0149] The module M3.3 includes the following submodules:

[0150] Module M3.3.1: Scale the original ellipse to construct multiple elliptical regions that increase in size from the inside to the outside;

[0151] Module M3.3.2: Divide the original ellipse into multiple layers of masks, each layer representing the range of an image area, and obtain the repair mask of each layer;

[0152] Module M3.3.3: Calculate the average value of the RGB pixel values ​​in the non-missing area of ​​each layer;

[0153] Module M3.3.4: Use the average pixel value as the filling value of the missing area in the next layer to complete the preliminary repair and obtain the preliminary repaired image.

[0154] The module M3.4 includes the following submodules:

[0155] Module M3.4.1: Dilate and Gaussian blur each mask layer to enhance the boundary transition effect;

[0156] Module M3.4.2: Use the Telea algorithm to perform repairs layer by layer using the repair mask to obtain the final repaired image.

[0157] Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, and units provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same functions of the system and its various devices, modules, and units provided by the present invention in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; the devices, modules, and units for implementing various functions can also be considered as both software modules implementing the method and structures within the hardware component.

[0158] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.

Claims

1. A method for repairing incomplete images of a material yard, characterized by: include: Step S1: Determine whether the symmetry feature in the collected original image meets the preset value. If so, execute step S2; otherwise, execute step S3; Step S2: Use the symmetric restoration method to restore the original image and output the final restoration image; Step S3: Use the layered restoration method to restore the original image and output the final restoration image.

2. The method for repairing a defective image of a material yard according to claim 1, characterized in that: The step S2 includes the following sub-steps: Step S2.1: preprocessing the original image to obtain a preprocessed image; Step S2.2: performing symmetry axis extraction on the preprocessed image to obtain the symmetry axis; Step S2.3: Use the axis of symmetry to perform mirror filling on the image to be repaired. For each pixel in the defective area, calculate its symmetric point about the axis of symmetry. If the symmetric point is within the image range and valid, fill the current defective pixel with the pixel value of the symmetric point. If the symmetric point is invalid, mark the pixel as an area requiring further repair. Based on this, a preliminary repair image and a mask image of the pixel position information requiring further repair are obtained. Step S2.4: The preliminary repaired image is repaired using the Telea algorithm based on the pixel position information mask to obtain the final repaired image.

3. The method for repairing a defective image of a material yard according to claim 2, characterized in that: The step S2.1 includes the following sub-steps: Step S2.1.1: Convert the original image to grayscale and set a threshold value, setting pixels below this threshold to black; Step S2.1.2: Set the pixels in the green channel of the original image that are higher than the set value to black; Step S2.1.3: Perform a closing operation on the original image using a rectangular structure element.

4. The method for repairing an incomplete image of a material yard according to claim 3, characterized in that: The step S2.2 includes the following sub-steps: Step S2.2.1: In the green channel of the original image, find the maximum value of the pixels in each row at regular intervals to construct an approximate central axis point set of the pile; Step S2.2.2: Use the least squares method to fit the approximate central axis point set of the stockpile to generate the main symmetry axis of the image, and use it as the reference line for subsequent mirror symmetry.

5. The method for repairing an incomplete image of a material yard according to claim 1, characterized in that: The step S3 includes the following sub-steps: Step S3.1: Preprocess the original image; convert the original image into a grayscale image, set a threshold, and set pixels below this threshold to black to obtain a preprocessed image; Step S3.2: Obtain an elliptical outline of the missing area on the preprocessed image; Step S3.3: Using the elliptical outline of the missing area, perform elliptical region layering and layer mean filling on the pre-processed image to obtain the repair mask of each layer and the preliminary repair image after mean filling; Step S3.4: Use the repair mask to repair the preliminary repair image layer by layer to obtain the final repair image.

6. The method for repairing an incomplete image of a material yard according to claim 5, characterized in that: The step S3.2 includes the following sub-steps: Step S3.2.1: Binarize and perform morphological operations on the preprocessed image to obtain the maximum outer contour; Step S3.2.2: Use the convex hull algorithm to construct the maximum outer contour boundary point set and fit a rotated ellipse as the reference shape of the missing area.

7. The method for repairing an incomplete image of a material yard according to claim 6, characterized in that: The step S3.3 includes the following sub-steps: Step S3.3.1: Scale the original ellipse proportionally to construct multiple elliptical regions that increase in size from the inside to the outside; Step S3.3.2: Divide the original ellipse into multiple layers of masks, each layer representing the range of an image area, and obtain a repair mask for each layer; Step S3.3.3: Calculate the average value of the RGB pixel values ​​of the non-missing areas in each layer; Step S3.3.4: Use the average value of the pixel values ​​as the filling value of the missing area in the next layer to complete the preliminary repair and obtain the preliminary repaired image.

8. The method for repairing an incomplete image of a material yard according to claim 7, characterized in that: The step S3.4 includes the following sub-steps: Step S3.4.1: dilate and Gaussian blur each mask layer to enhance the boundary transition effect; Step S3.4.2: Use the Telea algorithm to perform repair layer by layer using the repair mask to obtain the final repaired image.

9. A repair system for incomplete images of a material yard, characterized by: include: Module M1: Determine whether the symmetry features in the collected original image meet the preset value. If so, execute module M2; otherwise, execute module M3; Module M2: Use the symmetric restoration method to repair the original image and output the final restoration image; Module M3: Use the layered restoration method to repair the original image and output the final restoration image.

10. The repair system for incomplete images of a material yard according to claim 9, characterized in that: The module M2 Includes the following submodules: Module M2.1: preprocess the original image to obtain a preprocessed image; Module M2.2: Extract the symmetry axis on the preprocessed image to obtain the symmetry axis; Module M2.3: Use the axis of symmetry to mirror the image to be repaired. For each pixel in the defective area, calculate its symmetric point about the axis of symmetry. If the symmetric point is within the image range and valid, fill the current defective pixel with the pixel value of the symmetric point. If the symmetric point is invalid, mark the pixel as an area requiring further repair. Based on this, a preliminary repair image and a mask image with information about the pixel positions that need further repair are obtained. Module M2.4: Use the Telea algorithm to repair the preliminary repair image based on the pixel position information mask to obtain the final repair image.