Distance-based crack merging method, device, electronic device, and storage medium
By obtaining the coordinate and attribute information of the crack, establishing vector lines and judging the merge conditions, the problem of cracks being split after multiple shots is solved, and efficient and accurate crack merging and three-dimensional display are achieved.
Patent Information
- Application Number
- CN202210621278.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In the prior art, the fine cracks of the concrete structure are split into short cracks after multiple shots, resulting in difficulty in merging the cracks and being difficult to accurately display in three-dimensional scenes.
By obtaining the coordinate information and attribute information of the crack, a vector line is established, and the distance between the vector elements meets the merge condition, and the cracks are merged according to the merge condition, and a distance-based crack merging method is adopted.
It improves the accuracy and data processing efficiency of crack merging, facilitates the display of cracks in three-dimensional scenarios, and improves the efficiency and accuracy of crack merging.
Smart Images

Figure CN115018747B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building defect detection, and in particular to a distance-based crack merging method, device, electronic equipment and storage medium. Background Art
[0002] In concrete structures, concrete cracks cannot be ignored. When cracks appear in concrete structures, their bearing capacity, waterproof performance and durability will be reduced.
[0003] Cracks on concrete surfaces are typically elongated and narrow. While typically less than 1 millimeter wide, cracks can range in length from a few centimeters to several meters, sometimes reaching tens of meters. The permitted crack width in China and abroad is only submillimeter. Therefore, when inspecting large concrete buildings for crack defects, to capture these minute cracks, current camera resolution often requires close-up photography using a long-focal-length lens. However, this "seeing the whole picture through a tube" approach presents a problem: the image size is small, and a single image often cannot capture a complete crack. Consequently, multiple images of a single crack are necessary. However, this approach fragments the crack into smaller segments, leading to the need for crack merging. Summary of the Invention
[0004] The purpose of the present invention is to overcome the above technical deficiencies and provide a distance-based crack merging method, device, electronic device and storage medium to solve the technical problem in the prior art that cracks are split into short cracks in multiple shots and crack merging is difficult.
[0005] To achieve the above technical objectives, in a first aspect, the technical solution of the present invention provides a distance-based crack merging method, comprising the following steps:
[0006] Obtaining coordinate information and attribute information of the first crack and the second crack;
[0007] Establishing a first vector line according to the coordinate information and attribute information of the first crack, and establishing a second vector line according to the coordinate information and attribute information of the second crack;
[0008] Determining whether a vector element of the first vector line and a vector element of the second vector line satisfy a distance merging condition;
[0009] If the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition, the first crack and the second crack are merged.
[0010] Compared with the prior art, the present invention has the following beneficial effects:
[0011] The distance-based crack merging method provided by the present invention regards the crack data as a complete vector line, considers the crack data as a collection of a series of vector pixels, and defines the vector lines belonging to the same crack as the vector pixels of the crack. Vector pixels can be understood as a vector line belonging to the same crack object. Just like pixel upsampling, vector pixels can be evenly or unevenly split into more and shorter vector pixels; just like pixel downsampling, vector pixels can be evenly or unevenly combined into fewer and longer vector pixels. In addition, in addition to carrying the location information of the crack, vector pixels can also be attached with attributes like vector lines. First, the coordinate information and attribute information of the two cracks are obtained, and then a vector line is established based on the coordinate information and attribute information of the cracks. The distance between the vector pixels of the vector line is used to determine whether the cracks meet the merging conditions. When the cracks meet the merging conditions, the two cracks are merged.
[0012] The present invention can effectively merge cracks that are photographed multiple times, and can merge multiple short cracks belonging to the same crack. Compared with the conventional method of manually determining whether cracks can be merged, the present invention greatly improves data processing efficiency and the accuracy of crack merging. It is also convenient for displaying cracks in a three-dimensional scene, and has very good promotion and utilization value.
[0013] According to some embodiments of the present invention, determining whether a vector element of the first vector line and a vector element of the second vector line satisfy a distance merging condition comprises the steps of:
[0014] Calculating a minimum distance between a vector element of the first vector line and a vector element of the second vector line;
[0015] It is determined whether the minimum distance is less than a distance threshold.
[0016] According to some embodiments of the present invention, merging the first crack and the second crack comprises the steps of:
[0017] According to a minimum distance between a vector element of the first vector line and a vector element of the second vector line, the first vector line is divided into a retained segment and an eliminated segment, and the second vector line is divided into a retained segment and an eliminated segment;
[0018] merging the eliminated segment of the first vector line and the eliminated segment of the second vector line to obtain a merged segment;
[0019] A merged crack of the first crack and the second crack is obtained according to the retained segment of the first vector line, the retained segment and the merged segment of the second vector line.
[0020] According to some embodiments of the present invention, calculating the minimum distance between the first vector line's vector pixels and the second vector line's vector pixels comprises the steps of:
[0021] Calculating the distance between a point of a vector pixel of the first vector line and a line segment of a vector pixel of the second vector line;
[0022] When the point is between the line segments, the distance between the projection of the point on the line segment and the point is selected as the minimum distance;
[0023] When the point is outside the line segment, the distance between the point and the closest endpoint on the line segment is selected as the minimum distance.
[0024] According to some embodiments of the present invention, before determining whether the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition, the steps include:
[0025] Establishing a point-line distance matrix between the first vector line and the second vector line;
[0026] Vector elements that meet the distance merging condition are screened out in the point-line distance matrix.
[0027] According to some embodiments of the present invention, the attribute information of the first crack and the second crack includes: crack length information and crack width information.
[0028] According to some embodiments of the present invention, merging the first crack and the second crack comprises the steps of:
[0029] Step S1, extracting a vector element from the first vector line as a merged set, and deleting the extracted vector element from the first vector line;
[0030] Step S2: extracting a vector element from the second vector line and merging it into the merged set. If the vector element extracted from the second vector line does not meet the merging condition, directly adding the vector element extracted from the second vector line to the merged set and deleting the extracted vector element from the second vector line.
[0031] Step S3, repeating step S2 until the second vector line is an empty set;
[0032] Step S4: extracting a vector element from the first vector line and merging it into the merged set. If the vector element extracted from the first vector line does not meet the merging condition, directly adding the vector element extracted from the first vector line to the merged set and deleting the extracted vector element from the first vector line.
[0033] Step S5, repeating step S4 until the first vector line is an empty set, and the merged set is a merged crack of the first crack and the second crack.
[0034] In a second aspect, the technical solution of the present invention provides a distance-based crack merging device, comprising:
[0035] a crack information acquisition unit, configured to acquire coordinate information and attribute information of the first crack and the second crack;
[0036] a vector line establishing unit, configured to establish a first vector line according to the coordinate information and attribute information of the first crack, and to establish a second vector line according to the coordinate information and attribute information of the second crack;
[0037] a merging condition judging unit, configured to judge whether a vector element of the first vector line and a vector element of the second vector line satisfy a distance merging condition;
[0038] The crack merging unit merges the first crack and the second crack if a vector element of the first vector line and a vector element of the second vector line meet a distance merging condition.
[0039] In a third aspect, the technical solution of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored on the memory and runnable on the processor, wherein when the processor executes the computer program, the distance-based crack merging method as described in any one of the first aspects is implemented.
[0040] In a fourth aspect, the technical solution of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the distance-based crack merging method as described in any one of the first aspects.
[0041] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, wherein the abstract drawing is identical to one of the drawings in the specification:
[0043] Figure 1 A flow chart of a distance-based crack merging method provided by one embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a method for calculating the distance from a point to a line segment provided in another embodiment of the present invention;
[0045] Figure 3 A flow chart of a distance-based crack merging method provided in another embodiment of the present invention;
[0046] Figure 4 A point-line distance matrix diagram of a distance-based crack merging method provided by another embodiment of the present invention;
[0047] Figure 5 A flow chart of a distance-based crack merging method provided in another embodiment of the present invention;
[0048] Figure 6 This is a block diagram of an electronic device used to implement an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0050] It should be noted that although the system diagrams illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the system or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0051] The present invention provides a distance-based crack merging method, which can effectively merge cracks photographed multiple times and can merge multiple short cracks belonging to the same crack. Compared with the conventional method of manually determining whether cracks can be merged, the present invention greatly improves data processing efficiency and the accuracy of crack merging, and is also convenient for displaying cracks in three-dimensional scenes, and has very good promotion and utilization value.
[0052] The embodiments of the present invention are further described below with reference to the accompanying drawings.
[0053] Reference Figure 1 and Figure 2 , Figure 1 is a flow chart of a distance-based crack merging method according to an embodiment of the present invention; Figure 2 A schematic diagram of a method for calculating the distance from a point to a line segment provided in another embodiment of the present invention; the distance-based crack merging method includes but is not limited to the following steps:
[0054] Step S110, obtaining coordinate information and attribute information of the first crack and the second crack;
[0055] Step S120, establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack;
[0056] Step S130, determining whether the vector element of the first vector line and the vector element of the second vector line meet a distance merging condition;
[0057] Step S140 : If the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition, the first crack and the second crack are merged.
[0058] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0059] The distance-based crack merging method treats crack data as a complete vector line and a collection of vector pixels. Vector lines belonging to the same crack are defined as the vector pixels of that crack. A vector pixel can be understood as a vector line belonging to the same crack object. Similar to pixel upsampling, vector pixels can be evenly or unevenly split into more and shorter vector pixels; similar to pixel downsampling, vector pixels can be evenly or unevenly combined into fewer and longer vector pixels. Furthermore, in addition to carrying crack location information, vector pixels, like vector lines, can also have attributes attached. First, the coordinate and attribute information of the two cracks is obtained. A vector line is then created based on this information. The distance between the vector pixels of the vector line determines whether the cracks meet the merging criteria. If the conditions are met, the two cracks are merged.
[0060] The present invention can effectively merge cracks captured multiple times, and can merge multiple short cracks belonging to the same crack. Compared with the conventional method of manually determining whether cracks can be merged, the present invention greatly improves data processing efficiency and improves the accuracy of crack merging.
[0061] Crack C i It can be expressed as C i {a1,a2,…,a j}. Among them, a k It represents the kth vector element, which contains the coordinate information crd of the vector element k And a series of properties of this crack k (e.g. length, width attributes), a k It can be recorded as a k {s k ,crd k}.
[0062] Based on the above definition, the problem of how to merge cracks is transformed into the problem of how to merge two sets of vector pixels. When two vector pixels in a crack reach the merging distance condition, they can be merged. The distance between vector pixel a1 and vector pixel a2 is dist 12 , is the minimum distance from any point in a1 to any line segment in a2, or the minimum distance from any point in a2 to any line segment in a1.
[0063] Take the distance from point A to line segment BC as an example. The perpendicular plane (infinite) to BC through B is called plane B, and the perpendicular plane (infinite) to BC through C is called plane C. When A is between plane B and plane C, Calculate the projection point A of A on BC p , AA p That is the distance from A to BC; when A is on the side of B plane away from C ( and ), AB is the distance from A to BC; when A is on the side of plane C away from B ( and ), AC is the distance from A to BC.
[0064] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0065] Determining whether the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition includes the steps of: calculating the minimum distance between the vector element of the first vector line and the vector element of the second vector line; and determining whether the minimum distance is less than a distance threshold.
[0066] Reference Figure 3 , Figure 3 A flow chart of a distance-based crack merging method provided in another embodiment of the present invention; the distance-based crack merging method includes but is not limited to the following steps:
[0067] Step S210 , dividing the first vector line into a retaining segment and an eliminating segment, and dividing the second vector line into a retaining segment and an eliminating segment, according to the minimum distance between the vector elements of the first vector line and the vector elements of the second vector line;
[0068] Step S220, merging the eliminated segment of the first vector line and the eliminated segment of the second vector line to obtain a merged segment;
[0069] Step S230 , obtaining a merged crack of the first crack and the second crack according to the retained segment of the first vector line, the retained segment and the merged segment of the second vector line.
[0070] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0071] The first crack and the second crack are merged, comprising the steps of: dividing the first vector line into a retained segment and an eliminated segment, and dividing the second vector line into a retained segment and an eliminated segment according to a minimum distance between vector elements of the first vector line and vector elements of the second vector line; merging the eliminated segment of the first vector line and the eliminated segment of the first vector line to obtain a merged segment; and obtaining a merged crack of the first crack and the second crack according to the retained segment of the first vector line, the retained segment of the second vector line, and the merged segment.
[0072] It can be understood that the overlapping part between the two cracks to be merged can be set as an elimination segment, and the non-overlapping part between the two cracks to be merged can be set as a retained segment, and the merged crack of the first crack and the second crack is obtained according to the retained segment of the first vector line, the retained segment of the second vector line and the merged segment.
[0073] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0074] The first crack and the second crack are merged, comprising the steps of: dividing the first vector line into a retained segment and an eliminated segment, and dividing the second vector line into a retained segment and an eliminated segment according to a minimum distance between vector elements of the first vector line and vector elements of the second vector line; merging the eliminated segment of the first vector line and the eliminated segment of the first vector line to obtain a merged segment; and obtaining a merged crack of the first crack and the second crack according to the retained segment of the first vector line, the retained segment of the second vector line, and the merged segment.
[0075] Calculating the minimum distance between a vector element of a first vector line and a vector element of a second vector line includes the following steps: calculating the distance between a point of a vector element of the first vector line and a line segment of a vector element of the second vector line; when the point is between the line segments, selecting the distance between the projection of the point on the line segment to the point as the minimum distance; and when the point is outside the line segment, selecting the distance between the point and a close endpoint on the line segment as the minimum distance.
[0076] Reference Figure 4 , Figure 4 A point-line distance matrix diagram of a distance-based crack merging method provided in another embodiment of the present invention.
[0077] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0078] Before determining whether the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, the method includes the steps of: establishing a point-line distance matrix between the first vector line and the second vector line; and screening out the vector elements that meet the distance merging condition in the point-line distance matrix.
[0079] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0080] The attribute information of the first crack and the second crack includes: crack length information and crack width information.
[0081] Reference Figure 5 , Figure 5 A flow chart of a distance-based crack merging method provided in another embodiment of the present invention; the distance-based crack merging method includes but is not limited to the following steps:
[0082] Step S1, extracting a vector element from the first vector line as a merged set, and deleting the extracted vector element from the first vector line;
[0083] Step S2: extract a vector element from the second vector line and merge it into the merged set. If the vector element extracted from the second vector line does not meet the merge condition, directly add the vector element extracted from the second vector line to the merged set and delete the extracted vector element from the second vector line.
[0084] Step S3, repeating step S2 until the second vector line is an empty set;
[0085] Step S4, extracting a vector element from the first vector line and merging it into the merged set. If the vector element extracted from the first vector line does not meet the merging condition, directly add the vector element extracted from the first vector line to the merged set and delete the extracted vector element from the first vector line.
[0086] Step S5, repeating step S4 until the first vector line is an empty set, and the merged set is the merged crack of the first crack and the second crack.
[0087] In one embodiment, a distance-based crack merging method includes the following steps: obtaining coordinate information and attribute information of a first crack and a second crack; establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack; determining whether the vector elements of the first vector line and the vector elements of the second vector line meet a distance merging condition; if the vector elements of the first vector line and the vector elements of the second vector line meet the distance merging condition, merging the first crack and the second crack.
[0088] Merging the first crack and the second crack includes the following steps:
[0089] Step S1, extracting a vector element from the first vector line as a merged set, and deleting the extracted vector element from the first vector line;
[0090] Step S2: extract a vector element from the second vector line and merge it into the merged set. If the vector element extracted from the second vector line does not meet the merge condition, directly add the vector element extracted from the second vector line to the merged set and delete the extracted vector element from the second vector line.
[0091] Step S3, repeating step S2 until the second vector line is an empty set;
[0092] Step S4, extracting a vector element from the first vector line and merging it into the merged set. If the vector element extracted from the first vector line does not meet the merging condition, directly add the vector element extracted from the first vector line to the merged set and delete the extracted vector element from the first vector line.
[0093] Step S5, repeating step S4 until the first vector line is an empty set, and the merged set is the merged crack of the first crack and the second crack.
[0094] The method for merging two three-dimensional cracks specifically includes the following steps (to merge the cracks C1{a1, a2, ..., a m},C2{b1,b2,…,b n} as an example):
[0095] 1. When the merging condition is met, merging begins. The merging condition of the crack is C1, and any two vector elements in C2 meet the merging condition.
[0096] 2. Extract a vector element a from C1 i , as C 合 .
[0097] 3. Extract a vector element b from C2 j , b j Merge into C 合 In. It is important to note that if b j with C 合 If any of the vector elements in b does not meet the vector element merging conditions, then b j Directly add to crack C 合 Remove b from C2 j .
[0098] 4. Return to step 3 until C2 is empty.
[0099] 5. C 合 As the new C2. Remove a from C1 i .
[0100] 6. Return to step 2 until C1 is empty.
[0101] 7. C2 is the final merge result.
[0102] The present invention also provides a distance-based crack merging device, comprising:
[0103] a crack information acquisition unit, configured to acquire coordinate information and attribute information of the first crack and the second crack;
[0104] A vector line establishing unit, configured to establish a first vector line according to the coordinate information and attribute information of the first crack, and to establish a second vector line according to the coordinate information and attribute information of the second crack;
[0105] a merging condition judging unit, configured to judge whether the vector element of the first vector line and the vector element of the second vector line satisfy a distance merging condition;
[0106] The crack merging unit merges the first crack and the second crack if the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition.
[0107] The present invention also provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the distance-based crack merging method described above is implemented.
[0108] Reference below Figure 6 , which shows a block diagram of an electronic device 900 suitable for implementing embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.
[0109] like Figure 6 As shown, the electronic device 900 may include a processing device 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The processing device 901 can be various general and / or special processing components with processing and computing capabilities. Some examples of the processing device 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processing device 901 performs the various methods and processes described above.
[0110] Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0111] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0112] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program comprising a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present invention are executed. Alternatively, in other embodiments, the processing device 901 can be configured to execute the method in any other appropriate manner (for example, by means of firmware).
[0113] The computer-readable medium described above in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0114] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0115] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0116] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0117] Obtaining coordinate information and attribute information of the first crack and the second crack;
[0118] Establishing a first vector line based on the coordinate information and attribute information of the first crack, and establishing a second vector line based on the coordinate information and attribute information of the second crack;
[0119] Determine whether the vector element of the first vector line and the vector element of the second vector line meet a distance merging condition;
[0120] If the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition, the first crack and the second crack are merged.
[0121] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0123] The modules involved in the embodiments of the present invention may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.
[0124] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0125] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), a computing system that includes middleware components (e.g., an application server), a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0129] A computer system may include a client and a server. The client and server are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services. The server may also be a server in a distributed system or a server integrated with blockchain.
[0130] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.
[0131] Cloud computing refers to a technology system that provides network access to elastically scalable shared pools of physical or virtual resources. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on-demand in a self-service manner. Cloud computing technology provides efficient and powerful data processing capabilities for the application of technologies such as artificial intelligence and blockchain, as well as for model training.
[0132] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution provided by the present invention can be achieved. This is not limited herein.
[0133] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A distance-based crack merging method, characterized in that: The following steps are involved: Obtaining coordinate information and attribute information of the first crack and the second crack; Establishing a first vector line according to the coordinate information and attribute information of the first crack, and establishing a second vector line according to the coordinate information and attribute information of the second crack; Determining whether a vector element of the first vector line and a vector element of the second vector line satisfy a distance merging condition; If the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition, merging the first crack and the second crack; The merging of the first crack and the second crack comprises the following steps: Step S1, extracting a vector element from the first vector line as a merged set, and deleting the extracted vector element from the first vector line; Step S2: extract a vector pixel from the second vector line. If the vector pixel extracted from the second vector line and any vector pixel in the merged set meet a distance merging condition, merge the first crack and the second crack. If the vector pixel extracted from the second vector line and any vector pixel in the merged set do not meet the merging condition, directly add the vector pixel extracted from the second vector line to the merged set and delete the extracted vector pixel from the second vector line. Step S3, repeating step S2 until the second vector line is an empty set; Step S4: extracting another vector element from the first vector line. If the vector element extracted again from the first vector line and any vector element in the merged set meet a distance merging condition, merging the first crack and the second crack. If the vector element extracted again from the first vector line and any vector element in the merged set do not meet the merging condition, directly adding the vector element extracted again from the first vector line to the merged set and deleting the vector element extracted again from the first vector line. Step S5, repeating step S4 until the first vector line is an empty set, and the merged set is the merged result of the first crack and the second crack.
2. A distance-based crack merging method according to claim 1, characterized in that: Determining whether the vector element of the first vector line and the vector element of the second vector line meet a distance merging condition includes the steps of: Calculating a minimum distance between a vector element of the first vector line and a vector element of the second vector line; It is determined whether the minimum distance is less than a distance threshold.
3. The distance-based crack merging method according to claim 1, characterized in that: Merging the first crack and the second crack comprises the steps of: According to a minimum distance between a vector element of the first vector line and a vector element of the second vector line, the first vector line is divided into a retained segment and an eliminated segment, and the second vector line is divided into a retained segment and an eliminated segment; the eliminated segment of the first vector line and the eliminated segment of the second vector line overlap with each other, the retained segment of the first vector line does not overlap with the second vector line, and the retained segment of the second vector line does not overlap with the first vector line; A merged crack of the first crack and the second crack is obtained according to the retained segment of the first vector line, the retained segment of the second vector line, and the eliminated segment of the first vector line and the eliminated segment of the second vector line.
4. The distance-based crack merging method according to claim 2, characterized in that: Calculating the minimum distance between the vector elements of the first vector line and the vector elements of the second vector line, comprising the steps of: Calculating the distance between a point of a vector pixel of the first vector line and a line segment of a vector pixel of the second vector line; When the point is between the line segments, the distance between the projection of the point on the line segment and the point is selected as the minimum distance; When the point is outside the line segment, the distance between the point and the closest endpoint on the line segment is selected as the minimum distance.
5. The distance-based crack merging method according to claim 1, characterized in that: Before determining whether the vector element of the first vector line and the vector element of the second vector line meet the distance merging condition, the method includes the following steps: Establishing a point-line distance matrix between the first vector line and the second vector line; Vector elements that meet the distance merging condition are screened out in the point-line distance matrix.
6. The distance-based crack merging method according to claim 1, characterized in that: The attribute information of the first crack and the second crack includes: crack length information and crack width information.
7. A distance-based crack merging device, characterized in that: include: a crack information acquisition unit, configured to acquire coordinate information and attribute information of the first crack and the second crack; a vector line establishing unit, configured to establish a first vector line according to the coordinate information and attribute information of the first crack, and to establish a second vector line according to the coordinate information and attribute information of the second crack; a merging condition judging unit, configured to judge whether a vector element of the first vector line and a vector element of the second vector line satisfy a distance merging condition; a crack merging unit, configured to merge the first crack and the second crack if a vector element of the first vector line and a vector element of the second vector line satisfy a distance merging condition; The crack merging unit is further configured to perform the following steps: Step S1, extracting a vector element from the first vector line as a merged set, and deleting the extracted vector element from the first vector line; Step S2: extract a vector pixel from the second vector line. If the vector pixel extracted from the second vector line and any vector pixel in the merged set meet a distance merging condition, merge the first crack and the second crack. If the vector pixel extracted from the second vector line and any vector pixel in the merged set do not meet the merging condition, directly add the vector pixel extracted from the second vector line to the merged set and delete the extracted vector pixel from the second vector line. Step S3, repeating step S2 until the second vector line is an empty set; Step S4: extracting another vector element from the first vector line. If the vector element extracted again from the first vector line and any vector element in the merged set meet a distance merging condition, merging the first crack and the second crack. If the vector element extracted again from the first vector line and any vector element in the merged set do not meet the merging condition, directly adding the vector element extracted again from the first vector line to the merged set and deleting the vector element extracted again from the first vector line. Step S5, repeating step S4 until the first vector line is an empty set, and the merged set is the merged result of the first crack and the second crack.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the distance-based crack merging method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the distance-based crack merging method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Crack evaluation apparatus, crack evaluation method, and crack evaluation program
US20220148150A1