Connection method and device of fracture contour line, equipment, medium and product
By identifying and connecting broken contour lines in visual task output, the incompleteness of target contours in the case of low contrast or high environmental interference is solved, and higher contour integrity is achieved.
Patent Information
- Application Number
- CN202411770990.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
AI Technical Summary
The target profile output by the visual task is incomplete in the case of low contrast or high environmental interference. It is usually disconnected into several sections of contour lines and needs to be connected for easy data processing.
By obtaining each contour line in the target detection result, a set of contour lines is generated, and each two contour line forms a contour line group to determine the angle difference between the two contour lines in each contour line group. If the angle difference meets the preset conditions, its absolute distance, relative distance and offset distance are determined, and the connection result of the profile line is determined based on these distances.
Effective connection of broken contour lines is achieved, the integrity of the target contour is improved, and the problem of low integrity of the target contour output by visual task is solved.
Smart Images

Figure CN119722724A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device, equipment, medium and product for connecting fracture contour lines. Background Art
[0002] In visual tasks such as target detection and target segmentation, it is often necessary to extract the target contour. However, when the contrast between the target and the environment is low, or there is a lot of interference in the target's environment, the target contour output by the visual task is not complete and is usually broken into several contour lines. In order to facilitate data processing, the broken contour lines need to be connected to form a complete target contour. Summary of the invention
[0003] The present invention provides a method, device, equipment, medium and product for connecting broken contour lines to solve the problem of low target contour integrity in visual task output. By identifying broken contour lines, the connection of collinear contour lines is achieved, which is beneficial to improving the integrity of the target contour.
[0004] According to one aspect of the present invention, a method for connecting fracture contours is provided, the method comprising:
[0005] Obtain each contour line in the target detection result, generate a contour line set, form a contour line group with every two contour lines in the contour line set, and determine the angle difference between the two contour lines in each contour line group;
[0006] If the angle difference between two contour lines in the contour line group meets the preset angle condition, then the absolute distance, relative distance and offset distance of the two contour lines in the contour line group are determined;
[0007] The connection result of each contour line is determined according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group.
[0008] According to another aspect of the present invention, there is provided a device for connecting a fracture contour line, the device comprising:
[0009] An angle difference determination module is used to obtain each contour line in the target detection result, generate a contour line set, form a contour line group with every two contour lines in the contour line set, and determine the angle difference between two contour lines in each contour line group;
[0010] A distance determination module, for determining an absolute distance, a relative distance and an offset distance between two contour lines in the contour line group if the angle difference between the two contour lines in the contour line group satisfies a preset angle condition;
[0011] The connection result determination module is used to determine the connection result of each contour line according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group.
[0012] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0013] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for connecting the fracture contour lines described in any embodiment of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for connecting fracture contours described in any embodiment of the present invention when executed.
[0015] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method for connecting fracture contours according to any embodiment of the present invention is implemented.
[0016] The technical solution of the embodiment of the present invention generates a contour set by acquiring each contour line in the target detection result, and forms a contour line group with every two contour lines in the contour line set, and determines the angle difference between the two contour lines in each contour line group; if the angle difference between the two contour lines in the contour line group meets the preset angle condition, then the absolute distance, relative distance and offset distance of the two contour lines in the contour line group are determined; according to the absolute distance, relative distance and translation distance of the two contour lines in each contour line group, the connection result of each contour line is determined. This technical solution solves the problem of low integrity of the target contour output by the visual task, and realizes the connection of the collinear contour lines by identifying the broken contour lines, which is conducive to improving the integrity of the target contour.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1A is a flow chart of a method for connecting fracture contour lines provided according to the first embodiment of the present invention;
[0020] Figure 1B is a schematic diagram of the angle difference between two contour lines provided according to the first embodiment of the present invention;
[0021] Figure 1C is a schematic diagram of the absolute distance between two contour lines provided according to the first embodiment of the present invention;
[0022] Figure 1D is a schematic diagram of the relative distance between two contour lines provided according to the first embodiment of the present invention;
[0023] Figure 1E is a schematic diagram of the offset distance between two contour lines provided according to the first embodiment of the present invention;
[0024] Figure 2 is a flow chart of a method for connecting fracture contour lines provided according to a second embodiment of the present invention;
[0025] Figure 3 is a structural schematic diagram of a connection device for a fracture contour line provided according to a third embodiment of the present invention;
[0026] Figure 4 It is a schematic structural diagram of an electronic device for implementing the method for connecting fracture contour lines according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0029] Embodiment 1
[0030] Figure 1A A flowchart of a method for connecting a broken contour line is provided for the first embodiment of the present invention. This embodiment is applicable to the correction scenario of target detection results, especially the case where the target contour is disconnected. The method can be performed by a device for connecting a broken contour line, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1A As shown, the method includes:
[0031] S110, obtaining each contour line in the target detection result, generating a contour line set, forming a contour line group with every two contour lines in the contour line set, and determining the angle difference between two contour lines in each contour line group.
[0032] This solution can be executed by electronic devices such as computers and servers. The electronic devices can obtain the target detection results output by the visual detection task, extract each contour line in the target detection results, and generate a contour line set. The electronic device can form a contour group with every two contour lines in the contour line set, and calculate the angle difference between the two contour lines in each contour group. Among them, the contour line can be a line segment used to characterize the boundary of the detection target, and the contour line can be a straight line segment or a curve segment. The angle difference between the two contour lines can be the angle between the fitted straight lines of the two contour lines.
[0033] In this solution, determining the angle difference between two contour lines in each contour line group includes:
[0034] If at least one of the two contour lines in the contour line group is a curve segment, a fitting straight line of the curve segment is determined, and the angle difference between the two contour lines in the contour line group is determined according to the fitting straight line of the curve segment.
[0035] It can be understood that if both contour lines in the contour group are straight line segments, the electronic device can directly obtain the angle difference between the two contour lines based on the slopes of the two contour lines. If at least one of the two contour lines in the contour group is a curve segment, the electronic device can fit the curve segment into a straight line, and use the fitted straight line of the curve segment to calculate the angle difference between the two contour lines in each contour group.
[0036] Figure 1B is a schematic diagram of the angle difference between two contour lines provided according to the first embodiment of the present invention, such as Figure 1B As shown, contour line a and contour line b are two contour lines in a contour group. Contour line a and contour line b are both curve segments, and their fitting straight lines are as follows: Figure 1B The angle α between the two fitting lines is the angle difference between the contour line a and the contour line b.
[0037] S120: If the angle difference between two contour lines in the contour line group meets a preset angle condition, determine the absolute distance, relative distance, and offset distance between the two contour lines in the contour line group.
[0038] The electronic device can pre-set an angle condition to evaluate whether the angle difference of two contour lines is "collinear". Specifically, the preset angle condition is that the angle difference of two contour lines in the contour line group is less than or equal to a preset angle threshold. If the angle difference of two contour lines in the contour line group meets the preset angle condition, it means that the two contour lines are "collinear", and the electronic device can calculate the absolute distance, relative distance and offset distance of the two contour lines in the contour line group. If the angle difference of two contour lines in the contour line group does not meet the preset angle condition, it means that the two contour lines are "not collinear" and the two contour lines cannot be connected.
[0039] Optionally, the absolute distance is the distance from the projection point of the first endpoint of the first contour line on the second contour line to the first endpoint of the second contour line; the first endpoint of the first contour line is the endpoint of the two endpoints of the first contour line that is closest to the second contour line; the first endpoint of the second contour line is the endpoint of the two endpoints of the second contour line that is closest to the first contour line; the relative distance is the ratio of the absolute distance to the length of the second contour line; and the translation distance is the distance from the second endpoint of the first contour line to the first contour line.
[0040] It should be noted that if the contour line is a straight line segment, the contour line length is the length of the straight line segment; if the contour line is a curve segment, the contour line length is the straight-line distance between the mapping points of the endpoints of the curve segment on its fitting straight line. Figure 1C is a schematic diagram of the absolute distance between two contour lines provided according to the first embodiment of the present invention, Figure 1D is a schematic diagram of the relative distance between two contour lines provided according to the first embodiment of the present invention, Figure 1E Schematic diagram of the offset distance between two contour lines provided according to the first embodiment of the present invention. Figure 1C As shown, contour line b is the first contour line, contour line a is the second contour line, b1 is the first endpoint of the first contour line, a1 is the first endpoint of the second contour line, and the absolute distance between contour line b and contour line a is shown by the double-arrow dotted line. The relative distance between contour line b and contour line a is Figure 1C The absolute distance between Figure 1D The ratio of the straight length of contour line a in the figure. The translation distance between contour line b and contour line a is Figure 1E The translation distance shown.
[0041] S130, determining the connection result of each contour line according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group.
[0042] The electronic device can use the absolute distance, relative distance and translation distance of two contour lines as evaluation indicators to calculate the connection cost of two contour lines in the contour group, and then determine the connection result of each contour line according to the connection cost of two contour lines in each contour line. Specifically, the electronic device can directly add the absolute distance, relative distance and translation distance of the two contour lines as the connection cost of the contour group. The electronic device can also pre-set the weight coefficients corresponding to the absolute distance, relative distance and translation distance, calculate the weighted sum of the absolute distance, relative distance and translation distance, and use the weighted sum of the absolute distance, relative distance and translation distance of the two contour lines as the connection cost of the contour group.
[0043] The technical solution of the embodiment of the present invention generates a contour set by acquiring each contour line in the target detection result, and forms a contour line group with every two contour lines in the contour line set, and determines the angle difference between the two contour lines in each contour line group; if the angle difference between the two contour lines in the contour line group meets the preset angle condition, then the absolute distance, relative distance and offset distance of the two contour lines in the contour line group are determined; according to the absolute distance, relative distance and translation distance of the two contour lines in each contour line group, the connection result of each contour line is determined. This technical solution solves the problem of low integrity of the target contour output by the visual task, and realizes the connection of the collinear contour lines by identifying the broken contour lines, which is conducive to improving the integrity of the target contour.
[0044] Embodiment 2
[0045] Figure 2 This is a flow chart of a method for connecting fracture contour lines provided in the second embodiment of the present invention. This embodiment is based on the above embodiment and is refined. Figure 2 As shown, the method includes:
[0046] S201, obtaining each contour line in the target detection result and generating a contour line set.
[0047] S202: Every two contour lines in the contour line set form a contour line group, and determine the angle difference between the two contour lines in each contour line group.
[0048] S203: Determine whether the angle difference between two contour lines in the contour line group meets a preset angle condition.
[0049] If the angle difference between two contour lines in the contour line group is less than or equal to the preset angle threshold, the two contour lines in the contour line group can be connected, and S204 is executed. If the angle difference between the two contour lines in the contour line group is greater than the preset angle threshold, it means that the two contour lines in the contour line group cannot be connected, and S210 is executed.
[0050] It is easy to understand that the target contour may have two parallel but far-distance contour lines. For example, the target contour is a rectangle, contour line 1 is a line segment in side a of the rectangle, and contour line 2 is a line segment in the opposite side of side a. In this case, although the angle difference between the two contour lines meets the angle condition, they cannot be connected. The electronic device can set a distance condition based on the angle condition, for example, the distance between the two contour lines is less than a preset distance threshold, and the minimum value of the endpoint distance of the two contour lines is less than the preset distance threshold. Among them, the endpoint distance of the two contour lines can be the distance from one endpoint of one contour line to an endpoint of the other contour line, and there are 4 endpoint distances between the two contour lines. The minimum value of the endpoint distance of the two contour lines can be the minimum value of the 4 endpoint distances.
[0051] S204: Determine the absolute distance, relative distance, and offset distance between two contour lines in the contour line group.
[0052] In a preferred solution, determining the absolute distance, relative distance and offset distance between two contour lines in the contour line group includes:
[0053] If the angle difference between two contour lines in the contour line group meets the preset angle condition, a first endpoint extension area and a second endpoint extension area of the first contour line in the contour line group are determined; the endpoint extension area is a regular shape area formed with the endpoint of the first contour line as the center, and the first endpoint extension area and the second endpoint extension area are respectively endpoint extension areas where two endpoints of the first contour line match;
[0054] If at least one endpoint of a second contour line in the contour group is within the first endpoint extension region, or within the second endpoint extension region, then determining an absolute distance, a relative distance, and an offset distance between two contour lines in the contour group;
[0055] If both endpoints of the second contour line in the contour group are not within the first endpoint extension region, and both endpoints are not within the second endpoint extension region, it is determined that the two contour lines in the contour line group are not connectable.
[0056] On the premise that the angle difference between two contour lines in the contour line group satisfies the angle condition, the electronic device can further determine whether the two contour lines in the contour line group meet the distance condition. Specifically, the distance condition can be represented by setting an endpoint extension area. The electronic device can select any contour line in the contour line group as the first contour line, and generate an endpoint extension area corresponding to each endpoint with the two endpoints of the first contour line as the center. It can be understood that the endpoint extension area can be a regular shape area formed with the endpoint as the center, such as a square, a circle, etc.
[0057] The electronic device can use another contour line in the contour line group as the second contour line, and determine whether the endpoint of the second contour line is located in the extension area of the two endpoints of the first contour line. If at least one endpoint of the second contour line is within the extension area of the two endpoints of the first contour line, the absolute distance, relative distance and offset distance of the two contour lines in the contour line group are determined to further calculate the connection cost. If both endpoints of the second contour line in the contour line group are not within the extension area of the two endpoints of the first contour line, the two contour lines in the contour line group cannot be connected, and there is no need to further calculate the absolute distance, relative distance and offset distance of the two contour lines in the contour line group.
[0058] This scheme sets the endpoint extension area of the contour line and judges the connectivity of two contour lines in the contour line group from the perspective of distance, which is conducive to filtering the unconnectable contour line group, saving computing resources and accelerating the generation of the target contour.
[0059] S205 , calculating the connection cost of each contour line group according to the pre-acquired distance evaluation threshold, the absolute distance, the relative distance and the translation distance between two contour lines in each contour line group.
[0060] In order to avoid the influence of the difference in the numerical range of different distance features on the connection cost, the electronic device can pre-set the distance evaluation threshold to normalize the absolute distance, relative distance and translation distance of two contour lines in each contour line group to obtain a reliable connection cost.
[0061] Specifically, the calculation formula for the connection cost of two contour lines in a contour line group can be:
[0062]
[0063] Among them, absDis represents the absolute distance between two contour lines in the contour line group, ratioDis represents the relative distance between two contour lines in the contour line group, shiftDis represents the translation distance between two contour lines in the contour line group, and maxDis represents the pre-acquired distance evaluation threshold.
[0064] S206 : Determine a target contour group according to the connection cost of each contour group, and connect two contours in the target contour group.
[0065] The electronic device may sort the connection costs of each contour group, take the contour group with the smallest connection cost as the target contour group, and connect two contour lines in the target contour group. Specifically, the electronic device may connect the first endpoint of the first contour line in the target contour group with the first endpoint of the second contour line. In order to ensure the reliability of the connection and avoid the misconnection of parallel contour lines at a long distance, the electronic device may also set a connection cost threshold, filter out contour groups with connection costs less than the connection cost threshold from each contour group, sort the connection costs of each contour group less than the connection cost threshold, take the contour group with the smallest connection cost in the sorting result as the target contour group, and connect two contour lines in the target contour group.
[0066] S207: Update the contour line set according to the connection result of two contour lines in the target contour group.
[0067] After connecting two contour lines in the target contour group into one contour line, the electronic device may delete the two contour lines in the target contour line group and add the connected contour line to the contour line set to update the contour line set.
[0068] S208: Determine whether there are connectable contour lines in the contour line set.
[0069] The electronic device can determine whether there are connectable contour lines in the contour line set according to the angle difference between each two contour lines, and if there are no connectable contour lines in the contour line set, continue to execute S209. If there are connectable contour lines in the contour line set, return to execute S202-S207 until there are no connectable contour lines in the contour line set, and output the connection results of each contour line.
[0070] S209: Output the connection results of each contour line.
[0071] S210: Determine whether two contour lines in the contour line group are not connectable.
[0072] The technical solution of the embodiment of the present invention generates a contour set by acquiring each contour line in the target detection result, and forms a contour line group with every two contour lines in the contour line set, and determines the angle difference between the two contour lines in each contour line group; if the angle difference between the two contour lines in the contour line group meets the preset angle condition, then the absolute distance, relative distance and offset distance of the two contour lines in the contour line group are determined; according to the absolute distance, relative distance and translation distance of the two contour lines in each contour line group, the connection result of each contour line is determined. This technical solution solves the problem of low integrity of the target contour output by the visual task, and realizes the connection of the collinear contour lines by identifying the broken contour lines, which is conducive to improving the integrity of the target contour.
[0073] Embodiment 3
[0074] Figure 3 This is a schematic diagram of the structure of a connection device for a fracture contour line provided in the third embodiment of the present invention. Figure 3 As shown, the device comprises:
[0075] An angle difference determination module 310 is used to obtain each contour line in the target detection result, generate a contour line set, form a contour line group with every two contour lines in the contour line set, and determine the angle difference between two contour lines in each contour line group;
[0076] A distance determination module 320, configured to determine an absolute distance, a relative distance, and an offset distance between two contour lines in the contour line group if the angle difference between the two contour lines in the contour line group satisfies a preset angle condition;
[0077] The connection result determination module 330 is used to determine the connection result of each contour line according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group.
[0078] In this solution, optionally, the angle difference determination module 310 is specifically used to:
[0079] If at least one of the two contour lines in the contour line group is a curve segment, a fitting straight line of the curve segment is determined, and the angle difference between the two contour lines in the contour line group is determined according to the fitting straight line of the curve segment.
[0080] On the basis of the above solution, the preset angle condition is that the angle difference between two contour lines in the contour line group is less than or equal to a preset angle threshold;
[0081] The angle difference determination module 310 is further used for:
[0082] After determining the angle difference between two contour lines in each contour line group, if the angle difference between the two contour lines in the contour line group does not meet a preset angle condition, it is determined that the two contour lines in the contour line group are not connectable.
[0083] In a feasible solution, the absolute distance is the distance from the projection point of the first end point of the first contour line on the second contour line to the first end point of the second contour line;
[0084] The first endpoint of the first contour line is the endpoint of the two endpoints of the first contour line that is closest to the second contour line; the first endpoint of the second contour line is the endpoint of the two endpoints of the second contour line that is closest to the first contour line;
[0085] The relative distance is the ratio of the absolute distance to the length of the second contour line;
[0086] The translation distance is the distance from the second end point of the first contour line to the first contour line.
[0087] In a preferred solution, the distance determination module 320 is further used to:
[0088] If the angle difference between two contour lines in the contour line group meets the preset angle condition, a first endpoint extension area and a second endpoint extension area of the first contour line in the contour line group are determined; the endpoint extension area is a regular shape area formed with the endpoint of the first contour line as the center, and the first endpoint extension area and the second endpoint extension area are respectively endpoint extension areas where two endpoints of the first contour line match;
[0089] If at least one endpoint of a second contour line in the contour group is within the first endpoint extension region, or within the second endpoint extension region, then determining an absolute distance, a relative distance, and an offset distance between two contour lines in the contour group;
[0090] If both endpoints of the second contour line in the contour group are not within the first endpoint extension region, and both endpoints are not within the second endpoint extension region, it is determined that the two contour lines in the contour line group are not connectable.
[0091] Based on the above solution, the connection result determination module 330 is specifically used to:
[0092] Calculate the connection cost of each contour line group according to the pre-acquired distance evaluation threshold, the absolute distance, relative distance and translation distance between two contour lines in each contour line group;
[0093] According to the connection cost of each contour group, determine the target contour group, and connect two contours in the target contour group;
[0094] According to the connection results of two contour lines in the target contour group, the contour set is updated, and the execution is returned to form a contour group with every two contour lines in the contour set, and the angle difference between the two contour lines in each contour group is determined until there are no connectable contour lines in the contour set, and the connection results of each contour line are output.
[0095] The fracture contour line connection device provided in the embodiment of the present invention can execute the fracture contour line connection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0096] Embodiment 4
[0097] Figure 4A schematic diagram of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) 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 present invention described and / or required herein.
[0098] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0099] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 executes the various methods and processes described above, such as a method for connecting fracture contours.
[0101] In some embodiments, the method for connecting the fracture contours may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the method for connecting the fracture contours described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to execute the method for connecting the fracture contours in any other appropriate manner (e.g., by means of firmware).
[0102] Various implementations of the systems and techniques described above herein can be implemented in 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), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0103] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, a special purpose computer or other device connected to a programmable fracture profile, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0104] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may 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.
[0105] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0106] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend 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 backend components, middleware components, or frontend components. The components of the system may 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.
[0107] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0108] It should be understood that the various forms of 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 different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0109] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for connecting fracture contour lines, characterized in that: The method comprises: Obtain each contour line in the target detection result, generate a contour line set, form a contour line group with every two contour lines in the contour line set, and determine the angle difference between the two contour lines in each contour line group; If the angle difference between two contour lines in the contour line group meets the preset angle condition, then the absolute distance, relative distance and offset distance of the two contour lines in the contour line group are determined; The connection result of each contour line is determined according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group.
2. The method according to claim 1, characterized in that Determining the angle difference between two contour lines in each contour line group includes: If at least one of the two contour lines in the contour line group is a curve segment, a fitting straight line of the curve segment is determined, and the angle difference between the two contour lines in the contour line group is determined according to the fitting straight line of the curve segment.
3. The method according to claim 2, characterized in that The preset angle condition is that the angle difference between two contour lines in the contour line group is less than or equal to a preset angle threshold; After determining the angle difference between two contour lines in each contour line group, the method further comprises: If the angle difference between two contour lines in the contour line group does not meet the preset angle condition, it is determined that the two contour lines in the contour line group cannot be connected.
4. The method according to claim 1, characterized in that: The absolute distance is the distance from the projection point of the first end point of the first contour line on the second contour line to the first end point of the second contour line; The first endpoint of the first contour line is the endpoint closest to the second contour line among the two endpoints of the first contour line; The first endpoint of the second contour line is the endpoint closest to the first contour line among the two endpoints of the second contour line; The relative distance is the ratio of the absolute distance to the length of the second contour line; The translation distance is the distance from the second end point of the first contour line to the first contour line.
5. The method according to claim 1, characterized in that The determining of the absolute distance, relative distance and offset distance between two contour lines in the contour line group includes: If the angle difference between two contour lines in the contour line group meets the preset angle condition, a first endpoint extension area and a second endpoint extension area of the first contour line in the contour line group are determined; the endpoint extension area is a regular shape area formed with the endpoint of the first contour line as the center, and the first endpoint extension area and the second endpoint extension area are respectively endpoint extension areas where two endpoints of the first contour line match; If at least one endpoint of a second contour line in the contour group is within the first endpoint extension region, or within the second endpoint extension region, then determining an absolute distance, a relative distance, and an offset distance between two contour lines in the contour group; If both endpoints of the second contour line in the contour group are not within the first endpoint extension region, and both endpoints are not within the second endpoint extension region, it is determined that the two contour lines in the contour line group are not connectable.
6. The method according to claim 3 or 5, characterized in that: Determining the connection result of each contour line according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group includes: Calculate the connection cost of each contour line group according to the pre-acquired distance evaluation threshold, the absolute distance, relative distance and translation distance between two contour lines in each contour line group; According to the connection cost of each contour group, determine the target contour group, and connect two contours in the target contour group; According to the connection results of two contour lines in the target contour group, the contour set is updated, and the execution is returned to form a contour group with every two contour lines in the contour set, and the angle difference between the two contour lines in each contour group is determined until there are no connectable contour lines in the contour set, and the connection results of each contour line are output.
7. A connection device for a fracture contour line, characterized in that: The device comprises: An angle difference determination module is used to obtain each contour line in the target detection result, generate a contour line set, form a contour line group with every two contour lines in the contour line set, and determine the angle difference between two contour lines in each contour line group; A distance determination module, for determining an absolute distance, a relative distance and an offset distance between two contour lines in the contour line group if the angle difference between the two contour lines in the contour line group satisfies a preset angle condition; The connection result determination module is used to determine the connection result of each contour line according to the absolute distance, relative distance and translation distance between two contour lines in each contour line group.
8. An electronic device, characterized in that: The electronic device comprises: At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor so that the at least one processor can execute the method for connecting the fracture contour lines according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for connecting fracture contours according to any one of claims 1 to 6 when the instructions are executed.
10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method for connecting fracture contours according to any one of claims 1 to 6.