Method, device, equipment and medium for detecting surface cracks of aviation structural parts
Through the image processing method of multi-directional grayscale value difference and binary matrix, combined with adaptive binarization and morphological operation, the accuracy and efficiency of micro crack detection on the surface of aviation structural parts is solved, and efficient and accurate crack detection is achieved.
Patent Information
- Application Number
- CN202510517708.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-04-24
AI Technical Summary
The prior art is difficult to efficiently and accurately detect small cracks on the surface of aviation structural parts. Traditional non-destructive testing methods have great limitations, low manual detection efficiency and easy to miss inspection. Image recognition technology has poor accuracy in complex backgrounds.
The image processing method based on the difference in grayscale value and binary matrix of multi-direction is adopted. By acquiring the target image of the aviation structural parts, traversing pixel points in different directions, extracting crack width information, and using the template crack image to extract the skeleton information. Combining adaptive binarization and morphological operations, noise interference is eliminated and detection accuracy is improved.
Effectively separate background and cracks, improve the accuracy of crack detection on surfaces of aviation structural parts, reduce noise interference, improve detection efficiency and consistency, and ensure accurate identification of micro cracks.
Smart Images

Figure CN120047440B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method, device, equipment and medium for detecting surface cracks of aviation structural parts. Background Art
[0002] Because aviation structural components (such as engine air intake grilles) are exposed to harsh environments for long periods of time, high-speed airflow and the impact of foreign matter like sand and rocks can easily cause microcracks on their surfaces. This can affect aircraft performance and, in severe cases, even lead to structural failure, endangering flight safety. Therefore, accurate detection of microcracks on the surfaces of aviation structural components has become a crucial aspect of aircraft maintenance.
[0003] Due to the unique geometry and surface complexity of aviation structural components, traditional nondestructive testing technologies (such as penetrant testing, ultrasonic testing, and eddy current testing) have significant limitations in their application, making it difficult to accurately detect tiny cracks. Currently, crack detection relies primarily on manual inspection, but due to limitations in vision, fatigue, and experience, manual inspection is inefficient and prone to false positives and missed detections, making it difficult to guarantee the accuracy of test results.
[0004] In recent years, image recognition technology has gradually been introduced into the field of crack detection. However, image processing still faces many challenges in crack detection of aviation structural parts. First, random noise is easily generated during image acquisition and storage, affecting the clear presentation of crack features. Second, problems such as uneven light sources in the external environment and stains attached to the surface of structural parts can lead to uneven grayscale distribution in the image, thereby reducing the accuracy of crack detection. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, device, equipment and medium for detecting surface cracks of aviation structural parts, which can solve the technical problem of low crack detection accuracy.
[0006] To solve the above technical problems, an embodiment of the present invention provides a method for detecting surface cracks of an aviation structural component, comprising the following steps:
[0007] Acquire a target image of an aviation structural part to be inspected;
[0008] Based on the various directions of surface cracks on aviation structural parts, the pixel points in the target image are traversed along each direction respectively. The initial crack image containing the width information of the surface crack of the aviation structural part is extracted from the target image based on the gray value difference between each pixel in the target image.
[0009] A target crack image containing information about the crack skeleton on the surface of the aviation structural component is extracted from the initial crack image based on brightness differences between the initial crack image and multiple template crack images. The multiple template crack images are binary images corresponding to binary matrices created based on different directions and widths of cracks on the surface of the aviation structural component.
[0010] Surface cracks on aviation structural parts are detected through target crack images.
[0011] Optionally, the aviation structural member is a protective grid, which is composed of a plurality of grids of the same size, and the horizontal and vertical spacings between two adjacent grids are equal;
[0012] The traversing the pixel points in the target image along each direction respectively includes:
[0013] Binarize the target image and perform a closing operation on the binarized target image to obtain the Hole region of each grid in the target image;
[0014] Determine the bottom area of each grid in the target image based on the hole area of each grid and the arrangement rules of each grid in the target image;
[0015] Traverse the pixels in each Bottom area along each direction respectively.
[0016] Optionally, binarizing the target image and performing a closing operation on the binarized target image to obtain a hole region of each grid in the target image includes:
[0017] When binarizing the target image, areas in the target image with pixel values higher than a first preset threshold are set to white, and areas with pixel values lower than the first preset threshold are set to black;
[0018] By performing a closing operation on the binarized target image, the black areas whose areas are smaller than the second preset threshold are eliminated, and the white areas whose areas are smaller than the second preset threshold are filled;
[0019] The preset contour tracking algorithm is used to extract the contour of the processed target image to form a bounding rectangle, which is used as the hole area of the grid.
[0020] Optionally, determining the bottom area of each grid in the target image according to the hole area of each grid and the arrangement rule of each grid in the target image includes:
[0021] Get the upper left corner coordinates, width and height of the circumscribed rectangle of the Hole area;
[0022] Get the upper left corner coordinates, width, and height of the circumscribed rectangle of the Bottom area based on the upper left corner coordinates, width, height, and vertical spacing between two adjacent grids of the circumscribed rectangle of the Hole area.
[0023] Optionally, the binary matrix includes binary matrices created for cracks in the horizontal direction, vertical direction, left oblique direction, and right oblique direction on the surface of the aviation structure, as follows:
[0024] ;
[0025] ;
[0026] ;
[0027] ;
[0028] Where, is a binary matrix in the horizontal direction, is a binary matrix in the vertical direction, is a binary matrix in the left oblique direction, is a binary matrix in the right oblique direction, Represent the row and column indices of the binary matrix respectively, Indicates height, The width of the crack, is the preset offset constant, Indicates a point The vertical distance to the center axis of the crack.
[0029] Optionally, the target image includes multiple local areas, and detecting surface cracks of aviation structural parts using the target crack image includes:
[0030] Obtaining the grayscale value of each local area, and determining the binarization threshold of each local area according to the grayscale value of each local area;
[0031] Binarizing each local area using a binarization threshold of each local area to obtain a binarized image of the target image; wherein the binarization threshold of each local area is adjusted in real time using a preset parameter;
[0032] The surface cracks of aviation structural parts are detected by the intersection of the binary image of the target image and the target crack image.
[0033] Optionally, obtaining a target image of the aviation structural component to be inspected includes:
[0034] Take pictures to obtain the initial images of aviation structural parts;
[0035] Perform perspective transformation on the initial image;
[0036] According to the tilt direction of the shooting camera and the surface shape of the aviation structure, the initial image after perspective transformation is corrected to obtain the target image.
[0037] An embodiment of the present invention further provides a device for detecting surface cracks of an aviation structural component, comprising:
[0038] An image acquisition module, used to acquire a target image of the aviation structural part to be inspected;
[0039] A first image processing module is configured to traverse the pixels in the target image along each direction based on the multiple different directions of the surface cracks of the aviation structural component, so as to extract an initial crack image containing the width information of the surface cracks of the aviation structural component from the target image based on the grayscale value difference between each pixel in the target image;
[0040] a second image processing module for extracting a target crack image containing crack skeleton information on the surface of the aviation structural component from the initial crack image based on brightness differences between the binary image of the initial crack image and a plurality of template crack images, wherein the plurality of template crack images are binary images corresponding to binary matrices created based on different directions and widths of cracks on the surface of the aviation structural component;
[0041] The image detection module is used to detect surface cracks of aviation structural parts through target crack images.
[0042] An embodiment of the present invention also provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for detecting surface cracks of aviation structural parts.
[0043] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned method for detecting surface cracks of aviation structural parts.
[0044] The method for detecting surface cracks in aviation structural parts provided by the present invention has at least the following beneficial effects:
[0045] First, based on the various directions of surface cracks on aircraft structural parts, the pixels in the target image are traversed along each direction. The width information of the surface cracks on the aircraft structural parts is extracted from the image by comparing the grayscale value differences between the pixels in the target image. The corresponding image is used as the preliminary extracted crack image. Then, a specific rule, namely a binary matrix, is introduced to define the crack features of different directions and widths on the surface of the aircraft structural part. This specific rule allows for deeper crack feature extraction from the preliminary extracted crack image to obtain the skeleton information of the surface cracks on the aircraft structural part, thereby effectively avoiding the detection of large block defects and edge information. In addition, the above-mentioned specific rule is used to further extract crack features from the preliminary extracted crack image based on the binary image, which can effectively separate the image background and cracks, resulting in less noise around the cracks. Based on this, the surface cracks of aircraft structural parts can be effectively detected, improving the accuracy of crack detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] One or more embodiments are exemplarily described by the figures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments.
[0047] Figure 1 This is a flow chart of a method for detecting surface cracks of an aviation structural component according to one embodiment of the present invention;
[0048] Figure 2 A contrast image of an original image and a perspective-transformed image provided according to an embodiment of the present invention;
[0049] Figure 3 is an illustration of an area to be detected provided according to an embodiment of the present invention;
[0050] Figure 4 is a binarized image provided according to an embodiment of the present invention;
[0051] Figure 5 A Bottom area diagram is provided according to an embodiment of the present invention;
[0052] Figure 6 This is a comparison diagram of conventional binarization and adaptive binarization effects provided according to an embodiment of the present invention;
[0053] Figure 7 The present invention is a flowchart of a method for detecting surface cracks of an aviation structural component according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] To make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in the embodiments of the present invention, many technical details are provided to enable the reader to better understand the present invention. However, even without these technical details and the various changes and modifications based on the following embodiments, the technical solutions claimed in the present invention can be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with each other and referenced to each other under the premise that there is no contradiction.
[0055] Existing crack detection technology has the following specific defects:
[0056] 1. Disadvantages of manual inspection:
[0057] (1) Low detection efficiency: Manual detection requires a lot of time and energy, and the detection process is easily affected by human factors (such as vision, fatigue, experience, etc.).
[0058] (2) Poor consistency: Due to the different subjective judgments of testers, false detection and missed detection are common, making it difficult to guarantee the accuracy of the test results.
[0059] 2. Limitations of traditional image recognition algorithms:
[0060] (1) Edge blur: The crack size is very small, and traditional filtering algorithms often produce edge blur when processing images, making it difficult to distinguish fine cracks.
[0061] (2) Fixed threshold problem: The traditional binarization algorithm uses a fixed threshold, which is difficult to adapt to the interference of complex background (such as oil stains, shadows, etc.) and is prone to losing crack information.
[0062] (3) Low efficiency: The sliding window algorithm is often affected by the grayscale changes in the non-crack area, resulting in a high false detection rate and slow processing speed.
[0063] The method for detecting surface cracks of aviation structural parts of the present invention can effectively solve the above problems.
[0064] One embodiment of the present invention relates to a method for detecting surface cracks of an aviation structural part. The specific process of the method for detecting surface cracks of an aviation structural part of this embodiment can be as follows: Figure 1 As shown, including:
[0065] Step 101: Acquire a target image of an aviation structural component to be inspected.
[0066] In step 102 , based on the various directions of the surface cracks of the aviation structural component, the pixels in the target image are traversed along each direction respectively, so as to extract an initial crack image containing the width information of the surface cracks of the aviation structural component from the target image based on the grayscale value difference between each pixel in the target image.
[0067] Step 103 : extracting a target crack image containing the crack skeleton information of the surface of the aviation structural component from the initial crack image based on the brightness difference between the binary image of the initial crack image and a plurality of template crack images; wherein the plurality of template crack images are binary images corresponding to binary matrices created based on the different directions and widths of the surface cracks of the aviation structural component.
[0068] Step 104 : Detect surface cracks of the aviation structural component using the target crack image.
[0069] In this embodiment, based on the various directions of surface cracks on aircraft structural components, the pixels in a target image are traversed along each direction. The width of the surface cracks on the aircraft structural component is extracted from the image by comparing the grayscale value differences between the pixels in the target image. The corresponding image is then used as a preliminary extracted crack image. A specific rule, namely a binary matrix, is then introduced to define the characteristics of cracks of different directions and widths on the surface of the aircraft structural component. This specific rule enables deeper crack feature extraction from the preliminary extracted crack image to obtain skeleton information of the surface crack on the aircraft structural component, effectively avoiding the detection of large block defects and edge information. Furthermore, the crack feature extraction from the preliminary extracted crack image using this specific rule is based on a binary image, effectively separating the image background from the crack, resulting in less noise around the crack. This allows for effective detection of surface cracks on aircraft structural components and improves crack detection accuracy.
[0070] The following is a detailed description of the implementation details of the method for detecting surface cracks in aviation structural parts of the present invention. The following content is only provided for ease of understanding and is not necessary for implementing this solution.
[0071] In step 101, due to the geometric structure of the aviation structure, the camera needs to be deflected when shooting the image, which causes the image of the aviation structure to be slightly deformed. In order to ensure the accuracy and reliability of subsequent crack detection, the captured image needs to be perspective transformed and corrected according to different shooting conditions (such as the camera tilt direction and the surface shape of the structure) to make the image more consistent with the actual geometric shape, such as Figure 2Therefore, when acquiring a target image of an aviation structure to be inspected, this embodiment first captures an initial image of the aviation structure, then performs perspective transformation on the initial image, and corrects the perspective-transformed initial image based on the tilt direction of the camera and the surface shape of the aviation structure, ultimately obtaining a target image.
[0072] The perspective transformation operation is as follows:
[0073] (1) Select four point coordinates in the original image.
[0074] (2) Calculate the coordinates of the four points in the correction state.
[0075] The y coordinates of the upper left point and the upper right point are equal to the minimum y values of the upper left point and the upper right point;
[0076] The y coordinates of the lower left point and the upper right point are equal to the maximum y values of the upper left point and the upper right point;
[0077] The x-coordinate of the upper left point and the x-coordinate of the lower left point are equal to the minimum x-value of the upper left point and the lower left point;
[0078] The x-coordinate of the upper right point and the x-coordinate of the lower right point are equal to the maximum x-value of the upper right point and the lower right point.
[0079] (3) Construct a set of perspective transformation equations.
[0080] (4) Solve the matrix through linear algebra.
[0081] (5) Obtain the image after perspective transformation.
[0082] In one example, when taking the initial image of an aviation structure, images of the aviation structure with multiple resolutions are obtained. Then, the image of the aviation structure that meets the resolution requirements is read and converted into a grayscale image before the next step is performed. Since color images have three channels (RGB) and grayscale images only use one channel, grayscale images have smaller data volumes than color images, are simpler and more efficient to process, and highlight brightness information. Cracks are usually detected by brightness differences, and color information introduces unnecessary complexity. Based on the human eye's sensitivity to color, the weights of red, green, and blue are 0.299, 0.587, and 0.114, respectively, that is, the grayscale image is obtained by the following formula :
[0083] .
[0084] In one example, after obtaining a target image of an aviation structure, the following preprocessing operations are performed on the target image:
[0085] (1) Median filtering is used to remove “salt and pepper noise” in images, which refers to points in the image where the pixel values deviate extremely from the surrounding values. Median filtering removes noise without blurring the edges, which is particularly important for crack detection because it can preserve the structural information in the image while reducing the interference of noise on crack extraction.
[0086] (2) Adaptive histogram equalization is used to improve the contrast of the image, especially in the case of uneven lighting. It improves the visibility of low-contrast areas by equalizing the local area, which helps in subsequent crack detection.
[0087] (3) Since the image captured by the camera has a high resolution and is not convenient for early image processing, the common interpolation methods for image size transformation include nearest neighbor interpolation, bilinear interpolation, and cubic linear interpolation. Although the cubic linear interpolation method has a better effect, it is not conducive to real-time processing due to the large amount of calculation and the long time. Therefore, the bilinear interpolation method is chosen.
[0088] In some embodiments, during crack detection, the crack area is first roughly located. By quickly screening potential crack areas, interference from irrelevant areas can be effectively reduced, narrowing the recognition range, thereby reducing the amount of calculation and processing complexity. Coarse positioning can not only improve the efficiency of subsequent precise identification, but also avoid the waste of resources and risk of misjudgment that may be caused by direct precise detection. Therefore, this embodiment first locates the target detection area in the target image, and then searches for pixels in the target detection area along different directions of the center point of the target detection area to extract an initial crack image from the target detection area, and then extracts a target crack image from the initial crack image before performing subsequent crack detection.
[0089] Taking the aviation structure as an example, the protective grid is composed of multiple grids of the same size, and the horizontal and vertical spacing between two adjacent grids are equal. According to this rule, each grid in the target image is divided into three areas: Hole, Left and Bottom, as shown in the following example: Figure 3 As shown in the figure, since cracks only appear in the bottom area of the grid and the grids of the protective grid have a certain arrangement rule, the bottom area can be inferred by determining the hole area.
[0090] Specifically, first, the target image is binarized to make the image area to be detected and the background more distinct, so as to accurately locate the Hole area. When binarizing the target image, a threshold (first preset threshold) is set, and the area with pixel values higher than the first preset threshold in the target image is set to white (255), and the area with pixel values lower than the first preset threshold is set to black (0). According to experimental analysis, the threshold T=10 is set to obtain the protective fence binarization image, as shown in FIG. Figure 4As shown. Then, a closing operation is performed on the binarized target image. In crack detection, the closing operation can eliminate small black areas and fill small white areas. That is, by performing a closing operation on the binarized target image, black areas with an area smaller than the second preset threshold are eliminated, and white areas with an area smaller than the second preset threshold are filled, making the hole area contour more complete. Finally, a preset contour tracking algorithm is used to extract the contour of the processed target image, and the area of the circumscribed rectangle of the extracted contour is calculated. The contours of the circumscribed rectangle within the preset area range are screened out as the hole areas of the corresponding grid.
[0091] After obtaining the hole area of each grid, the bottom area of each grid in the target image is determined based on the hole area of each grid and the arrangement rules of each grid in the target image. For each grid, first obtain the upper left corner coordinates (X, Y), width (W), and height (H) of the rectangle bounding the hole area. Then, based on the upper left corner coordinates, width, height of the rectangle bounding the hole area and the vertical spacing (Vh) between two adjacent grids, obtain the upper left corner coordinates, width, and height of the rectangle bounding the bottom area.
[0092] For example, set the area interval of the circumscribed rectangle of the Hole area to (A1, A2). The contour within this area interval is the required complete hole (i.e., the Hole area). After finding all the holes, the bottom area of each grid can be determined based on the vertical spacing (Vh) of the protective grid: calculate the upper left corner coordinates (X, Y), width (W), and height (H) of the circumscribed rectangle of each Hole, and then determine the upper left corner coordinates of the circumscribed rectangle of the Bottom area as (X, Y+H), width W, and height Vh based on Vh, thereby obtaining the bottom area of each grid. This bottom area is the target detection area, as shown in the following example. Figure 5 shown.
[0093] Through this step, the overall efficiency and accuracy of crack detection are significantly improved, laying the foundation for refined detection.
[0094] In steps 102 and 103, this embodiment creates matching templates (including horizontal templates, vertical templates, left-slanted templates, and right-slanted templates) for cracks in different directions on the surface of aviation structural parts, thereby improving detection coverage. The matching template is a binary matrix used to detect specific crack shapes.
[0095] Among them, the horizontal template is used to detect cracks in the horizontal direction. The specified width of the middle row is assigned a value of 255. The template matrix (i.e., the binary matrix in the horizontal direction) is defined as follows:
[0096] ;
[0097] Where, Represents the height, that is, the number of rows of the binary matrix, The width of the crack, Represent the row and column indices of the binary matrix respectively.
[0098] Vertical template: used to detect cracks in the vertical direction. The height of the middle column is assigned a value of 255. The template matrix (i.e., the binary matrix in the vertical direction) is defined as follows:
[0099] ;
[0100] Where, Indicates height, The width of the crack, Represent the row and column indices of the binary matrix respectively.
[0101] Left-slanted template: used to detect cracks from the upper left to the lower right. The right diagonal area of the template matrix is assigned a value of 255. The template matrix (i.e., a binary matrix in the left-slanted direction) is defined as follows:
[0102] ;
[0103] Where, is a preset offset constant used to define the slope (main diagonal offset), Indicates height, The width of the crack, Indicates the vertical distance from the pixel point to the main line of the template (i.e. the central axis of the crack), Represent the row and column indices of the binary matrix respectively.
[0104] Right-slanted template: used to detect cracks from the upper right to the lower left. The right diagonal area of the template matrix is assigned a value of 255. The template matrix (i.e., a binary matrix in the right-slanted direction) is defined as follows:
[0105] ;
[0106] Where, is a preset offset constant used to define the slope (main diagonal offset), Indicates height, represents the crack width, Indicates the vertical distance from the pixel to the main line of the template, Represent the row and column indices of the binary matrix respectively.
[0107] Based on this, a crack search is performed in the target image along various directions of surface cracks in aviation structural parts, namely horizontally, vertically, and diagonally (including right and left diagonally). The search is based on grayscale value differences, and stops when the grayscale value of the searched pixel is greater than the grayscale value of the center point. Thus, an initial crack image containing information on the crack width of the aviation structural part can be extracted from the target image based on the grayscale value differences between each pixel in the target image. After traversing and obtaining the grayscale values of each pixel in the target image, the grayscale values of each pixel can be compared. If there are continuous pixels in a direction, such as the horizontal direction, with very small grayscale value differences, and these pixels have large grayscale value differences with pixels at other locations, these continuous pixels in this direction are considered as an initial crack, thus forming an initial crack image containing information on the crack width of the aviation structural part.
[0108] Then, the extracted initial crack image is matched with the images corresponding to the above template matrices (i.e., multiple template crack images), and the target crack image containing the surface crack skeleton information of the aviation structural component can be extracted from the initial crack image.
[0109] In the specific implementation, the width of the crack is one of the main features of the crack search. Areas that are too wide or too narrow may be excluded. The actual width of the crack is determined by searching for cracks to provide parameters for the subsequent matching of the initial crack image with the template crack image. The crack width calculation formula is as follows:
[0110] ;
[0111] Where, is the width of the search from the center point to the left, The width to search from the center point to the right.
[0112] By comparing the brightness difference between the initial crack image and the template crack image, the brightness difference in the area with higher correlation is smaller, so it is possible to determine whether the initial crack image is a crack. At the same time, the adaptive threshold can be used to adapt to different crack widths.
[0113] ;
[0114] Where, is the grayscale value of the image area, is the grayscale value of the template area.
[0115] In one example, filling small gaps in image cracks through morphological operations can enhance crack connectivity, remove isolated small noise points, and make the final detection results smoother.
[0116] ;
[0117] ;
[0118] Where, represents the expansion operation, represents the corrosion operation, is the structural element (i.e., matrix kernel).
[0119] At this point, by superimposing the template crack images corresponding to the horizontal template, vertical template, left-slanted template, and right-slanted template, the skeleton information of the crack in the initial crack image (i.e., the target crack image) can be extracted as follows:
[0120] ;
[0121] Where, is the pixel value of the i-th image, n is the total number of images, including template crack images in different directions.
[0122] In one example, before matching the initial crack image with the template crack image in this step, the initial crack image is first subjected to adaptive histogram equalization to enhance the contrast, especially in the crack area to improve the difference between the crack and the background, and Gaussian blurring is performed on the image to smooth the image and reduce the interference of high-frequency noise on crack detection. High-frequency noise may be mistaken for crack edges, and smoothing can better capture the true crack characteristics.
[0123] In step 104, when detecting surface cracks on aviation structural parts, the surface cracks on aviation structural parts can be detected directly through the target crack image, or the target image can be binarized first to generate a binary image, and then the target crack image and the binarized image of the target image are combined to detect the surface cracks on aviation structural parts.
[0124] In a specific implementation, the target image contains multiple local regions. The binarization method used in the above-mentioned binarization of the target image is as follows: obtaining the grayscale value of each local region and determining the binarization threshold of each local region based on the grayscale value of each local region; binarizing each local region using the binarization threshold of each local region to obtain a binary image of the target image; wherein the binarization threshold of each local region is adjusted in real time using preset parameters. It is understandable that in order to improve the accuracy of crack detection, the binarization operation can be directly performed on the target detection region obtained above.
[0125] This adaptive binarization algorithm performs grayscale analysis on the local area of the target detection area image and determines the binarization threshold of each area based on the grayscale value of each area, thereby effectively suppressing problems such as uneven brightness (such as shadows, light spots or other uneven brightness) and noise interference in the image. It is described as follows:
[0126] (1) Fill the input image.
[0127] (2) Calculate the sum of the local area.
[0128] (3) Calculate the average value of the local area.
[0129] (4) Calculate the local average gray value, that is, the local threshold.
[0130] (5) The local binarization threshold is adjusted through adjustable parameters to adapt to image brightness changes and enhance the binarization effect.
[0131] (6) Invert the result to generate a binary image.
[0132] The adaptive binarization algorithm is more effective in separating cracks from the background (i.e., there is less noise around the cracks), but it will detect shadows and stains. The target crack image contains the crack skeleton information, which can effectively avoid detecting large block defects and edge information. However, it will introduce a large amount of noise in the crack area. Therefore, combining these two images and finding the intersection method can effectively extract the crack information, as shown below:
[0133] ;
[0134] Where, represents the binarized image obtained based on the adaptive binarization algorithm, represents the target crack image obtained by the above template matching.
[0135] This embodiment uses an improved adaptive binarization algorithm to efficiently and accurately extract crack information on the guardrail. By comparing the images processed by the conventional binarization algorithm and the algorithm of this embodiment, Figure 6 As shown, it can be clearly seen that the binarization algorithm provided in this embodiment can not only clearly extract the crack skeleton, but also significantly reduce the interference of surrounding noise points on crack extraction, thereby greatly improving the accuracy and reliability of crack detection, and providing good technical support for crack detection of protective grid plates.
[0136] In the specific implementation, the detected cracks are finally screened by length. According to experimental analysis, when the crack length is greater than 1 / 3 of the height of the target detection area, it is determined to be a real crack.
[0137] One embodiment of the present invention relates to a method for detecting surface cracks of an aviation structural part. The specific process of the method for detecting surface cracks of an aviation structural part of this embodiment can be as follows: Figure 7 As shown, including:
[0138] Step 1: Read an image of an aviation structure that meets the resolution requirements and convert it into a grayscale image.
[0139] Step 2: Perform perspective transformation on the read image and make corrections based on different shooting conditions (such as camera tilt direction and structural component surface shape) to make the image more consistent with the actual geometric shape.
[0140] Step 3: Preprocess the perspective transformed image.
[0141] Step 3.1: Median filtering.
[0142] Step 3.2: Adaptive histogram equalization.
[0143] Step 3.3: Interpolation of image size transformation.
[0144] Step 4: Locate the target detection area: When identifying cracks, the crack area is first roughly located. By quickly screening potential crack areas, the interference from irrelevant areas is effectively reduced, narrowing the identification range, thereby reducing the amount of calculation and processing complexity.
[0145] Step 5: Adaptive binarization: By performing grayscale analysis on the local area of the target detection area image, the binarization threshold of each area is determined according to the grayscale value of each area, thereby effectively suppressing problems such as uneven brightness (such as shadows, light spots or other uneven brightness) and noise interference in the image.
[0146] Step 6: Rule-based multi-directional template matching binarization: The input image is grayscaled, contrast-limited histogram equalization (CLAHE), and Gaussian blurring is performed to suppress noise and highlight the dark, narrow crack features. An adaptive width search method is then used to determine the geometric characteristics of the cracks. Directionality is detected and verified through template matching (including vertical and oblique templates), ensuring robustness against cracks of varying sizes and improving the detection of complex cracks.
[0147] Step 6.1: Perform adaptive histogram equalization on the input image.
[0148] Step 6.2: Gaussian blur the image.
[0149] Step 6.3: Create matching templates for cracks in different directions (including horizontal templates, vertical templates, left-slanted templates, and right-slanted templates).
[0150] Step 6.4: Search for crack width in the horizontal, vertical, and oblique directions (i.e., the search is based on grayscale value differences and stops when the grayscale value of the search point is higher than that of the center pixel).
[0151] Step 6.5: Template matching and threshold judgment: Compare the brightness difference between the template area and the actual area. The area with higher correlation has smaller brightness difference, so as to determine whether it is a crack.
[0152] Step 6.6: Use morphological operations to fill small gaps in the cracks, enhance crack connectivity, remove isolated small noise points, and make the final detection results smoother.
[0153] Step 6.7: Superimpose the binary images of the horizontal template, vertical template, left oblique template, and right oblique template to extract the skeleton information of the crack.
[0154] Step 7: Intersect the adaptive binarization with the rule-based multi-directional template matching binarization.
[0155] Step 8: Screen the extracted suspected cracks by crack length.
[0156] The above crack detection methods for aviation structural parts generally follow a processing approach from coarse to fine and from global to local. Each step addresses a specific problem, ultimately achieving accurate crack detection.
[0157] The method for detecting surface cracks in aviation structural parts of the present invention has the following beneficial effects:
[0158] 1. Improved adaptive crack detection algorithm:
[0159] (1) Based on the traditional adaptive crack detection algorithm, the noise suppression mechanism is optimized for complex background and high noise environment, and the interference of random noise on crack feature extraction is eliminated through regularization method.
[0160] (2) Combined with the local gradient feature analysis of the image, the crack detection algorithm can improve its ability to capture the edge features of small cracks.
[0161] 2. Layered detection strategy:
[0162] (1) Use a fast feature extraction method (coarse positioning) to detect suspected crack areas in the global image, significantly reducing the amount of calculation.
[0163] (2) Further apply a refined edge feature enhancement algorithm (fine-tuned detection) to the suspected crack area to improve the detection accuracy and accurate description of the crack boundary.
[0164] 3. Combination of noise suppression and feature enhancement:
[0165] (1) Use multiple algorithms to fuse together to separate interference features from crack features.
[0166] (2) Multi-scale image processing technology is introduced to analyze crack characteristics at different resolutions, making the algorithm more robust in detecting tiny cracks.
[0167] 4. Dynamic parameter adaptive adjustment:
[0168] According to the different crack morphologies (such as length, width, and curvature), the detection threshold and feature extraction range of the algorithm are adaptively adjusted to improve the detection rate of complex crack morphologies.
[0169] The steps of the various methods above are divided only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are within the scope of protection of the present invention. Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of the invention.
[0170] Another embodiment of the present invention relates to a device for detecting surface cracks in aircraft structural parts. The implementation details of the device for detecting surface cracks in aircraft structural parts of this embodiment are described in detail below. The following content is provided only for ease of understanding and is not required for implementing this solution. The device for detecting surface cracks in aircraft structural parts of this embodiment includes:
[0171] An image acquisition module, used to acquire a target image of the aviation structural part to be inspected;
[0172] A first image processing module is configured to traverse the pixels in the target image along each direction based on the multiple different directions of the surface cracks of the aviation structural component, so as to extract an initial crack image containing the width information of the surface cracks of the aviation structural component from the target image based on the grayscale value difference between each pixel in the target image;
[0173] a second image processing module for extracting a target crack image containing crack skeleton information on the surface of the aviation structural component from the initial crack image based on brightness differences between the binary image of the initial crack image and a plurality of template crack images, wherein the plurality of template crack images are binary images corresponding to binary matrices created based on different directions and widths of cracks on the surface of the aviation structural component;
[0174] The image detection module is used to detect surface cracks of aviation structural parts through target crack images.
[0175] It is not difficult to find that this embodiment is an apparatus embodiment corresponding to the above-mentioned method embodiment, and this embodiment can be implemented in conjunction with the above-mentioned method embodiment. The relevant technical details and technical effects mentioned in the above-mentioned embodiment are still valid in this embodiment, and to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above-mentioned embodiment.
[0176] It is worth noting that all modules involved in this embodiment are logical modules. In actual applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, to highlight the innovations of the present invention, this embodiment does not include units that are not closely related to solving the technical problems proposed by the present invention. However, this does not mean that other units do not exist in this embodiment.
[0177] Another embodiment of the present invention relates to a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for detecting surface cracks in aviation structural parts in the above-mentioned embodiments.
[0178] The memory and processor are connected using a bus, which can include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors and memories. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and are therefore not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor.
[0179] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0180] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0181] That is, those skilled in the art will understand that all or part of the steps in the above-described method embodiments can be implemented by instructing the relevant hardware through a program. The program is stored in a storage medium and includes a number of instructions for causing a device (such as a microcontroller or chip) or a processor to execute all or part of the steps in the method embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0182] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present invention, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A method for detecting surface cracks of aviation structural parts, characterized in that: The method comprises: Acquire a target image of an aviation structural part to be inspected; Based on the various directions of surface cracks on aviation structural parts, the pixel points in the target image are traversed along each direction respectively. The initial crack image containing the width information of the surface crack of the aviation structural part is extracted from the target image based on the gray value difference between each pixel in the target image. A target crack image containing crack skeleton information on the surface of an aviation structural component is extracted from the initial crack image based on brightness differences between the binary image of the initial crack image and a plurality of template crack images; wherein an area in the binary image of the initial crack image having a small brightness difference with the template crack image is determined as a crack; the plurality of template crack images are binary images corresponding to binary matrices created based on different directions and different widths of cracks on the surface of the aviation structural component, wherein the binary matrices include binary matrices created for cracks in the horizontal, vertical, left oblique, and right oblique directions on the surface of the aviation structural component, respectively; the horizontal binary matrix is used to detect horizontal cracks, wherein the specified width of the middle row is assigned a value of 255; the vertical binary matrix is used to detect vertical cracks, wherein the specified height of the middle column is assigned a value of 255; the left oblique binary matrix is used to detect cracks from the upper left to the lower right, wherein the left diagonal area is assigned a value of 255; and the right oblique binary matrix is used to detect cracks from the upper right to the lower left, wherein the right diagonal area is assigned a value of 255; Detect surface cracks on aviation structural parts through target crack images; The target image includes multiple local areas, and the detection of surface cracks of an aviation structural component using the target crack image includes: Obtaining the grayscale value of each local area, and determining the binarization threshold of each local area according to the grayscale value of each local area; Binarizing each local area using a binarization threshold of each local area to obtain a binarized image of the target image; wherein the binarization threshold of each local area is adjusted in real time using a preset parameter; The surface cracks of aviation structural parts are detected by the intersection of the binary image of the target image and the target crack image.
2. The method for detecting surface cracks of aviation structural parts according to claim 1, characterized in that: The aviation structural member is a protective grid, which is composed of a plurality of grids of the same size, and the horizontal and vertical spacings between two adjacent grids are equal; The traversing the pixel points in the target image along each direction respectively includes: Binarize the target image and perform a closing operation on the binarized target image to obtain the Hole region of each grid in the target image; Determine the bottom area of each grid in the target image based on the hole area of each grid and the arrangement rules of each grid in the target image; Traverse the pixels in each Bottom area along each direction respectively.
3. The method for detecting surface cracks of aviation structural parts according to claim 2, characterized in that: The target image is binarized and a closing operation is performed on the binarized target image to obtain the hole area of each grid in the target image, including: When binarizing the target image, areas in the target image with pixel values higher than a first preset threshold are set to white, and areas with pixel values lower than the first preset threshold are set to black; By performing a closing operation on the binarized target image, the black areas whose areas are smaller than the second preset threshold are eliminated, and the white areas whose areas are smaller than the second preset threshold are filled; The preset contour tracking algorithm is used to extract the contour of the processed target image to form a bounding rectangle, which is used as the hole area of the grid.
4. The method for detecting surface cracks of aviation structural parts according to claim 3, characterized in that: The determining of the bottom area of each grid in the target image according to the hole area of each grid and the arrangement rule of each grid in the target image includes: Get the upper left corner coordinates, width and height of the circumscribed rectangle of the Hole area; Get the upper left corner coordinates, width, and height of the circumscribed rectangle of the Bottom area based on the upper left corner coordinates, width, height, and vertical spacing between two adjacent grids of the circumscribed rectangle of the Hole area.
5. The method for detecting surface cracks of aviation structural parts according to claim 1, characterized in that: The binary matrix is as follows: ; Where, is a binary matrix in the horizontal direction, is a binary matrix in the vertical direction, is a binary matrix in the left oblique direction, is a binary matrix in the right oblique direction, Represent the row and column indices of the binary matrix respectively, Indicates height, The width of the crack, is the preset offset constant, Indicates a point The vertical distance to the center axis of the crack.
6. The method for detecting surface cracks of aviation structural parts according to claim 1, characterized in that: The step of obtaining a target image of an aviation structural component to be inspected includes: Take pictures to obtain the initial images of aviation structural parts; Perform perspective transformation on the initial image; According to the tilt direction of the shooting camera and the surface shape of the aviation structure, the initial image after perspective transformation is corrected to obtain the target image.
7. A device for detecting surface cracks of aviation structural parts, characterized in that: The device comprises: An image acquisition module, used to acquire a target image of the aviation structural part to be inspected; A first image processing module is configured to traverse the pixels in the target image along each direction based on the multiple different directions of the surface cracks of the aviation structural component, so as to extract an initial crack image containing the width information of the surface cracks of the aviation structural component from the target image based on the grayscale value difference between each pixel in the target image; The second image processing module is used to extract a target crack image containing the crack skeleton information of the aviation structure surface from the initial crack image according to the brightness difference between the binary image of the initial crack image and the multiple template crack images; wherein, the area with a small brightness difference between the binary image of the initial crack image and the template crack image is judged as a crack; the multiple template crack images are respectively binary images corresponding to a binary matrix created based on different directions and different widths of the cracks on the aviation structure surface, and the binary matrix contains the information of the crack skeleton on the aviation structure surface respectively. Binary matrices are created for cracks in the horizontal, vertical, left-slanting, and right-slanting directions. The horizontal binary matrix is used to detect horizontal cracks, where the specified width of the middle row is assigned a value of 255. The vertical binary matrix is used to detect vertical cracks, where the specified height of the middle column is assigned a value of 255. The left-slanting binary matrix is used to detect cracks from the upper left to the lower right, where the left diagonal area is assigned a value of 255. The right-slanting binary matrix is used to detect cracks from the upper right to the lower left, where the right diagonal area is assigned a value of 255. An image detection module is used to detect surface cracks on aviation structural parts using target crack images; The target image contains multiple local areas, and the image detection module is further used to: Obtaining the grayscale value of each local area, and determining the binarization threshold of each local area according to the grayscale value of each local area; Binarizing each local area using a binarization threshold of each local area to obtain a binarized image of the target image; wherein the binarization threshold of each local area is adjusted in real time using a preset parameter; The surface cracks of aviation structural parts are detected by the intersection of the binary image of the target image and the target crack image.
8. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executed by the at least one processor, the instructions being executed by the at least one processor so as to enable the at least one processor to execute the method for detecting surface cracks in aviation structural parts according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting surface cracks of an aviation structural component according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and apparatus for testing surface defect
CN101256157A
Automatic identification method and system of pavement disease image
CN107230202A
Non-contact crack measurement method and system
CN113446932A