Compression-type fitting bend detection method and device, computer device, and medium

By enhancing, extracting features, and correcting rotation in the hardware images, the inaccuracy caused by changes in imaging angle during detection is solved, achieving efficient and accurate detection of hardware curvature.

CN122289348APending Publication Date: 2026-06-26GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
Filing Date
2026-02-02
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies for detecting the curvature of compression fittings are easily affected by changes in imaging angle, equipment installation position, and shooting conditions, leading to inaccurate detection.

Method used

Image enhancement processing is performed on the original hardware images to extract the hardware outline. Feature extraction and deduplication are performed using a target detection network model to obtain the axial information of the hardware region image and perform rotation correction. The hardware outline curve is then extracted to obtain the curvature.

Benefits of technology

It enables rapid and accurate positioning of the hardware body, improves detection efficiency and accuracy, and eliminates the influence of image interference information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289348A_ABST
    Figure CN122289348A_ABST
Patent Text Reader

Abstract

This application relates to a compression-type method, apparatus, computer equipment, and medium for detecting the curvature of hardware fittings. The method includes: performing image enhancement processing on an acquired original hardware fitting image to obtain an enhanced image; extracting the hardware fitting contour from the enhanced image to obtain a contour image; extracting features from the contour image using a target detection network model; obtaining candidate region images based on the extracted features; performing deduplication processing on the candidate region images to obtain a target region image; performing size correction on the target region image to obtain a hardware fitting region image; obtaining the axial information of the hardware fitting region image; performing rotation correction on the hardware fitting region image based on the axial information to obtain a target hardware fitting image; extracting the hardware fitting contour curve from the target hardware fitting image; and obtaining the hardware fitting curvature based on the hardware fitting contour curve. This method can improve the accuracy of hardware fitting curvature detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power transmission line operation and maintenance technology, and in particular to a method, apparatus, computer equipment and medium for detecting the bending degree of compression fittings. Background Technology

[0002] During the operation and maintenance of transmission lines, compression fittings may experience overall structural bending or deformation under long-term exposure to conductor tension, environmental loads, and construction stresses, thus affecting the stress distribution on the conductor and the reliability of the connection. To assess the structural condition of the fittings after crimping, X-ray imaging technology is typically used for non-destructive testing of the internal structure of the fittings, and inspectors determine whether bending exists based on the imaging results.

[0003] Current methods for detecting bending primarily rely on manual interpretation. Inspectors qualitatively determine whether bending has occurred by observing changes in the straightness of the hardware's main outline in X-ray images. In some cases, technical solutions attempt to extract the hardware's outline or center line using image processing methods and estimate the degree of structural offset. However, these methods typically analyze the raw imaging images directly, lacking systematic processing for differences in shooting posture. They are easily affected by variations in imaging angle, equipment installation position, and shooting conditions, leading to inaccurate detection of hardware bending. Summary of the Invention

[0004] Therefore, it is necessary to provide a compression-type method, apparatus, computer equipment, and medium for detecting the curvature of fittings, which can improve the accuracy of fitting curvature detection, in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for detecting the curvature of compression fittings, including:

[0006] The original hardware images were enhanced to obtain enhanced images, and the hardware outlines were extracted from the enhanced images to obtain outline images.

[0007] Feature extraction is performed on the contour image using an object detection network model, and candidate region images are obtained based on the extracted features;

[0008] The candidate region image is deduplicated to obtain the target region image, and the target region image is then sized to obtain the hardware region image.

[0009] Obtain the axial information of the hardware region image, and perform rotation correction on the hardware region image based on the axial information to obtain the target hardware image;

[0010] Extract the hardware profile curve from the target hardware image, and obtain the hardware curvature based on the hardware profile curve.

[0011] In one embodiment, the step of performing image enhancement processing on the acquired original hardware image to obtain an enhanced image includes:

[0012] The grayscale information of the original hardware image is acquired, and the original hardware image is mapped to a preset grayscale range based on the grayscale information to obtain the first intermediate image;

[0013] The brightness and contrast information of the first intermediate image are extracted. Based on the brightness and contrast information, the contrast enhancement processing of the first intermediate image is performed to obtain the second intermediate image.

[0014] The enhanced image is obtained by using a filtering algorithm to suppress noise in the second intermediate image.

[0015] In one embodiment, the step of extracting the hardware outline from the enhanced image to obtain the outline image includes:

[0016] The enhanced image is smoothed by a smoothing suppression algorithm to remove the background image and obtain a third intermediate image.

[0017] The contour image is obtained by performing contour enhancement processing on the third intermediate image using an edge enhancement algorithm.

[0018] In one embodiment, deduplication of the candidate region image is performed to obtain the target region image, including:

[0019] Based on the image confidence of the candidate region image, the candidate region image is subjected to the first deduplication process to obtain the candidate region image;

[0020] The image intersection-union ratio (IUU) between candidate region images is obtained, and a second deduplication process is performed on the candidate region images based on the IUU to obtain the target region image.

[0021] In one embodiment, the step of obtaining axial information of the hardware region image includes:

[0022] The image of the hardware area is converted to grayscale to obtain a grayscale image, and line segments in the grayscale image are extracted using a line detection algorithm.

[0023] Based on the preset axis information of the hardware body, the straight line segments are filtered to obtain candidate straight line segments;

[0024] Based on the direction angle of the candidate line segments, obtain the axial information of the hardware region image.

[0025] In one embodiment, the step of extracting the hardware outline curve from the target hardware image includes:

[0026] The target hardware image is segmented by grayscale thresholding to obtain the corresponding binary image. Noise connected components in the binary image are removed to obtain the main connected component of the hardware.

[0027] The binary image is traversed using a contour tracking algorithm to obtain the set of pixel coordinates of the outer contour of the connected domain of the hardware body;

[0028] The pixel coordinates in the outer contour pixel coordinate set are grouped according to the axial information, and the hardware contour curve is obtained according to the grouping result; the hardware contour curve includes the first edge contour curve and the second edge contour curve.

[0029] In one embodiment, the step of obtaining the bending degree of the fitting based on the fitting profile curve includes:

