Crack real-time detection method and device based on coin reference

By using smartphones to photograph coins for calibration and image analysis, accurate, fast, and lightweight crack detection has been achieved. This solves the problems of cumbersome calibration materials and insufficient accuracy in existing technologies, and provides an efficient and low-cost crack identification solution.

CN121010590AActive Publication Date: 2025-11-25INNOVATION CENTER OF YANGTZE RIVER DELTA ZHEJIANG UNIVERSITY
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202511531117.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2025-11-25
Estimated Expiration
2045-10-24

AI Technical Summary

Technical Problem

Existing crack detection technologies rely on calibration materials, and the calibration process is cumbersome and complex, making it difficult to meet the convenience needs of the general public. Furthermore, the accuracy is insufficient, making it impossible to achieve accurate, fast, and lightweight crack identification and quantitative detection.

Method used

Images containing a standard-sized coin and a crack area are captured using a smartphone. Hand interference is masked through semantic segmentation. Valid coins are obtained using feature enhancement, edge detection, and morphological closure modules. Perspective transformation is used to correct the image. Crack segmentation is performed using the YOLO model, and the physical size parameters of the crack are calculated.

Benefits of technology

It achieves sub-millimeter level crack size measurement accuracy, reduces hardware costs, shortens on-site operation time, improves detection efficiency, is suitable for rapid detection by the general public, and has a simple and convenient coin calibration method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010590A_ABST
    Figure CN121010590A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time crack detection method and device based on coin reference, and the method comprises the steps: collecting a crack image containing a coin with a standard size through a smart phone, and achieving the precise quantitative measurement of the crack through coin detection, perspective transformation and crack analysis. According to the main technical scheme, 1) a coin detection module accurately identifies the position and contour of a reference coin through an improved ellipse detection algorithm in combination with a hand region shielding technology; 2) a perspective transformation module for realizing image geometric correction by using perspective transformation based on the coin position; and 3) a crack analysis module, which adopts a YOLO (You Only Look Once) algorithm and a skeletonization algorithm to realize submillimeter-level crack measurement. The invention provides a nondestructive testing scheme of combining the smart phone with the coin reference object for the first time, the hardware cost is remarkably reduced while the measurement precision is ensured, the detection precision can reach + / -0.2 mm, and the method is suitable for the fields of civil engineering detection and identification and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and nondestructive testing technology, and in particular to a method and apparatus for real-time crack detection based on a coin reference. Background Technology

[0002] Surface cracks in walls are a major characteristic of structural aging in buildings such as residential and office buildings. Cracks are one of the important inspection items in the safety assessment of concrete structures and components. How to achieve accurate, rapid, and lightweight identification and quantitative detection of cracks is a major challenge in the field of structural health monitoring.

[0003] Traditional crack detection technologies mainly include traditional contact detection technologies based on manual crack rulers and crack width gauges, and non-contact detection technologies based on computer vision. The former relies on manual visual observation, which has shortcomings such as low efficiency and strong subjectivity. It also requires specialized equipment, which has a high learning threshold for ordinary people and cannot meet the safety concerns and detection needs of ordinary people regarding their surrounding living / working environment. As for the latter, the academic and industrial communities are currently mainly working on improving the accuracy of crack segmentation / detection algorithms and developing crack detection equipment for large-scale civil engineering structures. However, its effectiveness and convenience cannot yet meet the detection needs of ordinary people anytime and anywhere.

[0004] Numerous scholars have researched algorithms for measuring the width of surface cracks in building structures using images. Some researchers have recommended using QR codes as calibration objects for image correction and dimensional conversion, and have implemented algorithm integration, indoor experimental verification, website platform construction, and on-site measurements. While using QR codes as calibration objects has proven effective for periodic inspections of specific cracks, the process of printing and pasting QR codes is too cumbersome for ordinary users, failing to meet their core need for simplicity and convenience. Furthermore, researchers have studied a calibration-free road crack detection method based on the angle between the imaging plane and the camera; however, this method suffers from inaccurate crack localization, with an accuracy limited to the centimeter level, hindering its widespread application.

[0005] As we all know, smartphones are an indispensable part of people's lives, and coins are also common items that people carry with them. Using coins as a reference for crack detection has natural advantages. On the other hand, existing research has shown that convolutional neural networks can accurately detect the number and denomination of coins. In view of this, it is feasible and meaningful to study a real-time crack detection method based on coins and to establish a corresponding detection system for achieving accurate, fast, and lightweight crack identification and quantitative detection. Summary of the Invention

