A large-scale inlaid line extraction method based on gray scale cost
By constructing an initial mosaic line network and optimizing the mosaic line path using a dynamically weighted A-star search algorithm, the problems of geometric misalignment and brightness difference in mosaic line search are solved, achieving efficient image stitching and mosaic line extraction.
Patent Information
- Application Number
- CN202310471426.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Existing technologies struggle to effectively avoid geometric misalignment and differences in brightness and chromaticity during mosaic line search, leading to a decline in image stitching quality. In particular, mosaic line extraction in obvious ground areas such as buildings is complex and inefficient.
A large-scale mosaicking line extraction method based on grayscale cost is adopted. An initial mosaicking line network is constructed and the mosaicking line path is optimized using a dynamically weighted A-star search algorithm. The cost is controlled by grayscale and distance, and the mosaicking line network is optimized to reduce geometric misalignment and intensity inconsistency.
It effectively avoids mosaic lines crossing obvious areas such as buildings, reduces splicing marks, improves mosaic line extraction efficiency and image splicing quality, and is suitable for high-resolution remote sensing image splicing.
Smart Images

Figure CN116563725B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a large-scale mosaic line extraction method based on gray cost. BACKGROUND
[0002] Digital Ortho Map (DOM) as one of 4D products, has the advantages of high precision, rich information, intuitive and realistic, fast acquisition, etc., and has wide application in emergency rescue, surveying and mapping, land and engineering development, etc. Since a single image is difficult to cover the target area, the mosaic of multiple images to obtain DOM is an important step in the process of remote sensing image processing. The automatic search method for mosaic lines is studied, and one of the key technologies is to search a reasonable mosaic line in the overlapping area of the images. The images on both sides of the mosaic line do not produce misalignment and brightness and color difference. Since the brightness and color difference can be removed by uniform light and color, if the geometric misalignment occurs after the mosaic, it will cause obvious seams near the mosaic line, which cannot be removed by uniform light and color, and will greatly affect the quality of image stitching. Therefore, how to avoid geometric misalignment in the mosaic process is a key problem in the mosaic process.
[0003] Existing researches focus on optimizing the seam line between adjacent images to minimize the difference in geometry and radiation angle. These methods can be divided into two categories: image-based methods and ground-based methods, where the image-based methods only use color information of adjacent images to guide the seam line, avoid areas with large contrast, and ensure the minimum difference on the seam line; the ground-based methods use DSM, DEM, OESM (Ortho-Elevation Synchronous Model), LiDAR (Light Detection and Ranging) point cloud and other ground information to guide the stitching line to avoid high objects on the ground (such as buildings and trees), and they mostly use cost functions to represent the difference, so the main goal is to find the optimal seam line with the minimum cost. The general mosaic line search algorithm is to search an optimal path on the cost image, but it is difficult to balance the global optimality and the time complexity of the algorithm, so the cost of the extracted mosaic line is as small as possible, the intensity and geometric difference of the left and right images in the region crossed by the mosaic line is as small as possible, and the obvious ground area such as buildings is avoided. SUMMARY
[0004] The application provides a large-scale tessellation line extraction method based on gray scale cost, which comprises the following steps.
[0005] The application can be implemented by the following technical scheme.
[0006] A large-scale tessellation line extraction method based on gray scale cost comprises the following steps.
[0007] Step one, the overlapping area of two adjacent orthographic images is calculated, and the contour point set of the overlapping area is extracted.
[0008] Step two, the skeleton point and bisector of the overlapping area are calculated according to the contour point set, and a weighted graph is constructed, then the Dijkstra algorithm is used to find the minimum path between the start and end points as the initial tessellation line, and the contour area of each orthographic image is cut according to the initial tessellation line to construct an initial tessellation line network.
[0009] Step three, the improved A-star search algorithm is used to start from the starting point of the initial tessellation line, the minimum cost path to the end point is calculated according to the dynamic adjustment of the cost function as the final tessellation line, so as to optimize the initial tessellation line network, and the effective area of the two adjacent orthographic images is reprojected and tessellated through the optimized tessellation line network, and finally the tessellated image is obtained.
[0010] Further, the gray scale value and the maximum gradient value of the current pixel point are added to the A-star cost function as the gray scale cost, and the distance from the current pixel point to the initial tessellation line is added to the distance control cost, and the estimated distance cost in the A-star cost function is dynamically weighted to construct the improved A-star cost function.
[0011] Further, the A-star cost function used by the improved A-star search algorithm is calculated by the following equation.
[0012] F=G+w*H+c*gCost+D
[0013] Wherein, w is a dynamic weight coefficient, G is the distance value from the starting point to the current pixel point, H is the estimated distance value from the current pixel point to the end point, d G The Euclidean distance from the current pixel point to the starting point, c is the gray scale cost conversion coefficient, gCost is the gray scale cost of the current pixel point, and D is the distance control cost of the current pixel point.
[0014] The calculation formula of the gray cost gCost is as follows:
[0015] gCost = max(|gv L -gv R |, max(gd L , gd R )
[0016]
[0017]
[0018] wherein gv L , gv R are the gray values of the current pixel point on the two adjacent orthographic images, gd L , gd R are the maximum gradient values of the eight adjacent domains of the current pixel point on the two adjacent orthographic images, gd1, gd2,..., gd8 are the gradient values of the eight adjacent domains of the pixel point, and g (i,j) is the gray value of the image coordinate P(i, j);
[0019] The calculation formula of the distance control cost D is as follows:
[0020] D = min(Height(P(i, j), Line k )
[0021] wherein P(i, j) is the image coordinate of the current pixel point, Line k is the line segment between the two adjacent points of the initial tessellation line, and Height() is the distance from a point to a straight line.
[0022] Further, when the improved A-star search algorithm is executed, the start point and the end point of the initial tessellation line are first adjusted in position, and then the search is performed pixel by pixel to obtain the final tessellation line. When the search is performed, the eight adjacent pixel points around the current pixel point are respectively judged for obstacles. If any adjacent pixel point is an obstacle, the current pixel point is skipped, and the search is performed from the next pixel point.
[0023] Further, when the obstacle judgment is performed, the gray cost gCost of the current adjacent pixel point and the obstacle threshold T are calculated. If gCost≥T, it is judged that the current adjacent pixel point is an obstacle.
[0024] When the position adjustment is performed, if either of the two conditions is not met, the position of the end point needs to be adjusted, and the obstacle and the searchable depth judgment are performed again until both conditions are met. The end point at this time is taken as the new start point and the end point,
[0025] Two conditions are set: ① the gray cost gCost of the current endpoint is less than the obstacle threshold T, then it is not an obstacle; ② whether the searchable passing depth, i.e. the Euclidean distance Dp from the searchable arrival point to the endpoint, meets the requirement, i.e. Dp≥passable depth dN, then it is passable;
[0026] wherein the obstacle threshold T is calculated from the gray mean value of the overlapping area of the adjacent two images and the gray mean value of the N*N block size around the current pixel point;
[0027]
[0028]
[0029] T = min(T all , min(T Llocal , T Rlocal ))
[0030] wherein T all is the gray mean value of the overlapping area of the adjacent two images, T Llocal , T Rlocal is the gray mean value of the N*N block size of the current pixel point on the adjacent two orthographic images, i.e. the left image and the right image, gv L (i+Δr, j+Δc) and gv R (i+Δr, j+Δc) are the gray values of a point within the N*N block size around the current pixel point on the left and right images respectively;
[0031] Passable depth Dis(P start , P end ) is the straight line distance between the start and end points of the initial tessellation line.
[0032] Further, when performing the searchable passing depth judgment, the eight adjacent pixel points, i.e. search points Pk, around the endpoint P(i,j) are traversed, and the passable pixel points are searched,
[0033] If the Euclidean distance Dp from the search point Pk to the endpoint P(i,j) is greater than or equal to dN, the searchable passing depth of the endpoint meets the requirement, and there is no need to adjust the endpoint position;
[0034] If it does not meet the requirement, the eight adjacent pixel points are respectively taken as the center points, and the eight directions around them are traversed again, and the already traversed ones are skipped, until the circular range with the endpoint P(i,j) as the center and dN as the radius is traversed completely, if Dp still does not meet the requirement, one of the eight adjacent pixel points around the endpoint P(i,j) is adjusted as the endpoint P(i,j), the above process is repeated, and the searchable passing depth is calculated again.
[0035] Further, when extracting the contour point set of the overlapping area, the boundary contour point set of a single orthographic image is calculated using the neighborhood boundary tracking method, the Douglas-Peuker algorithm is used to simplify the boundary contour point set, and the convex hull operation method is used to obtain the convex polygon area corresponding to the boundary contour point set, which is used as the effective area, then the intersection of the polygon areas corresponding to the two orthographic images is calculated, and finally the polygon clipping algorithm Weiler-Atherton is used to extract the contour point set of the overlapping area of the two adjacent orthographic images.
[0036] Further, when constructing the initial tessellation line network, the skeleton point set and bisector set of the overlapping area are calculated, the two intersection points with the largest distance in the intersection points of the convex polygon areas corresponding to the two orthographic images are selected as the start and end points, the skeleton point set is selected as the intermediate node, and the bisector set is selected as the edge to construct a weighted graph, and then the Dijkstra algorithm is used to find the minimum path between the start and end points as the initial tessellation line, and the contour area of the orthographic image is clipped according to the initial tessellation line to construct the initial tessellation line network.
[0037] Further, when performing re-projection tessellation, the corresponding vector file is generated according to the optimized tessellation line network, which corresponds to the orthographic image one by one, then the vector file is converted into a mask grid, and the pixel points of the effective area of the orthographic image are re-projected into the created large tessellation image using affine transformation according to the corresponding mask area, and finally the tessellation image is obtained.
[0038] The beneficial technical effects of the present application are as follows:
[0039] 1. Only the gray scale information of adjacent orthographic images is needed to extract the tessellation line by improving the A-star search algorithm by calculating the gray scale cost and distance control cost of the search point in the image, without relying on other auxiliary data, which greatly reduces the situation that the tessellation line crosses the obvious ground area such as buildings and the inconsistency of the intensity and geometry on both sides of the tessellation line.
[0040] 2. When constructing the initial tessellation line network globally and then further adjusting, only the extraction and optimization between adjacent two orthographic images need to be considered each time, which greatly reduces the complex extraction work of the tessellation line in the overlapping area of multiple orthographic images and improves the tessellation line extraction efficiency.
[0041] 3. The adaptive calculation of the obstacle threshold of the current pixel point reduces the loss of image information in the continuous area with small gray scale gradient, and better uses the image information to avoid the geometric inconsistency area.
[0042] 4. The distance cost is dynamically weighted based on the existing search distance, which is more consistent with the actual search path, and the minimum heap sorting queue is used for storage and sorting of the search point, which further improves the tessellation line extraction efficiency of the improved A search algorithm. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 for the overall flowchart of the present application;
[0044] Fig. 2(a) is a flowchart of the endpoint position adjustment of the present application;
[0045] Fig. 2(b) is a flowchart of the searchable access depth determination of the present application;
[0046] Figure 3 for the flowchart of the present application for extracting the tessellation line of adjacent images;
[0047] Figure 4 for the flowchart of the present application for extracting the tessellation line of adjacent images compared with other software methods;
[0048] Figure 5 for the flowchart of the present application for extracting the tessellation line of multiple images of plain urban areas. DETAILED DESCRIPTION
[0049] The specific embodiments of the present application will be described in detail below with reference to the accompanying drawings and preferred embodiments.
[0050] As shown in the drawings, Figure 1 the present application provides a large-scale tessellation line extraction method based on gray cost, calculates the overlapping area of adjacent orthographic images, extracts the initial tessellation line network according to the overlapping area, further refines and extracts the initial tessellation line in real time based on the gray cost and distance control cost of adjacent images, constructs a minimum heap sorting queue as the data structure of the A-star algorithm open list, and finally performs re-projection tessellation according to the optimized tessellation line network to obtain a tessellation image.
[0051] The specific embodiments are as follows:
[0052] Step one, calculate the overlapping area of two adjacent orthographic images, and extract the contour point set of the overlapping area
[0053] When extracting the contour point set of the overlapping area, first, the eight-neighbor boundary tracking method is used to calculate the boundary contour point set of a single orthographic image, the Douglas-Peuker algorithm is used to simplify the boundary contour point set, the convex hull operation method is used to obtain the convex polygon area corresponding to the boundary contour point set, which is used as the effective area, then the intersection points of the polygon areas corresponding to the two orthographic images are calculated, and finally the polygon clipping algorithm Weiler-Atherton is used to extract the contour point set of the overlapping area of the two adjacent orthographic images.
[0054] Step two, construct an initial tessellation line network
[0055] According to the above contour point set, first, the skeleton point set and the bisector set of the overlapping region are calculated, the two intersection points of the convex polygon regions corresponding to the two orthographic images farthest from each other are selected as the start and end points, the skeleton point set is selected as the intermediate node, and the bisector set is selected as the edge to construct a weighted graph, and then the Dijkstra algorithm is used to find the minimum path between the start and end points as the initial tessellation line, and the orthographic image contour region is cut according to the initial tessellation line to construct an initial tessellation line network.
[0056] Step three, using the improved A-star search algorithm, the minimum cost path from the start point of the initial tessellation line to the end point is calculated as the final tessellation line according to the dynamically adjusted cost function, so as to optimize the initial tessellation line network, and the effective regions of the two adjacent orthographic images are reprojected and tessellated through the optimized tessellation line network, and finally the tessellation image is obtained.
[0057] The A-star cost function of the improved A-star search algorithm is constructed as follows:
[0058] The gray value and the maximum gradient value of the current pixel point are added to the A-star cost function as the gray cost and the distance control cost of the current pixel point to the initial tessellation line, and the estimated distance cost in the A-star cost function is dynamically weighted, so as to construct the improved A-star cost function.
[0059] For the tessellation of the orthographic image, the tessellation line should be the shortest path with the minimum geometric and radiation difference, and the uniform light and color orthographic image only needs to consider the geometric inconsistency. In order to reduce the geometric difference, the seam line should avoid the area with large gray difference and gradient in the two adjacent images, and the gray cost of the search point is added to avoid this area, and the further optimization of the tessellation line is based on the initial tessellation line network; the distance control of the initial tessellation line is added, so that the value of H in the traditional A-star cost function is closer to the actual path distance value, and the search speed is faster, and the value of H is dynamically weighted and adjusted by using the ratio of the actual distance of the passed path to the estimated Euclidean distance of the passed path, so that the value of H is closer to the actual path distance value.
[0060] The A-star cost function used by the improved A-star search algorithm is calculated by the following equation
[0061] F=G+w*H+c*gCost+D
[0062] Wherein, w is a dynamic weight coefficient, The value of G is the distance value from the start point to the current pixel point, the value of H is the estimated distance value from the current pixel point to the end point, the value of d G The value of d is the Euclidean distance from the current pixel point to the start point, the value of c is a gray cost conversion coefficient, the value of gCost is the gray cost of the current pixel point, and the value of D is the distance control cost of the current pixel point.
[0063] The improved A-star search algorithm searches the surrounding eight fields, that is, contains straight line direction and diagonal direction search, and the estimated distance H uses the Euclidean distance which is more suitable; in the application, the straight line distance unit is 10, and the diagonal distance unit is 14, and the use of integer unit is more convenient in calculation; the minimum heap sorting queue is used as the data structure of the A-star search algorithm for storing search points, and the search algorithm efficiency can be effectively improved.
[0064] The calculation formula of the gray cost gCost is as follows:
[0065] gCost=max(|gv L -gv R |,max(gd L ,gd R )
[0066]
[0067]
[0068] wherein gv L , gv R are the gray values of the current pixel point on the adjacent two orthographic images, gd L , gd R are the maximum gradient values of the current pixel point in the surrounding eight neighborhoods on the adjacent two orthographic images, gd1, gd2,..., gd8 are the gradient values of the surrounding eight neighborhood pixel points and the pixel point, g (i,j) is the gray value of the image coordinate P(i, j);
[0069] The calculation formula of the distance control cost D is as follows:
[0070] D=min(Height(P(i,j),Line k )
[0071] wherein P(i, j) is the image coordinate of the current pixel point, Line k is the line segment between any two adjacent points of the initial tessellation line, and Height() is the point-to-line distance.
[0072] When the improved A-star search algorithm is executed, the starting point and the ending point of the initial tessellation line are first adjusted in position, and then the search is performed on each pixel point to obtain the final tessellation line, and when the search is performed, the eight adjacent pixel points around the current pixel point need to be judged for obstacles, and if any adjacent pixel point is an obstacle, the current pixel point is skipped and the search is performed from the next pixel point.
[0073] In the process of obstacle judgment, the gray cost gCost of the current adjacent pixel point and the obstacle threshold T are calculated, if gCost≥T, the current adjacent pixel point is judged as an obstacle; otherwise, it is not an obstacle;
[0074] In the process of position adjustment, as shown in Fig. 2(a), if either of the two conditions is not met, the end point position needs to be adjusted, the obstacle and searchable depth judgment is re-performed until both conditions are met, the end point at this time is taken as a new starting point and end point, and then the inlay line extraction is performed.
[0075] The following takes the end point corresponding to the starting point as an example for detailed description:
[0076] The two conditions are set as: ① whether the current end point is an obstacle, i.e. the gray cost gCost of the current end point is less than the obstacle threshold T, then it is not an obstacle; ② whether the searchable depth, i.e. the Euclidean distance Dp from the searchable point to the end point, meets the requirement, i.e. Dp≥dN, then it is passable.
[0077] Among them, the obstacle threshold T is calculated by the gray mean value of the overlapping region of the adjacent two images and the gray mean value of the N*N block size around the current pixel point.
[0078]
[0079]
[0080] T=min(T all ,min(T Llocal ,T Rlocal ))
[0081] In the formula, T all is the gray mean value of the overlapping region of the adjacent two images, T Llocal , T Rlocal are the gray mean values of the N*N block size around the current pixel point on the left and right adjacent images, gv L (i+Δr,j+Δc), gv R (i+Δr,j+Δc) are the gray values of a point within the N*N block size around the current point on the left and right images, N=2n+1, and N is 65 in the present application.
[0082] The passable depth Dis(P start ,P end ) is the straight line distance of the starting and ending points of the initial inlay line.
[0083] When calculating the searchable passing depth Dp, if the starting point is adjusted in position, Dp is the Euclidean distance from the searchable reaching point to the starting point; if the ending point is adjusted in position, Dp is the Euclidean distance from the searchable reaching point to the ending point.
[0084] As shown in Fig. 2(b), the black color represents the obstacle, and when performing the searchable passing depth judgment, the eight adjacent pixel points, i.e. the search points Pk, around the end point P(i,j) are traversed, and the passable pixel points are searched,
[0085] If the Euclidean distance Dp from the search point Pk to the end point P(i,j) is greater than or equal to dN, the searchable passing depth of the end point meets the requirement, and the position of the end point does not need to be adjusted;
[0086] If the requirement is not met, the eight adjacent pixel points are taken as the center points, and the eight directions around the center points are traversed again, and the already traversed pixel points are skipped, until the circular range with the end point P(i,j) as the center and dN as the radius is traversed completely. If Dp still does not meet the requirement, one of the eight adjacent pixel points around the end point P(i,j) is adjusted as the end point P(i,j), and the above process is repeated to recalculate the obstacle and the searchable passing depth.
[0087] The specific search process is as follows:
[0088] 1. Through the obstacle and the searchable passing depth judgment, the positions of the starting point and the ending point of the initial tessellation line are adjusted, and the adjusted starting point is added to the open list;
[0089] 2. Repeat the following process:
[0090] 2.1 Traverse the open list to find the node with the minimum F value, take it as the current node N to be processed, and then move it to the close list;
[0091] 2.2 Traverse the eight adjacent pixel points of the current node N one by one to perform the adaptive obstacle judgment, if yes, the current adjacent pixel point M is not passable or in the close list, skip the current pixel point M and start searching from the next pixel point; otherwise, perform the following operations:
[0092] If the current pixel point M is not in the open list, calculate the dynamic weight coefficient w of the pixel point M, the cost values and the F value, set the current node N as the parent node of the pixel point M and add the pixel point M to the open list;
[0093] If the current pixel point M has been in the open list, check whether the path (i.e. via the current node N to the pixel point M) is closer; if it is closer, set the parent node of the current pixel point M as the node N, and recalculate the dynamic weight coefficient w, each cost value and F value of the current pixel point M, and reorder the open list according to the G value; otherwise, skip.
[0094] 2.3 Stop searching when the following conditions are met:
[0095] The termination point is added to the open list, and at this time the path has been found;
[0096] The open list is empty, and at this time the path search fails to find the termination point;
[0097] 3. Starting from the termination point, traverse along the parent nodes until the starting point to form the path.
[0098] Step four, optimize the initial tessellation line network with the final tessellation line path, and perform re-projection tessellation on the effective areas of the two adjacent images according to the optimized tessellation line network, first generate a corresponding vector file for the tessellation line network, which corresponds to the orthographic image one by one, convert the appropriate file into a mask grid, and use affine transformation to re-project the effective area pixels of the orthographic image into the created large tessellation image according to the corresponding mask area, and finally obtain the tessellation image.
[0099] Figure 3 The present application is used for processing the flow and results of adjacent images, Figure 3 (a) After uniform color extraction of the adjacent images, the initial tessellation line network is constructed, and the improved A-star algorithm of the present application is used for further refinement to obtain the optimized tessellation line network as shown in Figure 3 (b); the tessellation line network is generated into a mask, and the effective area of the adjacent image is the mask value, as shown in Figure 3 (c); and Figure 3 (d) is the result of the re-projection tessellation image, and as can be seen from the enlarged local area, the tessellation line automatic generation method of the improved A-star algorithm of the present application can avoid the buildings in the image and reduce the misplacement of the buildings.
[0100] As shown in Figure 4 , the 2.1m downward-looking images of ZY-3 satellite are used for the experiment of the image pairs of the plain urban area with about 51% overlap, to verify the superiority of the tessellation line extraction effect of the present method. Meanwhile, the mainstream software on the market is used to process the two image pairs, wherein the straight lines are the tessellation lines extracted by the present method and the extraction results of other software methods, the short dashed lines and long dashed lines are Arcgis_1EDGE_DETECTION and Arcgis_2RADIOMETRY, and the dotted lines are the extraction results of PIE-Bsaic.
[0101] The mosaic line extraction results for image pairs in plain urban areas are as follows: Figure 4 As shown, magnified views of tessellation lines from different methods within the same area are presented. In Area 1, a rural area, all four methods perform well, avoiding major villages and areas of significant brightness. In Area 2, the combined results of this method and ArcGIS_2 in an urban area show that ArcGIS_2 lines have a larger span, traversing most of the prominent buildings, while the lines from this method largely avoid prominent buildings, mostly choosing roads and only traversing a few less prominent buildings—areas with darker grayscale and little difference from the surrounding ground. In Area 3, ArcGIS_1 and PIE_Bsaic are used in a city area, both traversing areas of significant building brightness. In Area 4, the four methods are used in a city river area. ArcGIS_1 and PIE_Bsaic lines directly traverse bright building areas, ArcGIS_2 lines avoid most prominent buildings, and the lines from this method largely avoid prominent building areas, choosing adjacent roads or ground.
[0102] The mosaic line extraction results from image pairs in plain urban areas revealed that ArcGIS_1 and PIE_Bsaic methods performed poorly, traversing most buildings and failing to effectively avoid them even in low-density village areas. ArcGIS_2 traversed fewer obvious building areas, showing some avoidance effectiveness and effectively avoiding villages. The mosaic lines extracted by our proposed method effectively avoided most obvious building areas, demonstrating good performance in both urban and village areas. Experiments show that the mosaic lines extracted by our proposed method effectively avoid buildings when passing through them, representing a significant improvement over methods from other software.
[0103] like Figure 5 As shown, an experiment was conducted using nine 2.1m downward-looking images from the ZY-3 satellite, covering plain urban areas such as Shanghai and Suzhou. The mosaic lines of these images were extracted using the mosaic line extraction method of this invention and mosaicked into a complete image, verifying that this invention has the capability to extract mosaic lines from large-scale images.
[0104] The results demonstrate that this approach effectively solves the problem of mosaic lines passing through obvious areas such as buildings, reduces mosaicking marks, and shows a significant improvement in results compared to other software methods. It can be widely applied to high-resolution remote sensing image mosaicking and has practical significance for automatic mosaicking of remote sensing images.
[0105] Although the specific embodiments of the present application have been described above, it is understood by those skilled in the art that these are merely illustrative, and various changes or modifications can be made to these embodiments without departing from the principles and the spirit of the present application, and therefore, the scope of protection of the present application is defined by the appended claims.
Claims
1. A method for large-scale mosaic line extraction based on grayscale cost, characterized in that... Includes the following steps: Step 1: Calculate the overlapping area of two adjacent orthophotos and extract the contour point set of the overlapping area; Step 2: Based on the set of contour points, calculate the skeleton points and bisectors of the overlapping area and construct a weighted graph. Then, use Dijkstra's algorithm to find the minimum path between the start and end points as the initial mosaic line. Based on the initial mosaic line, trim the contour areas of each orthophoto to construct the initial mosaic line network. Step 3: Using the improved A-star search algorithm, starting from the starting point of the initial mosaicking line, the minimum cost path to the termination point is calculated based on the dynamically adjusted cost function as the final mosaicking line. This optimizes the initial mosaicking line network. The effective areas of two adjacent orthophotos are then reprojected and mosaicked using the optimized mosaicking line network to finally obtain the mosaicked image. The grayscale value and maximum gradient value of the current pixel are used as grayscale cost, and the distance from the current pixel to the initial mosaic line is used as distance control cost. These are added to the A-star cost cost function, and the estimated distance cost in the A-star cost cost function is dynamically weighted to construct an improved A-star cost cost function. Calculate the cost function of A-Star using the improved A-Star search algorithm using the following equation. in, For dynamic weighting coefficients, G is the distance from the starting point to the current pixel, and H is the estimated distance from the current pixel to the ending point. The Euclidean distance from the current pixel to the starting point, where c is the grayscale cost conversion coefficient. The grayscale cost of the current pixel. The distance control cost for the current pixel; Grayscale cost The calculation formula is as follows: in, This represents the grayscale value of the current pixel in the two adjacent orthophotos. , These are the maximum gradient values of the current pixel in its eight neighboring areas on the two adjacent orthophotos. These are the gradient values of the eight neighboring pixels surrounding the pixel and the pixel itself, respectively. Image coordinates The grayscale value at that location; The formula for calculating the distance control cost D is as follows: in The image coordinates of the current pixel. Let the line segment between any two adjacent points of an initial tessellation line be denoted as . This is the distance from the point to the line.
2. The method for large-scale mosaic line extraction based on grayscale cost according to claim 1, characterized in that: When executing the improved A* search algorithm, the positions of the start and end points of the initial mosaic line are first adjusted, and then the search is performed pixel by pixel to obtain the final mosaic line. During the search, obstacles need to be judged for the eight neighboring pixels around the current pixel. If any neighboring pixel is an obstacle, the current pixel is skipped and the search starts from the next pixel.
3. The method for large-scale mosaic line extraction based on grayscale cost according to claim 2, characterized in that: When determining obstacles, the grayscale cost of the current adjacent pixels is calculated. Obstacle threshold T, if If so, then the current adjacent pixel is determined to be an obstacle; If either of the two conditions is not met during position adjustment, the endpoint position needs to be adjusted, and the obstacle and searchable passage depth needs to be re-evaluated until both conditions are met. The endpoint at this point is then used as the new starting and ending point. Two conditions are set as follows: ① If the grayscale cost gCost of the current endpoint is less than the obstacle threshold T, then it is not an obstacle; ② If the searchable traversable depth is the Euclidean distance Dp from the reachable point to the endpoint, then it is traversable if Dp ≥ traversable depth dN. The obstacle threshold T is calculated from the average gray value of the overlapping area of two adjacent images and the average gray value of the N*N block surrounding the current pixel. In the formula, This represents the average grayscale value of the overlapping region between two adjacent images. This represents the average grayscale value of the current pixel across N*N blocks in the two adjacent orthophoto images, namely the left and right images. These are the grayscale values of a point within an N*N block surrounding the current pixel on the left and right images, respectively. , This is the straight-line distance between the start and end points of the initial mosaic line.
4. The method for large-scale mosaic line extraction based on grayscale cost according to claim 3, characterized in that: When determining the searchable traversable depth, the system traverses from the endpoint P(i,j) to its eight surrounding neighboring pixels (i.e., the search point Pk) to search for traversable pixels. If the Euclidean distance Dp from the search point Pk to the endpoint P(i,j) is greater than or equal to dN, the searchable depth of the endpoint meets the requirements, and there is no need to adjust the endpoint position. If the requirement is not met, the process is to use the eight surrounding adjacent pixels as the center point and then traverse in eight directions around them. If a pixel has already been traversed, it is skipped until the circular range with endpoint P(i,j) as the center and dN as the radius is traversed. If Dp still does not meet the requirement, one of the eight adjacent pixels around endpoint P(i,j) is adjusted to endpoint P(i,j), and the above process is repeated to recalculate the searchable traversable depth.
5. The method for large-scale mosaic line extraction based on grayscale cost according to claim 1, characterized in that: When extracting the contour point set of the overlapping region, the boundary contour point set of a single orthophoto is first calculated using the neighborhood boundary tracking method. The Douglas-Peuker algorithm is then used to simplify the boundary contour point set. The convex hull operation method is then used to obtain the convex polygon region corresponding to the boundary contour point set, which is used as the effective region. Then, the intersection point of the polygon regions corresponding to the two orthophotos is calculated. Finally, the polygon clipping algorithm Weiler-Atherton is used to extract the contour point set of the overlapping region of two adjacent orthophotos.
6. The method for large-scale mosaic line extraction based on grayscale cost according to claim 5, characterized in that: When constructing the initial mosaicking network, first calculate the skeleton point set and the bisecting line set of the overlapping region. Select the two intersection points with the largest distance among the intersection points of the convex polygon regions corresponding to the two orthophotos as the start and end points, the skeleton point set as the intermediate nodes and the bisecting line set as the edges to construct a weighted graph. Then, use Dijkstra's algorithm to find the minimum path between the start and end points as the initial mosaicking line. Based on the initial mosaicking line, cut the contour region of the orthophoto to construct the initial mosaicking network.
7. The method for large-scale mosaic line extraction based on grayscale cost according to claim 1, characterized in that: When performing reprojection mosaicking, firstly, a corresponding vector file is generated based on the optimized mosaicking line network, which corresponds one-to-one with the orthophoto. Then, the vector file is converted into a mask raster. Based on the corresponding mask area, the pixels of the effective area of the orthophoto are reprojected onto the created mosaicking large image using affine transformation, and finally, the mosaicking image is obtained.