[0030] The effective length of the fitting is obtained based on the endpoint coordinates of the fitting profile curve, and the edge chord height is obtained based on the coordinates of each pixel on the fitting profile curve.

[0031] The edge curvature is obtained based on the effective length of the metal fitting and the edge chord height; the edge curvature includes the first edge curvature and the second edge curvature.

[0032] The maximum value between the first edge curvature and the second edge curvature is taken as the hardware curvature.

[0033] Secondly, this application also provides a compression-type fitting bending detection device, comprising:

[0034] The image enhancement module is used to enhance the acquired original hardware images to obtain an enhanced image, and to extract the hardware outline from the enhanced image to obtain an outline image.

[0035] The feature extraction module is used to extract features from the contour image through the object detection network model and obtain candidate region images based on the extracted features;

[0036] The size correction module is used to deduplicate the candidate region image to obtain the target region image, and to perform size correction on the target region image to obtain the hardware region image.

[0037] The rotation correction module is used to acquire the axial information of the hardware area image and perform rotation correction on the hardware area image based on the axial information to obtain the target hardware image.

[0038] The curvature acquisition module is used to extract the hardware contour curve from the target hardware image and obtain the hardware curvature based on the hardware contour curve.

[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method steps of any one of the first aspects.

[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method steps of any one of the first aspects.

[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method steps of any one of the first aspects.

[0042] The aforementioned compression-type fitting bending degree detection method, apparatus, computer equipment, and medium enhance the acquired original fitting image to obtain an enhanced image, extract the fitting contour from the enhanced image to obtain a contour image, extract features from the contour image using a target detection network model, obtain candidate region images based on the extracted features, deduplicate the candidate region images to obtain a target region image, perform size correction on the target region image to obtain a fitting region image, obtain the axial information of the fitting region image, perform rotation correction on the fitting region image based on the axial information to obtain a target fitting image, extract the fitting contour curve from the target fitting image, and obtain the fitting bending degree based on the fitting contour curve. This method can eliminate interference information in the original fitting image, achieve rapid and accurate positioning of the fitting body, and improve detection efficiency and accuracy. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a diagram illustrating the application environment of a compression-type hardware bending detection method in one embodiment.

[0045] Figure 2 This is a flowchart illustrating a method for detecting the curvature of compression fittings in one embodiment;

[0046] Figure 3 This is a flowchart illustrating a method for detecting the curvature of compression fittings in another embodiment;

[0047] Figure 4 This is a structural block diagram of a compression-type hardware bending detection device in one embodiment;

[0048] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0050] The compression fitting bending detection method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 is used to perform image enhancement processing on the acquired raw hardware image to obtain an enhanced image, extract the hardware contour from the enhanced image to obtain a contour image, extract features from the contour image using a target detection network model, obtain candidate region images based on the extracted features, perform deduplication processing on the candidate region images to obtain a target region image, perform size correction on the target region image to obtain a hardware region image, obtain the axial information of the hardware region image, perform rotation correction on the hardware region image based on the axial information to obtain a target hardware image, extract the hardware contour curve from the target hardware image, and obtain the hardware curvature based on the hardware contour curve. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0051] In one exemplary embodiment, such as Figure 2 As shown, a method for detecting the bending degree of compression fittings is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps 202 to 210. Wherein:

[0052] S202: Perform image enhancement processing on the acquired original hardware image to obtain an enhanced image, and extract the hardware outline from the enhanced image to obtain a outline image.

[0053] Optionally, due to the influence of shooting distance, exposure parameters and equipment status during on-site inspection, there are differences in grayscale distribution between different images. First, grayscale normalization is used to eliminate brightness differences, mapping images under different exposures and distances to a unified grayscale range. Then, adaptive contrast enhancement is used to highlight the boundary between the hardware and the background. Finally, bilateral filtering is used to suppress shot noise, large-scale smoothing weakens the gradually changing grayscale background, and gradient enhancement highlights the hardware structure, so that the main outline of the hardware is preserved and highlighted. This achieves the suppression of background structures and non-target components, laying a reliable image foundation for subsequent key structural area localization and imaging posture normalization and curvature calculation within the area.

[0054] S204: Extract features from the contour image using an object detection network model, and obtain candidate region images based on the extracted features.

[0055] Optionally, the target detection network is used to perform multi-scale feature analysis on the contour image. By extracting information such as grayscale distribution, structural contour, and geometric features of the contour image, it generates candidate region boxes containing spatial location and size information, forming a candidate region image. This allows for the rapid identification of the main body of the hardware in a complex background, avoiding interference from wires and irrelevant components, and narrowing the scope of subsequent analysis.

[0056] S206: Perform deduplication on the candidate region image to obtain the target region image, and perform size correction on the target region image to obtain the hardware region image.

[0057] Optionally, for the obtained candidate region images, they are first filtered according to the detection confidence threshold to remove regions with low confidence. Then, non-maximum suppression is used to calculate the intersection-union ratio (IU / U) between the detection boxes, and duplicate boxes with overlap exceeding the threshold are removed, retaining the optimal region. This ensures that each hardware main structure corresponds to only one stable and reliable positioning region in the image. Subsequently, considering the differences in size and position of the detection regions under different shooting conditions, the filtered regions are uniformly cropped to generate standardized hardware region images. This ensures that the region only contains the target hardware main structure without additional range expansion, thereby avoiding interference from wires, adjacent components, or background structures in subsequent pose normalization and contour analysis.

[0058] S208: Obtain the axial information of the hardware area image, and perform rotation correction on the hardware area image based on the axial information to obtain the target hardware image.

[0059] Optionally, since X-ray inspection equipment typically images hardware at an angle during on-site imaging, the hardware may appear tilted overall in the regional image. To eliminate this imaging posture difference, the principal axis direction is extracted based on the geometric features of the hardware's main structure within the region. The rotation angle is calculated based on the principal axis direction, and the image is rotated to align the hardware with the reference direction, eliminating imaging tilt deviation, resolving the image tilt problem caused by changes in the shooting angle, establishing a unified geometric reference system, and avoiding interference from changes in the shooting angle on subsequent contour extraction and curvature calculation.

[0060] S210: Extract the hardware outline curve from the target hardware image, and obtain the hardware curvature based on the hardware outline curve.

[0061] Optionally, after completing the pose normalization within the region, the outline of the main body of the hardware is extracted from the normalized region image, the main body structure of the hardware is separated from the background, and the upper edge outline curve and lower edge outline curve of the main body of the hardware in the length direction are extracted respectively, providing basic data for the curvature calculation.

[0062] In the above-mentioned compression-type fitting bending degree detection method, the original fitting image is enhanced to obtain an enhanced image, and the fitting contour is extracted from the enhanced image to obtain a contour image. The contour image is then used to extract features from the contour image through a target detection network model, and candidate region images are obtained based on the extracted features. The candidate region images are deduplicated to obtain a target region image, and the target region image is sized and corrected to obtain a fitting region image. The axial information of the fitting region image is obtained, and the fitting region image is rotated and corrected based on the axial information to obtain a target fitting image. The fitting contour curve is extracted from the target fitting image, and the fitting bending degree is obtained based on the fitting contour curve. This method can eliminate interference information in the original fitting image, achieve rapid and accurate positioning of the fitting body, and improve detection efficiency and accuracy.

[0063] In an exemplary embodiment, the step of performing image enhancement processing on the acquired original hardware image to obtain an enhanced image includes: acquiring grayscale information of the acquired original hardware image; mapping the original hardware image to a preset grayscale range based on the grayscale information to obtain a first intermediate image; extracting brightness and contrast information of the first intermediate image; performing contrast enhancement processing on the first intermediate image based on the brightness and contrast information to obtain a second intermediate image; and performing noise suppression processing on the second intermediate image using a filtering algorithm to obtain an enhanced image.

[0064] Optionally, the acquired X-ray images are normalized. By using grayscale normalization and adaptive histogram equalization methods, the original hardware images are mapped to a uniform grayscale range, so that the brightness distribution of the hardware structure remains consistent in different images, resulting in the first intermediate image. This effectively reduces the impact of uneven exposure on subsequent structural analysis and provides a stable image basis for bending detection.

[0065] Furthermore, after image normalization, the first intermediate image undergoes contrast enhancement. Addressing the issue of small grayscale differences and indistinct structural boundaries between the hardware body and the background, an adaptive contrast enhancement method is employed to adjust the local brightness and contrast of the image, making the grayscale changes in the hardware outline region more significant, thus obtaining the second intermediate image. This enhances the distinguishability of the hardware edges and main structure, improving the stability and accuracy of subsequent contour extraction processes.

[0066] Furthermore, noise suppression processing is applied to the second intermediate image after contrast enhancement. Since shot noise and imaging noise are unavoidable during X-ray imaging, direct contour analysis can easily introduce errors. Bilateral filtering and other noise suppression methods are employed to reduce image noise while preserving as much of the hardware structure's edge information as possible, thereby improving the overall image quality while ensuring structural continuity.

[0067] In this embodiment, by acquiring the grayscale information of the original hardware image, the original hardware image is mapped to a preset grayscale range based on the grayscale information to obtain a first intermediate image. The brightness and contrast information of the first intermediate image are extracted. Based on the brightness and contrast information, the first intermediate image is subjected to contrast enhancement processing to obtain a second intermediate image. The second intermediate image is subjected to noise suppression processing through a filtering algorithm to obtain an enhanced image. This can improve the recognition of hardware structure, reduce the interference of random noise, and improve the stability and accuracy of detection results.

[0068] In an exemplary embodiment, the step of extracting the hardware outline from the enhanced image to obtain the outline image includes: smoothing the enhanced image using a smoothing suppression algorithm to remove the background image from the enhanced image to obtain a third intermediate image; and performing outline enhancement processing on the third intermediate image using an edge enhancement algorithm to obtain the outline image.

[0069] Optionally, for background structures, non-target components, or regions with gradual gray-level changes that may exist in the enhanced image, suppression processing is performed using the differences in gray-level and structural responses between the background region and the main body of the fitting. The background region and the main body of the fitting typically exhibit different gray-level and structural features in X-ray images. The background region often shows gradual gray-level changes and weak edge responses, while the main body of the fitting has obvious abrupt gray-level changes and continuous structural edges. In actual processing, by performing large-scale smoothing or morphological operations on the image, the background components with gradual gray-level changes are first estimated and weakened to obtain a third intermediate image. Then, gradient or edge response enhancement is combined to strengthen structurally significant regions, preserving and highlighting the outline of the main body of the fitting. This achieves suppression of background structures and non-target components, weakens the influence of non-target regions, and, combined with edge enhancement or structural enhancement operators, highlights the outline features of the main body of the fitting, making the fitting structure clearer and more complete in the image.

[0070] In this embodiment, the enhanced image is smoothed by a smoothing suppression algorithm to remove the background image and obtain a third intermediate image. The third intermediate image is then enhanced by an edge enhancement algorithm to obtain a contour image. This process can accurately identify and weaken background areas with gradual grayscale changes, accurately separate the hardware body from the background, wires, and other non-target structures, and provide accurate contour data for subsequent curvature calculation, thereby improving the accuracy of the detection results.

[0071] In an exemplary embodiment, the step of deduplicating candidate region images to obtain target region images includes: performing a first deduplication process on candidate region images based on the image confidence of the candidate region images to obtain candidate region images; obtaining the image intersection-union ratio (IUU) between candidate region images; and performing a second deduplication process on candidate region images based on the IUU to obtain target region images.

[0072] Optionally, a deep learning-based target detection network is used to perform multi-scale feature analysis on the hardware structure in the contour image, extract the gray-scale distribution, structural contour and geometric features related to the main shape of the hardware, and generate several candidate region boxes. Each region box contains the spatial location and size information of the corresponding structure, which can initially lock the main hardware region related to bending detection in a complex imaging background, i.e., the candidate region image.

[0073] Furthermore, the candidate region images are screened and optimized. First, candidate boxes are filtered based on a detection confidence threshold, eliminating detection results with incomplete structures or low confidence. Image confidence is the probability value output by the target detection network, representing the credibility of the candidate region box corresponding to the real hardware structure. The threshold is preset manually or by an algorithm. By traversing all candidate region images, regions with confidence scores higher than the preset threshold are selected, while regions with low confidence scores are directly eliminated. Then, non-maximum suppression (NMS) is used to eliminate duplicate detection boxes of the same structure, retaining only the optimal region representation. NMS determines whether a detection box belongs to the same structure by comparing the spatial overlap between detection boxes. The intersection-union ratio (IU / I) between different candidate region images is calculated; when the IU / I of two candidate region images is greater than a preset threshold, they are considered duplicate detection results corresponding to the same hardware structure. Based on this, only the candidate region image with the highest confidence score is retained, and other overlapping boxes are eliminated, thus determining the optimal region representation for that structure.

[0074] In this embodiment, the candidate region images are first deduplicated based on their image confidence scores to obtain candidate region images. The image intersection-union ratio (IUU) between the candidate region images is then obtained. The candidate region images are then second deduplicated based on the IUU to obtain the target region images. This process can eliminate false detection backgrounds, incomplete hardware areas, and duplicate detection areas, ensuring that the target region images contain only complete and reliable hardware bodies, avoiding irrelevant interference, and thus providing accurate image data for subsequent size correction and curvature calculation.

[0075] In an exemplary embodiment, the step of obtaining the axial information of the hardware area image includes: performing image grayscale processing on the hardware area image to obtain a grayscale image, and extracting straight line segments in the grayscale image using a straight line detection algorithm; filtering the straight line segments according to the preset axial line information of the hardware body to obtain candidate straight line segments; and obtaining the axial information of the hardware area image according to the direction angle of the candidate straight line segments.

[0076] Optionally, the imaging pose of a single hardware area image is normalized. Specifically, the area image is converted to grayscale, transforming a multi-channel image into a single-channel image, retaining only the brightness information for each pixel. Since the hardware area image may be output in a multi-channel format by the imaging device, grayscale conversion is performed through weighted averaging or single-channel extraction to unify pixel dimensions and simplify the computational complexity of subsequent line detection. Then, a line detection algorithm analyzes continuous regions with abrupt changes in pixel grayscale in the image, identifies a set of pixels that conform to the characteristics of a straight line, and outputs the start point, end point, and direction angle of the line. The preset axis information is based on constraints set according to the hardware design specifications, including the range of line length, direction angle, and spatial location. Since background noise, wire edges, and other irrelevant line segments may be extracted from the grayscale image, the preset axis information (e.g., the hardware axis length should match its design length, and the direction angle should be close to horizontal / vertical or a specific angle) filters out line segments that are too short, have excessive directional deviations, or are located outside the main body of the hardware. Candidate line segments that are highly correlated with the hardware axis height are retained, and the direction of these lines is used as the main axis direction of the hardware. The orientation angle is the angle between the straight line segment and the horizontal axis of the image. The axial information is the direction of the central axis of the hardware body. The orientation angles of the candidate straight line segments are statistically analyzed, and the angle with the highest frequency or closest to the preset axial direction is taken as the axial direction of the hardware. If there are multiple candidate straight line segments, the optimal orientation angle can be determined by mean clustering or voting mechanism. Finally, this orientation angle is used as the axial information of the hardware area image.

[0077] In this embodiment, the image of the hardware area is converted to grayscale to obtain a grayscale image. A straight line detection algorithm is then used to extract straight line segments from the grayscale image. Based on the preset axis information of the hardware body, the straight line segments are filtered to obtain candidate straight line segments. Based on the direction angle of the candidate straight line segments, the axial information of the hardware area image is obtained. This effectively eliminates the influence of noise and irrelevant structures, accurately extracts the axial information of the hardware area image, reduces detection errors caused by posture deviations, and thus improves the accuracy of the detection results.

[0078] In an exemplary embodiment, the step of extracting the hardware contour curve from the target hardware image includes: performing grayscale thresholding on the target hardware image to obtain a corresponding binary image, and removing noise connected components from the binary image to obtain the hardware body connected component; traversing the binary image using a contour tracking algorithm to obtain the set of outer contour pixel coordinates of the hardware body connected component; grouping the pixel coordinates in the outer contour pixel coordinate set according to axial information, and obtaining the hardware contour curve based on the grouping result; the hardware contour curve includes a first edge contour curve and a second edge contour curve.

[0079] Optionally, after rotation correction, the main body contour of the target hardware image is extracted. Using grayscale thresholding and connected component analysis, the main body structure of the hardware is separated from the background, yielding the binary structure region of the hardware body. Grayscale thresholding involves setting a fixed or adaptive grayscale threshold to divide image pixels into foreground and background, transforming it into a binary image containing only black and white values. A connected component is a set of adjacent pixels with the same grayscale value; a noise connected component is a set of isolated pixels with too small an area and noisy values. Based on the grayscale difference between the hardware and the background in the X-ray image, thresholding transforms the hardware body into a white foreground and the background into black. Then, area filtering removes connected components with an area smaller than a preset threshold, eliminating residual shot noise and small background fragments after segmentation, while retaining the complete connected component of the hardware body. Subsequently, contour tracking is performed on the binary image to extract the upper and lower edge contour curves of the hardware body along its length. The contour tracking algorithm traverses adjacent edge pixels along the boundary between the foreground and background in a specific direction in the binary image, recording the pixel coordinates to form a continuous set of coordinates, i.e., the outer contour. Starting from the edge pixels of the connected components of the hardware body, it traverses according to preset rules, recording the coordinates of each edge pixel in turn, ultimately forming a closed or continuous set of outer contour pixel coordinates that completely covers the boundary shape of the hardware body. Based on the obtained principal axis direction of the hardware, the contour pixel coordinate set is classified and divided along the vertical direction of the principal axis into two groups, corresponding to the two opposing edges of the hardware. Each group of coordinates is sorted and curve fitted to obtain a continuous first edge contour curve and a second edge contour curve.

[0080] In this embodiment, grayscale thresholding is performed on the target hardware image to obtain a corresponding binary image. Noise-prone connected components in the binary image are removed to obtain the hardware body connected component. A contour tracking algorithm is used to traverse the binary image to obtain the set of outer contour pixel coordinates of the hardware body connected component. The pixel coordinates in the set of outer contour pixel coordinates are grouped according to the axial information. The hardware contour curve is obtained based on the grouping results. This effectively removes noise and background interference, improves the matching degree between the outer contour pixel coordinates and the hardware boundary, avoids the curvature calculation error caused by contour distortion, and thus improves the accuracy of the detection results.

[0081] In an exemplary embodiment, the step of obtaining the bending degree of a fitting based on the fitting profile curve includes: obtaining the effective length of the fitting based on the endpoint coordinates of the fitting profile curve, and obtaining the edge chord height based on the coordinates of each pixel on the fitting profile curve; obtaining the edge bending degree based on the effective length of the fitting and the edge chord height; the edge bending degree includes a first edge bending degree and a second edge bending degree; and taking the maximum value of the first edge bending degree and the second edge bending degree as the bending degree of the fitting.

[0082] Optionally, the curvature of the first edge contour curve and the second edge contour curve are calculated separately. For each edge contour, a reference straight line is first constructed based on the endpoints of the contour, and the distance between the endpoints is taken as the effective length L of the fitting. The effective length L is the straight-line distance between the two endpoints and is a standardized parameter for measuring the length of the fitting body. Then, the vertical distance from each point on the contour curve to the reference straight line is calculated, where the maximum distance is recorded as the maximum chord height H corresponding to that edge. The edge chord height H is the maximum value among the vertical distances from all pixels on the contour curve to the lines connecting the two endpoints, directly reflecting the degree of curvature and protrusion of the contour. By normalizing the maximum chord height and the effective length, the curvature measurement value of the edge is obtained, calculated using the formula: δ=H / L. Normalization eliminates the influence of fitting specification differences, making the curvature of fittings of different sizes comparable. Finally, after obtaining the curvature measurement values ​​for the upper and lower edges, the larger of the two is taken as the final curvature detection result of the fitting body.

[0083] In this embodiment, the effective length of the fitting is obtained based on the endpoint coordinates of the fitting profile curve, and the edge chord height is obtained based on the coordinates of each pixel on the fitting profile curve. The edge curvature is obtained based on the effective length of the fitting and the edge chord height. The maximum value of the first edge curvature and the second edge curvature is taken as the fitting curvature. This can avoid the influence of single profile or centerline analysis on the local maximum deformation, accurately capture the limit bending state of the fitting, and thus improve the sensitivity and reliability of the bending detection results to the actual structural deformation.

[0084] In one exemplary embodiment, such as Figure 3 As shown, a method for detecting the bending degree of compression fittings is provided, which includes the following steps:

[0085] (1) Image enhancement processing: The grayscale information of the original hardware image is acquired, and the original hardware image is mapped to a preset grayscale range based on the grayscale information to obtain the first intermediate image; the brightness and contrast information of the first intermediate image are extracted, and the contrast enhancement processing is performed on the first intermediate image based on the brightness and contrast information to obtain the second intermediate image; the second intermediate image is subjected to noise suppression processing through a filtering algorithm to obtain the enhanced image. The enhanced image is smoothed through a smoothing suppression algorithm to remove the background image in the enhanced image to obtain the third intermediate image; the third intermediate image is subjected to contour enhancement processing through an edge enhancement algorithm to obtain the contour image.

[0086] (2) Fittings region localization: Feature extraction is performed on the contour image using a target detection network model, and candidate region images are obtained based on the extracted features. Based on the image confidence of the candidate region images, the candidate region images are subjected to a first deduplication process to obtain candidate region images; the image intersection-union ratio (IUU) between candidate region images is obtained, and the candidate region images are subjected to a second deduplication process based on the IUU to obtain the target region image, and the target region image is sized to obtain the fittings region image.

[0087] (3) Rotation posture correction: The image of the hardware area is processed into grayscale to obtain a grayscale image, and the straight line segments in the grayscale image are extracted by the straight line detection algorithm; the straight line segments are filtered according to the preset axis information of the hardware body to obtain candidate straight line segments; the axial information of the hardware area image is obtained according to the direction angle of the candidate straight line segments, and the hardware area image is rotated and corrected according to the axial information to obtain the target hardware image.

[0088] (4) Edge contour curve extraction: Perform grayscale threshold segmentation on the target hardware image to obtain the corresponding binary image, and remove the noise connected regions in the binary image to obtain the hardware body connected region; traverse the binary image through the contour tracking algorithm to obtain the set of outer contour pixel coordinates of the hardware body connected region; group the pixel coordinates in the outer contour pixel coordinate set according to the axial information, and obtain the hardware contour curve according to the grouping result; the hardware contour curve includes the first edge contour curve and the second edge contour curve.

[0089] (5) Curvature calculation: Based on the endpoint coordinates of the hardware profile curve, obtain the effective length of the hardware and the edge chord height based on the coordinates of each pixel on the hardware profile curve; based on the effective length of the hardware and the edge chord height, obtain the edge curvature; the edge curvature includes the first edge curvature and the second edge curvature; take the maximum value of the first edge curvature and the second edge curvature as the hardware curvature.

[0090] In this embodiment, the original hardware image is enhanced to obtain an enhanced image, and the hardware outline is extracted from the enhanced image to obtain a outline image. Feature extraction is performed on the outline image using a target detection network model, and candidate region images are obtained based on the extracted features. The candidate region images are deduplicated to obtain a target region image, and the target region image is sized and corrected to obtain a hardware region image. The axial information of the hardware region image is obtained, and the hardware region image is rotated and corrected based on the axial information to obtain a target hardware image. The hardware outline curve is extracted from the target hardware image, and the hardware curvature is obtained based on the hardware outline curve. This process can eliminate interference information in the original hardware image, achieve rapid and accurate positioning of the hardware body, and improve detection efficiency and accuracy.

[0091] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0092] Based on the same inventive concept, this application also provides a compression fitting bending detection device for implementing the compression fitting bending detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more compression fitting bending detection device embodiments provided below can be found in the limitations of the compression fitting bending detection method described above, and will not be repeated here.