[0006] This invention addresses two core problems in existing technologies: strong dependence on calibration, as current mobile detection schemes require manual placement of specialized calibration objects (such as QR codes), which is difficult to implement on complex building surfaces, and the calibration process accounts for more than 3 / 4 of the total detection time; and the specialized nature of the calibration objects, as the current calibration objects are not common objects used by ordinary people, lacking simplicity and convenience, making current vision-based crack detection schemes unsuitable for a wider range of users. This invention provides a real-time crack detection method and system based on a coin reference, applicable to the quantitative measurement of cracks in civil engineering, building maintenance, and other scenarios, especially addressing the need for rapid on-site detection when specialized measurement equipment is lacking.

[0007] The objective of this invention is achieved through the following technical solution: a real-time crack detection method based on a coin reference, comprising:

[0008] Capture an image of the test object, including a standard-sized coin and a cracked area, using a mobile imaging device (such as a smartphone);

[0009] The hand in the image to be tested is semantically segmented to mask the interference area of ​​the hand, and a grayscale image after masking the hand is obtained.

[0010] The grayscale image is sequentially processed using a feature enhancement module, an edge detection and morphological closure module, and a fitted coin detection module to obtain a set of valid fitted coins.

[0011] The coin with the largest radius is identified from the set of valid fitted coins and selected as the reference benchmark. The conversion ratio between pixels and actual size is determined. The image to be tested is corrected to the front view plane through the perspective transformation algorithm, and a front view image of the surface to be tested containing cracks is generated.

[0012] Cracks are segmented from the front view image of the surface to be tested, and the physical size parameters of the cracks are calculated.

[0013] Furthermore, the diameter of the coin Occupying the width of the image to be tested 5% to 10%.

[0014] Furthermore, semantic segmentation is performed on the hand in the image to be tested to mask the hand-related interference region, including:

[0015] The Hands hand detector from the MediaPipe library is used to generate a hand region mask for the image Image_test under test. .

[0016] Furthermore, the feature enhancement module applies contrast-limited adaptive histogram equalization and Gaussian blur algorithm to the grayscale image Image_non_hand to enhance the coin features, obtaining the coin feature-enhanced image Image_feat;

[0017] Edge detection and morphological closure module: Based on the occluded edge detection algorithm, locate the coin in the Image_feat image and obtain the coin boundary; perform morphological closure processing on the incomplete coin boundary to obtain the processed image Image_proc;

[0018] The coin fitting detection module uses a three-step process of ellipse fitting, Hough circle, and geometric verification to detect Image_proc and obtain a set of valid fitted coins.

[0019] Furthermore, the edge detection and morphological closure module includes:

[0020] Edge detection module: This module processes the grayscale matrix of the image Image_non_hand. Calculate the double-threshold Canny operator , Next, the Canny function from the OpenCV library is called to obtain the binarized edge image Edges.

[0021] Morphological Closure Module: Performs closure processing on the binarized edge image Edges. Using an elliptical structuring element S, it performs a "dilation-erosion" morphological closure operation on the edge image to obtain the processed image Image_proc.

[0022] Furthermore, the fitted coin detection module includes:

[0023] Ellipse fitting priority mode: Performs connected contour search on the processed image Image_proc, filtering contours with areas greater than a threshold. For incomplete elliptical regions, ellipse fitting is performed on incomplete ellipses with at least 5 contour feature points to obtain candidate regions. ,in , , , They are respectively The coordinates of the center and the radius of the circle. ;

[0024] right Calculate the ratio of major to minor axis , ,in , The first The lengths of the major and minor axes of each candidate contour ellipse; Let the roundness threshold be... ,when When a candidate contour ellipse is determined to be a valid fitted coin, a set of valid fitted coins is obtained, and the center coordinates of the ellipse are output. and equivalent radius ;

[0025] Hough Circle Alternate Mode: When the ellipse fitting priority mode fails to obtain a valid coin fit, switch to the Hough Circle fitting mode. Call the OpenCV library's HoughCircles function to locate the coin in the Image_proc image and obtain candidate regions. ;

[0026] For candidate regions Candidate targets whose vertical distance from the center of the circle to the image boundary is less than its equivalent radius are eliminated, resulting in new candidate regions. ;

[0027] For candidate regions Calculate its average radius Remove those with radius deviation exceeding Outliers, to obtain a set of validly fitted coins. , This is the tolerance coefficient.

[0028] Further, a frontal view image of the tested surface containing cracks is generated, including:

[0029] Establish the mapping relationship between the imaging plane and the target plane, and obtain the perspective transformation matrix. ,include:

[0030] Imaging plane reference point selection: from the set of effectively fitted coins Select the center of the coin with the largest radius. Centered on the image plane, four extreme points are extracted along its circumference at four angular directions to form a set of coordinate points on the imaging plane. ;

