Inlay line optimization method, device, electronic equipment and medium
By optimizing mosaic lines during the image mosaic process, using auxiliary data and local optimization processing technology, the problem of poor mosaic lines optimization in the existing technology is solved, and the quality and accuracy of image mosaics are improved.
Patent Information
- Application Number
- CN202411111674.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-08-13
AI Technical Summary
The prior art is difficult to effectively optimize the mosaic line during the image mosaic process, resulting in low quality of the final mosaic image.
By obtaining orthographic images and auxiliary data carrying the initial mosaic line to be optimized, the optimization area is determined in the effective overlapping area, the candidate route is obtained based on the auxiliary data, the initial mosaic line is optimized, and the optimized mosaic line is replaced by local optimization processing to obtain the optimized mosaic line.
The quality of image mosaic is improved, ensuring that the mosaic line follows the road, and avoiding obvious land features such as buildings, thereby maintaining the integrity of land objects and the accuracy of the mosaic line.
Smart Images

Figure CN119107382B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of computer vision, image processing, and the like, and in particular to a mosaic line optimization method, device, electronic device, storage medium, and computer program product. Background Art
[0002] Image mosaicking is the process of stitching two or more orthophotos together to form a larger image. Image mosaicking is usually achieved using a mosaic line-based method. The quality of the mosaic line directly affects the quality of the final mosaicked image. Therefore, the optimization of the mosaic line is a key step in the image mosaicking process. Summary of the invention
[0003] The present invention provides a mosaic line optimization method, device, electronic equipment, storage medium and computer program product.
[0004] According to one aspect of the present invention, a mosaic line optimization method is provided, comprising: obtaining a first orthophoto and a second orthophoto carrying an initial mosaic line to be optimized, and auxiliary data for optimizing the initial mosaic line, wherein the initial mosaic line is constructed in an effective overlapping area between the first orthophoto and the second orthophoto; determining an optimization area containing the initial mosaic line in the effective overlapping area, wherein the optimization area indicates an area range for optimizing the initial mosaic line; in response to obtaining at least one candidate road line matching the optimization area based on the auxiliary data, optimizing the initial mosaic line based on the at least one candidate road line to obtain a first optimized mosaic line; determining at least one first optimized mosaic line segment passing through a non-road line in the first optimized mosaic line, and sequentially performing local optimization processing on each first optimized mosaic line segment in the at least one first optimized mosaic line segment to obtain at least one second optimized mosaic line segment; replacing at least one first optimized mosaic line segment in the first optimized mosaic line with the at least one second optimized mosaic line segment to obtain a second optimized mosaic line, and using the second optimized mosaic line as the optimized mosaic line.
[0005] According to another aspect of the present invention, there is provided a mosaic line optimization device, comprising: an acquisition module, for acquiring a first orthophoto and a second orthophoto carrying an initial mosaic line to be optimized, and auxiliary data for optimizing the initial mosaic line, wherein the initial mosaic line is constructed in an effective overlapping area between the first orthophoto and the second orthophoto; a determination module, for determining an optimization area containing the initial mosaic line in the effective overlapping area, wherein the optimization area indicates an area range for optimizing the initial mosaic line; a first optimization module, for optimizing the initial mosaic line based on at least one candidate road line in response to obtaining at least one candidate road line matching the optimization area based on the auxiliary data, to obtain a first optimized mosaic line; a second optimization module, for determining at least one first optimized mosaic line segment in the first optimized mosaic line passing through a non-road line, and performing local optimization processing on each first optimized mosaic line segment in the at least one first optimized mosaic line segment in turn, to obtain at least one second optimized mosaic line segment; a replacement module, for replacing at least one first optimized mosaic line segment in the first optimized mosaic line with at least one second optimized mosaic line segment, to obtain a second optimized mosaic line, and using the second optimized mosaic line as the optimized mosaic line.
[0006] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method as described above.
[0007] According to another aspect of the present invention, a computer-readable storage medium is provided, on which executable instructions are stored. When the instructions are executed by a processor, the processor executes the method as described above.
[0008] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which implements the method described above when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 is a flow chart of a mosaic line optimization method according to an embodiment of the present invention;
[0011] Figure 2A is a schematic diagram of a process of obtaining at least one reference road line according to an embodiment of the present invention;
[0012] Figure 2B Shows the Figure 2A Schematic diagram of the effect of connecting the starting point and end point of the initial tessellation line with the two-dimensional triangular mesh;
[0013] Figure 2C Shown based on Figure 2B A schematic diagram of a first undirected graph constructed by multiple candidate endpoints in;
[0014] Figure 2D Shows Figure 2C Schematic diagram of the shortest path in ;
[0015] Figure 2E Shown according to Figure 2D A schematic diagram of a first optimized tessellation line determined by the shortest path;
[0016] Figure 3A Shown based on Figure 2E A schematic diagram of a first reference pixel point and a second reference pixel point determined by a first optimized mosaic line segment X1a in FIG.
[0017] Figure 3B Shown based on Figure 3A A schematic diagram of a second undirected graph constructed by multiple first pixel points in;
[0018] Figure 3C Shows Figure 3B Schematic diagram of the shortest path in ;
[0019] Figure 3D Shown according to Figure 3C Schematic diagram of local tessellation segments determined by the shortest path;
[0020] Figure 3E Shows the Figure 3A A schematic diagram of a second optimized tessellation line segment generated after local optimization processing of the first optimized tessellation line segment in ;
[0021] Figure 4 is a flow chart of a mosaic line optimization method according to another embodiment of the present invention;
[0022] Figure 5 is a block diagram of a mosaic line optimization device according to an embodiment of the present invention;
[0023] Figure 6 is a block diagram of an electronic device suitable for implementing a mosaic line optimization method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention and the drawings in the embodiments. 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 belong to the scope of protection of the present invention.
[0025] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
[0026] In addition, in the description of the present invention, the terms “first”, “second”, “third”, etc. (if any) are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0027] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision, disclosure and application of the data involved (for example, including but not limited to user personal information) shall comply with the relevant laws and regulations of relevant countries and regions and shall not violate public order and good morals.
[0028] In addition, in the technical solution of the present invention, before obtaining or collecting relevant data, the authorization or consent of the data owner is obtained.
[0029] Figure 1 is a flow chart of a mosaic line optimization method according to an embodiment of the present invention.
[0030] like Figure 1 As shown, the tessellation line optimization method 100 includes operations S110 to S150.
[0031] In operation S110, a first orthophoto and a second orthophoto carrying an initial mosaic line to be optimized, and auxiliary data for optimizing the initial mosaic line are acquired.
[0032] In operation S120 , an optimized region including an initial tessellated line is determined in the valid overlapping region.
[0033] In operation S130, in response to obtaining at least one candidate road line matching the optimization area based on the auxiliary data, the initial tessellated line is optimized based on the at least one candidate road line to obtain a first optimized tessellated line.
[0034] In operation S140, at least one first optimized tessellated line segment passing through the non-road line in the first optimized tessellated line is determined, and each of the at least one first optimized tessellated line segment is locally optimized in turn to obtain at least one second optimized tessellated line segment.
[0035] In operation S150, at least one first optimized tessellation line segment in the first optimized tessellation line is replaced with at least one second optimized tessellation line segment to obtain a second optimized tessellation line, and the second optimized tessellation line is used as the optimized tessellation line.
[0036] According to an embodiment of the present invention, both the first orthoimage and the second orthoimage may include data of multiple bands, for example, including R (Red) band data, G (Green) band data, B (Blue) band data, etc. Of course, the embodiment of the present invention is not limited thereto, and in some embodiments, the first orthoimage and the second orthoimage may also include data of other bands.
[0037] According to an embodiment of the present invention, the initial mosaic line to be optimized is constructed, for example, within the effective overlapping area between the first orthophoto and the second orthophoto. The effective overlapping area refers to the overlapping portion between the effective areas of the first orthophoto and the second orthophoto, which can be determined based on the effective areas of the first orthophoto and the second orthophoto, respectively. Unless otherwise specified, the effective overlapping area referred to in the present invention refers to the effective overlapping area between the first orthophoto and the second orthophoto.
[0038] It is understood that the initial mosaic line to be optimized can be constructed by any solution in the related art, and the present invention does not limit the method of obtaining the initial mosaic line. However, when constructing the initial mosaic line in the effective overlapping area, the related art usually makes it difficult to make the initial mosaic line effectively avoid obvious features such as buildings, so the initial mosaic line needs to be further optimized.
[0039] In the embodiment of the present invention, the auxiliary data includes, for example, but is not limited to, road line vector data, road surface vector data, building surface vector data, and raster data associated with the above-mentioned effective overlapping area. The auxiliary data can be used as a priori to optimize the direction of the initial mosaic line, so that the optimized mosaic line is as close to the road direction as possible to avoid crossing obvious ground features such as buildings. This not only maintains the integrity of obvious ground targets such as buildings, but also ensures the accuracy of the optimized mosaic line, which is conducive to improving the quality of image mosaicking.
[0040] According to an embodiment of the present invention, in order to prevent the direction of the inlay line from exceeding the effective overlapping area during the optimization process of the initial inlay line, thereby causing deviations in the optimization process of the initial inlay line and resulting in an unsatisfactory final result, an optimization area containing the initial inlay line can be determined in the effective overlapping area, and the optimization area indicates the area range for optimizing the initial inlay line. When the initial inlay line is optimized in the optimization area, the optimization process of the initial inlay line will not be disturbed. Exemplarily, for example, a first preset area range containing the initial inlay line in the effective overlapping area can be determined as the optimization area, wherein the first preset area range can be set according to actual needs, and the present invention does not limit this.
[0041] After the optimization area is determined, next, it is determined whether at least one candidate road line matching the optimization area can be acquired based on the auxiliary data.
[0042] It can be understood that each candidate road line can be represented by road line vector data. The road line vector data includes coordinate data and attribute information of the candidate road line. Among them, the coordinate data of the candidate road line includes the coordinate data of the first endpoint on the candidate road line, and the first endpoint may include, for example, the starting endpoint and the ending endpoint of the candidate road line, or include a string of shape points (point string) forming the candidate road line. The attribute information of the candidate road line includes, but is not limited to, the identification information of the candidate road line and the width of the candidate road line.
[0043] Whether the candidate road line is located within the coverage of the optimization area can be determined based on the road line vector data corresponding to each candidate road line and the position information corresponding to the optimization area, thereby determining whether the candidate road line is a candidate road line that matches the optimization area. If the position of a candidate road line is determined to be within the coverage of the optimization area based on the road line vector data of the candidate road line and the position information corresponding to the optimization area, the candidate road line is determined to be a candidate road line that matches the optimization area; otherwise, the candidate road line is considered not to be a candidate road line that matches the optimization area.
[0044] In view of this, the corresponding road line vector data may be searched in the auxiliary data to obtain the candidate road line matching the optimization area.
[0045] If no candidate road line matching the optimization area is obtained based on the auxiliary data, the initial mosaic line can be optimized based on the raster data, road surface vector data, building surface vector data, etc. associated with the effective overlapping area in the auxiliary data. This process will be described later.
[0046] If at least one candidate road line matching the optimization area is obtained based on the auxiliary data, the initial mosaic line can be optimized based on the at least one candidate road line to obtain a first optimized mosaic line. The initial mosaic line is optimized by using the road line vector data in the auxiliary data as a priori, so that a part of the mosaic line segments in the initial mosaic line can be along the road line direction, thereby achieving preliminary optimization of the initial mosaic line.
[0047] The first optimized mosaic line obtained through the above optimization process also includes at least one first optimized mosaic line segment passing through a non-road line. Next, the at least one first optimized mosaic line can be further optimized using raster data, road surface vector data, building surface vector data, etc. in the auxiliary data to obtain an optimized mosaic line.
[0048] For example, based on the above auxiliary data, at least one first optimized mosaic line segment can be locally optimized in sequence to obtain at least one second optimized mosaic line segment. Then, at least one second optimized mosaic line segment is used to replace at least one first optimized mosaic line segment in the first optimized mosaic line to obtain a second optimized mosaic line, and the second optimized mosaic line is used as the optimized mosaic line. By using the raster data, road surface vector data, building surface vector data, etc. in the auxiliary data as a priori to further optimize each first optimized mosaic line segment, each first optimized mosaic line segment is made to run along the road surface as much as possible, so that the optimized mosaic line is made to run along the road as a whole, so as to avoid crossing obvious land features such as buildings, thereby ensuring the accuracy of the optimized mosaic line.
[0049] According to the technical solution of the present invention, in the process of optimizing the initial mosaic line, on the one hand, by optimizing the initial mosaic line in the optimization area, the optimization process of the initial mosaic line is avoided from deviation, which provides a basis for obtaining accurate optimized mosaic lines. On the other hand, by using auxiliary data as a priori to optimize the direction of the initial mosaic line, the optimized mosaic line is made to follow the direction of the road as much as possible to avoid crossing obvious land features such as buildings. This not only maintains the integrity of obvious land features such as buildings, but also ensures the accuracy of the optimized mosaic line, which is conducive to improving the quality of image mosaicking.
[0050] Reference below FIG. 2A to FIG. 2E The process of obtaining the first optimized mosaic line is exemplarily described. It should be understood that FIG. 2A to FIG. 2E The optimization area, initial inlay line, candidate road line, reference road line, shortest path, and first optimized inlay line shown in FIG. 1 are only exemplary, and the technical solution of the present invention is not limited thereto.
[0051] The shape of the initial tessellation line to be optimized is as follows: Figure 2AAs shown. Similar to the candidate road lines, the initial inlay line 21 can be represented by vector data. The vector data includes coordinate data and attribute information of the initial inlay line 21. Among them, the coordinate data of the initial inlay line 21 includes the coordinate data of the third endpoint on the initial inlay line 21, and the third endpoint may include, for example, the starting point and the end point of the initial inlay line 21, or include a string of shape points (point string) forming the initial inlay line 21. The attribute information of the initial inlay line 21 includes but is not limited to the identification information of the initial inlay line 21 and the width of the initial inlay line 21.
[0052] In the embodiment of the present invention, the third endpoints on the initial inlay line 21 include a third endpoint X1 and a third endpoint X2, wherein the third endpoint X1 and the third endpoint X2 are the starting point and the end point of the initial inlay line 21, respectively.
[0053] Based on the above method, it can be determined that Figure 2A The optimization region 210 is shown. The initial inlay line 21 is included in the optimization region 210. The starting point (third endpoint X1) and the end point (third endpoint X2) of the initial inlay line 21 are both located on the boundary of the optimization region 210.
[0054] If at least one road line vector data matching the optimization area 210 is found in the auxiliary data, at least one candidate road line is obtained based on the at least one road line vector data, such as Figure 2A As shown, for example, it includes candidate road line A11A12, candidate road line A12A13, candidate road line A13A14, candidate road line A14A15, candidate road line A12A22, and so on.
[0055] As mentioned above, each candidate road line can be represented by road line vector data. The road line vector data includes coordinate data and attribute information of the candidate road line, and their definitions are the same as those in the above embodiment, which will not be repeated here. In the embodiment of the present invention, the first endpoint on each candidate road line includes the starting endpoint and the ending endpoint of the candidate road line. Take the candidate road line A11A12 as an example. The candidate road line A11A12 includes a first endpoint A11 and a first endpoint A12, wherein the first endpoint A11 and the first endpoint A12 are the starting endpoint and the ending endpoint of the candidate road line A11A12, respectively.
[0056] In the embodiment of the present invention, the initial tessellated line 21 is optimized based on at least one candidate road line to obtain a first optimized tessellated line, which includes the following process.
[0057] First, a first undirected graph is constructed based on at least one candidate road line and an initial mosaic line. FIG. 2A to FIG. 2C The construction process of the first undirected graph is described.
[0058] First, the candidate road line intersecting the boundary of the optimization area 210 is removed from at least one candidate road line to obtain at least one reference road line.
[0059] refer to Figure 2A As shown, all candidate road lines that intersect with the boundary of the optimization area 210 (e.g., candidate road line A11A12, candidate road line A21A22, etc.) can be removed from multiple candidate road lines to obtain multiple reference road lines, such as reference road line A12A13, reference road line A13A14, reference road line A12A22, and so on.
[0060] Through the above-mentioned method, it can be further ensured that the optimization processing of the initial inlay line 21 is completed within the optimization area 210, avoiding deviation in the optimization process of the initial inlay line 21, thereby further improving the effect of the inlay line optimization.
[0061] Similar to the candidate road lines, each reference road line can be represented by road line vector data. The road line vector data includes coordinate data and attribute information of the reference road line. The coordinate data of the reference road line includes coordinate data of the second endpoint on the reference road line, and the second endpoint may include, for example, the starting endpoint and the ending endpoint of the reference road line, or a string of shape points (point string) forming the reference road line. The attribute information of the reference road line includes, but is not limited to, the identification information of the reference road line and the width of the reference road line.
[0062] In the embodiment of the present invention, the second endpoint on each reference road line includes the starting endpoint and the ending endpoint of the reference road line. Take the reference road line A12A13 as an example. The reference road line A12A13 includes the second endpoint A12 and the second endpoint A13, wherein the second endpoint A12 and the second endpoint A13 are the starting endpoint and the ending endpoint of the reference road line A12A13, respectively.
[0063] Next, a first undirected graph is constructed based on at least one reference road line and the initial mosaic line 21. Figure 2B , Figure 2C The process of constructing the first undirected graph is exemplified.
[0064] First, the second endpoint of each reference road line in at least one reference road line is obtained. Then, based on the Delaunay triangulation algorithm, a two-dimensional triangular mesh is constructed according to each second endpoint of each reference road line in at least one reference road line.
[0065] Please refer to Figure 2BAs shown, the second endpoints of each reference road line in the plurality of reference road lines are obtained, such as the second endpoints A12, A13, A14, etc. Then, based on the Delaunay triangulation algorithm, a two-dimensional triangular mesh is constructed according to the second endpoints.
[0066] Next, the starting point and end point of the initial tessellation line 21 are used as search starting points respectively, and the first intersection point of the initial tessellation line 21 and the two-dimensional triangular mesh is searched to obtain the first intersection point and the second intersection point, and the first intersection point and the two-dimensional triangular mesh are connected by a first line segment, and the second intersection point and the two-dimensional triangular mesh are connected by a second line segment, so as to connect the starting point and end point of the initial tessellation line 21 with the two-dimensional triangular mesh.
[0067] In one example, if Figure 2B As shown, the starting point (e.g., the third endpoint X1) and the end point (e.g., the third endpoint X2) of the initial tessellation line 21 can be used as the search starting points, respectively, to search for reference line segments in the two-dimensional triangular mesh that the initial tessellation line 21 passes for the first time, and obtain the first reference line segment A13A14 and the second reference line segment A33A34. Then, the intersection points between the first reference line segment A13A14 and the second reference line segment A33A34 and the initial tessellation line 21 are determined, respectively, to obtain the first intersection point a and the second intersection point b. Among them, the first intersection point a and the second intersection point b are both points on the initial tessellation line 21. Next, the first intersection point a and at least one second endpoint (e.g., the second endpoints A13 and A14) of the first reference line segment A13A14 are connected by a first line segment, and the second intersection point b and at least one second endpoint (e.g., the second endpoints A33 and A34) of the second reference line segment A33A34 are connected by a second line segment.
[0068] Exemplarily, for example, the first intersection point a and the second endpoint A13 of the first reference line segment A13A14 can be connected by the first line segment A13a, and the first intersection point a and the second endpoint A14 of the first reference line segment A13A14 can be connected by the first line segment aA14. The second intersection point b and the second endpoint A33 of the second reference line segment A33A34 can be connected by the second line segment A33b, and the second intersection point b and the second endpoint A34 of the second reference line segment A33A34 can be connected by the second line segment bA34. Thus, the starting point (e.g., the third endpoint X1) and the end point (e.g., the third endpoint X2) of the initial tessellation line 21 are connected to the two-dimensional triangular mesh through the first line segment aA13, the first line segment aA14, the second line segment A33b and the second line segment bA34.
[0069] It should be noted that if there is no intersection between the initial tessellation line 21 and the two-dimensional triangular mesh, the initial tessellation line is globally optimized using auxiliary data, and this process will be described later.
[0070] For ease of description, each second endpoint in the two-dimensional triangular mesh, the starting point and the end point in the initial tessellation line, and each point in the first intersection point and the second intersection point are referred to as candidate endpoints below.
[0071] Next, a first undirected graph is constructed based on the multiple candidate endpoints and the connection relationship between the multiple candidate endpoints. For example, each of the multiple candidate endpoints is used as a first node in the first undirected graph, and a first edge between the first nodes in the first undirected graph is constructed based on the connection relationship between the multiple candidate endpoints.
[0072] Please refer to Figure 2C As shown, the candidate endpoint X1 corresponds to the first node X1 in the first undirected graph, the candidate endpoint X2 corresponds to the first node X2 in the first undirected graph, the candidate endpoint a corresponds to the first node a in the first undirected graph, the candidate endpoint A12 corresponds to the first node A12 in the first undirected graph, the candidate endpoint b corresponds to the first node b in the first undirected graph, and so on. Through the above operations, a mapping relationship between the candidate endpoints and the first nodes in the first undirected graph can be established. Subsequently, the candidate endpoint corresponding to a first node can be quickly obtained based on this mapping relationship.
[0073] Please continue to refer to Figure 2C , there is a connection relationship between the candidate endpoint X1 and the candidate endpoint a, so there is a first edge between the first node X1 and the first node a, denoted as B X1_a There is a connection relationship between candidate endpoint a and candidate endpoint A13, so there is a first edge between the first node a and the first node A13, denoted as B A13_a There is a connection relationship between candidate endpoint A12 and candidate endpoint A13, so there is a first edge between the first node A12 and the first node A13, denoted as B A12_A13 There is a connection relationship between candidate endpoint A22 and candidate endpoint A13, so there is a first edge between the first node A22 and the first node A13, denoted as B A22_A13 There is a connection relationship between candidate endpoint A33 and candidate endpoint b, so there is a first edge B between the first node A33 and the first node b. A33_b Similarly, the first edge between the first nodes can be constructed based on the connection relationship between other candidate endpoints. Through the above operations, a mapping relationship between the candidate endpoints and the first edge in the first undirected graph and a mapping relationship between the connection relationship between the candidate endpoints (or the line segment between the candidate endpoints) and the first edge in the first undirected graph can be established.
[0074] Through the above process, we can construct Figure 2C The first undirected graph is shown.
[0075] After the first undirected graph is determined, next, a first cost parameter corresponding to the first undirected graph is determined.
[0076] The first cost parameter includes first cost sub-parameters corresponding to each first edge in the first undirected graph. Each first cost sub-parameter is used to describe the cost or cost (Cost) of passing through the corresponding first edge.
[0077] In the embodiment of the present invention, the first cost parameter may be determined by the following operation: for any first edge in the first undirected graph, for example, the first cost sub-parameter corresponding to the first edge may be determined according to the length and width of the line segment between two candidate endpoints associated with the first edge. Then, the first cost parameter is obtained based on the first cost sub-parameter corresponding to each first edge.
[0078] In an embodiment of the present invention, the length and width of the line segment between the two candidate endpoints associated with the first edge can be determined based on the corresponding vector data, wherein the corresponding vector data is used to represent the vector line where the two candidate endpoints are located. Take determining the length and width of the line segment X1a between the candidate endpoints X1 and the candidate endpoint a as an example. The coordinate data corresponding to the candidate endpoint X1 and the candidate endpoint a and the width of the initial inlay line 21 can be determined based on the vector data corresponding to the initial inlay line 21. Then, the length of the line segment X1a is determined based on the coordinate data corresponding to the candidate endpoint X1 and the candidate endpoint a, and the width of the initial inlay line 21 is used as the width of the line segment X1a.
[0079] In one example, the first cost sub-parameter corresponding to the first edge is determined using the following formula.
[0080]
[0081] In formulas (1) and (2), represents the first cost sub-parameter corresponding to the first edge i, L i represents the length of the line segment i between the two candidate endpoints associated with the first edge i, W i represents the width of the line segment i between the two candidate endpoints associated with the first edge i, represents the width factor of the line segment i between the two candidate endpoints associated with the first edge i, θ and β represent the first truncation value and the second truncation value respectively, θ is less than β, α and Y represent constants, max() represents maximization calculation, min() represents minimization calculation, and i is a positive integer. Exemplarily, θ and β are 1 and 5 respectively, and α and Y are 0.2 and 5 respectively. Of course, the embodiments of the present invention are not limited to this example.
[0082] In an example, the first cost parameter can be expressed using the following formula.
[0083]
[0084] In formula (3), Cost1 represents the first cost parameter, represents the first cost sub-parameter corresponding to the first edge i, n represents the number of first edges in the first undirected graph, i=1, 2, ..., n, where n is a positive integer.
[0085] Next, the shortest path from the starting point to the end point of the initial tessellation line 21 is determined according to the first cost parameter and the first undirected graph to obtain a first optimized tessellation line.
[0086] Reference below Figure 2D , Figure 2E The process of obtaining the first optimized mosaic line is exemplarily described.
[0087] First, the first nodes corresponding to the starting point and the end point of the initial inlay line 21 are respectively determined as the first starting node and the first ending node. For example, the first node X1 corresponding to the starting point of the initial inlay line 21 (for example, the candidate endpoint X1) is used as the first starting node, and the first node X2 corresponding to the end point of the initial inlay line 21 (for example, the candidate endpoint X2) is used as the first ending node.
[0088] Next, based on the first cost parameter and the first node and the first edge in the first undirected graph, a first shortest path between the first start node and the first end node is determined.
[0089] The first undirected graph is a weighted undirected graph. A variety of algorithms can be used to determine the first shortest path from the first starting node to the first ending node, including but not limited to Dijkstra's Algorithm, Bellman-Ford Algorithm, Floyd-Warshall Algorithm, A-star algorithm, breadth-first search algorithm and other algorithms, which can be selected according to needs and are not limited here. The first shortest path is the path with the smallest sum of the first cost sub-parameters of the first edge passed between the first starting node and the first ending node.
[0090] The first node that the first shortest path passes through is a representation of each candidate endpoint, and the first edge that the first shortest path passes through is a representation of the connection relationship between each candidate endpoint. The first node on the first shortest path essentially represents the target endpoint that constitutes the first optimized tessellation line, and the first edge on the first shortest path essentially represents the connection relationship between the target endpoints that constitute the first optimized tessellation line. Based on the connection relationship between these target endpoints and target endpoints, the first optimized tessellation line can be obtained.
[0091] Assume that the first shortest path is Figure 2DThe first shortest path passes through the first node X1, the first node a, the first node A13, the first node A23, the first node A33, the first node b and the first node X2 in sequence. The first edge on the first shortest path includes the first edge BX 1_a 、First side B a_A13 、First side B A13_A23 、First side B A23_A33 、First side B A33_b 、First side B b_X2 Among them, the first side B g_j Represents the first edge between the first node g and the first node j.
[0092] Next, based on the first shortest path, a first optimized tessellation line is determined.
[0093] In the embodiment of the present invention, first, each target endpoint among a plurality of candidate endpoints is determined, and each target endpoint corresponds one-to-one to each first node on the first shortest path.
[0094] Please refer to Figure 2E , determine the target endpoint X1 based on the first node X1 on the first shortest path, determine the target endpoint a based on the first node a on the first shortest path, and so on, based on the first node A13, the first node A23, the first node A33, the first node b and the first node X2 on the first shortest path, obtain the target endpoint A13, the target endpoint A23, the target endpoint A33, the target endpoint b and the target endpoint X2 respectively.
[0095] Then, according to these target endpoints, a first optimized tessellation line is determined.
[0096] In one example, the first edge B on the first shortest path may be mapped to the first edge in the first undirected graph based on the connection relationship between the candidate endpoints (or the line segments between the candidate endpoints). X1_a , and obtain the first optimized tessellated line segment X1a. Similarly, based on the first edge B on the first shortest path a_A13 、First side B A13_A23 、First side B A23_A33 、First side B A33_b 、First side B b_X2 , correspondingly obtain the first optimized mosaic line segment aA13, the first optimized mosaic line segment A13A23, the first optimized mosaic line segment A23A33, the first optimized mosaic line segment A33b, and the first optimized mosaic line segment bX2. Next, based on these first optimized mosaic line segments, obtain the first optimized mosaic line 22 (such as Figure 2E shown).
[0097] In another example, based on the order of the first nodes on the first shortest path, ie, X1→a→A13→A23→A33→b→X2, the corresponding target endpoints are connected in sequence to obtain the following: Figure 2E A first optimized inlay line 22 is shown.
[0098] Based on the above description, it can be seen that the first optimized inlay line 22 includes a plurality of first optimized inlay line segments. Figure 2E As shown, a part of the first optimized mosaic line segments in the first optimized mosaic line 22 are first optimized mosaic line segments passing through road lines, and another part of the first optimized mosaic line segments are first optimized mosaic line segments passing through non-road lines. In the embodiment of the present invention, the first optimized mosaic line segment passing through a road line refers to a first optimized mosaic line segment overlapping with a reference road line, and the first optimized mosaic line segment passing through a non-road line refers to a first optimized mosaic line segment that does not overlap with any reference road line. For example, the first optimized mosaic line segment A13a, the first optimized mosaic line segment A13A23, the first optimized mosaic line segment A23A33, and the first optimized mosaic line segment A33b are first optimized mosaic line segments passing through road lines, and the first optimized mosaic line segment X1a and the first optimized mosaic line segment bX2 are first optimized mosaic line segments passing through non-road lines.
[0099] For each first optimized tessellated line segment passing through the non-road line in the first optimized tessellated line 22, each of them can be locally optimized in sequence using auxiliary data to obtain corresponding second optimized tessellated line segments.
[0100] It should be noted that the process of local optimization of each first optimized mosaic line segment passing through the non-road line is similar. Figure 2E Taking the first optimized tessellated line segment X1a in FIG. 1 as an example, the local optimization processing process of each first optimized tessellated line segment passing through the non-road line is introduced.
[0101] In the embodiment of the present invention, performing local optimization processing on the first optimized tessellated line segment passing through the non-road line may include, for example, the following process.
[0102] First, a local optimization region including the current first optimized mosaic line segment, such as the first optimized mosaic line segment X1a, is determined in the above-mentioned optimization region 210. Exemplarily, for example, a second preset region range including the first optimized mosaic line segment X1a in the optimization region 210 can be determined as the local optimization region, wherein the second preset region range can be set according to actual needs, and the present invention does not limit this.
[0103] Next, first grid data corresponding to the local optimization area is obtained from the auxiliary data, and pixel points included in the first grid data are determined to obtain a plurality of first pixel points.
[0104] For example, in Figure 3A The first grid data shown includes 12 grids, each grid ( Figure 3A A small square represents a grid in the figure) represents a pixel. Based on the first grid data, a plurality of first pixel points can be obtained, for example, including first pixel points G1, G2, ..., G12.
[0105] Next, according to the coordinate data corresponding to the starting point and end point of the current first optimized mosaic line segment, for example, the first optimized mosaic line segment Xla, the first starting pixel point and the first ending pixel point are determined, wherein the first starting pixel point and the first ending pixel point correspond one-to-one to the starting point and end point of the current first optimized mosaic line segment, respectively.
[0106] Vector data and raster data can be converted to each other. The conversion relationship between vector data and raster data can be used to convert the starting point and the end point of the first optimized mosaic line segment X1a to the first starting pixel and the first ending pixel. This facilitates the subsequent determination of the first reference pixel and the second reference pixel based on the first starting pixel and the first ending pixel.
[0107] In an embodiment of the present invention, the conversion relationship between the above-mentioned vector data and raster data refers to the conversion relationship between the coordinate data corresponding to the vector point in the vector data and the row and column numbers of the pixel points corresponding to the vector point in the raster data. Based on this conversion relationship, the row and column numbers corresponding to the first starting pixel point and the first ending pixel point can be determined according to the coordinate data corresponding to the starting point and the end point of the first optimized mosaic line segment X1a, so that the positions corresponding to the first starting pixel point and the first ending pixel point in the first raster data can be determined. Among them, the coordinate data corresponding to the starting point and the end point of the first optimized mosaic line segment X1a can be determined according to the vector data corresponding to the initial mosaic line 21.
[0108] Next, a first pixel point closest to the first starting pixel point and the first ending pixel point is determined among the plurality of first pixel points to obtain a first reference pixel point and a second reference pixel point.
[0109] Please continue to refer to Figure 3A Assuming that the first pixel points closest to the first starting pixel point and the first ending pixel point are the first pixel point G1 and the first pixel point G12 respectively, the first pixel point G1 is determined as the first reference pixel point, and the first pixel point G12 is determined as the second reference pixel point.
[0110] Next, the shortest path from the first reference pixel to the second reference pixel is determined to obtain a second shortest path.
[0111] In the embodiment of the present invention, obtaining the second shortest path includes the following process.
[0112] First, a second undirected graph is constructed based on a plurality of first pixel points.
[0113] Exemplarily, each first pixel point may be used as a second node in the second undirected graph, and a second edge between second nodes in the second undirected graph may be constructed based on an adjacency relationship between each first pixel point in the plurality of first pixel points.
[0114] Please refer to Figure 3B For example, the second undirected graph is constructed by using the first pixel points G1 to G12 as the second nodes in the second undirected graph. In this way, a mapping relationship between each first pixel point and the second node in the second undirected graph can be established, and the first pixel point corresponding to a second node can be quickly obtained based on this mapping relationship.
[0115] In the embodiment of the present invention, the first pixel points having an adjacency relationship with the first pixel point G1 include the first pixel points G2 and G4. The second edge between the second node G1 and the second node G2 can be determined based on the adjacency relationship between the first pixel point G1 and the first pixel point G2, which is recorded as the second edge B. G1_G2 The second edge between the second node G1 and the second node G4 is determined by the adjacency relationship between the first pixel point G1 and the first pixel point G4, which is recorded as the second edge B. G1_G4 Similarly, using the above method, the second edge between the corresponding second nodes can be determined based on the adjacency relationship between other first pixel points. Through the above operation, a mapping relationship between the first pixel points and the second edge in the second undirected graph and a mapping relationship between the adjacency relationship between the first pixel points and the second edge in the second undirected graph can be established.
[0116] Through the above process, we can construct Figure 3B The second undirected graph shown.
[0117] Next, a second cost parameter corresponding to the second undirected graph is determined.
[0118] In the embodiment of the present invention, the second cost parameter includes second cost sub-parameters corresponding to each second edge in the second undirected graph. Each second cost sub-parameter is used to describe the cost or price of passing through the corresponding second edge.
[0119] In one example, the following operation may be used to determine the second cost parameter.
[0120] First, for any second edge in the second undirected graph, the first target color difference values corresponding to the two first pixel points associated with the second edge are determined, and the maximum value of the first target color difference values corresponding to the two first pixel points is determined as the second cost sub-parameter corresponding to the second edge.
[0121] Then, based on the second cost sub-parameters corresponding to the respective second edges, a second cost parameter is obtained.
[0122] It should be noted that the process of obtaining the second cost sub-parameter corresponding to each second edge is similar. To save space, the following is to determine the second edge B between the second node G1 and the second node G2. G1_G2 The corresponding second cost sub-parameter is taken as an example to illustrate the process of obtaining the second cost sub-parameter.
[0123] First, determine the second side B G1_G2 The two associated first pixel points obtain the first pixel point G1 and the first pixel point G2.
[0124] Next, for the second side B G1_G2 For each of the two associated first pixel points, a first initial color difference value corresponding to the first pixel point is determined. The first initial color difference value indicates the difference between the pixel values of the first pixel point in the first orthophoto and the second orthophoto, respectively.
[0125] In one example, determining the first initial color difference value corresponding to each first pixel point may include the following operations: for each first pixel point, according to the pixel values corresponding to the first pixel point in the first orthoimage and the second orthoimage, determine the difference value of the pixel values of the first pixel point in each band, and determine the maximum value of the difference value of the pixel values of the first pixel point in each band as the first initial color difference value corresponding to the first pixel point.
[0126] For example, for the second side B G1_G2 For the associated first pixel point G1 and first pixel point G2, the difference value of the first pixel point G1 in the pixel values of each band can be determined according to the pixel values corresponding to the first pixel point G1 in the first orthoimage and the second orthoimage, and the maximum value of the difference value of the first pixel point G1 in the pixel values of each band can be determined as the first initial color difference value corresponding to the first pixel point G1. In addition, the difference value of the first pixel point G2 in the pixel values of each band can be determined according to the pixel values corresponding to the first pixel point G2 in the first orthoimage and the second orthoimage, and the maximum value of the difference value of the first pixel point G2 in the pixel values of each band can be determined as the first initial color difference value corresponding to the first pixel point G2.
[0127] Take the first orthophoto and the second orthophoto as an example. Both of them include R band data, G band data, and B band data. Assume that the pixel value corresponding to the first pixel point G1 in the first orthophoto is (R 1_G1 , G 1_G1 , B 1_G1 ), the pixel value corresponding to the first pixel point G1 in the second orthophoto is (R 2_G1 , G2_Gl , B 2_G1 ). The pixel value corresponding to the first pixel point G2 in the first orthophoto is (R 1_G2 , G 1_G2 , B 1_G2 ), the pixel values corresponding to the first pixel point G2 in the second orthophoto are (R 2_G2 , G 2_G2 , B 2_G2 ). Among them, R 1_G1 , G 1_G1 , B 1_G1 Respectively represent the R band pixel value, G band pixel value, and B band pixel value corresponding to the first pixel point G1 in the first orthophoto. 2_G1 , G 2_G1 , B 2_G1 Respectively represent the R band pixel value, G band pixel value, and B band pixel value corresponding to the first pixel point G1 in the second orthophoto. 1_G2 , G 1_G2 , B 1_G2 Respectively represent the R band pixel value, G band pixel value, and B band pixel value corresponding to the first pixel point G2 in the first orthophoto. 2_G2 , G 2_G2 , B 2_G2 They respectively represent the R-band pixel value, G-band pixel value, and B-band pixel value corresponding to the first pixel point G2 in the second orthoimage.
[0128] The difference value of the pixel values of the first pixel point G1 or the first pixel point G2 in each band can be calculated using the following formula (4).
[0129]
[0130] In formula (4), R 1_Gk represents the R band pixel value corresponding to the first pixel point Gk in the first orthophoto, R 2_Gk Indicates the R band pixel value corresponding to the first pixel point Gk in the second orthophoto, ΔR Gk Indicates the difference between the R band pixel values of the first pixel point Gk in the two orthophotos, G 1_Gk represents the pixel value of the G band corresponding to the first pixel point Gk in the first orthophoto, G 2_Gk Indicates the G band pixel value corresponding to the first pixel point Gk in the second orthophoto, ΔG Gk Indicates the difference between the pixel values of the first pixel Gk in the two orthophotos, B 1_Gk represents the B-band pixel value corresponding to the first pixel point Gk in the first orthophoto, B 2_GkIndicates the B-band pixel value corresponding to the first pixel point Gk in the second orthophoto, ΔB Gk Represents the difference value of the B-band pixel values corresponding to the first pixel point Gk in the two orthoimages, k=1, 2.
[0131] The first initial color difference value corresponding to the first pixel point G1 or the first pixel point G2 can be calculated using the following formula (5).
[0132] ΔS Gk =max(ΔR Gk , ΔG Gk , ΔB Gk ) (5)
[0133] In formula (5), ΔS Gk represents the first initial color difference value corresponding to the first pixel point Gk, max() represents maximization calculation, k=1, 2.
[0134] Based on the above formulas (4) to (5), the first initial color difference value corresponding to the first pixel point G1 and the first initial color difference value corresponding to the first pixel point G2 can be obtained.
[0135] Next, for the second side B G1_G2 For each of the two associated first pixel points, a first target color difference value corresponding to the first pixel point is determined according to a first initial color difference value corresponding to the first pixel point and a first cost coefficient.
[0136] In an example, for each first pixel point, a first target color difference value corresponding to the first pixel point may be obtained based on a ratio between a first initial color difference value corresponding to the first pixel point and a first cost coefficient.
[0137] For each first pixel point, the first cost coefficient is determined based on a first spatial position relationship between the first pixel point and the auxiliary vector surface.
[0138] Auxiliary vector surfaces include road vector surfaces and building vector surfaces. Among them, the road vector surface refers to the geometric shape of the road represented by the road surface vector data, which has corresponding spatial position information (such as coordinate data). The building vector surface refers to the geometric shape of the building represented by the building surface vector data, which has corresponding spatial position information (such as coordinate data). The road surface vector data and the building surface vector data are obtained based on the auxiliary data.
[0139] The first spatial position relationship between the first pixel point and the auxiliary vector plane refers to the spatial position relationship between the first pixel point and the auxiliary vector plane. It can be understood that each first pixel point has a corresponding row and column number in the first raster data. The coordinate data of the vector point corresponding to the first pixel point can be determined based on the row and column numbers of each first pixel point, so that it can be determined whether the vector point and the auxiliary vector plane are spatially associated based on the coordinate data of the vector point and the coordinate data of the auxiliary vector plane, and then it can be determined whether the first pixel point is spatially associated with the auxiliary vector plane, for example, the first pixel point is located in the auxiliary vector plane, or the first pixel point is located outside the auxiliary vector plane. In this way, the first spatial position relationship between the first pixel point and the auxiliary vector plane can be determined.
[0140] Take the determination of the first cost coefficient corresponding to the first pixel point G1 as an example. If the first spatial position relationship indicates that the first pixel point G1 is located in the road vector plane, the first cost coefficient corresponding to the first pixel point G1 is determined to be a first value. If the first spatial position relationship indicates that the first pixel point G1 is located in the building vector plane, the first cost coefficient corresponding to the first pixel point G1 is determined to be a second value, and the second value is greater than the first value. For example, the first value is, for example, 10, and the second value is, for example, 10. 5 Of course, the first value and the second value are not limited to this example, and can be set according to actual needs.
[0141] Similarly, by adopting the above method, the first cost coefficient corresponding to the first pixel point G2 can be determined.
[0142] Afterwards, the first target color difference value corresponding to the first pixel point G1 can be determined based on the first initial color difference value and the first cost coefficient corresponding to the first pixel point G1. The first target color difference value corresponding to the first pixel point G2 can be determined based on the first initial color difference value and the first cost coefficient corresponding to the first pixel point G2. Then, the maximum value of the first target color difference value corresponding to the first pixel point G1 and the first target color difference value corresponding to the first pixel point G2 is determined as the maximum value corresponding to the second edge B. G1_G2 The corresponding second cost sub-parameter.
[0143] Through the above operations, the second cost sub-parameters corresponding to the second edges in the second undirected graph can be determined. Then, based on the second cost sub-parameters corresponding to the second edges, the second cost parameters are obtained.
[0144] In an example, the second cost parameter can be expressed using the following formula.
[0145]
[0146] In formula (6), Cost2 represents the second cost parameter, represents the second cost sub-parameter corresponding to the second edge f, m represents the number of second edges in the second undirected graph, f=1, 2, ..., m, where m is a positive integer.
[0147] Next, the shortest path from the first reference pixel to the second reference pixel is determined based on the second cost parameter and the second undirected graph to obtain a second shortest path.
[0148] Reference below Figure 3C The process of determining the second shortest path is described.
[0149] First, the second nodes corresponding to the first reference pixel and the second reference pixel are respectively determined as the second starting node and the second ending node. For example, the second node G1 corresponding to the first reference pixel (i.e., the first pixel G1) is determined as the second starting node, and the second node G12 corresponding to the second reference pixel (i.e., the first pixel G12) is determined as the second ending node.
[0150] Next, based on the second cost parameter and the second node and the second edge in the second undirected graph, a third shortest path between the second start node and the second end node is determined.
[0151] The second undirected graph is a weighted undirected graph. The third shortest path between the second starting node and the second ending node can be determined based on the second cost parameter and the second node and the second edge in the second undirected graph, for example, based on a breadth-first search algorithm. The third shortest path is a path with the smallest sum of the second cost sub-parameters of the second edge passed between the second starting node and the second ending node.
[0152] The second nodes that the third shortest path passes through are representations of the first pixels, and the second sides that the third shortest path passes through are representations of the adjacency relationship between the first pixels. The second nodes on the third shortest path essentially represent the first target pixels on the shortest path from the first reference pixel to the second reference pixel. Based on these first target pixels, the shortest path from the first reference pixel to the second reference pixel, i.e., the second shortest path, can be obtained.
[0153] Assume that the third shortest path is Figure 3C The third shortest path passes through the second node G1, the second node G2, the second node G3, the second node G6, the second node G9, and the second node G12 in sequence. The second side on the third shortest path includes the second side B G1_G2 , Second side B G2_G3 , Second side B G3_G6 , Second side B G6_G9 , Second side B G9_G12 .
[0154] Next, based on the third shortest path, the shortest path from the first reference pixel to the second reference pixel is determined.
[0155] First, each first target pixel point among a plurality of first pixel points is determined, and each first target pixel point corresponds one-to-one to each second node on the third shortest path.
[0156] In an embodiment of the present invention, the first target pixel point G1 can be determined based on the second node G1 on the third shortest path, the first target pixel point G2 can be determined based on the second node G2 on the third shortest path, the first target pixel point G3 can be determined based on the second node G3 on the third shortest path, the first target pixel point G6 can be determined based on the second node G6 on the third shortest path, the first target pixel point G9 can be determined based on the second node G9 on the third shortest path, and the first target pixel point G12 can be determined based on the second node G12 on the third shortest path.
[0157] Next, based on the order of the second nodes on the third shortest path, i.e., G1→G2→G3→G6→G9→G12, the corresponding first target pixel points are connected in sequence to obtain the shortest path from the first reference pixel point to the second reference pixel point, i.e., the second shortest path.
[0158] After the second shortest path is determined, next, local mosaic line segments are obtained according to each first pixel point on the second shortest path.
[0159] Similarly, the conversion relationship between vector data and raster data can be used to convert each first pixel point on the second shortest path (i.e., the first target pixel point described above) to obtain a first target vector point corresponding to each first target pixel point. In an embodiment of the present invention, the coordinate data corresponding to the first target vector point can be determined based on the row and column number corresponding to each first pixel point. The row and column number corresponding to each first pixel point can be determined based on the first raster data.
[0160] like Figure 3D As shown, by converting the first target pixel points G1 to G12 on the second shortest path, the first target vector points G1 to G12 are obtained. By connecting these first target vector points, a local mosaic line segment G1G12 can be obtained. The starting point of the local mosaic line G1G12 is the first target vector point G1, and the end point is the first target vector point G12.
[0161] Next, a third line segment is constructed between the starting point of the current first optimized mosaic line segment, such as the first optimized mosaic line segment Xla, and the starting point of the local mosaic line segment, and a fourth line segment is constructed between the end point of the current first optimized mosaic line segment, such as the first optimized mosaic line segment Xla, and the end point of the local mosaic line segment, to obtain a second optimized mosaic line segment corresponding to the current first optimized mosaic line segment, such as the first optimized mosaic line segment X1a.
[0162] like Figure 3E As shown, a third line segment X1G1 is constructed between the starting point of the first optimized mosaic line segment X1a (e.g., candidate endpoint X1) and the first target vector point G1, and a fourth line segment G12a is constructed between the end point of the first optimized mosaic line segment X1a (e.g., candidate endpoint a) and the first target vector point G12. Thus, a second optimized mosaic line segment X1a corresponding to the current first optimized mosaic line segment, e.g., the first optimized mosaic line segment X1a, can be obtained. The second optimized mosaic line segment X1a is used to replace the first optimized mosaic line segment X1a in the first optimized mosaic line 22.
[0163] Based on the above process, other first optimized mosaic line segments in the first optimized mosaic line 22, such as the first optimized mosaic line segment bX2, can be locally optimized in sequence to obtain corresponding second optimized mosaic line segments. Thus, each second optimized mosaic line segment can be used to replace the corresponding first optimized mosaic line segment in the first optimized mosaic line to obtain a second optimized mosaic line, and the second optimized mosaic line is used as the optimized mosaic line.
[0164] Figure 4 is a flow chart of a mosaic line optimization method according to another embodiment of the present invention.
[0165] like Figure 4 As shown, in the embodiment of the present invention, the mosaic line optimization method 400 includes operations S410-450 and operations S401-S403. Operations S410-S450 are respectively implemented in the same manner as the corresponding operations in the above embodiments, and the repeated parts are not described in detail here.
[0166] In operation S410, a first orthophoto and a second orthophoto carrying an initial mosaic line to be optimized, and auxiliary data for optimizing the initial mosaic line are obtained, wherein the initial mosaic line is constructed in a valid overlapping area between the first orthophoto and the second orthophoto.
[0167] In operation S420, an optimized region including the initial tessellation line is determined in the effective overlapping region, and the optimized region indicates a region range for optimizing the initial tessellation line.
[0168] In operation S401, it is determined whether at least one candidate road line matching the optimization area can be acquired based on the auxiliary data. If yes, operation S430 is performed, and if not, operation S402 is performed.
[0169] In operation S430, the initial tessellated line is optimized based on at least one candidate road line to obtain a first optimized tessellated line.
[0170] In operation S440, at least one first optimized tessellated line segment passing through the non-road line in the first optimized tessellated line is determined, and each of the at least one first optimized tessellated line segment is locally optimized in turn to obtain at least one second optimized tessellated line segment.
[0171] In operation S450, at least one first optimized tessellation line segment in the first optimized tessellation line is replaced with at least one second optimized tessellation line segment to obtain a second optimized tessellation line, and the second optimized tessellation line is used as the optimized tessellation line.
[0172] In operation S402, the initial tessellation line is globally optimized to obtain a third optimized tessellation line, and the third optimized tessellation line is used as the optimized tessellation line.
[0173] In an embodiment of the present invention, performing global optimization processing on the initial tessellation line to obtain the third optimized tessellation line includes, for example, the following process.
[0174] First, the second grid data corresponding to the optimized area is obtained from the auxiliary data, and the pixel points contained in the second grid data are determined to obtain a plurality of second pixel points. In the embodiment of the present invention, the process of determining the plurality of second pixel points is similar to the process of determining the plurality of first pixel points, and will not be repeated here.
[0175] Next, according to the coordinate data corresponding to the starting point and the end point of the initial mosaic line, the second starting pixel point and the second ending pixel point are determined, wherein the second starting pixel point and the second ending pixel point correspond one-to-one to the starting point and the end point of the initial mosaic line, respectively. In the embodiment of the present invention, the process of obtaining the second starting pixel point and the second ending pixel point is similar to the process of obtaining the first starting pixel point and the first ending pixel point, and will not be repeated here.
[0176] Next, a second pixel point closest to the second starting pixel point and the second ending pixel point is determined among the plurality of second pixel points to obtain a third reference pixel point and a fourth reference pixel point, wherein the second starting pixel point and the second ending pixel point correspond to the starting point and the end point of the initial mosaic line respectively.
[0177] In the embodiment of the present invention, the process of determining the third reference pixel and the fourth reference pixel is similar to the process of determining the shortest path from the first reference pixel to the second reference pixel, and is not described in detail here.
[0178] Next, the shortest path from the third reference pixel to the fourth reference pixel is determined to obtain a fourth shortest path.
[0179] In the embodiment of the present invention, determining the fourth shortest path includes the following process.
[0180] First, a third undirected graph is constructed based on multiple second pixel points. For example, each second pixel point can be used as a third node in the third undirected graph, and a third edge between third nodes in the third undirected graph can be constructed based on the adjacency relationship between each second pixel point in the multiple second pixel points. In an embodiment of the present invention, the method of constructing the third undirected graph is similar to the method of constructing the second undirected graph above, and will not be repeated here.
[0181] Next, a third cost parameter corresponding to the third undirected graph is determined.
[0182] The third cost parameter includes a third cost sub-parameter corresponding to each third edge in the third undirected graph. Each third cost sub-parameter is used to describe the cost or expense of passing through the corresponding third edge. In an embodiment of the present invention, the method for determining the third cost parameter is the same as or similar to the method for determining the second cost parameter. In order to save space, the method for obtaining the third cost parameter is briefly described here.
[0183] First, for any third edge in the third undirected graph, determine the second target color difference values corresponding to each of the two second pixel points associated with the third edge, and determine the maximum value of the second target color difference values corresponding to each of the two second pixel points as the third cost sub-parameter corresponding to the third edge.
[0184] In the embodiment of the present invention, the second target color difference values respectively corresponding to two second pixel points associated with the third side may be determined in the following manner.
[0185] For each of the two second pixel points associated with the third edge, a second initial color difference value corresponding to the second pixel point is determined, and the second initial color difference value indicates the difference between the pixel values of the second pixel point in the second orthophoto and the second orthophoto, respectively. Then, for each second pixel point, a second target color difference value corresponding to the second pixel point is determined according to the second initial color difference value corresponding to the second pixel point and the second cost coefficient. The second cost coefficient is determined based on the second spatial position relationship between the second pixel point and the auxiliary vector surface, and the auxiliary vector surface is obtained based on the auxiliary data.
[0186] In one example, for each second pixel point, the difference value of the second pixel point in the pixel values of each band can be determined according to the pixel values corresponding to the second pixel point in the first orthophoto and the second orthophoto, and the maximum value of the difference value of the second pixel point in the pixel values of each band is determined as the second initial color difference value corresponding to the second pixel point. It should be noted that the process of determining the second initial color difference value is similar to that of determining the first initial color difference value, and will not be described in detail here.
[0187] In an example, for each second pixel point, a second target color difference value corresponding to the second pixel point may be obtained based on a ratio between a second initial color difference value corresponding to the second pixel point and a second cost coefficient.
[0188] In the embodiment of the present invention, the second cost coefficient is determined in the following manner: if the second spatial position relationship indicates that the second pixel point is located in the road vector plane, the second cost coefficient corresponding to the second pixel point is determined to be a third value. If the second spatial position relationship indicates that the second pixel point is located in the building vector plane, the second cost coefficient corresponding to the second pixel point is determined to be a fourth value, and the fourth value is greater than the third value. In the embodiment of the present invention, the third value and the fourth value can be set according to actual needs, and there is no limitation here.
[0189] It should be noted that in the embodiments of the present invention, the definition and acquisition methods of auxiliary vector planes, road vector planes, building vector planes, etc. are the same as those described in the above embodiments, and the method for determining the second spatial position relationship is the same or similar to the method for determining the first spatial position relationship, which will not be repeated here.
[0190] Through the above process, the third cost sub-parameters corresponding to each third edge may be determined.
[0191] Next, based on the third cost sub-parameters corresponding to the third edges, a third cost parameter is obtained. The third cost parameter is expressed in a similar manner to the second cost parameter, and will not be described in detail here.
[0192] After determining the third cost parameter, next, the shortest path from the third reference pixel to the fourth reference pixel is determined according to the third cost parameter and the third undirected graph to obtain a fourth shortest path. In the embodiment of the present invention, the process of determining the fourth shortest path is similar to the process of determining the second shortest path above, and will not be repeated here.
[0193] Next, a global mosaic line segment is obtained according to each second pixel point in the fourth shortest path.
[0194] In an embodiment of the present invention, the conversion relationship between vector data and raster data can be used to convert each second pixel point on the fourth shortest path, thereby obtaining a second target vector point corresponding to each second target pixel point. By connecting these second target vector points, a global mosaic line segment can be obtained. It should be noted that the process of determining the second target vector point is similar to the process of determining the first target vector point, and will not be described in detail here.
[0195] Next, a fifth line segment is constructed between the starting point of the initial tessellation line and the starting point of the global tessellation line segment, and a sixth line segment is constructed between the end point of the initial tessellation line and the end point of the global tessellation line segment, to obtain a third optimized tessellation line, ie, the optimized tessellation line.
[0196] Returning to operation S403 , the first orthoimage and the second orthoimage are mosaicked based on the optimized mosaicking lines to obtain a mosaicked image.
[0197] It can be understood that since the optimized mosaic line follows the road direction as much as possible and avoids crossing obvious land features such as buildings, this not only maintains the integrity of obvious land features such as buildings, but also ensures the accuracy of the optimized mosaic line, thereby improving the quality of image mosaicking.
[0198] It should be noted that the mosaic line optimization method in the embodiment of the present invention is not only applicable to optimizing the initial mosaic line between two orthophotos, but also applicable to optimizing the initial mosaic line between each two adjacent orthophotos in a mosaic line network of multiple orthophotos. When optimizing the initial mosaic line between two adjacent orthophotos in the mosaic line network, the determined optimization area does not include other initial mosaic lines except the initial mosaic line, thereby preventing the optimization process of the initial mosaic line from being disturbed by other initial mosaic lines, thereby improving the accuracy of mosaic line optimization.
[0199] Figure 5 is a block diagram of a mosaic line optimization device according to an embodiment of the present invention.
[0200] like Figure 5 As shown, the inlay line optimization device 500 includes: an acquisition module 510, a determination module 520, a first optimization module 530, a second optimization module 540 and a replacement module 550.
[0201] The acquisition module 510 is used to acquire the first orthoimage and the second orthoimage carrying the initial mosaic line to be optimized, as well as auxiliary data for optimizing the initial mosaic line, where the initial mosaic line is constructed within the effective overlapping area between the first orthoimage and the second orthoimage.
[0202] The determination module 520 is used to determine an optimized region including the initial mosaic line in the effective overlapping region, and the optimized region indicates a region range for optimizing the initial mosaic line.
[0203] The first optimization module 530 is used for optimizing the initial inlay line based on at least one candidate road line matching the optimization area in response to obtaining at least one candidate road line based on the auxiliary data to obtain a first optimized inlay line.
[0204] The second optimization module 540 is used to determine at least one first optimized tessellated line segment passing through the non-road line in the first optimized tessellated line, and perform local optimization processing on each first optimized tessellated line segment in the at least one first optimized tessellated line segment in turn to obtain at least one second optimized tessellated line segment.
[0205] The replacement module 550 is used to replace at least one first optimized tessellation line segment in the first optimized tessellation line with at least one second optimized tessellation line segment to obtain a second optimized tessellation line, and use the second optimized tessellation line as the optimized tessellation line.
[0206] It should be noted that the implementation methods, technical problems solved, functions realized, and technical effects achieved of each module in the device part embodiment are the same or similar to the implementation methods, technical problems solved, functions realized, and technical effects achieved of each corresponding step in the method part embodiment, and will not be repeated here.
[0207] Figure 6 A block diagram of an electronic device suitable for implementing a mosaic line optimization method according to an embodiment of the present invention is schematically shown.
[0208] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0209] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0210] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0211] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the inlay line optimization method according to the embodiment of the present invention is implemented.
[0212] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0213] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the inlay line optimization method provided by the embodiment of the present invention.
[0214] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 601. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0215] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0216] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0217] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages, specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed completely on the user computing device, partially on the user device, partially on the remote computing device, or completely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0218] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0219] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0220] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A method for optimizing a mosaic line, characterized in that: include: Acquire a first orthophoto and a second orthophoto carrying an initial mosaic line to be optimized, and auxiliary data for optimizing the initial mosaic line, wherein the initial mosaic line is constructed within a valid overlapping area between the first orthophoto and the second orthophoto; Determine an optimized region including the initial tessellation line in the effective overlapping region, wherein the optimized region indicates a region range for optimizing the initial tessellation line; In response to obtaining at least one candidate road line matching the optimization area based on the auxiliary data, optimizing the initial tessellated line based on the at least one candidate road line to obtain a first optimized tessellated line; Determine at least one first optimized tessellated line segment passing through the non-road line in the first optimized tessellated line, and perform local optimization processing on each first optimized tessellated line segment in turn based on the auxiliary data to obtain at least one second optimized tessellated line segment; The at least one second optimized tessellation line segment is used to correspondingly replace the at least one first optimized tessellation line segment in the first optimized tessellation line to obtain a second optimized tessellation line, and the second optimized tessellation line is used as the optimized tessellation line.
2. The method according to claim 1, characterized in that The optimizing the initial tessellated line based on the at least one candidate road line to obtain a first optimized tessellated line comprises: constructing a first undirected graph based on the at least one candidate road line and the initial tessellation line; Determining a first cost parameter corresponding to the first undirected graph; The shortest path from the starting point to the end point of the initial tessellation line is determined based on the first cost parameter and the first undirected graph to obtain a first optimized tessellation line.
3. The method according to claim 2, characterized in that The constructing a first undirected graph based on the at least one candidate road line and the initial tessellation line comprises: Removing the candidate road line intersecting with the boundary of the optimization area from the at least one candidate road line to obtain at least one reference road line; The first undirected graph is constructed according to the at least one reference road line and the initial tessellation line.
4. The method according to claim 3, characterized in that The constructing the first undirected graph according to the at least one reference road line and the initial tessellation line comprises: Acquire a second endpoint on each reference road line of the at least one reference road line, wherein the second endpoint includes a start endpoint and an end endpoint of the reference road line; Based on the Delaunay triangulation algorithm, construct a two-dimensional triangular mesh according to each second endpoint on each reference road line of the at least one reference road line; Taking the starting point and the end point of the initial tessellation line as the search starting points respectively, searching for the first intersection point of the initial tessellation line and the two-dimensional triangular mesh to obtain a first intersection point and a second intersection point, and connecting the first intersection point and the two-dimensional triangular mesh with a first line segment, and connecting the second intersection point and the two-dimensional triangular mesh with a second line segment, so as to connect the starting point and the end point of the initial tessellation line with the two-dimensional triangular mesh; Take each of multiple candidate endpoints as a first node in the first undirected graph, and construct a first edge between the first nodes in the first undirected graph based on the connection relationship between the multiple candidate endpoints, wherein the multiple candidate endpoints include each second endpoint in the two-dimensional triangular mesh, the starting point and end point of the initial tessellation line, the first intersection point and the second intersection point.
5. The method according to claim 4, characterized in that The step of taking the starting point and the end point of the initial tessellation line as the search starting point, searching for the first intersection point of the initial tessellation line and the two-dimensional triangular mesh, and obtaining the first intersection point and the second intersection point comprises: Taking the starting point and the end point of the initial tessellation line as the search starting points respectively, searching for the reference line segment in the two-dimensional triangular mesh that the initial tessellation line passes through for the first time, to obtain a first reference line segment and a second reference line segment; Determine the intersection points between the first reference line segment and the second reference line segment and the initial inlay line respectively, and obtain the first intersection point and the second intersection point.
6. The method according to claim 5, characterized in that The step of connecting the first intersection point and the two-dimensional triangular mesh with a first line segment, and connecting the second intersection point and the two-dimensional triangular mesh with a second line segment, so as to connect the starting point and the end point of the initial tessellation line with the two-dimensional triangular mesh, comprises: The first intersection point and at least one second endpoint of the first reference line segment are connected by a first line segment, and the second intersection point and at least one second endpoint of the second reference line segment are connected by a second line segment to connect the start point and the end point of the initial tessellation line with the two-dimensional triangular mesh.
7. The method according to claim 4, characterized in that Determining the shortest path from the starting point to the end point of the initial tessellation line based on the first cost parameter and the first undirected graph to obtain a first optimized tessellation line comprises: Determine the first nodes corresponding to the starting point and the end point of the initial tessellation line as the first starting node and the first ending node respectively; Determine a first shortest path between the first starting node and the first ending node based on the first cost parameter and the first node and the first edge in the first undirected graph; Based on the first shortest path, the first optimized tessellation line is determined.
8. The method according to claim 7, characterized in that The determining the first optimized tessellation line based on the first shortest path comprises: Determine each target endpoint among the plurality of candidate endpoints, each target endpoint corresponding to each first node on the first shortest path one by one; Based on the order of the first nodes on the first shortest path, the corresponding target endpoints are connected in sequence to obtain the first optimized inlay line.
9. The method according to claim 7, characterized in that: The first cost parameter includes a first cost sub-parameter corresponding to each first edge in the first undirected graph; and determining the first cost parameter corresponding to the first undirected graph includes: For any first edge in the first undirected graph, determine a first cost sub-parameter corresponding to the first edge according to the length and width of a line segment between two candidate endpoints associated with the first edge; The first cost parameter is obtained based on the first cost sub-parameters corresponding to the respective first edges.
10. The method according to claim 9, characterized in that The first cost sub-parameter corresponding to the first edge is determined using the following formula: in, represents the first cost sub-parameter corresponding to the first edge i, L i represents the length of the line segment i between the two candidate endpoints associated with the first edge i, W i represents the width of the line segment i between the two candidate endpoints associated with the first edge i, represents the width factor of the line segment i between the two candidate endpoints associated with the first edge i, θ and β represent the first truncation value and the second truncation value respectively, θ is less than β, α and Y represent constants, max() represents maximization calculation, min() represents minimization calculation, and i is a positive integer.
11. The method according to any one of claims 1 to 10, characterized in that The local optimization process includes: Determine a local optimization region including the current first optimized tessellation line segment in the optimization region; Acquire first grid data corresponding to the local optimization area from the auxiliary data, and determine pixel points included in the first grid data to obtain a plurality of first pixel points; Determine a first starting pixel point and a first ending pixel point according to the coordinate data corresponding to the starting point and the end point of the current first optimized mosaic line segment, wherein the first starting pixel point and the first ending pixel point correspond one-to-one to the starting point and the end point of the current first optimized mosaic line segment, respectively; Determine a first pixel point closest to the first starting pixel point and the first ending pixel point among the plurality of first pixel points to obtain a first reference pixel point and a second reference pixel point; Determine the shortest path from the first reference pixel to the second reference pixel to obtain a second shortest path; Obtaining a local mosaic line segment according to each first pixel point on the second shortest path; A third line segment is constructed between the starting point of the current first optimized tessellation line segment and the starting point of the local tessellation line segment, and a fourth line segment is constructed between the end point of the current first optimized tessellation line segment and the end point of the local tessellation line segment, to obtain a second optimized tessellation line segment corresponding to the current first optimized tessellation line segment.
12. The method according to claim 11, characterized in that The determining the shortest path from the first reference pixel to the second reference pixel to obtain a second shortest path comprises: constructing a second undirected graph based on the plurality of first pixel points; Determining a second cost parameter corresponding to the second undirected graph; The shortest path from the first reference pixel to the second reference pixel is determined based on the second cost parameter and the second undirected graph to obtain the second shortest path.
13. The method according to claim 12, characterized in that The constructing a second undirected graph based on the plurality of the first pixel points comprises: Each of the first pixel points is used as a second node in the second undirected graph, and a second edge between the second nodes in the second undirected graph is constructed based on the adjacency relationship between each of the first pixel points in the plurality of first pixel points.
14. The method according to claim 13, characterized in that The second cost parameter includes a second cost sub-parameter corresponding to each second edge in the second undirected graph; and determining the second cost parameter corresponding to the second undirected graph includes: For any second edge in the second undirected graph, determine first target color difference values respectively corresponding to two first pixel points associated with the second edge, and determine a maximum value of the first target color difference values respectively corresponding to the two first pixel points as a second cost sub-parameter corresponding to the second edge; The second cost parameter is obtained based on the second cost sub-parameters corresponding to each of the second edges.
15. The method according to claim 14, characterized in that The determining of the first target color difference value corresponding to the two first pixel points associated with the second edge comprises: for each of the two first pixel points, Determine a first initial color difference value corresponding to the first pixel point, where the first initial color difference value indicates a difference between pixel values of the first pixel point in the first orthoimage and the second orthoimage respectively; A first target color difference value corresponding to the first pixel is determined according to the first initial color difference value and a first cost coefficient, wherein the first cost coefficient is determined based on a first spatial position relationship between the first pixel and an auxiliary vector surface, and the auxiliary vector surface is obtained based on the auxiliary data.
16. The method according to claim 15, characterized in that The determining a first initial color difference value corresponding to the first pixel point comprises: According to the pixel values corresponding to the first pixel point in the first orthophoto and the second orthophoto, the difference value of the pixel values of the first pixel point in each band is determined, and the maximum value of the difference value of the pixel values of the first pixel point in each band is determined as the first initial color difference value.
17. The method according to claim 15, characterized in that The determining, according to the first initial color difference value and the first cost coefficient, a first target color difference value corresponding to the first pixel point comprises: Based on the ratio between the first initial color difference value and the first cost coefficient, a first target color difference value corresponding to the first pixel is obtained.
18. The method according to claim 17, characterized in that The auxiliary vector plane includes a road vector plane and a building vector plane; the first cost coefficient is determined in the following manner: In response to the first spatial position relationship indicating that the first pixel point is located within the road vector plane, determining the first cost coefficient to be a first value; In response to the first spatial position relationship indicating that the first pixel point is located within the building vector plane, the first cost coefficient is determined to be a second value, and the second value is greater than the first value.
19. The method according to claim 14, characterized in that The determining the shortest path from the first reference pixel to the second reference pixel based on the second cost parameter and the second undirected graph comprises: Determine the second nodes corresponding to the first reference pixel and the second reference pixel as the second starting node and the second ending node; Determine a third shortest path between the second starting node and the second ending node based on the second cost parameter and the second node and the second edge in the second undirected graph; Based on the third shortest path, a shortest path from the first reference pixel to the second reference pixel is determined.
20. The method according to claim 19, characterized in that The determining, based on the third shortest path, the shortest path from the first reference pixel to the second reference pixel comprises: Determine each first target pixel point among the plurality of first pixel points, each of the first target pixel points corresponding one-to-one to each second node on the third shortest path; Based on the order of the second nodes on the third shortest path, the corresponding first target pixel points are connected in sequence to obtain the shortest path from the first reference pixel point to the second reference pixel point.
21. The method according to any one of claims 1 to 10, characterized in that The method further comprises: In response to not obtaining a candidate road line matching the optimization area based on the auxiliary data, globally optimizing the initial inlay line based on the auxiliary data to obtain a third optimized inlay line, and using the third optimized inlay line as the optimized inlay line.
22. The method according to claim 21, characterized in that The global optimization process includes: Acquire second grid data corresponding to the optimization area from the auxiliary data, and determine pixel points included in the second grid data to obtain a plurality of second pixel points; Determine a second starting pixel point and a second ending pixel point according to the coordinate data corresponding to the starting point and the end point of the initial mosaic line, wherein the second starting pixel point and the second ending pixel point correspond to the starting point and the end point of the initial mosaic line one by one; Determine a second pixel point closest to the second starting pixel point and the second ending pixel point among the plurality of second pixel points, to obtain a third reference pixel point and a fourth reference pixel point; Determine the shortest path from the third reference pixel to the fourth reference pixel to obtain a fourth shortest path; Obtaining a global mosaic line segment according to each second pixel point on the fourth shortest path; A fifth line segment is constructed between the starting point of the initial tessellation line and the starting point of the global tessellation line segment, and a sixth line segment is constructed between the end point of the initial tessellation line and the end point of the global tessellation line segment, to obtain the third optimized tessellation line.
23. The method according to claim 22, characterized in that The determining the shortest path from the third reference pixel to the fourth reference pixel to obtain the fourth shortest path comprises: constructing a third undirected graph based on the plurality of second pixel points; Determining a third cost parameter corresponding to the third undirected graph; The shortest path from the third reference pixel to the fourth reference pixel is determined based on the third cost parameter and the third undirected graph to obtain the fourth shortest path.
24. The method according to claim 23, characterized in that The constructing a third undirected graph based on the plurality of second pixel points comprises: Each of the second pixel points is used as a third node in the third undirected graph, and a third edge between the third nodes in the third undirected graph is constructed based on the adjacency relationship between each of the second pixel points in the plurality of second pixel points.
25. The method according to claim 24, characterized in that The third cost parameter includes a third cost sub-parameter corresponding to each third edge in the third undirected graph; and determining the third cost parameter corresponding to the third undirected graph includes: For any third edge in the third undirected graph, determine the second target color difference values respectively corresponding to two second pixel points associated with the third edge, and determine the maximum value of the second target color difference values respectively corresponding to the two second pixel points as the third cost sub-parameter corresponding to the third edge; The third cost parameter is obtained based on the third cost sub-parameters corresponding to each of the third edges.
26. The method according to claim 25, characterized in that The determining of the second target color difference value corresponding to the two second pixel points associated with the third edge comprises: for each of the two second pixel points, Determine a second initial color difference value corresponding to the second pixel point, where the second initial color difference value indicates a difference between pixel values of the second pixel point in the second orthoimage and the second orthoimage respectively; A second target color difference value corresponding to the second pixel is determined according to the second initial color difference value and the second cost coefficient, wherein the second cost coefficient is determined based on a second spatial position relationship between the second pixel and an auxiliary vector surface, and the auxiliary vector surface is obtained based on the auxiliary data.
27. The method according to claim 26, characterized in that The determining of the second initial color difference value corresponding to the second pixel point comprises: According to the pixel values corresponding to the second pixel point in the first orthoimage and the second orthoimage, the difference value of the pixel values of the second pixel point in each band is determined, and the maximum value of the difference value of the pixel values of the second pixel point in each band is determined as the second initial color difference value.
28. The method according to claim 26, characterized in that The determining, according to the second initial color difference value and the second cost coefficient, a second target color difference value corresponding to the second pixel point comprises: Based on the ratio between the second initial color difference value and the second cost coefficient, a second target color difference value corresponding to the second pixel is obtained.
29. The method according to claim 28, characterized in that The auxiliary vector plane includes a road vector plane and a building vector plane; the second cost coefficient is determined in the following manner: In response to the second spatial position relationship indicating that the second pixel point is located within the road vector plane, determining the second cost coefficient to be a third value; In response to the second spatial position relationship indicating that the second pixel point is located within the building vector plane, the second cost coefficient is determined to be a fourth value, and the fourth value is greater than the third value.
30. The method according to claim 25, characterized in that The determining the shortest path from the third reference pixel to the fourth reference pixel based on the third cost parameter and the third undirected graph comprises: Determine third nodes corresponding to the third reference pixel and the fourth reference pixel as a third starting node and a third ending node respectively; Determine a fifth shortest path between the third starting node and the third ending node based on the third cost parameter and the third node and the third edge in the third undirected graph; Based on the fifth shortest path, a shortest path from the third reference pixel to the fourth reference pixel is determined.
31. The method according to claim 30, characterized in that The determining, based on the fifth shortest path, the shortest path from the third reference pixel to the fourth reference pixel comprises: Determine each second target pixel point among the plurality of second pixel points, each second target pixel point corresponding one-to-one to each third node on the fifth shortest path; Based on the order of the third nodes on the fifth shortest path, the corresponding second target pixel points are connected in sequence to obtain the shortest path from the third reference pixel point to the fourth reference pixel point.
32. The method according to any one of claims 1 to 10, characterized in that The method further comprises: Based on the optimized mosaicking line, the first orthophoto and the second orthophoto are mosaicked to obtain a mosaicked image.
33. A device for optimizing inlay lines, characterized in that: include: An acquisition module, used for acquiring a first orthophoto and a second orthophoto carrying an initial mosaic line to be optimized, and auxiliary data for optimizing the initial mosaic line, wherein the initial mosaic line is constructed within a valid overlapping area between the first orthophoto and the second orthophoto; A determination module, configured to determine an optimization region including the initial tessellation line in the effective overlapping region, wherein the optimization region indicates a region range for optimizing the initial tessellation line; A first optimization module, configured to, in response to obtaining at least one candidate road line matching the optimization area based on the auxiliary data, optimize the initial tessellated line based on the at least one candidate road line to obtain a first optimized tessellated line; A second optimization module is used to determine at least one first optimized tessellated line segment passing through the non-road line in the first optimized tessellated line, and to perform local optimization processing on each first optimized tessellated line segment in the at least one first optimized tessellated line segment in sequence based on the auxiliary data to obtain at least one second optimized tessellated line segment; A replacement module is used to replace the at least one first optimized inlay line segment in the first optimized inlay line with the at least one second optimized inlay line segment to obtain a second optimized inlay line, and use the second optimized inlay line as the optimized inlay line.
34. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 32.
35. A computer-readable storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 32.
36. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 32.
Citation Information
Patent Citations
Orthoimage tessellation line network automatic selection method based on building roof vector
CN106846251A
Large-scale mosaic line extraction method based on gray cost
CN116563725A