[0093] In one exemplary embodiment, such as Figure 4 As shown, a compression-type fitting bending degree detection device is provided, comprising: an image enhancement module 10, a feature extraction module 20, a size correction module 30, a rotation correction module 40, and a bending degree acquisition module 50, wherein:

[0094] The image enhancement module 10 is used to perform image enhancement processing on the acquired original hardware image to obtain an enhanced image, and to extract the hardware outline in the enhanced image to obtain a outline image.

[0095] The feature extraction module 20 is used to extract features from the contour image through the object detection network model and obtain candidate region images based on the extracted features.

[0096] The size correction module 30 is used to perform deduplication processing on the candidate region image to obtain the target region image, and to perform size correction on the target region image to obtain the hardware region image.

[0097] The rotation correction module 40 is used to acquire the axial information of the hardware area image and perform rotation correction on the hardware area image based on the axial information to obtain the target hardware image.

[0098] The curvature acquisition module 50 is used to extract the hardware contour curve from the target hardware image and obtain the hardware curvature based on the hardware contour curve.

[0099] In an exemplary embodiment, the image enhancement module 10 is further configured to acquire grayscale information of the acquired original hardware image, map the original hardware image to a preset grayscale range based on the grayscale information to obtain a first intermediate image; extract the brightness and contrast information of the first intermediate image, perform contrast enhancement processing on the first intermediate image based on the brightness and contrast information to obtain a second intermediate image; and perform noise suppression processing on the second intermediate image through a filtering algorithm to obtain an enhanced image.