[0031] Target plane reference point selection: Let ,in The conversion ratio between pixels and actual size, in , , as well as Establish a target plane coordinate system using four points, forming a set of target plane coordinate points. ;

[0032] Transformation matrix calculation: based on the above and The homography matrix is ​​calculated using the least squares method and satisfies: Calculate the distance from the four corner points of the image to be tested, Image_test. The transformed boundary coordinates are used to determine the size of the target image; a translation correction matrix is ​​then constructed. This aligns the top-left corner of the target image with the origin of the coordinate system; therefore, the perspective transformation matrix... ;

[0033] The OpenCV library's perspective transformation function warpPerspective is used to obtain the coordinates of each pixel in the image Image_test on the target plane.

[0034] Pixel resampling processing is used to obtain the pixel values ​​of the target plane, including:

[0035] The OpenCV library's bicubic interpolation function INTER_CUBIC is called to calculate the corresponding pixel value on the target plane by weighted combination of the 16 neighboring pixel values ​​of the sampling point on the imaging plane, thus generating a pixel matrix. For each neighboring pixel, the distance from the sampling point is considered. The weights are determined by a piecewise continuous cubic polynomial kernel function. This allows for the calculation of the corresponding pixel values ​​of the sampling points on the imaging plane within the target plane.

[0036] ;

[0037] in, Used to achieve optimal sharpness-smoothness balance;

[0038] The pixel values ​​of each pixel in the image under test Image_test on the target plane are obtained accordingly, thereby generating the front view image of the surface under test Image_pt containing the crack.

[0039] Furthermore, the front view image of the surface under test is segmented into cracks, and the physical size parameters of the cracks are calculated, including:

[0040] The YOLO model is used to segment the cracks in the front view image Image_pt. The physical size parameters of the cracks, including the maximum crack width, are calculated by combining skeletonization and distance transformation algorithms. Average width and length ,in Represents the first in the image A crack.

[0041] The present invention also provides a real-time crack detection device based on a coin reference, comprising one or more processors for implementing the above-described real-time crack detection method based on a coin reference.

[0042] The present invention also provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, is used to implement the above-described real-time crack detection method based on a coin reference.

[0043] The beneficial effects of this invention are that, through an innovative coin calibration method and image analysis technology, it achieves sub-millimeter-level crack size measurement (±0.20mm) on a smartphone for the first time, with higher accuracy than traditional manual inspection. Even with interference-prone coin detection algorithms, it maintains a coin recognition accuracy rate of over 90%. Combining a lightweight YOLO model and parallel computing architecture, it achieves second-level processing (2.3s / frame) on 4K resolution images. The natural coin calibration method significantly reduces on-site operation time and lowers hardware costs to 1 / 100th of professional equipment. The system also possesses the following unique advantages: multi-scale fusion detection increases the detection rate of small cracks (<0.3mm) to 91%. This invention provides the first smartphone-based non-destructive testing solution in the field of building inspection that combines high accuracy, low cost, and simple and convenient calibration. Attached Figure Description

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

[0045] Figure 1 This is a flowchart illustrating the real-time crack detection method based on a coin reference provided by the present invention.

[0046] Figure 2 This is a flowchart illustrating the process of removing hand interference for coin recognition in this invention.

[0047] Figure 3 This is a flowchart illustrating the process of correcting errors using coin perspective in this invention.

[0048] Figure 4 This is a flowchart illustrating the crack parameter identification process in this invention.

[0049] Figure 5 This is a diagram showing the crack identification results in this invention.

[0050] Figure 6 This is a technical roadmap for the crack detection system in this invention.

[0051] Figure 7 This is a schematic diagram of the smartphone platform for crack recognition in this invention.

[0052] Figure 8 This is a schematic diagram of a hardware structure provided for an embodiment of the present invention. Detailed Implementation

[0053] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.

[0054] The core technology of this invention is to establish a complete coin calibration and crack measurement system, which achieves accurate physical size measurement through multi-level image processing algorithms. The system adopts computer vision-based multimodal detection technology, combined with deep learning and traditional image processing methods, and uses smartphones to achieve sub-millimeter-level precision crack size measurement. The core technical features include: (1) an adaptive coin calibration algorithm that can accurately detect and identify standard-sized coins in complex backgrounds; (2) an intelligent perspective transformation system that eliminates size errors caused by shooting angles through perspective transformation; and (3) a crack analysis engine that integrates YOLO and skeletonization to achieve accurate quantification of crack geometric parameters.

[0055] The present invention proposes a real-time crack detection method based on a coin reference, comprising the following steps:

[0056] (1) Image acquisition stage: Image acquisition stage: Take a picture of a standard-sized coin (radius of) using a smartphone. The test image (Image_test) of the crack region is used to read the test image by calling the cv2.imread function in the OpenCV library, and the grayscale matrix is ​​obtained by calling the cv2.cvtColor function. The size of the matrix is The requirements are that the coin held in hand and the crack are on the same plane (the thickness of the coin can be ignored) and captured in the same image, and the diameter of the coin must occupy the width of the image. The distortion rate is 5% to 10%. To ensure image quality, an adaptive shooting strategy is adopted: when the ambient light level is detected to be <100 lux, flash compensation is automatically activated, and the shooting distance is controlled within 30±5cm using a laser rangefinder module. For different mobile phone models, a built-in CMOS sensor parameter database is used to automatically correct the lens distortion coefficient. .

[0057] (2) Hand masking stage: Based on the feature detection module of the MediaPipe hand recognition library, semantic segmentation is performed on the hand in the image to be tested, Image_test, to mask the hand interference region, and the grayscale image Image_non_hand after masking the hand is obtained, whose matrix representation is as follows: Specifically, it includes the following sub-steps:

[0058] The Hands hand detector from the MediaPipe library is used to generate a hand region mask for the image Image_test under test. Generally, a minimum confidence threshold for hand detection is set. .

[0059] (3) Coin detection stage: The grayscale image Image_non_hand from step (2) is processed using a feature enhancement module, an edge detection and morphological closure module, and a coin detection fitting module to obtain a set of valid fitted coins. Specifically, it includes the following sub-steps:

[0060] (3.1) Feature Enhancement Module: Apply Contrast Limited Adaptive Histogram Equalization (CLAHE) and Gaussian Blur algorithms to Image_non_hand to enhance coin features and obtain the enhanced image Image_feat. This includes the following sub-steps:

[0061] (3.1.1) The parameters of the CLAHE algorithm include, but are not limited to: contrast limit. (Suppress noise amplification, generally set to 0.01~0.05; the larger the value, the stronger the contrast enhancement), block size. (Generally set to) , (The smaller the block size, the more obvious the local contrast).

[0062] (3.1.2) The Gaussian Blur algorithm parameters include, but are not limited to: kernel parameters. (Generally set to not less than) ), standard deviation parameter (Generally set to 1~3, The larger the image size, the smoother it becomes, but the loss of detail is more noticeable.

[0063] (3.2) Edge detection and morphological closure module: Based on the occluded edge detection algorithm, the coin in the Image_feat image is located, and the boundary of the incomplete coin is obtained; the morphological closure processing of the incomplete coin boundary is performed to obtain the processed image Image_proc, which specifically includes the following sub-steps:

[0064] (3.2.1) Edge detection module: This module processes the grayscale matrix of the image Image_non_hand. Calculate the double-threshold Canny operator , ,

[0065]

[0066] in 0.67 and 1.33 are the mean gray values ​​of the non-hand area of ​​the image, and 0.67 and 1.33 are fixed values ​​for Canny edge detection.

[0067] Use the Canny function from the OpenCV library to obtain a binarized edge image: ;

[0068] (3.2.2) Morphological Closure Module: Performs closure processing on the binarized edge image Edges.

[0069] Use an elliptical structural element S (with a kernel size of 3×3 pixels to fit the geometric features of a circular or near-circular target object).

[0070] Perform a morphological closing operation (dilation followed by erosion) on the edge image to obtain the processed image Image_proc:

[0071]

[0072] in, and These represent expansion and erosion operations, respectively.

[0073] (3.3) Fitted Coin Detection Module: The Image_proc is detected through a three-step process of ellipse fitting, Hough circle, and geometric verification to obtain a set of valid fitted coins. Specifically, it includes the following sub-steps:

[0074] (3.3.1) Ellipse fitting priority mode:

[0075] Perform a connected contour search on the processed image Image_proc, filtering contours with areas greater than a threshold. For incomplete elliptical regions (default value is 100, generally set to 80-150 pixels), ellipse fitting is performed on incomplete ellipses with at least 5 contour feature points (5 independent points determine one ellipse) to obtain candidate regions. ,in , , , They are respectively The coordinates of the center and the radius of the circle;

[0076] right Calculate the ratio of major to minor axis , ,in , The first The lengths of the major and minor axes of each candidate contour ellipse; Let the roundness threshold be... (Generally set to 0.6~0.8), when When the candidate contour ellipse is determined to be a valid fitted coin, the set of valid fitted coins is... Output the coordinates of the center of the ellipse. and equivalent radius ;

[0077] (3.3.2) Hoff circle standby mode:

[0078] When the ellipse fitting mode cannot obtain a valid fitted coin (i.e.) Switching to Hough Circle fitting mode, the OpenCV library's HoughCircles function is called to locate the coin in the image and obtain candidate regions. Generally, the ratio of image pixel resolution to parameter space resolution is... (This indicates that the parameter space has the same resolution as the image space; it is generally set to 1. If the coin's edges are blurry, it can be adjusted.) To reduce parameter spatial resolution, minimum center distance (Set according to the coin diameter, generally larger than 24mm), Canny edge detection high threshold (Generally set to 100~200), center threshold (Generally set to 20~50, the smaller the value, the more circles are detected);

