Method, device and computer-readable storage medium for merging straight line features
By determining the predetermined straight line features in the straight line feature set and updating the endpoints, forming a subset and judging the structural division semantics, merging only when there are no division straight line features, the problem of poor processing of short straight line features in the image is solved, and the expression accuracy of the edge features of the three-dimensional model is improved.
Patent Information
- Application Number
- CN202111131831.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-09-26
AI Technical Summary
Existing technologies tend to obtain a large number of short straight line features when acquiring straight line features in images, resulting in poor processing and affecting the edge feature expression of the three-dimensional building model.
By obtaining a set of straight line features, determining predetermined straight line features and updating endpoints, forming the first and second subsets according to relative positions, and judging whether there are dividing straight line features with structural dividing semantics, merging is only performed when there are no dividing straight line features to avoid excessive merging.
The accuracy of line feature merging is improved, ensuring the precise expression of building edge features and avoiding excessive merging of line features.
Smart Images

Figure CN114022720B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of line feature merging, and in particular to a method, device and computer-readable storage medium for merging line features. Background Art
[0002] Oblique photogrammetry can capture images from multiple directions, obtaining image information of buildings from multiple angles, and is widely used in urban 3D model reconstruction. Currently, 3D reconstruction based on oblique images mainly constructs a 3D building model using a 3D point cloud obtained through dense image matching. This model can well express the overall outline of the building, but suffers from significant deformation and missing information in the local edge areas of the building. However, the building itself contains a large number of straight line features, and the combination of these straight line features contains rich structural information, which can better express the edge features of the building. Therefore, if these straight line features can be used to constrain the 3D point cloud generated by dense matching, the accuracy of the 3D model will be improved to a certain extent.
[0003] However, when acquiring straight line features in images, it is often easy to obtain a large number of short straight line features, which are fragmented and lead to poor subsequent processing. Therefore, it is necessary to merge these short straight line features to better express the edge characteristics of buildings. Summary of the Invention
[0004] The present application provides a method, device and computer-readable storage medium for merging straight line features, which can improve the accuracy of merging straight line features.
[0005] On the one hand, an embodiment of the present application provides a method for merging straight line features, the method comprising: obtaining a straight line feature set; determining a predetermined straight line feature among the straight line features that are not merged in the straight line feature set, and determining one of the endpoints of the predetermined straight line feature as the endpoint to be updated; determining a first set among the straight line features that are not merged in the straight line feature set based on the relative position with the endpoint to be updated; determining a first subset and a second subset in the first set based on the relative position with the predetermined straight line feature; determining whether there is a partitioning straight line feature with structural partitioning semantics in the second subset; when the partitioning straight line feature does not exist, merging the straight line features in the first subset with the predetermined straight line feature to update the endpoint to be updated and the predetermined straight line feature; returning to execute the step of determining the first set among the straight line features that are not merged in the straight line feature set based on the relative position with the endpoint to be updated, until a predetermined condition is met.
[0006] On the other hand, an embodiment of the present application provides a device for merging straight line features, which includes a processor, a memory, and a communication circuit. The processor is coupled to the memory and the communication circuit, respectively. Program data is stored in the memory. The processor implements the steps in the above method by executing the program data in the memory.
[0007] Another aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the above method.
[0008] The beneficial effect of the present application is that when merging straight line features, the present application will determine whether there are dividing straight line features with structural division semantics nearby. Only when it is determined that there are no dividing straight line features will the straight line features be merged, which can avoid excessive merging of straight line features and improve the accuracy of straight line feature merging. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:
[0010] Figure 1 This is a flow chart of an embodiment of the method for merging straight line features of the present application;
[0011] Figure 2 yes Figure 1 Flow chart of step S150;
[0012] Figure 3 It is a distribution diagram of several straight line features in a straight line feature set in an application scenario;
[0013] Figure 4 yes Figure 1 Flow chart of step S160;
[0014] Figure 5 yes Figure 1 Flow chart of step S170;
[0015] Figure 6 This is a structural diagram of an embodiment of a device for merging straight line features of the present application;
[0016] Figure 7 This is a schematic structural diagram of another embodiment of the device for merging straight line features of the present application;
[0017] Figure 8 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0019] See Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for merging straight line features of the present application, the method comprising:
[0020] S110: Obtain a line feature set.
[0021] Among them, the straight line feature set is a set of straight line features to be merged, which includes multiple straight line features. The purpose of this application is to merge the straight line features in the straight line feature set.
[0022] In one application scenario, step S110 specifically includes obtaining an image to be processed, and then extracting straight line features from the image to be processed to obtain a straight line feature set. For example, the LSD detection algorithm can be used to extract straight line features from the image to be processed. In one application scenario, after extracting the straight line features from the image to be processed, the straight line features are arranged in descending order to obtain a straight line feature set.
[0023] S120: Determine a predetermined straight line feature among the unmerged straight line features in the straight line feature set, and determine one of the endpoints of the predetermined straight line feature as an endpoint to be updated.
[0024] Among them, the predetermined straight line feature is the straight line feature that needs to be merged. The following steps will introduce how to merge the straight line features in the straight line feature set with the predetermined straight line feature.
[0025] At the same time, the predetermined straight line feature includes two endpoints, and one of the endpoints is determined as the endpoint to be updated.
[0026] Considering that a line feature that has been merged with other line features cannot be merged with other line features again during merging, a predetermined line feature is determined from the unmerged line features in the line feature set.
[0027] S130: Determine a first set of unmerged line features in the line feature set according to relative positions with the endpoints to be updated.
[0028] Among them, the process is the same as that of determining the predetermined straight line features. Considering that in determining the first set, some straight line features in the straight line feature set may have been merged, they can no longer be merged with the predetermined straight line features. Therefore, in determining the first set, the search is made among the unmerged straight line features in the straight line feature set. That is to say, the straight line features in the first set have not been merged before.
[0029] Among them, considering that the straight line features that can be merged with the predetermined straight line features are generally located near the predetermined straight line features, in this embodiment, the specific steps of S130 to determine the first set include: among the straight line features that have not been merged in the straight line feature set, selecting straight line features whose at least one endpoint falls within a circular area of a predetermined size with the endpoint to be updated as the center, to form a first set.
[0030] Specifically, first, a circular area of a predetermined size is determined with the endpoint to be updated as the center of the circle. Then, as long as at least one endpoint of a straight line feature falls within the circular area and the straight line feature is an unmerged straight line feature, the straight line feature is selected to finally form the first set.
[0031] In other embodiments, S130 may also be: from the unmerged straight line features in the straight line feature set, select straight line features whose end points both fall within a circular area of a predetermined size with the end point to be updated as the center, to form a first set; or, from the unmerged straight line features in the straight line feature set, select straight line features whose angle with the predetermined straight line feature is less than a threshold, to form a first set.
[0032] In summary, this application does not impose any specific restrictions on the process of forming the first set.
[0033] S140: Determine a first subset and a second subset in the first set according to relative positions to the predetermined straight line feature.
[0034] Wherein, according to a predetermined strategy and relative positions to predetermined straight line features, a first subset and a second subset are determined in the first set.
[0035] In this embodiment, step S140 specifically includes: selecting line features whose angles with the predetermined line feature are smaller than an angle threshold from the first set to form a first subset, and the remaining line features to form a second subset.
[0036] That is to say, based on whether the angle with the predetermined straight line feature is less than the angle threshold, the first set is divided into a first subset and a second subset, wherein the angle between the straight line feature in the first subset and the predetermined straight line feature is less than the angle threshold, and the angle between the straight line feature in the second subset and the predetermined straight line feature is greater than or equal to the angle threshold.
[0037] It can be understood that the smaller the angle between the straight line feature and the predetermined straight line feature, the more likely it is that the straight line feature is on the same straight line as the predetermined straight line feature, that is, the more likely it is to be merged with the predetermined straight line feature.
[0038] In other embodiments, step S140 may further specifically include: in the first set, selecting straight line features whose angle with the predetermined straight line feature is less than a first angle threshold to form a first subset, selecting straight line features whose angle with the predetermined straight line feature is greater than a second angle threshold to form a second subset, wherein the second angle threshold is greater than the first angle threshold.
[0039] S150: Determine whether there is a partition line feature with structural partition semantics in the second subset.
[0040] If the result of the determination is that the target object does not exist, step S160 is executed; otherwise, step S180 is executed.
[0041] Specifically, a dividing line feature with structural dividing semantics refers to a line feature that is a dividing line between two different structures. For example, a dividing line between roofs of adjacent houses is a dividing line feature with structural dividing semantics.
[0042] In view of the meaning of the partitioning line feature, if there is a partitioning line feature with structural partitioning semantics in the second subset, it means that the line features near the partitioning line feature may belong to two different structures. Therefore, the line features near the partitioning line feature cannot be merged, and then it is determined that the predetermined line feature cannot be merged with the line feature in the first subset.
[0043] In this embodiment, for the sake of convenience, the following defines the straight line features in the first subset as the first straight line features, and the straight line features in the second subset as the second straight line features. Figure 2 Step S150 of determining whether there is a dividing line feature includes:
[0044] S151: Determine whether there is a second straight line feature in the second subset, the angle difference between the first angle with the predetermined straight line feature and the second angle with at least one first straight line feature being less than a difference threshold.
[0045] If it exists, go to step S152; if it does not exist, go to step S153.
[0046] S152: Determine whether a partitioning line feature exists in the second subset.
[0047] S153: Determine whether there is no dividing line feature in the second subset.
[0048] Specifically, it may be determined whether the second straight line features in the second subset are partitioning straight line features in order from short to long.
[0049] Alternatively, the smaller value of the distance between the two end points of the second straight line feature and the endpoint to be updated is used as the distance between the second straight line feature and the predetermined straight line feature, and then the second straight line features in the second subset are judged in order from small to large according to the distance to the predetermined straight line feature.
[0050] Of course, it is also possible to determine whether the second straight line features in the second subset are partitioning straight line features in other orders, which will not be elaborated here.
[0051] It can be understood that, when it is determined that one of the second straight line features is a partitioning straight line feature, it is no longer determined whether the remaining second straight line features in the second subset are partitioning straight line features.
[0052] Among them, for a certain second straight line feature, as long as there is a first straight line feature in the first subset, so that the angle difference between the second straight line feature and the first angle of the predetermined straight line feature and the second angle between the second straight line feature and the first straight line feature is less than the difference threshold, then the second straight line feature is determined to be a divided straight line feature.
[0053] In other embodiments, for a certain second straight line feature, its first angle with the predetermined straight line feature is calculated, and its second angle with all first straight line features is calculated. Only when the angle difference between the first angle and all second angles is less than a threshold value, is it determined that the second straight line feature is a dividing straight line feature; otherwise, it is determined not to be a dividing straight line feature.
[0054] The process of calculating the first angle between the second straight line feature and the predetermined straight line feature, and the second angle between the second straight line feature and the first straight line feature is as follows:
[0055] Combine Figure 3 , assuming that the predetermined straight line feature is a straight line feature l, which includes two end points p s 、p e , where endpoint p s is the endpoint to be updated, and the line feature l i The first line feature in the first subset is the distance between its two end points and the endpoint to be updated p s The closer endpoint is defined as endpoint p i c , the farther endpoint is defined as p i f , straight line feature l j is the second line feature in the second subset. Similarly, the distance between its two end points and the endpoint to be updated is p sThe closer endpoint is defined as endpoint p j c , the farther endpoint is defined as p j f .
[0056] Then the second straight line feature l j The first angle θ with the predetermined straight line feature l j The calculation formula is:
[0057]
[0058] Second straight line feature l j With the first straight line feature l i The second angle θ ij The calculation formula is:
[0059]
[0060] The calculation formula of the angle difference Δθ between the first angle and the second angle is:
[0061] Δθ=|θ j -θ ij |.
[0062] It can be seen from the above content that in the above calculation process, the starting points of the straight line feature vector corresponding to the first straight line feature and the straight line feature vector corresponding to the second straight line feature are close to the endpoint to be updated, and the end points are far away from the endpoint to be updated. The starting point of the straight line feature vector corresponding to the predetermined straight line feature is the endpoint to be updated, and the end point is the other endpoint of the predetermined straight line feature.
[0063] S160: Determine whether there is a line feature to be merged in the first subset that can be merged with the predetermined line feature.
[0064] If the result of the determination is yes, then execute step S170 ; otherwise, execute step S180 .
[0065] Specifically, when there is no dividing line feature with structural dividing semantics in the second subset, in order to improve the accuracy of the merging, it is not directly determined that the predetermined line feature can be merged with other line features. It is also necessary to specifically determine whether there is a line feature to be merged in the first subset that can be merged with the predetermined line feature.
[0066] In this embodiment, combined with Figure 4 Step S160 of determining whether there are line features to be merged in the first subset includes:
[0067] S161: Determine whether there is a line feature in the first subset whose vertical projection point of an endpoint farthest from the endpoint to be updated on the line where the predetermined line feature is located falls outside the predetermined line feature.
[0068] If it exists, go to step S162; if not, go to step S163.
[0069] S162: Determine whether there are straight line features to be merged in the first subset.
[0070] S163: Determine whether there are any line features to be merged in the first subset.
[0071] Specifically, combined Figure 3 , the first line feature l i Stay away from the endpoint to be updated p s The endpoint p i f Vertically project to the line where the predetermined linear feature l is located to obtain the vertical projection point p i′ f , if the vertical projection point p i′ f If it falls outside the predetermined straight line feature l, the first straight line feature l is determined i Can be merged with the predetermined straight line feature l, otherwise determine the first straight line feature l i It cannot be merged with the predetermined line feature l. That is, if the line feature p i′ f p e The length of the line characteristic p is greater than s p e The length of the first straight line feature l is determined i Can be merged with the predetermined straight line feature l.
[0072] In other embodiments, other methods may be used to determine the first straight line feature l i Can it be merged with the predetermined straight line feature l? For example, determine whether the first straight line feature l i Is the angle between the first line feature l and the predetermined line feature l less than the threshold? If so, determine the first line feature l i It can be merged with the predetermined straight line feature l, otherwise it is determined to be unavailable.
[0073] It is possible to determine whether the line features in the first subset can be merged with the predetermined line features in sequence according to a predetermined order. If it is determined that one line feature can be merged with the predetermined line feature, the remaining line features will no longer be determined.
[0074] It is taken into consideration that the smaller the angle between the straight line feature and the predetermined straight line feature, the more likely it is that the straight line feature is on the same straight line as the predetermined straight line feature, that is, the more likely it is to be merged with the predetermined straight line feature. In this embodiment, whether the straight line features in the first subset are the straight line features to be merged is determined in order from small to large angles with the predetermined straight line feature.
[0075] Of course, in other embodiments, the smaller value of the distance between the two endpoints of the first straight line feature and the endpoint to be updated can be used as the distance between the first straight line feature and the predetermined straight line feature, and then the first straight line features in the first subset are determined to be the straight line features to be merged in order of the distance from the predetermined straight line feature to the largest one.
[0076] S170: Merge the line feature to be merged with the predetermined line feature to update the endpoint to be updated and the predetermined line feature.
[0077] S180: Determine that the endpoint to be updated cannot be updated.
[0078] After determining that there is a line feature to be merged in the first subset, the line feature to be merged is merged with the predetermined line feature, and then the predetermined line feature is updated with the merged line feature, and the endpoint to be updated is updated with the merged new endpoint.
[0079] In this embodiment, combined with Figure 5 Step S170 of merging the line feature to be merged with the predetermined line feature includes:
[0080] S171: Determine the vertical projection point of the endpoint of the line feature to be merged away from the endpoint to be updated on the line where the predetermined line feature is located.
[0081] S172: Extend the predetermined straight line feature to the vertical projection point to obtain an updated predetermined straight line feature, wherein the vertical projection point is the updated endpoint to be updated.
[0082] Specifically, continue to combine Figure 3 , in determining the first straight line feature l i After being merged with the predetermined straight line feature l, the first straight line feature l i Stay away from the endpoint to be updated p s The endpoint p i f , the vertical projection point p on the line where the predetermined line feature l is located i′ f Replace endpoint p s Become the updated endpoint to be updated, connect endpoint p i′ f and endpoint p e, get a new straight line, and use the new straight line to replace the predetermined straight line l, that is, after the update, the two endpoints of the predetermined straight line l are endpoints p i′ f and endpoint p e , and the endpoint p i′ f The endpoint to be updated.
[0083] In other embodiments, the method for merging the line feature to be merged with the predetermined line feature may also be: connecting the endpoint of the line feature to be merged away from the end point to be updated and the endpoint p of the predetermined line l e (the endpoint of the predetermined straight line l away from the other end of the endpoint to be updated), and the updated predetermined straight line is obtained, wherein the endpoint of the straight line feature to be merged away from one end of the endpoint to be updated is the updated endpoint to be updated.
[0084] After executing step S170 , the process returns to step S130 and continues until it is determined that the endpoint to be updated cannot be updated. The entire process ends. That is, when it is determined that the endpoint to be updated cannot be updated, it is determined that the predetermined condition is met and the process ends.
[0085] It should be noted that, in addition to the two situations where the endpoint to be updated cannot be updated, that is, there is a dividing line feature with structural dividing semantics in the second subset, and there is no line feature to be merged that can be merged with the predetermined line feature in the first subset, there is also an implicit situation where the endpoint to be updated cannot be updated: there is no first subset corresponding to the endpoint to be updated. That is, at this time, when determining the set, if the first subset corresponding to the endpoint to be updated cannot be found, the entire process ends. It should be noted that in other embodiments, when it is determined in step S150 that there is a dividing line feature with structural dividing semantics in the second subset, it is not necessary to immediately determine that the endpoint to be updated cannot be updated. Instead, the determination is continued in combination with other parameters. For example, it is determined whether the length of the existing dividing line feature meets the requirements. Only when the length meets the requirements is it finally determined that the endpoint to be updated cannot be updated. Otherwise, step S160 can be continued.
[0086] Similarly, when step S160 determines that there is no straight line feature to be merged in the first subset that can be merged with the predetermined straight line feature, it is not necessary to immediately determine that the endpoint to be updated cannot be updated, but to continue to determine in combination with other parameters. For example, it is determined whether there is a first straight line feature with a length less than a threshold in the first subset. Only when there is no first straight line feature with a length less than the threshold, it is finally determined that the endpoint to be updated cannot be updated.
[0087] At the same time, in other embodiments, in addition to ending the process by determining that the predetermined condition is met when it is determined that the endpoint to be updated cannot be updated, the process can also be ended by determining that the predetermined condition is met when other conditions are met. For example, when the number of times step S130 is returned to be executed reaches a threshold number of times, excessive merging of straight line features is avoided and the process is forced to end at this time. That is to say, when the number of times step S130 is returned to be executed reaches a threshold number of times, it is determined that the predetermined condition is met and the process is ended.
[0088] At the same time, in other embodiments, when it is determined that there is no dividing straight line feature in the second subset, the first subset and the predetermined straight line feature can be directly merged without determining whether there is a straight line feature to be merged. For example, the straight line feature with the smallest angle with the predetermined straight line feature in the first subset is directly merged with the predetermined straight line feature, or the straight line feature closest to the predetermined straight line feature (the distance from the endpoint closest to the endpoint to be updated to the endpoint to be updated is used as the distance between the corresponding straight line feature and the predetermined straight line feature) is merged with the predetermined straight line feature.
[0089] After the above process is completed when the predetermined conditions are met, the method of the present application further includes:
[0090] The other endpoint of the predetermined straight line feature is determined as the endpoint to be updated, and steps S130 to S170 are executed again until the predetermined condition is met again. At this time, it is determined that the merging of the predetermined straight line features is completed.
[0091] Specifically, after determining that the update of the endpoint to be updated is completed, the merging of the predetermined straight line feature and the straight line feature located near one end thereof is completed. Therefore, the other endpoint of the predetermined straight line feature is used as the endpoint to be updated, and the predetermined straight line feature is merged with the straight line feature located near the other end thereof until it is determined again that the predetermined condition is met, thereby determining that the merging of the predetermined straight line features is completed.
[0092] For a better understanding, see Figure 3 , assuming that for a predetermined straight line l, initially its endpoint p s For the endpoint to be updated, Figure 1 After the process, the predetermined straight line l and the endpoint p are completed. s Merge the nearby line features and then use the endpoint p e For the endpoint to be updated, repeat the merging process until the endpoint p e The update of is completed, thus completing the merging process of the predetermined straight line l.
[0093] In this embodiment, after determining that the merging of the predetermined straight line features is completed, it is necessary to continue merging other straight line features in the straight line feature set, so return to execute step S120 and re-determine the predetermined straight line features until the traversal of the unmerged straight line features in the straight line feature set is completed.
[0094] As described in the aforementioned related content, a straight line feature that has been merged with other straight line features cannot be used as a merging object for another straight line feature. Therefore, after the straight line features are merged, the merged straight line features are marked. When determining the predetermined straight line features in step S120 and determining the first set in step S130, the straight line features that are not marked in the straight line feature set can be directly searched.
[0095] It should be noted that when a straight line feature in the straight line feature set is used as a predetermined straight line feature and the above-mentioned process of taking both endpoints as endpoints to be updated is executed in turn, it is found that it cannot be merged with any straight line feature. Therefore, when step S120 is subsequently executed, the straight line feature will no longer be used as a predetermined straight line feature, but when step S130 is executed, it can be used as an object to be merged with another straight line feature, that is, it may appear in the first set.
[0096] That is, each time step S120 is executed, the predetermined straight line feature is actually determined from the straight line features that have not been merged into the straight line feature set and have not been determined as the predetermined straight line feature before.
[0097] In one application scenario, each time step S120 is executed, among the line features in the unmerged line feature set and not previously determined as predetermined line features, the line feature with the longest length is determined as the predetermined line feature.
[0098] In this embodiment, the method of the present application also includes: saving the merged straight line features obtained after each merging of predetermined straight line features to obtain a merged set, and then performing length constraints on the straight line features in the merged set, eliminating fine straight line features whose length is less than the length threshold, and obtaining the final merged set.
[0099] It should be noted that, as can be seen from the above analysis, some merged straight line features are obtained through merging, while some merged straight line features may be the original straight line features in the straight line feature set, that is, the straight line feature cannot be merged with any straight line feature in the straight line feature set.
[0100] In this embodiment, the method of the present application also includes: forming and saving a correspondence between a straight line feature set and a final merged set, wherein the correspondence indicates that the straight line features in the final merged set are obtained by merging corresponding straight line features in the straight line feature set.
[0101] From the above content, it can be seen that the method of the present application adds constraints on straight line features with structural division semantics during the process of merging straight line features, stops merging near straight line features with structural division semantics, and can avoid excessive merging of straight line features.
[0102] See Figure 6 , Figure 6 2 is a schematic diagram of the structure of an embodiment of a device for merging linear features of the present application. Device 200 for merging linear features includes a processor 210, a memory 220, and a communication circuit 230. Processor 210 is coupled to memory 220 and communication circuit 230, respectively. Memory 220 stores program data. Processor 210 executes the program data in memory 220 to implement the steps of any of the aforementioned methods. The detailed steps can be found in the aforementioned embodiments and are not further described here.
[0103] The device 200 for merging straight line features may be any device with information processing capabilities, such as a computer or a mobile phone, and is not limited here.
[0104] See Figure 7 , Figure 7 This is a schematic diagram of another embodiment of the apparatus for merging line features of the present invention. The apparatus 300 for merging line features includes a set acquisition module 310, a predetermined line feature determination module 320, a first set determination module 330, a second set determination module 340, a divided line feature determination module 350, and a line feature merging module 360.
[0105] The set acquisition module 310 is used to acquire a line feature set.
[0106] The predetermined line feature determination module 320 is connected to the set acquisition module 310 and is used to determine a predetermined line feature among the unmerged line features in the line feature set and determine one of the endpoints of the predetermined line feature as the endpoint to be updated.
[0107] The first set determination module 330 is connected to the predetermined line feature determination module 320 and is configured to determine a first set from the unmerged line features in the line feature set according to relative positions with the endpoints to be updated.
[0108] The second set determining module 340 is connected to the first set determining module 330 and is configured to determine a first subset and a second subset in the first set according to relative positions to the predetermined straight line feature.
[0109] The partition line feature determination module 350 is connected to the second set determination module 340 and is used to determine whether there is a partition line feature with structural partitioning semantics in the second subset.
[0110] The straight line feature merging module 360 is connected to the dividing straight line feature determining module 350 and is used to merge the straight line features in the first subset with the predetermined straight line features to update the endpoints to be updated and the predetermined straight line features when the dividing straight line feature determining module 350 determines that there are no dividing straight line features.
[0111] At the same time, the first set determination module 330, the second set determination module 340, the divided straight line feature determination module 350 and the straight line feature merging module 360 will repeatedly execute corresponding steps until the predetermined conditions are met.
[0112] The device 300 for merging straight line features may be any device with information processing capabilities, such as a computer or a mobile phone, and is not limited here.
[0113] At the same time, the set acquisition module 310, the predetermined straight line feature determination module 320, the first set determination module 330, the second set determination module 340, the divided straight line feature determination module 350, and the straight line feature merging module 360 of the present application cooperate with each other when working to complete the steps in the method of straight line feature merging in any of the above-mentioned embodiments. The detailed steps can be found in the above-mentioned embodiments and will not be repeated here.
[0114] See Figure 8 , Figure 8 The computer-readable storage medium 400 stores a computer program 410, which can be executed by a processor to implement the steps of any of the above methods.
[0115] Among them, the computer-readable storage medium 400 can specifically be a device that can store the computer program 410, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it can also be a server that stores the computer program 410. The server can send the stored computer program 410 to other devices for execution, or it can also run the stored computer program 410 itself.
[0116] The above description is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for merging straight line features, characterized in that: The method comprises: Get the line feature set; Determining a predetermined straight line feature among the unmerged straight line features in the straight line feature set, and determining one of the endpoints of the predetermined straight line feature as an endpoint to be updated; Determine a first set among the unmerged line features in the line feature set according to relative positions with the endpoints to be updated; determining a first subset and a second subset in the first set according to relative positions to the predetermined straight line feature; Determining whether there is a dividing line feature with structural dividing semantics in the second subset; wherein the dividing line feature with structural dividing semantics represents a dividing line between two different structures; When the dividing line feature does not exist, merging the line features in the first subset with the predetermined line feature to update the endpoint to be updated and the predetermined line feature; Returning to the step of determining the first set of unmerged line features in the line feature set according to relative positions with the endpoints to be updated, until a predetermined condition is satisfied; In which, the straight line features in the first subset are defined as first straight line features, and the straight line features in the second subset are defined as second straight line features. The step of determining whether there is a dividing straight line feature with structural dividing semantics in the second subset includes: determining whether there is a second straight line feature in the second subset, the angle difference between the first angle with the predetermined straight line feature and the second angle with at least one of the first straight line features being less than a difference threshold; if so, determining that the dividing straight line feature exists in the second subset; if not, determining that the dividing straight line feature does not exist in the second subset.
2. The method according to claim 1, characterized in that The method further comprises: When the dividing line feature exists in the second subset, it is determined that the endpoint to be updated cannot be updated.
3. The method according to claim 1, characterized in that The step of determining a first set of unmerged line features in the line feature set according to relative positions with the endpoints to be updated includes: Among the unmerged line features in the line feature set, line features having at least one endpoint falling within a circular area of a predetermined size with the endpoint to be updated as the center are selected to form the first set.
4. The method according to claim 1, wherein The step of determining a first subset and a second subset in the first set according to relative positions to the predetermined straight line feature comprises: In the first set, the line features whose angles with the predetermined line feature are smaller than an angle threshold are selected to form the first subset, and the remaining line features form the second subset.
5. The method according to claim 1, wherein The step of merging the straight line features in the first subset with the predetermined straight line features to update the endpoint to be updated and the predetermined straight line features includes: determining whether there is a line feature to be merged in the first subset that can be merged with the predetermined line feature; If the line feature to be merged exists, merging the line feature to be merged with the predetermined line feature to update the endpoint to be updated and the predetermined line feature; If the straight line feature to be merged does not exist, it is determined that the endpoint to be updated cannot be updated.
6. The method according to claim 5, characterized in that The step of determining whether there is a line feature to be merged in the first subset that can be merged with the predetermined line feature comprises: Whether the line features in the first subset are the line features to be merged is determined in order from small to large angles with the predetermined line features.
7. The method according to claim 5, characterized in that The step of determining whether there is a line feature to be merged in the first subset that can be merged with the predetermined line feature comprises: Determine whether there is a line feature in the first subset whose vertical projection point of an endpoint away from the endpoint to be updated on the line where the predetermined line feature is located falls outside the predetermined line feature; If so, determining that the line feature to be merged exists in the first subset; If not, it is determined that the line feature to be merged does not exist in the first subset.
8. The method according to claim 7, characterized in that The step of merging the to-be-merged straight line feature with the predetermined straight line feature to update the to-be-updated endpoint and the predetermined straight line feature includes: Determine a vertical projection point of an endpoint of the to-be-merged straight line feature away from the endpoint to be updated on the straight line where the predetermined straight line feature is located; The predetermined straight line feature is extended to the vertical projection point to obtain the updated predetermined straight line feature, wherein the vertical projection point is the updated endpoint to be updated.
9. The method according to claim 2 or 5, characterized in that The predetermined condition includes: determining that the endpoint to be updated cannot be updated.
10. The method according to claim 1, characterized in that After the predetermined condition is met, the method further includes: Determining another endpoint of the predetermined straight line feature as the endpoint to be updated; Repeating the step of determining the first set among the unmerged line features in the line feature set based on their relative positions to the endpoint to be updated, and returning to the step of determining the first set among the unmerged line features in the line feature set based on their relative positions to the endpoint to be updated, until a predetermined condition is satisfied; When the predetermined condition is met again, it is determined that the merging of the predetermined straight line features is completed.
11. The method according to claim 10, characterized in that After determining that the merging of the predetermined straight line features is completed, the method further includes: Return to executing the step of determining a predetermined straight line feature from the unmerged straight line features in the straight line feature set until the traversal of the unmerged straight line features in the straight line feature set is completed.
12. The method according to claim 11, characterized in that The method further comprises: saving the merged straight line features obtained after completing the merging of the predetermined straight line features each time to obtain a merged set; The straight line features in the merged set whose length is less than a length threshold are eliminated.
13. A device for merging straight line features, characterized in that: The device for merging straight line features includes a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit respectively, the memory stores program data, and the processor implements the steps in the method as described in any one of claims 1 to 12 by executing the program data in the memory.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Ground buildings recognition positioning method
CN101114337A
Method for quickly extracting building three-dimensional outline information in onboard LiDAR (light detection and ranging) data
CN102915558A