[0100] In an exemplary embodiment, the image enhancement module 10 is further configured to smooth the enhanced image using a smoothing suppression algorithm, remove the background image from the enhanced image, and obtain a third intermediate image; and to perform contour enhancement processing on the third intermediate image using an edge enhancement algorithm to obtain a contour image.

[0101] In an exemplary embodiment, the size correction module 30 is further configured to perform a first deduplication process on the candidate region image based on the image confidence of the candidate region image to obtain a candidate region image; obtain the image intersection-union ratio between the candidate region images; and perform a second deduplication process on the candidate region image based on the image intersection-union ratio to obtain a target region image.

[0102] In an exemplary embodiment, the rotation correction module 40 is further configured to perform image grayscale processing on the hardware area image to obtain a grayscale image, and extract straight line segments in the grayscale image through a straight line detection algorithm; filter the straight line segments according to the preset axis information of the hardware body to obtain candidate straight line segments; and obtain the axial information of the hardware area image according to the direction angle of the candidate straight line segments.

[0103] In an exemplary embodiment, the curvature acquisition module 50 is further configured to perform grayscale threshold segmentation processing on the target hardware image to obtain a corresponding binary image, and remove the noise connected components in the binary image to obtain the hardware body connected component; traverse the binary image through a contour tracking algorithm to obtain the outer contour pixel coordinate set of the hardware body connected component; group the pixel coordinates in the outer contour pixel coordinate set according to the axial information, and obtain the hardware contour curve according to the grouping result; the hardware contour curve includes a first edge contour curve and a second edge contour curve.