[0079] (3.3.3) Geometric constraint verification:

[0080] Boundary distance verification: for candidate regions Candidate targets whose vertical distance from the center of the circle to the image boundary is less than its equivalent radius are eliminated (i.e., those that satisfy the condition...). and ), obtain new candidate regions ;

[0081] Size consistency verification: for candidate regions Calculate its average radius Remove radius deviation ( )Exceed outliers (where (This is a tolerance coefficient, typically set to 0.2~0.4), to obtain a set of coins that fits effectively. .

[0082] (4) Perspective transformation and size calibration stage: Input the image to be tested Image_test, and from the set of valid fitted coins ( or Identify and select the coin with the largest radius from the list. As a reference benchmark, determine the conversion ratio between pixels and actual size. The Image_test is corrected to a frontal view plane using a perspective transformation algorithm, generating an image of the tested surface Image_pt (a coin) containing cracks. After perspective transformation This process eliminates geometric deformation caused by the shooting angle, ensuring the accuracy of crack size measurement; specifically, it includes the following sub-steps:

[0083] (4.1) Determine the imaging plane by effectively fitting the coin with the largest radius in the coin set, establish the mapping relationship between the imaging plane and the target plane (frontal view), and obtain the perspective transformation matrix. Thus, the coordinates of each pixel in the image under test, Image_test, on the target plane are:

[0084] Imaging plane reference point selection: from the set of effectively fitted coins Select the center of the coin with the largest radius. Centered on the image plane, four extreme points are extracted along its circumference at angles of 0°, 90°, 180°, and 270° to form the set of coordinate points on the imaging plane. ,in: Right extreme point , The upper extreme point , Left extreme point , The lower extreme point ;

[0085] Target plane reference point selection: Let ,in The conversion ratio between pixels and actual size, in , , as well as Establish a target plane coordinate system using four points, forming a set of target plane coordinate points. ;

[0086] Transformation matrix calculation: based on the above and The homography matrix is ​​calculated using the least squares method. ,satisfy: ,in The homography matrix is ​​calculated using the findHomography function from the OpenCV library; the four corner points of the image Image_test are calculated. , , , go through Transformed boundary coordinates , , , The size of the target image is determined based on the aforementioned corner points. Construct the translation correction matrix This aligns the top left corner of the target image with the origin of the coordinate system. ,in and These refer to the smallest values ​​in the target image. and Coordinates; therefore, perspective transformation matrix ;

[0087] The OpenCV library's perspective transformation function warpPerspective is used to obtain the coordinates of each pixel in the image Image_test on the target plane.

[0088] (4.2) Pixel resampling process to obtain the pixel values ​​of the target plane :

[0089] The OpenCV library's bicubic interpolation function INTER_CUBIC is called to sample the values ​​of the 16 nearest pixels from the imaging plane. The weighted combination of these values ​​is used to calculate the corresponding pixel values ​​in the target plane to generate a pixel matrix. For each neighboring pixel, the distance from the sampling point is considered. ( Directional distance , Directional distance The weights are determined using a piecewise continuous cubic polynomial kernel function. (Horizontal weight) or vertical weight ):

[0090]

[0091] Among them, parameters At this point, optimal sharpness-smoothness balance can generally be achieved (typically set to -0.80 to -0.70). (As the size increases, the edge sharpness increases, and the smoothness decreases).

[0092] Its corresponding pixel value in the target plane is the bicubic weighted sum of its 16 neighboring pixels:

[0093]

[0094] The pixel values ​​of each pixel in the image under test Image_test on the target plane are obtained accordingly, thereby generating the front view image of the surface under test Image_pt containing the crack.

[0095] (5) Crack Analysis Stage: The YOLO (You Only Look Once) model is used to segment the cracks in the front view image Image_pt. The physical size parameters of the cracks are calculated by combining skeletonization and distance transformation algorithms, including the maximum crack width. Average width and length Where 'c' stands for 'crack'. Represents the first in the image The crack, specifically includes the following sub-steps:

[0096] (5.1) Input Image_pt and generate crack mask using the YOLO model. (The confidence threshold is generally set to 0.7).

[0097] (5.2) Skeleton extraction: Call the skeleton extraction function skeletonize from the scikit-image library to obtain the skeleton line image. ;

[0098] (5.3) Crack width calculation: The crack mask is obtained by calling the distanceTransform function of the OpenCV library. The distance from all crack points ("1" value points) to the nearest non-crack point ("0" value point). Take the image that belongs to the skeleton line. Location distance subset ;No. Width values ​​at various points of the crack For distance subset Twice the value of the corresponding element in the middle; the first Maximum width of the crack It is twice the value of the largest element in the distance subset;

[0099] (5.4) Crack length calculation: The 8-neighborhood skeletonization algorithm is used. The length of the crack is The sum of non-zero elements (can be used) (Acquisition) and conversion ratio The quotient;

[0100] (5.5) Average width calculation: The crack mask is obtained by calling the countnozero function of the OpenCV library. The area of ​​each crack in , No. Average width of the crack for With the The quotient of the length of the crack;

[0101] (5.6) Crack contour extraction: The crack mask is obtained by calling the contour extraction function findCountours in the OpenCV library. Contours in the outline;

[0102] (5.7) Crack Feature Map Image_ft Drawing: Crack feature parameters are labeled on Image_pt. The maximum crack width is marked in red, and the crack outline and its interior are marked in green. The physical feature parameters of the crack, including the maximum crack width, are labeled on the lower right side of the maximum crack width. Average width and length ,in of Represents the first in the image A crack. The final output image is Image_crack.

[0103] In one embodiment, a real-time crack detection system is also included:

[0104] Principle of real-time crack detection system:

[0105] The backend architecture of the real-time crack detection system includes: servers, Alibaba Cloud, and AGL (Automotive Grade Linux). The servers, as the core of the system, are responsible for the operation of the entire detection system, while Alibaba Cloud is responsible for storing input and output images (including crack masks). (Including crack feature parameter maps), Python code for real-time crack detection based on a coin reference is deployed on AGL. The smartphone uploads the image to be tested, Image_test, to the server, which then calls Alibaba Cloud. (OSS Object Storage Service Application Programming Interface) saves the input image to a specified space on Alibaba Cloud and automatically sends commands to AGL to run the Python code: ① When the image resolution is >4K, it is automatically segmented (if the remaining part is less than 512×512, the remaining part is processed directly) into 512×512 sub-images for processing; when the image resolution is <4K, the entire image is processed; ② The output image Image_crack is obtained through the steps of claim 1 above; ③ The Python code calls Alibaba Cloud... Upload the output image (Image_crack) to Alibaba Cloud for storage and generate an information about Image_crack. (Image output application programming interface), and send it to the server; ④ The server automatically reads it. And then it is delivered to the smartphone, which then calls... The output image is then displayed. Furthermore, after crack detection is complete, if the output result shows that the maximum crack width exceeds the warning value (determined jointly by historical data and standard limits), the Python code sends a warning signal to the server, which then forwards the signal to the smartphone to alert the user. If the output result shows that the number of coins recognized is not equal to 1, the smartphone prompts the user to retake the image.

[0106] User-detection system (mobile terminal) interaction flow:

[0107] Upon entering the mobile platform, first-time users must register an account (WeChat accounts can be directly linked), allowing the cloud platform to manage information and protect privacy using usernames (e.g., abc). After registration, users are directed to a point selection interface (points are used to distinguish cracks in different locations; images of the same crack must be within a single point according to rules for accurate tracking of crack trends). Points are divided into new and historical points. Clicking on a new point allows for image upload and crack identification, automatically creating a new point number (e.g., 001). Clicking on historical points allows for point selection, leading to a detailed interface for that point containing the crack mask most recently captured and identified at that point. The interface includes crack feature parameter maps and selectable crack feature parameters (length, average width, maximum width) time history curves. You can click on a new image to upload a new image and identify cracks on this interface.

[0108] Implementation Examples

[0109] The invention was implemented on a testing workstation equipped with an Intel Core i9-14900HX CPU, an NVIDIA GeForce RTX 4060 GPU, and 32GB of RAM. Using all the parameter configurations listed in the specific implementation (COIN_DIAMETER_MM=24.0, MIN_COIN_RADIUS_PX=15, etc.), the experimental results shown in the attached figures were obtained. The cracks on the surface of the detected target object are all composed of multi-layered geometric features. Each crack is converted into a continuous line segment consisting of 20-25 key points using a skeletonization algorithm. During real-time analysis, these feature lines are mapped to the frontal plane using the OpenCV geometric transformation module, and the YOLO segmentation results and distance transformation data are fused to generate a measurement report.

[0110] like Figures 1 to 4As shown, compared with existing detection methods, this method can: accurately identify the edge of a coin under hand occlusion conditions (through hand_mask shielding rate > 92%); test the linear crack defect morphology shown in the test, and the results show that: the system can stably process input images with a resolution of up to 4096×2160; within a 100mm² crack area, it can achieve: width measurement accuracy ±0.15mm, length calculation error <1.2%, and area statistical deviation <3%; among which, Figure 2 The green circle in the diagram represents the detected coin boundary, and the red dot represents the coin's center point.

[0111] like Figure 5 The crack identification results shown in the figure are as follows. The width of the part marked in red in the figure was measured by a company using a special crack measuring ruler. The measurement data is shown in Table 1. The crack width of the marked point was recently measured to be 2.50 mm, while the crack width of the corresponding point measured by this system was 2.62 mm, with an error of 4.8%, which verifies the effectiveness of this method system.

[0112]

[0113] like Figure 6 The technical approach shown demonstrates that the system achieves high-efficiency computation through a multi-stage pipeline processing architecture, with an average processing time of 2.3 seconds per frame on 4K images (including the entire process of coin detection, perspective correction, and crack analysis), which is 40 times more efficient than traditional manual measurement. Experimental data verify that the present invention has stable detection performance on the surfaces of various building materials (concrete, ceramic tiles, metal, etc.).

[0114] like Figure 7 The diagram shown illustrates a mobile platform for crack detection, which truly establishes a real-time crack detection system based on a coin reference. The cloud platform implements crack information privacy management based on usernames. Users can create new measurement points or re-upload images from historical measurement points for crack detection, making it convenient for users to monitor the trends of specific cracks and for the cloud platform to issue timely warnings based on trends.

[0115] Corresponding to the aforementioned embodiment of a real-time crack detection method based on a coin reference, the present invention also provides an embodiment of a real-time crack detection device based on a coin reference.

[0116] See Figure 8 The present invention provides a real-time crack detection device based on a coin reference, comprising one or more processors for implementing a real-time crack detection method based on a coin reference as described in the above embodiments.

[0117] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0118] An embodiment of the real-time crack detection device based on a coin reference of the present invention can be applied to any device with data processing capabilities, such as a computer. The device embodiment can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 8 The diagram shown is a hardware structure diagram of any data processing-capable device, including a real-time crack detection device based on a coin reference according to the present invention. (Except for...) Figure 8 In addition to the processor, memory, network interface, and non-volatile memory shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0119] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0120] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0121] This invention also provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a real-time crack detection method based on a coin reference as described in the above embodiments.

