An integrated crack measurement system and method based on structured light grid segmentation perspective correction and binocular vision
Patent Information
- Application Number
- CN202610884023.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-09-18
AI Technical Summary
然而,现有的视觉测量技术在实际工程应用中面临以下技术瓶颈:第一,尺度基准缺失与透视失真
1、本发明硬件高度集成与时序自动化,相较于传统3D扫描仪持续发光导致的光斑遮挡问题,系统利用嵌入式控制主板结合继电器模块,实现了网格投射与图像采集的精准时序同步。系统采用分时采集机制,既利用网格亮起时获取了空间透视基准,又在网格熄灭时获取了无任何结构光斑干扰的纯净裂缝原图,从硬件物理层面彻底解决了结构光干扰真实病害纹理的行业难题。
Smart Images

Figure CN122775643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of structural health monitoring and computer vision, and in particular to an integrated crack measurement system and method based on structured light grid segmented perspective correction and binocular vision. Background Technology
[0002] The normal operation of modern society relies on the stable functioning of large-scale civil engineering infrastructure such as bridges, tunnels, and high-rise buildings. However, these civil engineering structures are subject to various factors such as material aging, environmental erosion, and extreme loads over long periods of use, leading to the continuous accumulation of structural damage. Among these, surface cracks are the most direct and fatal early sign of damage. To more accurately understand the safety status of a structure during its service life, accurately extracting the geometric dimensions of cracks is crucial for assessing the overall structural safety.
[0003] To accurately measure surface cracks in large engineering structures, scholars both domestically and internationally have proposed various computer vision-based methods. However, existing visual measurement techniques face the following technical bottlenecks in practical engineering applications: First, the lack of a scale reference and perspective distortion. In real-world scenarios, cameras often cannot be directly aligned with the crack surface, and non-orthogonal optical axes cause severe perspective distortion in the image. Simultaneously, a single camera lacks depth information, and existing systems often heavily rely on external ranging sensors for calculations, increasing hardware complexity. More critically, ranging sensors can only acquire local, single-point depth information, failing to provide global depth gradient information when facing curved surfaces, pipes, or complex surfaces with undulations. Distance data from a single point cannot reflect the three-dimensional spatial orientation of the crack extending along various surface types, resulting in significant alignment errors and local distortions in the derived physical conversion reference, making it impossible to derive a true absolute physical scale under non-contact and purely visual conditions. Second, structured light features are difficult to extract automatically in complex backgrounds and are subject to imaging interference. To provide a physical benchmark, introducing structured light meshes is an effective method. However, concrete surfaces often have complex textures such as water stains and pitting, making it easy for traditional algorithms to misidentify background noise as mesh corners. More importantly, the continuously projected mesh directly obscures the fine edges of the cracks themselves, leading to an irreconcilable physical contradiction between mesh extraction and high-precision original crack imaging, often requiring manual point selection. Third, there is a lack of deep-dimensional representation of the true morphology and refined dimensional calculation. Traditional two-dimensional image measurement can only calculate the "two-dimensional chord length" on the projection surface, ignoring the three-dimensional depth undulations of the crack along the structural surface. In terms of width quantization, traditional methods are easily affected by edge burrs, making it impossible to accurately obtain the true topological opening of the crack. In addition, although existing 3D laser scanners or traditional structured light 3D reconstruction equipment can acquire three-dimensional morphology, they often rely on continuously projecting extremely dense light spots or phase-shifting gratings to generate massive point clouds. This traditional method has two drawbacks in practical engineering applications: First, continuous and dense light spots can severely obscure or damage the original fine crack texture on the concrete surface, making it difficult to extract the true features of the defects; Second, fitting millions of dense point clouds requires extremely large computational overhead, making it difficult to achieve real-time calculation on lightweight, portable embedded terminals.
[0004] In conclusion, breaking through the bottlenecks of existing computer vision inspection technology and achieving high-precision, automated measurement of surface cracks in structures has significant engineering application value for ensuring the stable operation and safety assessment of large-scale civil engineering infrastructure. Summary of the Invention
[0005] The purpose of this invention is to address the problems in existing technologies by proposing an integrated crack measurement system and method based on structured light mesh segmented perspective correction and binocular vision. Through time-series linked acquisition at the hardware layer and dual parallel calculations at the software layer using structured light mesh segmented perspective correction and physical isolation of length and width, high-precision, interference-resistant intelligent measurement of crack geometric information is achieved.
[0006] The present invention is achieved through the following technical solution: The present invention proposes an integrated crack measurement system based on structured light grid segmented perspective correction and binocular vision. The system includes an integrated housing 1-1, and the following components are installed inside the integrated housing 1-1: an embedded control motherboard 1-2, a binocular camera group 1-3, a ranging module 1-4, a structured light grid transmitter 1-5, and a relay module 1-6. The binocular camera group 1-3 and the ranging module 1-4 are both directly connected to the embedded control motherboard 1-2; the structured light grid emitter 1-5 is used to project a structured light grid onto the surface being measured; the relay module 1-6 is connected to the embedded control motherboard 1-2 and the structured light grid emitter 1-5, and the embedded control motherboard 1-2 controls the power supply of the structured light grid emitter 1-5. The embedded control motherboard 1-2 is configured to perform the following measurement process to obtain the physical dimensions of the crack: 1) Image capture control: control the switching of relay modules 1-6, drive the structured light grid emitters 1-5 to turn on and off in a time-division manner, and use binocular camera group 1-3 to simultaneously acquire binocular images of the reference grid and clear original appearance of the structured light; 2) Depth perception calculation: perform binocular parallax calculation based on the reference grid image, identify and extract each corner point on the structured light grid, and directly deduce the three-dimensional depth coordinates of each corner point; 3) Sub-grid segmentation, flattening and stitching: connect adjacent corner points to extract each sub-grid, and combine the calculated... 4) Scale conversion derivation: Using the three-dimensional depth coordinates of the grid in the center of the image and the mapping relationship during the flattening process, the absolute physical scale of how many "real millimeters" a "pixel" represents in this tiled image is derived; 5) Parallel length and width quantization: On this tiled image, the continuous single-pixel skeleton and the maximum inscribed circle of the crack are extracted at the same time, and combined with the scale just calculated, the maximum total length and maximum width of the crack are finally calculated.
[0007] Furthermore, the embedded control motherboard 1-2 controls the illumination state of the structured light grid transmitter 1-5 by sending high and low level signals to the relay module 1-6, so that the binocular camera group 1-3 captures a reference grid binocular image superimposed with the structured light grid when the structured light grid transmitter 1-5 is lit, and captures a clear original binocular image without structured light interference when it is turned off.
[0008] Furthermore, when the embedded control motherboard 1-2 performs the calculation of three-dimensional depth coordinates and the derivation of the absolute physical scale, it is specifically configured according to the following logic: 1) Visual ranging logic: Extract the high confidence parallax of the global structured light intersection point in the binocular image of the reference grid, remove mismatch noise generated by periodic textures through median filtering, and calculate the three-dimensional depth coordinates of the visual corner points of each sub-grid by combining the binocular physical baseline and the focal length after epipolar correction; 2) Virtual scale mapping logic: Construct an initial virtual reference line segment in the mathematical calculation space, use the local perspective flattening mapping relationship of the central sub-grid to map the line segment to the correction reference plane and calculate its pixel length; combine the actual physical length of the line segment derived from the three-dimensional depth coordinates of the central sub-grid to calculate the absolute physical scale of the pixels in the perspective-corrected image and the actual physical millimeters; 3) Clear imaging monitoring logic: The ranging data acquired in real time by the ranging module 1-4 is independent of the subsequent size calculation process and is only used to determine whether the measured surface is within the clear imaging range of the binocular camera group 1-3 to ensure the quality of the acquired image.
[0009] This invention also proposes an integrated crack measurement method based on structured light mesh segmented perspective correction and binocular vision, the method comprising: Step 1: Distance Measurement Monitoring and Automated Time-Sequence Image Acquisition: Drive the distance measurement module 1-4 to acquire distance measurement data of the measured surface and determine whether the measured surface is within the clear imaging range of the binocular camera group 1-3; after confirming that the clear imaging conditions are met, use the embedded control motherboard 1-2 to control the relay module 1-6 to close and illuminate the structured light grid transmitter 1-5, triggering the binocular camera group 1-3 to capture a reference grid binocular image; then control the relay module 1-6 to open, triggering the binocular camera group 1-3 to capture an interference-free, clear, original binocular image in situ; Step 2: Parallax Physical Distance Calculation and Segmented Perspective Flattening Correction for Various Surface Shapes: A semi-global block matching (SGBM) algorithm is executed on the reference grid binocular image to extract the corner points of each sub-grid of the structured light grid in the reference grid binocular image. The three-dimensional depth coordinates of each corner point are calculated using the effective parallax. The local three-dimensional space normal vector of each sub-grid is calculated by combining the three-dimensional depth coordinates of each corner point. The normal vector transformation is used to flatten each sub-grid region in the clear original image to the same two-dimensional reference plane and then stitch them together to obtain a physical plane view that eliminates oblique image distortion and the influence of various surface shapes. Step 3: Derivation of dynamic scale: Based on the three-dimensional depth coordinates of the central sub-grid calculated in Step 2, and combined with the local perspective flattening mapping relationship of the central sub-grid, the absolute physical scale of the physical plan view is derived through the comparison of virtual line segment mapping in mathematical space. Step 4: Parallel calculation of length and width with physical isolation: Two independent computing memory areas are opened in the data processing system of the embedded control motherboard 1-2. The clear original view after perspective correction is sent to the length calculation unit and the width calculation unit respectively. The continuous single-pixel skeleton of the crack and the maximum inscribed circle of the solid mask are extracted in parallel. Combined with the absolute physical scale, the maximum total length and maximum width of the crack are calculated respectively.
[0010] Furthermore, the process of calculating the local three-dimensional space normal vector of the sub-mesh and flattening it to the same two-dimensional reference plane and then stitching it together in step two is specifically performed according to the following steps: Step 2.1: Separate the color channels of the input reference grid binocular image, use the difference between the maximum value of the color channel set by the structured light and the other background color channels to strip the structured light signal, and extract the set of intersection corner points of the structured light grid in the whole image; Step 2.2: Combine the disparity map obtained by the SGBM algorithm with the camera intrinsic parameters to transform the two-dimensional corner point set into a three-dimensional depth coordinate set; Step 2.3: Connect adjacent corner points topologically to construct several locally independent small quadrilateral sub-mesh, and use the three-dimensional depth coordinates corresponding to the vertices of each sub-mesh to solve the local normal vector of each small quadrilateral sub-mesh in three-dimensional space through cross product operation or plane fitting. Step 2.4: Set a globally unified two-dimensional reference plane, calculate the rotation and translation matrices of the local normal vector of each sub-mesh to the normal vector of the reference plane, and thus derive the local perspective transformation matrix of each sub-mesh. Step 2.5: Using the calculated local perspective transformation matrices, unfold and map the corresponding image sub-grid surfaces in the clear original image onto the two-dimensional reference plane, and perform image fusion and seamless stitching on the boundaries of adjacent surfaces to finally synthesize the physical planar view that eliminates oblique distortion and the influence of various surface shapes.
[0011] Furthermore, the length calculation unit in step four performs length calculation according to the following steps: Step 4.1: Use adaptive thresholding combined with large-scale morphological closing operation to obtain the main body of the crack mask with complete connectivity. Use cross-shaped structural elements to iteratively erode and extract the original skeleton with a single pixel width. Then, perform terminal node filtering on the original skeleton to trim false forks. Step 4.2: Use a polygon approximation algorithm to convert the trimmed skeleton pixel mesh lines into smooth vector polyline polygons; Step 4.3: Extract the planar pixel coordinates of the first and last ends of each line segment of the vector polygon, calculate the pixel-level horizontal and vertical offsets, divide them by the absolute physical scale to convert them into physical offsets, integrate and accumulate them segment by segment according to the two-dimensional Euclidean distance formula, and the sum is the maximum total length of the crack.
[0012] Furthermore, the width calculation unit in step four performs width calculation according to the following steps: Step 4.4: Perform boundary mirroring and anti-edge snapping processing on the image region, and use adaptive edge thresholding to extract the entity mask that fits the real boundary of the crack; Step 4.5: Perform L2 Euclidean distance transformation on the entity mask, and globally search for the maximum peak point in the distance transformation matrix. The coordinate position of the peak point is determined as the center of the inscribed circle of the maximum width of the crack, and the corresponding pixel peak is the pixel radius of the inscribed circle. Step 4.6: Extract the pixel radius of the inscribed circle and multiply it by two to obtain the pixel-level maximum diameter. Divide the pixel-level maximum diameter by the absolute physical scale to directly calculate the maximum width of the crack.
[0013] Furthermore, after step four is completed, the continuous single-pixel skeleton extracted by the length calculation unit and the maximum inscribed circle located by the width calculation unit are simultaneously visualized and overlaid onto the extracted crack mask image.
[0014] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the integrated crack measurement method based on structured light grid segmented perspective correction and binocular vision.
[0015] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the integrated crack measurement method based on structured light grid segmented perspective correction and binocular vision.
[0016] The beneficial effects of this invention are: 1. This invention features highly integrated hardware and automated timing. Compared to the light spot occlusion problem caused by the continuous emission of light from traditional 3D scanners, the system utilizes an embedded control motherboard combined with a relay module to achieve precise timing synchronization between mesh projection and image acquisition. The system employs a time-division acquisition mechanism, acquiring a spatial perspective reference when the mesh is lit and a pure original image of the crack without any structured light spot interference when the mesh is off. This completely solves the industry problem of structured light interfering with the real texture of defects from a hardware physical perspective.
[0017] 2. This invention possesses robust distortion correction and adaptability to complex surface shapes. The solution process abandons traditional global homography mapping and proposes an SGBM-based algorithm to obtain disparity and calculate the 3D depth coordinates of corner points. By constructing local sub-mesh and solving for the local spatial normal vectors of each sub-mesh, it achieves segmented perspective flattening and seamless stitching of the original image. This mechanism perfectly avoids noise interference from complex concrete backgrounds, achieving not only high-precision distortion correction without manual intervention but also compensating for geometric errors caused by various surface shapes.
[0018] 3. This invention features high-precision, lightweight solution and automatic feature extraction capabilities. The system eliminates the computational redundancy of generating massive, dense point clouds using traditional 3D scanners, pioneering a dual-parallel solution architecture with "physical isolation of length and width." After acquiring a physical planar view free from surface influences, the algorithm automatically identifies and extracts entity masks and native skeletons that conform to the true boundaries of cracks using adaptive thresholds. Subsequently, the length calculation unit integrates piecewise using two-dimensional Euclidean distance combined with an absolute physical scale, while the width calculation unit globally searches for L2 distance transformation peaks to locate the maximum inscribed circle and converts it using this scale. This achieves precise quantization of three-dimensional physical dimensions with extremely low computational overhead, greatly improving the system's portability and real-time performance. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the integrated box structure of the integrated crack measurement system of the present invention; Figure 2 This is a top view of the internal spatial layout of the integrated crack measurement system of the present invention; Figure 3 This is a hardware control and connection block diagram of the system of the present invention; Figure 4 This is the main flowchart of the structured light grid segmented perspective correction and binocular vision measurement method of the present invention; Figure 5 This is a schematic diagram illustrating the principle of sub-grid segmented perspective flattening and seamless splicing in this invention; Figure 6 This is a schematic diagram of the physical isolation dual parallel solution architecture and size calculation principle of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] This invention proposes an integrated crack measurement system and method based on structured light mesh segmented perspective correction and binocular vision. The system controls the time-division sequential projection of the structured light mesh through an embedded motherboard, combines sub-mesh segmented perspective flattening correction to eliminate oblique image distortion and the influence of various surface shapes, and constructs a physically isolated dual-parallel solution architecture in three-dimensional space to automatically extract the true entity mask of the crack, achieving high-precision measurement of the true crack size. This invention can be used for long-term automated monitoring and assessment of surface cracks in large engineering structures such as bridges, tunnels, and dams.
[0023] Specifically, in combination Figures 1-6 This invention proposes an integrated crack measurement system based on structured light grid segmented perspective correction and binocular vision. The system includes an integrated housing 1-1, and the following components disposed inside the integrated housing 1-1: an embedded control motherboard 1-2, a binocular camera group 1-3, a ranging module 1-4, a structured light grid transmitter 1-5, and a relay module 1-6. In other embodiments, the components may also be installed separately or mounted on other mobile platforms.
[0024] The binocular camera group 1-3 and the ranging module 1-4 are both directly connected to the embedded control motherboard 1-2; the structured light grid transmitter 1-5 is used to project a structured light grid onto the surface being measured; the relay module 1-6 is connected to the embedded control motherboard 1-2 and the structured light grid transmitter 1-5, and the embedded control motherboard 1-2 controls the power supply of the structured light grid transmitter 1-5; in specific implementation, the structured light grid transmitter only requires a basic two-wire power supply (red wire and black wire). This system connects its positive power line (red wire) to the normally open contact of the relay module, and the high and low levels output by the GPIO pin of the motherboard directly control the closing and opening of the physical circuit, thereby realizing low-latency hard trigger time-division multiplexing.
[0025] The embedded control motherboard 1-2 is configured to perform the following measurement process to obtain the physical dimensions of the crack: 1) Image capture control: control the switching of relay modules 1-6, drive the structured light grid emitters 1-5 to turn on and off in a time-division manner, and use binocular camera group 1-3 to simultaneously acquire binocular images of the reference grid and clear original appearance of the structured light; 2) Depth perception calculation: perform binocular parallax calculation based on the reference grid image, identify and extract each corner point on the structured light grid, and directly deduce the three-dimensional depth coordinates of each corner point; 3) Sub-grid segmentation, flattening and stitching: connect adjacent corner points to extract each sub-grid, and combine the calculated... 4) Scale conversion derivation: Using the three-dimensional depth coordinates of the grid in the center of the image and the mapping relationship during the flattening process, the absolute physical scale of how many "real millimeters" a "pixel" represents in this tiled image is derived; 5) Parallel length and width quantization: On this tiled image, the continuous single-pixel skeleton and the maximum inscribed circle of the crack are extracted at the same time, and combined with the scale just calculated, the maximum total length and maximum width of the crack are finally calculated.
[0026] Furthermore, the embedded control motherboard 1-2 controls the illumination state of the structured light grid transmitter 1-5 by sending high and low level signals to the relay module 1-6, so that the binocular camera group 1-3 captures a reference grid binocular image superimposed with the structured light grid when the structured light grid transmitter 1-5 is lit, and captures a clear original binocular image without structured light interference when it is turned off.
[0027] Furthermore, when the embedded control motherboard 1-2 performs the calculation of three-dimensional depth coordinates and the derivation of the absolute physical scale, it is specifically configured according to the following logic: 1) Visual ranging logic: Extract the high confidence parallax of the global structured light intersection point in the binocular image of the reference grid, remove mismatch noise generated by periodic textures through median filtering, and calculate the three-dimensional depth coordinates of the visual corner points of each sub-grid by combining the binocular physical baseline and the focal length after epipolar correction; 2) Virtual scale mapping logic: Construct an initial virtual reference line segment in the mathematical calculation space, use the local perspective flattening mapping relationship of the central sub-grid to map the line segment to the correction reference plane and calculate its pixel length; combine the actual physical length of the line segment derived from the three-dimensional depth coordinates of the central sub-grid to calculate the absolute physical scale of the pixels in the perspective-corrected image and the actual physical millimeters; 3) Clear imaging monitoring logic: The ranging data acquired in real time by the ranging module 1-4 is independent of the subsequent size calculation process and is only used to determine whether the measured surface is within the clear imaging range of the binocular camera group 1-3 to ensure the quality of the acquired image.
[0028] This invention also proposes an integrated crack measurement method based on structured light mesh segmented perspective correction and binocular vision, the method comprising: Step 1: Distance Measurement Monitoring and Automated Time-Sequence Image Acquisition: Drive the distance measurement module 1-4 to acquire distance measurement data of the measured surface and determine whether the measured surface is within the clear imaging range of the binocular camera group 1-3; after confirming that the clear imaging conditions are met, use the embedded control motherboard 1-2 to control the relay module 1-6 to close and illuminate the structured light grid transmitter 1-5, triggering the binocular camera group 1-3 to capture a reference grid binocular image; then control the relay module 1-6 to open, triggering the binocular camera group 1-3 to capture an interference-free, clear, original binocular image in situ; Step 2: Parallax Physical Distance Calculation and Segmented Perspective Flattening Correction for Various Surface Shapes: A semi-global block matching (SGBM) algorithm is executed on the reference grid binocular image to extract the corner points of each sub-grid of the structured light grid in the reference grid binocular image. The three-dimensional depth coordinates of each corner point are calculated using the effective parallax. The local three-dimensional space normal vector of each sub-grid is calculated by combining the three-dimensional depth coordinates of each corner point. The normal vector transformation is used to flatten each sub-grid region in the clear original image to the same two-dimensional reference plane and then stitch them together to obtain a physical plane view that eliminates oblique image distortion and the influence of various surface shapes. Step 3: Derivation of dynamic scale: Based on the three-dimensional depth coordinates of the central sub-grid calculated in Step 2, and combined with the local perspective flattening mapping relationship of the central sub-grid, the absolute physical scale of the physical plan view is derived through the comparison of virtual line segment mapping in mathematical space. Step 4: Parallel calculation of length and width with physical isolation: Two independent computing memory areas are opened in the data processing system of the embedded control motherboard 1-2. The clear original view after perspective correction is sent to the length calculation unit and the width calculation unit respectively. The continuous single-pixel skeleton of the crack and the maximum inscribed circle of the solid mask are extracted in parallel. Combined with the absolute physical scale, the maximum total length and maximum width of the crack are calculated respectively.
[0029] Furthermore, the process of calculating the local three-dimensional space normal vector of the sub-mesh and flattening it to the same two-dimensional reference plane and then stitching it together in step two is specifically performed according to the following steps: Step 2.1: Separate the color channels of the input reference grid binocular image, use the difference between the maximum value of the color channel set by the structured light and the other background color channels to strip the structured light signal, and extract the set of intersection corner points of the structured light grid in the whole image; Step 2.2: Combine the disparity map obtained by the SGBM algorithm with the camera intrinsic parameters to transform the two-dimensional corner point set into a three-dimensional depth coordinate set; Step 2.3: Connect adjacent corner points topologically to construct several locally independent small quadrilateral sub-mesh, and use the three-dimensional depth coordinates corresponding to the vertices of each sub-mesh to solve the local normal vector of each small quadrilateral sub-mesh in three-dimensional space through cross product operation or plane fitting. Step 2.4: Set a globally unified two-dimensional reference plane, calculate the rotation and translation matrices of the local normal vector of each sub-mesh to the normal vector of the reference plane, and thus derive the local perspective transformation matrix of each sub-mesh. Step 2.5: Using the calculated local perspective transformation matrices, unfold and map the corresponding image sub-grid surfaces in the clear original image onto the two-dimensional reference plane, and perform image fusion and seamless stitching on the boundaries of adjacent surfaces to finally synthesize the physical planar view that eliminates oblique distortion and the influence of various surface shapes.
[0030] Furthermore, the length calculation unit in step four performs length calculation according to the following steps: Step 4.1: Use adaptive thresholding combined with large-scale morphological closing operation to obtain the main body of the crack mask with complete connectivity. Use cross-shaped structural elements to iteratively erode and extract the original skeleton with a single pixel width. Then, perform terminal node filtering on the original skeleton to trim false forks. Step 4.2: Use a polygon approximation algorithm to convert the trimmed skeleton pixel mesh lines into smooth vector polyline polygons; Step 4.3: Extract the planar pixel coordinates of the first and last ends of each line segment of the vector polygon, calculate the pixel-level horizontal and vertical offsets, divide them by the absolute physical scale to convert them into physical offsets, integrate and accumulate them segment by segment according to the two-dimensional Euclidean distance formula, and the sum is the maximum total length of the crack.
[0031] Furthermore, the width calculation unit in step four performs width calculation according to the following steps: Step 4.4: Perform boundary mirroring and anti-edge snapping processing on the image region, and use adaptive edge thresholding to extract the entity mask that fits the real boundary of the crack; Step 4.5: Perform L2 Euclidean distance transformation on the entity mask, and globally search for the maximum peak point in the distance transformation matrix. The coordinate position of the peak point is determined as the center of the inscribed circle of the maximum width of the crack, and the corresponding pixel peak is the pixel radius of the inscribed circle. Step 4.6: Extract the pixel radius of the inscribed circle and multiply it by two to obtain the pixel-level maximum diameter. Divide the pixel-level maximum diameter by the absolute physical scale to directly calculate the maximum width of the crack.
[0032] Furthermore, after step four is completed, the continuous single-pixel skeleton extracted by the length calculation unit and the maximum inscribed circle located by the width calculation unit are simultaneously visualized and overlaid onto the extracted crack mask image.
[0033] This invention proposes an integrated crack measurement system and method based on structured light mesh segmented perspective correction and binocular vision. Addressing issues such as image distortion caused by oblique camera shooting, various surface shapes, and the over-reliance of traditional visual measurement on physical ranging hardware for computation, this invention proposes an embedded control motherboard driving relays to control the illumination and extinguishing of the structured light mesh in a time-division manner, simultaneously acquiring a reference mesh and a clear binocular image of the original crack. The ranging module is only used for pre-monitoring before clear imaging. At the calculation end, the 3D depth coordinates of the mesh corner points are obtained based on the SGBM algorithm, and the local normal vectors of the sub-mesh are solved. The original image is segmented, perspective-flattened, and seamlessly stitched together to eliminate global distortion. Simultaneously, the absolute physical scale is dynamically derived using the central mesh spatial mapping, and algorithms such as adaptive thresholding are used to automatically extract the connected and complete mask region of the real crack. Finally, a dual-parallel architecture with physical separation of length and width is constructed to extract the continuous crack skeleton and the maximum inscribed circle of the solid mask, respectively, and the actual length and width dimensions of the crack are accurately quantified by combining the scale. This invention decouples physical ranging from dimension calculation, achieving a non-contact, high-precision intelligent measurement closed loop adaptable to complex curved surfaces.
[0034] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the integrated crack measurement method based on structured light grid segmented perspective correction and binocular vision.
[0035] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the integrated crack measurement method based on structured light grid segmented perspective correction and binocular vision.
[0036] The memory in this application embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the methods described in this invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0037] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0038] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0039] It should be noted that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or as a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above methods.
[0040] The above provides a detailed description of the integrated crack measurement system and method based on structured light grid segmented perspective correction and binocular vision proposed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. An integrated crack measurement system based on structured light mesh segmented perspective correction and binocular vision, characterized in that, The system includes an integrated enclosure (1-1), and the following components disposed inside the integrated enclosure (1-1): an embedded control motherboard (1-2), a binocular camera group (1-3), a ranging module (1-4), a structured light grid transmitter (1-5), and a relay module (1-6). The binocular camera group (1-3) and the ranging module (1-4) are both directly connected to the embedded control motherboard (1-2); the structured light grid emitter (1-5) is used to project a structured light grid onto the surface being measured; the relay module (1-6) is connected to the embedded control motherboard (1-2) and the structured light grid emitter (1-5), and the embedded control motherboard (1-2) controls the power supply of the structured light grid emitter (1-5); The embedded control motherboard (1-2) is configured to perform the following measurement process to obtain the physical dimensions of the crack: 1) Image capture control: control the switch of the relay module (1-6), drive the structured light grid emitter (1-5) to turn on and off in a time-division manner, and use the binocular camera group (1-3) to simultaneously acquire the reference grid binocular image and the clear original binocular image of the superimposed structured light; 2) Depth perception calculation: perform binocular parallax calculation based on the reference grid image, identify and extract each corner point on the structured light grid, and directly deduce the three-dimensional depth coordinates of each corner point; 3) Sub-grid segmentation, flattening and stitching: connect adjacent corner points to extract each sub-grid. Combine the calculated 3D depth coordinates to obtain their respective normal vectors, flatten these small grids onto the same 2D reference plane and stitch them together to obtain a physical planar view that eliminates oblique shooting distortion and the influence of various surface shapes; 4) Scale conversion derivation: using the 3D depth coordinates of the grid in the center of the image and the mapping relationship during the flattening process, derive the absolute physical scale of how many "real millimeters" each "pixel" in this tiled image represents; 5) Parallel length and width quantization: on this tiled image, simultaneously extract the continuous single-pixel skeleton and the maximum inscribed circle of the crack, and then combine it with the scale just calculated to finally determine the maximum total length and maximum width of the crack.
2. The system according to claim 1, characterized in that, The embedded control motherboard (1-2) controls the light emission state of the structured light grid transmitter (1-5) by sending high and low level signals to the relay module (1-6), so that the binocular camera group (1-3) captures a reference grid binocular image superimposed with the structured light grid when the structured light grid transmitter (1-5) is lit, and captures a clear original binocular image without structured light interference when it is turned off.
3. The system according to claim 1, characterized in that, When the embedded control motherboard (1-2) performs the calculation of three-dimensional depth coordinates and the derivation of the absolute physical scale, it is configured according to the following logic: 1) Visual ranging logic: Extract the high confidence parallax of the global structured light intersection point in the binocular image of the reference grid, remove mismatch noise generated by periodic textures through median filtering, and calculate the three-dimensional depth coordinates of the visual corner points of each sub-grid by combining the binocular physical baseline and the focal length after epipolar correction; 2) Virtual scale mapping logic: Construct an initial virtual reference line segment in the mathematical calculation space, use the local perspective flattening mapping relationship of the central sub-grid to map the line segment to the correction reference plane and calculate its pixel length; Combine the actual physical length of the line segment derived from the three-dimensional depth coordinates of the central sub-grid, calculate the absolute physical scale of the pixels in the perspective-corrected image and the actual physical millimeter; 3) Clear imaging monitoring logic: The ranging data acquired in real time by the ranging module (1-4) is independent of the subsequent size calculation process and is only used to determine whether the measured surface is within the clear imaging range of the binocular camera group (1-3) to ensure the quality of the acquired image.
4. A method for measuring cracks based on structured light mesh segmented perspective correction and binocular vision, characterized in that, The method includes: Step 1: Distance Measurement Monitoring and Automated Time-Sequence Image Acquisition: Drive the distance measurement module (1-4) to acquire distance measurement data of the measured surface and determine whether the measured surface is within the clear imaging range of the binocular camera group (1-3); after confirming that the clear imaging conditions are met, use the embedded control motherboard (1-2) to control the relay module (1-6) to close and light up the structured light grid transmitter (1-5), triggering the binocular camera group (1-3) to capture a reference grid binocular image; then control the relay module (1-6) to open, triggering the binocular camera group (1-3) to capture an interference-free, clear, original binocular image in situ; Step 2: Parallax Physical Distance Calculation and Segmented Perspective Flattening Correction for Various Surface Shapes: A semi-global block matching (SGBM) algorithm is executed on the reference grid binocular image to extract the corner points of each sub-grid of the structured light grid in the reference grid binocular image. The three-dimensional depth coordinates of each corner point are calculated using the effective parallax. The local three-dimensional space normal vector of each sub-grid is calculated by combining the three-dimensional depth coordinates of each corner point. The normal vector transformation is used to flatten each sub-grid region in the clear original image to the same two-dimensional reference plane and then stitch them together to obtain a physical plane view that eliminates oblique image distortion and the influence of various surface shapes. Step 3: Derivation of dynamic scale: Based on the three-dimensional depth coordinates of the central sub-grid calculated in Step 2, and combined with the local perspective flattening mapping relationship of the central sub-grid, the absolute physical scale of the physical plan view is derived through the comparison of virtual line segment mapping in mathematical space. Step 4: Parallel calculation of length and width with physical isolation: In the data processing system of the embedded control motherboard (1-2), two independent computing memory areas are opened. The clear original view after perspective correction is sent to the length calculation unit and the width calculation unit respectively. The continuous single-pixel skeleton of the crack and the maximum inscribed circle of the solid mask are extracted in parallel. Combined with the absolute physical scale, the maximum total length and maximum width of the crack are calculated respectively.
5. The method according to claim 4, characterized in that, Step two, which involves calculating the local 3D space normal vectors of the sub-mesh and flattening the perspective to the same 2D reference plane and then stitching them together, is specifically performed according to the following steps: Step 2.1: Separate the color channels of the input reference grid binocular image, use the difference between the maximum value of the color channel set by the structured light and the other background color channels to strip the structured light signal, and extract the set of intersection corner points of the structured light grid in the whole image; Step 2.2: Combine the disparity map obtained by the SGBM algorithm with the camera intrinsic parameters to transform the two-dimensional corner point set into a three-dimensional depth coordinate set; Step 2.3: Connect adjacent corner points topologically to construct several locally independent small quadrilateral sub-mesh, and use the three-dimensional depth coordinates corresponding to the vertices of each sub-mesh to solve the local normal vector of each small quadrilateral sub-mesh in three-dimensional space through cross product operation or plane fitting. Step 2.4: Set a globally unified two-dimensional reference plane, calculate the rotation and translation matrices of the local normal vector of each sub-mesh to the normal vector of the reference plane, and thus derive the local perspective transformation matrix of each sub-mesh. Step 2.5: Using the calculated local perspective transformation matrices, unfold and map the corresponding image sub-grid surfaces in the clear original image onto the two-dimensional reference plane, and perform image fusion and seamless stitching on the boundaries of adjacent surfaces to finally synthesize the physical planar view that eliminates oblique distortion and the influence of various surface shapes.
6. The method according to claim 4, characterized in that, The length calculation unit in step four performs length calculations according to the following steps: Step 4.1: Use adaptive thresholding combined with large-scale morphological closing operation to obtain the main body of the crack mask with complete connectivity. Use cross-shaped structural elements to iteratively erode and extract the original skeleton with a single pixel width. Then, perform terminal node filtering on the original skeleton to trim false forks. Step 4.2: Use a polygon approximation algorithm to convert the trimmed skeleton pixel mesh lines into smooth vector polyline polygons; Step 4.3: Extract the planar pixel coordinates of the first and last ends of each line segment of the vector polygon, calculate the pixel-level horizontal and vertical offsets, divide them by the absolute physical scale to convert them into physical offsets, integrate and accumulate them segment by segment according to the two-dimensional Euclidean distance formula, and the sum is the maximum total length of the crack.
7. The method according to claim 4, characterized in that, The width calculation unit in step four performs width calculation according to the following steps: Step 4.4: Perform boundary mirroring and anti-edge snapping processing on the image region, and use adaptive edge thresholding to extract the entity mask that fits the real boundary of the crack; Step 4.5: Perform L2 Euclidean distance transformation on the entity mask, and globally search for the maximum peak point in the distance transformation matrix. The coordinate position of the peak point is determined as the center of the inscribed circle of the maximum width of the crack, and the corresponding pixel peak is the pixel radius of the inscribed circle. Step 4.6: Extract the pixel radius of the inscribed circle and multiply it by two to obtain the pixel-level maximum diameter. Divide the pixel-level maximum diameter by the absolute physical scale to directly calculate the maximum width of the crack.
8. The method according to claim 4, characterized in that, After step four is completed, the continuous single-pixel skeleton extracted by the length calculation unit and the maximum inscribed circle located by the width calculation unit are simultaneously visualized and overlaid onto the extracted crack mask image.
9. An electronic 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 4-8.
10. A computer-readable storage medium for storing computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 4-8.