[0104] In an exemplary embodiment, the curvature acquisition module 50 is further configured to acquire the effective length of the fitting based on the endpoint coordinates of the fitting profile curve, and acquire the edge chord height based on the coordinates of each pixel on the fitting profile curve; acquire the edge curvature based on the effective length of the fitting and the edge chord height; the edge curvature includes a first edge curvature and a second edge curvature; and take the maximum value of the first edge curvature and the second edge curvature as the fitting curvature.

[0105] Each module in the aforementioned compression-type fitting bending detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0106] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a compressed metal fitting bending detection method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0107] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0108] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: performing image enhancement processing on an acquired original hardware image to obtain an enhanced image, and extracting the hardware contour from the enhanced image to obtain a contour image; performing feature extraction on the contour image using a target detection network model, and obtaining candidate region images based on the extracted features; performing deduplication processing on the candidate region images to obtain a target region image, and performing size correction on the target region image to obtain a hardware region image; obtaining axial information of the hardware region image, and performing rotation correction on the hardware region image based on the axial information to obtain a target hardware image; extracting the hardware contour curve from the target hardware image, and obtaining the hardware curvature based on the hardware contour curve.

[0109] In one embodiment, the image enhancement processing of the acquired original hardware image to obtain an enhanced image when the processor executes the computer program includes: acquiring grayscale information of the acquired original hardware image; mapping the original hardware image to a preset grayscale range based on the grayscale information to obtain a first intermediate image; extracting brightness and contrast information of the first intermediate image; performing contrast enhancement processing on the first intermediate image based on the brightness and contrast information to obtain a second intermediate image; and performing noise suppression processing on the second intermediate image using a filtering algorithm to obtain the enhanced image.