[0122] The computer-readable storage medium can be an internal storage unit of any data processing device described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.

[0123] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.

Claims

1. A real-time crack detection method based on a coin reference, characterized in that, include: The image of the test object, including a standard-sized coin and a cracked area, is captured by moving the imaging device. The hand in the image to be tested is semantically segmented to mask the interference area of ​​the hand, and a grayscale image after masking the hand is obtained. The grayscale image is sequentially processed using a feature enhancement module, an edge detection and morphological closure module, and a fitted coin detection module to obtain a set of valid fitted coins. The coin with the largest radius is identified from the set of valid fitted coins and selected as the reference benchmark. The conversion ratio between pixels and actual size is determined. The image to be tested is corrected to the front view plane through the perspective transformation algorithm, and a front view image of the surface to be tested containing cracks is generated. Cracks are segmented from the front view image of the surface to be tested, and the physical size parameters of the cracks are calculated.

2. The method according to claim 1, characterized in that, Coin diameter Occupying the width of the image to be tested 5% to 10%.

3. The method according to claim 1, characterized in that, Semantic segmentation of the hand in the image to be tested is performed to mask the hand-related interference region, including: The Hands hand detector from the MediaPipe library is used to generate a hand region mask for the image Image_test under test. .

4. The method according to claim 1, characterized in that, Feature enhancement module: Apply contrast-limited adaptive histogram equalization and Gaussian blur algorithm to the grayscale image Image_non_hand to enhance coin features and obtain the coin feature-enhanced image Image_feat; Edge detection and morphological closure module: Based on the occluded edge detection algorithm, locate the coin in the Image_feat image and obtain the coin boundary; perform morphological closure processing on the incomplete coin boundary to obtain the processed image Image_proc; The coin fitting detection module uses a three-step process of ellipse fitting, Hough circle, and geometric verification to detect Image_proc and obtain a set of valid fitted coins.

5. The method according to claim 4, characterized in that, The edge detection and morphological closure module includes: Edge detection module: This module processes the grayscale matrix of the image Image_non_hand. Calculate the double-threshold Canny operator , Next, the Canny function from the OpenCV library is called to obtain the binarized edge image Edges. Morphological Closure Module: Performs closure processing on the binarized edge image Edges. Using an elliptical structuring element S, it performs a "dilation-erosion" morphological closure operation on the edge image to obtain the processed image Image_proc.

6. The method according to claim 4, characterized in that, The fitted coin detection module includes: Ellipse fitting priority mode: Performs connected contour search on the processed image Image_proc, filtering contours with areas greater than a threshold. For incomplete elliptical regions, ellipse fitting is performed on incomplete ellipses with at least 5 contour feature points to obtain candidate regions. ,in , , , They are respectively The coordinates of the center and the radius of the circle. ; right Calculate the ratio of major to minor axis , ,in , The first The lengths of the major and minor axes of each candidate contour ellipse; Let the roundness threshold be... ,when When a candidate contour ellipse is determined to be a valid fitted coin, a set of valid fitted coins is obtained, and the center coordinates of the ellipse are output. and equivalent radius ; Hough Circle Alternate Mode: When the ellipse fitting priority mode fails to obtain a valid coin fit, switch to the Hough Circle fitting mode. Call the OpenCV library's HoughCircles function to locate the coin in the Image_proc image and obtain candidate regions. ; For candidate regions Candidate targets whose vertical distance from the center of the circle to the image boundary is less than its equivalent radius are eliminated, resulting in new candidate regions. ; For candidate regions Calculate its average radius Remove those with radius deviation exceeding Outliers, to obtain a set of validly fitted coins. , This is the tolerance coefficient.