[0110] In one embodiment, the extraction of hardware contours from an enhanced image to obtain a contour image by the processor executing a computer program includes: smoothing the enhanced image using a smoothing suppression algorithm to remove the background image from the enhanced image to obtain a third intermediate image; and performing contour enhancement processing on the third intermediate image using an edge enhancement algorithm to obtain the contour image.

[0111] In one embodiment, the deduplication process of a candidate region image to obtain a target region image when the processor executes a computer program includes: performing a first deduplication process on the candidate region image based on the image confidence of the candidate region image to obtain a candidate region image; obtaining the image intersection-union ratio (IUU) between the candidate region images; and performing a second deduplication process on the candidate region image based on the IUU to obtain the target region image.

[0112] In one embodiment, the process of obtaining axial information of a hardware region image when the processor executes a computer program includes: performing image grayscale processing on the hardware region image to obtain a grayscale image, and extracting straight line segments from the grayscale image using a straight line detection algorithm; filtering the straight line segments according to the preset axial line information of the hardware body to obtain candidate straight line segments; and obtaining the axial information of the hardware region image according to the direction angle of the candidate straight line segments.

[0113] In one embodiment, the extraction of the hardware contour curve from the target hardware image by the processor executing the computer program includes: performing grayscale thresholding on the target hardware image to obtain a corresponding binary image, and removing noise connected components from the binary image to obtain the hardware body connected component; traversing the binary image using a contour tracking algorithm to obtain the set of outer contour pixel coordinates of the hardware body connected component; grouping the pixel coordinates in the outer contour pixel coordinate set according to axial information, and obtaining the hardware contour curve based on the grouping result; the hardware contour curve includes a first edge contour curve and a second edge contour curve.

[0114] In one embodiment, the process of obtaining the bending degree of a fitting based on a fitting profile curve when the processor executes a computer program includes: obtaining the effective length of the fitting based on the endpoint coordinates of the fitting profile curve, and obtaining the edge chord height based on the coordinates of each pixel on the fitting profile curve; obtaining the edge bending degree based on the effective length of the fitting and the edge chord height; the edge bending degree includes a first edge bending degree and a second edge bending degree; and taking the maximum value of the first edge bending degree and the second edge bending degree as the fitting bending degree.

[0115] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon. When executed by a processor, the computer program performs the following steps: performing image enhancement processing on an acquired original hardware image to obtain an enhanced image, and extracting the hardware contour from the enhanced image to obtain a contour image; performing feature extraction on the contour image using a target detection network model, and obtaining candidate region images based on the extracted features; performing deduplication processing on the candidate region images to obtain a target region image, and performing size correction on the target region image to obtain a hardware region image; obtaining axial information of the hardware region image, and performing rotation correction on the hardware region image based on the axial information to obtain a target hardware image; extracting the hardware contour curve from the target hardware image, and obtaining the hardware curvature based on the hardware contour curve.

[0116] In one embodiment, when a computer program is executed by a processor, the image enhancement processing of the acquired original hardware image to obtain an enhanced image includes: acquiring grayscale information of the acquired original hardware image; mapping the original hardware image to a preset grayscale range based on the grayscale information to obtain a first intermediate image; extracting brightness and contrast information of the first intermediate image; performing contrast enhancement processing on the first intermediate image based on the brightness and contrast information to obtain a second intermediate image; and performing noise suppression processing on the second intermediate image using a filtering algorithm to obtain the enhanced image.

[0117] In one embodiment, the extraction of hardware contours from an enhanced image to obtain a contour image by the execution of a computer program by a processor includes: smoothing the enhanced image using a smoothing suppression algorithm to remove the background image from the enhanced image to obtain a third intermediate image; and performing contour enhancement processing on the third intermediate image using an edge enhancement algorithm to obtain the contour image.

[0118] In one embodiment, the computer program, when executed by a processor, involves deduplicating candidate region images to obtain a target region image, including: performing a first deduplication process on the candidate region images based on the image confidence of the candidate region images to obtain candidate region images; obtaining the image intersection-union ratio (IUU) between candidate region images; and performing a second deduplication process on the candidate region images based on the IUU to obtain the target region image.

[0119] In one embodiment, the process of obtaining axial information of a hardware region image when the computer program is executed by a processor includes: performing image grayscale processing on the hardware region image to obtain a grayscale image, and extracting straight line segments from the grayscale image using a straight line detection algorithm; filtering the straight line segments according to the preset axial line information of the hardware body to obtain candidate straight line segments; and obtaining the axial information of the hardware region image according to the direction angle of the candidate straight line segments.

[0120] In one embodiment, the extraction of the hardware contour curve from the target hardware image by the computer program being executed by the processor includes: performing grayscale thresholding on the target hardware image to obtain a corresponding binary image, and removing noise connected components from the binary image to obtain the hardware body connected component; traversing the binary image using a contour tracking algorithm to obtain the set of outer contour pixel coordinates of the hardware body connected component; grouping the pixel coordinates in the set of outer contour pixel coordinates according to axial information, and obtaining the hardware contour curve based on the grouping result; the hardware contour curve includes a first edge contour curve and a second edge contour curve.

[0121] In one embodiment, the computer program, when executed by a processor, involves obtaining the bending degree of a fitting based on a fitting profile curve, including: obtaining the effective length of the fitting based on the endpoint coordinates of the fitting profile curve, and obtaining the edge chord height based on the coordinates of each pixel on the fitting profile curve; obtaining the edge bending degree based on the effective length of the fitting and the edge chord height; the edge bending degree includes a first edge bending degree and a second edge bending degree; and taking the maximum value of the first edge bending degree and the second edge bending degree as the fitting bending degree.

[0122] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: performing image enhancement processing on an acquired original hardware image to obtain an enhanced image, and extracting the hardware contour from the enhanced image to obtain a contour image; performing feature extraction on the contour image using a target detection network model, and obtaining candidate region images based on the extracted features; performing deduplication processing on the candidate region images to obtain a target region image, and performing size correction on the target region image to obtain a hardware region image; obtaining axial information of the hardware region image, and performing rotation correction on the hardware region image based on the axial information to obtain a target hardware image; extracting the hardware contour curve from the target hardware image, and obtaining the hardware curvature based on the hardware contour curve.

[0123] In one embodiment, when a computer program is executed by a processor, the image enhancement processing of the acquired original hardware image to obtain an enhanced image includes: acquiring grayscale information of the acquired original hardware image; mapping the original hardware image to a preset grayscale range based on the grayscale information to obtain a first intermediate image; extracting brightness and contrast information of the first intermediate image; performing contrast enhancement processing on the first intermediate image based on the brightness and contrast information to obtain a second intermediate image; and performing noise suppression processing on the second intermediate image using a filtering algorithm to obtain the enhanced image.

[0124] In one embodiment, the extraction of hardware contours from an enhanced image to obtain a contour image by the execution of a computer program by a processor includes: smoothing the enhanced image using a smoothing suppression algorithm to remove the background image from the enhanced image to obtain a third intermediate image; and performing contour enhancement processing on the third intermediate image using an edge enhancement algorithm to obtain the contour image.