7. The method according to claim 1, characterized in that, Generate a frontal view image of the surface under test, including the cracks, including: Establish the mapping relationship between the imaging plane and the target plane, and obtain the perspective transformation matrix. ,include: Imaging plane reference point selection: from the set of effectively fitted coins Select the center of the coin with the largest radius. Centered on the image plane, four extreme points are extracted along its circumference at four angular directions to form a set of coordinate points on the imaging plane. ; Target plane reference point selection: Let ,in The conversion ratio between pixels and actual size, in , , as well as Establish a target plane coordinate system using four points, forming a set of target plane coordinate points. ; Transformation matrix calculation: based on the above and The homography matrix is ​​calculated using the least squares method and satisfies: Calculate the distance from the four corner points of the image to be tested, Image_test. The transformed boundary coordinates are used to determine the size of the target image; a translation correction matrix is ​​then constructed. This aligns the top-left corner of the target image with the origin of the coordinate system; therefore, the perspective transformation matrix... ; The OpenCV library's perspective transformation function warpPerspective is used to obtain the coordinates of each pixel in the image Image_test on the target plane. Pixel resampling processing is used to obtain the pixel values ​​of the target plane, including: The OpenCV library's bicubic interpolation function INTER_CUBIC is called to calculate the corresponding pixel value on the target plane by weighted combination of the 16 neighboring pixel values ​​of the sampling point on the imaging plane, thus generating a pixel matrix. For each neighboring pixel, the distance from the sampling point is considered. The weights are determined by a piecewise continuous cubic polynomial kernel function. This allows for the calculation of the corresponding pixel values ​​of the sampling points on the imaging plane within the target plane. ; in, Used to achieve optimal sharpness-smoothness balance; The pixel values ​​of each pixel in the image under test Image_test on the target plane are obtained accordingly, thereby generating the front view image of the surface under test Image_pt containing the crack.

8. The method according to claim 1, characterized in that, Crack segmentation is performed on the front view image of the surface to be tested, and the physical size parameters of the cracks are calculated, including: The YOLO model is used to segment the cracks in the front view image Image_pt. The physical size parameters of the cracks, including the maximum crack width, are calculated by combining skeletonization and distance transformation algorithms. Average width and length ,in Represents the first in the image A crack.

9. A real-time crack detection device based on a coin reference, characterized in that, It includes one or more processors for implementing a real-time crack detection method based on a coin reference, as described in any one of claims 1-8.

10. A computer-readable storage medium having a program stored thereon, characterized in that, When executed by the processor, the program is used to implement a real-time crack detection method based on a coin reference, as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Coin size measuring method based on vision

    CN102637317A

  • Length measuring method based on currency

    CN102865823A

  • Real-time rectification algorithm for circular instrument of transformer station

    CN107292871A

  • Crack parameter automatic extraction method and device and storage device

    CN110751656A

  • Pointer type instrument reading automatic identification method based on Faster R-CNN and U-Net

    CN111414934A