[0125] In one embodiment, the computer program, when executed by a processor, involves deduplicating candidate region images to obtain a target region image, including: performing a first deduplication process on the candidate region images based on the image confidence of the candidate region images to obtain candidate region images; obtaining the image intersection-union ratio (IUU) between candidate region images; and performing a second deduplication process on the candidate region images based on the IUU to obtain the target region image.

[0126] In one embodiment, the process of obtaining axial information of a hardware region image when the computer program is executed by a processor includes: performing image grayscale processing on the hardware region image to obtain a grayscale image, and extracting straight line segments from the grayscale image using a straight line detection algorithm; filtering the straight line segments according to the preset axial line information of the hardware body to obtain candidate straight line segments; and obtaining the axial information of the hardware region image according to the direction angle of the candidate straight line segments.

[0127] In one embodiment, the extraction of the hardware contour curve from the target hardware image by the computer program being executed by the processor includes: performing grayscale thresholding on the target hardware image to obtain a corresponding binary image, and removing noise connected components from the binary image to obtain the hardware body connected component; traversing the binary image using a contour tracking algorithm to obtain the set of outer contour pixel coordinates of the hardware body connected component; grouping the pixel coordinates in the set of outer contour pixel coordinates according to axial information, and obtaining the hardware contour curve based on the grouping result; the hardware contour curve includes a first edge contour curve and a second edge contour curve.

[0128] In one embodiment, the computer program, when executed by a processor, involves obtaining the bending degree of a fitting based on a fitting profile curve, including: obtaining the effective length of the fitting based on the endpoint coordinates of the fitting profile curve, and obtaining the edge chord height based on the coordinates of each pixel on the fitting profile curve; obtaining the edge bending degree based on the effective length of the fitting and the edge chord height; the edge bending degree includes a first edge bending degree and a second edge bending degree; and taking the maximum value of the first edge bending degree and the second edge bending degree as the fitting bending degree.

[0129] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0131] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for detecting the bending degree of compression fittings, characterized in that, The method includes: The original hardware images are enhanced to obtain enhanced images, and the hardware outlines in the enhanced images are extracted to obtain outline images. The contour image is used to extract features through an object detection network model, and candidate region images are obtained based on the extracted features. The candidate region image is deduplicated to obtain the target region image, and the target region image is resized to obtain the hardware region image; The axial information of the hardware region image is obtained, and the hardware region image is rotated and corrected according to the axial information to obtain the target hardware image; Extract the hardware outline curve from the target hardware image, and obtain the hardware curvature based on the hardware outline curve.

2. The method according to claim 1, characterized in that, The process of enhancing the acquired original metal fitting images to obtain enhanced images includes: The grayscale information of the original hardware image is acquired, and the original hardware image is mapped to a preset grayscale range based on the grayscale information to obtain a first intermediate image; The brightness and contrast information of the first intermediate image are extracted. Based on the brightness and contrast information, the first intermediate image is subjected to contrast enhancement processing to obtain the second intermediate image. The second intermediate image is subjected to noise suppression processing using a filtering algorithm to obtain an enhanced image.

3. The method according to claim 1, characterized in that, The step of extracting the hardware outline from the enhanced image to obtain the outline image includes: The enhanced image is smoothed using a smoothing suppression algorithm to remove the background image and obtain a third intermediate image. The third intermediate image is subjected to contour enhancement processing using an edge enhancement algorithm to obtain a contour image.

4. The method according to claim 1, characterized in that, The process of deduplicating the candidate region image to obtain the target region image includes: Based on the image confidence score of the candidate region image, the candidate region image is subjected to a first deduplication process to obtain the candidate region image; The image intersection-union ratio (IUU) between the candidate region images is obtained, and the candidate region images are subjected to a second deduplication process based on the IUU to obtain the target region image.

5. The method according to claim 1, characterized in that, The step of obtaining the axial information of the hardware region image includes: The image of the hardware area is converted to grayscale to obtain a grayscale image, and line segments in the grayscale image are extracted using a line detection algorithm. Based on the preset axis information of the hardware body, the straight line segments are filtered to obtain candidate straight line segments; Based on the direction angle of the candidate line segment, the axial information of the hardware region image is obtained.

6. The method according to claim 1, characterized in that, The step of extracting the hardware outline curve from the target hardware image includes: The target hardware image is subjected to grayscale threshold segmentation to obtain a corresponding binary image, and the noise connected components in the binary image are removed to obtain the main connected component of the hardware. The binary image is traversed using a contour tracking algorithm to obtain the set of outer contour pixel coordinates of the connected domain of the hardware body; The pixel coordinates in the outer contour pixel coordinate set are grouped according to the axial information, and the hardware contour curve is obtained according to the grouping result; the hardware contour curve includes a first edge contour curve and a second edge contour curve.

7. The method according to claim 1, characterized in that, The process of obtaining the bending degree of the hardware based on the hardware profile curve includes: The effective length of the fitting is obtained based on the endpoint coordinates of the fitting profile curve, and the edge chord height is obtained based on the coordinates of each pixel on the fitting profile curve. The edge curvature is obtained based on the effective length of the metal fitting and the edge chord height; the edge curvature includes a first edge curvature and a second edge curvature. The maximum value between the first edge curvature and the second edge curvature is taken as the hardware curvature.

8. A compression-type fitting bending detection device, characterized in that, The device includes: The image enhancement module is used to perform image enhancement processing on the acquired original hardware image to obtain an enhanced image, and to extract the hardware outline in the enhanced image to obtain a outline image; The feature extraction module is used to extract features from the contour image through an object detection network model, and to obtain candidate region images based on the extracted features; The size correction module is used to perform deduplication processing on the candidate region image to obtain the target region image, and to perform size correction on the target region image to obtain the hardware region image; A rotation correction module is used to acquire the axial information of the hardware area image and perform rotation correction on the hardware area image according to the axial information to obtain the target hardware image. The curvature acquisition module is used to extract the hardware outline curve from the target hardware image and acquire the hardware curvature based on the hardware outline curve.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.