An Image Mosaic Method Based on PostGIS

By using PostGIS spatial database and multi-dimensional feature extraction technology in remote sensing image mosaic, adaptive mosaic lines are generated and progressively fusion is solved, and the problems of unsatisfactory mosaic results and low processing efficiency in the existing technology are achieved, and high-quality Seamless inlay and efficiency improvements in images.

CN119295314BActive Publication Date: 2025-02-25YUNNAN INST OF GEOLOGY & MINERAL SURVEYING & MAPPING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411821354.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-02-25
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

When processing massive remote sensing image data, the existing technology lacks comprehensive consideration of multi-dimensional features such as image quality, geometric features, radiation features, etc., resulting in unsatisfactory mosaic results, and the mosaic line generation algorithm is insufficient to adapt to image features and terrain features. The weight allocation scheme of overlapping regions is rough and the processing efficiency is low.

Method used

A method of image mosaic based on PostGIS spatial database is proposed, and high-quality image seamless mosaic is achieved through multi-dimensional feature extraction and adaptive mosaic line optimization. The specific steps include using PostGIS to build a spatial index, detect overlapping areas between images, perform multi-dimensional feature extraction, establish a comprehensive weight scoring model, construct a weighted Voronoi graph, generate adaptive mosaic lines, and use a progressive fusion algorithm to achieve no overlapping areas. seam transition.

Benefits of technology

By comprehensively considering multi-dimensional features and adaptive mosaic line optimization, high-quality seamless mosaics are achieved, which significantly improves processing efficiency, avoids blur, seam and tone breakage problems in traditional methods, and meets the practical application The dual requirements of image mosaic quality and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295314B_ABST
    Figure CN119295314B_ABST
Patent Text Reader

Abstract

The present invention designs an image mosaic method based on PostGIS, which belongs to the field of remote sensing impact processing technology. The present invention realizes high-quality seamless mosaicking of images by combining multi-dimensional feature extraction and adaptive mosaic line generation technology; by establishing a comprehensive weight scoring model of fusion quality indicators, geometric features and radiation features, a reliable basis is provided for space division; the weighted Voronoi diagram constructed based on the comprehensive weight can adaptively generate the optimal mosaic line, and the smoothness and topology preservation characteristics of the mosaic line are ensured by energy function optimization; through the progressive fusion algorithm, a natural transition effect is achieved while maintaining image details. The entire processing process is based on the PostGIS spatial database, which not only improves the efficiency of large-scale image processing, but also provides a complete data management mechanism, and has good practicality and promotion value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of remote sensing impact processing, and in particular to an image mosaic method based on PostGIS. Background Art

[0002] With the rapid development of remote sensing technology, seamless mosaicking of massive remote sensing image data has become an important research topic. Image mosaicking is the process of stitching multiple images with overlapping areas into a complete seamless image. The key lies in solving the problem of seamless processing of overlapping areas.

[0003] At present, common image mosaic methods mainly include: fusion method based on weighted average, cropping method based on optimal seam line, and gradient fusion method based on transition zone such as Feather. These methods have their own advantages and disadvantages: the weighted average method is simple to calculate but easily causes blurring of overlapping areas; the optimal seam line method can maintain edge features but may have obvious seams; the gradient fusion method has a natural transition but is complex to calculate and is prone to losing detailed features.

[0004] At the same time, the existing methods have the following shortcomings when processing massive remote sensing data. The existing technology lacks comprehensive consideration of multi-dimensional features such as image quality, geometric features, and radiation features, resulting in unsatisfactory mosaic results; the mosaic line generation algorithm is not adaptable enough to image features and terrain features; the weight allocation scheme of overlapping areas is rough and fails to fully utilize the spatial feature information of the image; the efficiency is low when processing large-scale data, and the spatial data management capability is limited, etc.

[0005] Given these limitations, it is urgent to develop a method that can achieve high-quality image seamless mosaicking. Summary of the invention

[0006] This application proposes an image mosaicking method based on PostGIS spatial database, which realizes high-quality image seamless mosaicking through multi-dimensional feature extraction and adaptive mosaic line optimization.

[0007] According to an embodiment of the present application, a PostGIS-based image mosaic method is proposed, comprising:

[0008] Use PostGIS spatial database to build spatial indexes for multiple input images;

[0009] Detect overlapping areas between multiple input images based on spatial index;

[0010] Perform multi-dimensional feature extraction on the detected overlapping areas, including image quality indicators, geometric features, and radiation features;

[0011] A comprehensive weight scoring model is established based on the extracted multi-dimensional features to determine the comprehensive weight value of each pixel in the overlapping area;

[0012] A weighted Voronoi diagram is constructed based on the comprehensive weight values ​​of each pixel in the overlapping area to obtain an adaptive mosaic line.

[0013] The transition zones on both sides of the obtained mosaic line are merged using a progressive fusion algorithm to achieve seamless transition in the overlapping area.

[0014] In some embodiments, the image quality index includes a clarity index CI, a spectral uniformity index SI, a cloud coverage CC, and a noise evaluation value NL.

[0015] In some embodiments, a comprehensive weight scoring model is established based on the extracted multi-dimensional features to determine the comprehensive weight value of each pixel in the overlapping area, including:

[0016] The following comprehensive weight scoring model is established to calculate the comprehensive weight value W of each pixel in the overlapping area:

[0017] W = ω 1 ×Q+ω 2 ×G+ω 3 ×R+ω 4 ×exp(-d 1 / σ 1 ),

[0018] Among them, Q is the quality index score, G is the geometric feature score of the pixel to be tested, R is the radiation feature score of the pixel to be tested, and d 1 is the distance from the pixel to be tested to the center line of the overlapping area, σ 1 is the preset distance attenuation parameter, ω 1 ,ω 2 ,ω 3 ,ω 4 is the preset adjustment coefficient, and Σω i =1.

[0019] In some implementations, a weighted Voronoi diagram is constructed based on the comprehensive weight values ​​of each pixel point in the overlapping area to obtain an adaptive mosaic line, including:

[0020] Filter out the initial seed points according to the comprehensive weight values ​​of each pixel point in the overlapping area;

[0021] Calculate the weighted distance field of each seed point;

[0022] Construct a weighted Voronoi diagram based on the weighted distance field of each seed point and extract the initial tessellation line;

[0023] Adaptive optimization of tessellation lines.

[0024] In some implementations, calculating the weighted distance field for each seed point includes:

[0025] The weighted distance field of each seed point is calculated based on the following formula:

[0026] D(p,si)=W i ×[(1-λ 1 )×De(p,si)+λ 1 ×Dg(p,si)],

[0027] Where D(p,si) is the weighted distance from the point p to be classified to the seed point si in the overlapping area, and W i is the comprehensive weight value of the seed point si, De(p,si) is the Euclidean distance component, Dg(p,si) is the geodesic distance component, Dg(p,si)=∫[1+α 2 ×|∇I g (r)|β 2 ]dt, r = γ(t) represents the path connecting p and si, I g (r) is the grayscale value of the image on path r, ∇I g (r) represents the gray value of the image I g The gradient of (r), λ 1 ,α 2 ,β 2 To adjust the parameters.

[0028] In some implementations, adaptively optimizing the tessellated lines includes:

[0029] The shape and topological features of the tessellation line are adaptively optimized based on the following objective energy function E:

[0030] E=Ed+Ec+Es+Et,

[0031] Among them, Ed is the data item based on the image gradient, Ec is the curvature constraint item, which is used to constrain the curvature of the mosaic line, Es is the smoothness constraint, Et is the topology preservation item, and Et=exp(-d 2 (L,L 0 ) / σ 2 ), where L is the current tessellation parameter equation, L 0 is the initial tessellation line, d 2 (L,L 0 ) is the deviation distance between two mosaic lines, σ 2 is the attenuation parameter.

[0032] In some implementations, adaptively optimizing the tessellated lines includes:

[0033] Select control points on the tessellation line;

[0034] The control points of the mosaic line are iteratively updated based on the following formula:

[0035] P(t+1)=P(t)+η×F(P(t)), F(P)=Fd+Fs+Fe,

[0036] Among them, P(t) and P(t+1) are the control point position vectors after the t-th iteration and the t+1-th iteration respectively, Fd is the data driving force based on image difference, Fs is the shape preserving force, which is used to maintain the relative position relationship between the control points, Fe is the edge attraction, Fe=g(|∇I|)×∇I, g(x)=exp(-x² / k²), where I is the image grayscale value of the control point neighborhood, ∇I represents the gradient of the image grayscale value I, η is the learning rate, and k is the preset Gaussian function adjustment parameter.

[0037] In some embodiments, a progressive fusion algorithm is used to fuse the transition zones on both sides of the obtained mosaic line, including:

[0038] The pixel value P(x,y) of the transition zone after fusion is obtained based on the following formula:

[0039] P(x,y)=Σ j (P j ×F j ) / Σ j (F j ),

[0040] Among them, P j is the pixel value of the j-th source image at (x, y), F j is the local adaptability factor, F j =(1+λ 2 ×L j )×(1+μ×E j )×(1+ν×T j ), L j is the local brightness coordination, E j is the edge strength, T j is the texture complexity, λ 2 , μ, ν are adaptive adjustment parameters.

[0041] The PostGIS-based image mosaic method provided in this application has the following beneficial effects:

[0042] First, this method is built on the PostGIS spatial database, making full use of its spatial index and data management capabilities, significantly improving the processing efficiency of large-scale image data. By establishing a complete spatial index system, the detection and feature extraction of image overlapping areas can be quickly realized.

[0043] Secondly, this method innovatively proposes a comprehensive weighted scoring model of multi-dimensional features, which organically integrates multiple factors such as image quality indicators, geometric features, and radiation features. This comprehensive scoring mechanism can more accurately reflect the actual quality of the image and provide a more reliable basis for subsequent mosaic processing.

[0044] In terms of mosaic line generation, this method uses an improved weighted Voronoi algorithm, introduces geodesic distance and energy function optimization, so that the generated mosaic line can better adapt to the local characteristics of the image. Through the dynamic optimization strategy of control points, the smoothness and continuity of the mosaic line are further improved, effectively avoiding the jagged seam problem that is easy to generate in traditional methods.

[0045] In the processing of overlapping areas, this method designs a progressive fusion algorithm based on local adaptive factors. This algorithm fully considers the characteristics of local brightness coordination, edge strength and texture complexity, and realizes the natural transition of overlapping areas, which not only maintains the clarity of the image, but also avoids obvious tonal breaks.

[0046] Overall, this method significantly improves the automation and processing efficiency of image mosaicking by organically combining multiple innovative points while ensuring mosaicking quality. Especially when processing large-scale, multi-source remote sensing image data, this method shows obvious advantages and can meet the dual requirements of image mosaicking quality and efficiency in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0048] Figure 1 A flowchart of a PostGIS-based image mosaic method according to an embodiment of the present application is shown.

[0049] Figure 2 It is a schematic diagram of the structure of an electronic device shown in at least one embodiment of the present application. DETAILED DESCRIPTION

[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0051] Here we first introduce the overall framework of this solution. The image seamless mosaic method provided by this application adopts a multi-level processing architecture to complete key steps such as data management, feature analysis, mosaic line generation and seamless fusion in sequence.

[0052] Firstly, the spatial index of the input remote sensing image is constructed using the PostGIS spatial database to obtain the range information of the image, laying the foundation for the subsequent overlapping area detection. On this basis, the overlap between adjacent images is calculated, which not only considers the spatial overlap ratio, but also introduces the image quality score and time phase factors to achieve a more reasonable overlap relationship measurement.

[0053] Subsequently, multi-dimensional features were extracted from the overlapping areas, including quality indicators such as clarity index, spectral uniformity index, cloud coverage and noise assessment value, as well as geometric features and radiation features. Based on these features, a comprehensive weight scoring model was established, and the weight distribution of each image in the overlapping area was determined in combination with the spatial distance attenuation factor.

[0054] In the mosaic line generation process, this method is based on the weighted Voronoi diagram technology and achieves self-adaptation to image features by introducing the weighted distance field calculation of geodesic distance. Through energy function optimization and dynamic update of control points, the shape and topological features of the mosaic line are further optimized to better fit the image edge features.

[0055] Finally, a progressive fusion algorithm that considers local adaptability is adopted to achieve seamless transition of overlapping areas by comprehensively considering local brightness, edge and texture features, ensuring the visual continuity and naturalness of the final mosaic result.

[0056] The embodiments of the present application can be applied to computer systems / servers, which can operate with many other general or special computing system environments or configurations. Examples of well-known computing systems, environments and / or configurations suitable for use with computer systems / servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0057] Computer systems / servers may be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. In general, program modules may include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers may be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules may be located on local or remote computing system storage media including storage devices.

[0058] Figure 1 The flowchart of the image mosaic method based on PostGIS according to one embodiment of the present application is shown. As shown in the figure, the method includes steps 1 to 6.

[0059] Step 1: Use PostGIS spatial database to build spatial indexes for multiple input images.

[0060] Spatial index construction is a basic step in image processing. In this embodiment, the input remote sensing image data is first imported into the PostGIS spatial database, and the R-tree index is constructed using its built-in spatial index mechanism. Compared with traditional file system storage, the PostGIS-based storage solution provides a complete spatial data type and spatial operation function, which can efficiently process raster data with geographic location information, and the R-tree index structure can quickly locate and retrieve spatial objects, significantly improving the efficiency of subsequent overlapping area detection.

[0061] For example, in the specific implementation, the image data can be first imported into the database through the raster2pgsql tool of PostGIS, and the spatial reference information, range information and other metadata of the image can be automatically extracted. During the import process, the system can automatically assign a unique identifier to each image for easy reference in subsequent processing. For large-size images, PostGIS will automatically process them in blocks. The size of each block can be configured according to actual application requirements, and the default setting is 256×256 pixels.

[0062] In an example, when building a spatial index, the following SQL statement can be used:

[0063] CREATE INDEX idx_image_spatial ON image_table USING GIST (ST_ConvexHull(raster));

[0064] Among them, the ST_ConvexHull function is used to obtain the convex hull polygon of the image, which is used as the basic unit of spatial index. Compared with directly indexing the original raster data, this indexing method can significantly reduce the indexing overhead while ensuring the retrieval efficiency.

[0065] You can also use the following SQL query to obtain image range information, including spatial range, resolution, number of bands, etc.:

[0066] SELECT ST_Extent(raster), ST_PixelWidth(raster), ST_NumBands(raster)

[0067] FROM image_table;

[0068] This range information provides the necessary parameters for subsequent overlap detection and feature extraction. For example, when processing a multispectral image with a resolution of 2 meters, the range information can be used to quickly determine its spatial relationship with adjacent images and adjust the processing strategy accordingly.

[0069] Step 2: Detect overlapping areas between multiple input images based on the spatial index.

[0070] Based on the constructed spatial index, this step can complete the detection of overlapping areas. The spatial analysis function of PostGIS can be used to quickly filter out image pairs that may overlap through the spatial index, and then calculate the precise overlapping relationship between them.

[0071] In one example, the following SQL statement may be used to detect overlapping areas:

[0072] SELECT a.id, b.id, ST_Intersection(ST_ConvexHull(a.raster), ST_ConvexHull(b.raster)) as overlap_geom

[0073] FROM image_table a, image_table b

[0074] WHERE a.id <b.id AND ST_Intersects(ST_ConvexHull(a.raster), ST_ConvexHull(b.raster));

[0075] The above query example uses the ST_Intersects function to quickly determine whether there is overlap between images. For overlapping image pairs, the ST_Intersection function is used to obtain the precise geometry of the overlapping area.

[0076] Step 3: Extract multi-dimensional features from the detected overlapping areas, including image quality indicators, geometric features, and radiation features.

[0077] This step extracts multi-dimensional features from the overlapping areas, providing a basis for subsequent comprehensive weight scoring.

[0078] In some embodiments, the image quality index mainly includes: clarity index (CI), spectral uniformity index (SI), cloud coverage (CC) and noise rating (NL). Geometric features and radiation features can also be extracted.

[0079] The clarity index (CI) reflects the edge sharpness of the image. The larger the value, the clearer the image. This is particularly important for selecting the best image area. For example, in urban building areas, high-definition images can better preserve the edge features of buildings. The Laplacian operator can be used to evaluate the clarity of the image.

[0080] The spectral uniformity index (SI) is usually evaluated by calculating the spectral standard deviation of the local area. A smaller standard deviation indicates better spectral uniformity. This has an important impact on the mosaic effect of large-area homogeneous objects (such as farmland and water bodies).

[0081] Cloud coverage (CC) can be obtained by detecting cloud areas using a multi-threshold segmentation method and calculating their percentage. Cloud coverage directly affects the usability of the image, and the (1-CC) term is used in the weight calculation to reduce the weight of areas with larger cloud cover.

[0082] The noise estimation method based on wavelet transform can be used to calculate the image noise evaluation value (NL).

[0083] The geometric features mainly consider the distance from the pixel to the center of the image to which it belongs. Considering that there is usually geometric distortion in the edge area of ​​the image, the distance feature can give priority to the part close to the center of the image in the overlapping area. For example, the spatial calculation function of PostGIS can be used to calculate the geometric features.

[0084] The radiation characteristics can be characterized by calculating the local mean. For example, the local mean μ of the current image in the overlapping area and the average local mean μ_ref of all images in the overlapping area can be considered comprehensively, and the radiation characteristics can be characterized by the formula R = 1 - |μ-μ_ref| / μ_ref, so as to effectively detect and process the radiation abnormal area. For example, when an image has obvious radiation anomaly (such as overexposure and shadow) in the overlapping area, the difference between its local mean and the reference mean will be large, thereby reducing the weight of the area in the subsequent weight calculation.

[0085] In specific implementation, the focus of feature extraction can be adjusted according to different application scenarios. For example, for urban images, the weight of the clarity index can be increased, for vegetation areas, the focus can be on spectral uniformity, and for areas with unstable atmospheric conditions, special attention should be paid to cloud cover assessment.

[0086] Step 4: Establish a comprehensive weight scoring model based on the extracted multi-dimensional features to determine the comprehensive weight value of each pixel in the overlapping area.

[0087] This step establishes a comprehensive weight scoring model based on the multi-dimensional features extracted above to determine the comprehensive weight value of each pixel in the overlapping area.

[0088] In some embodiments, the following comprehensive weight scoring model may be established to calculate the comprehensive weight value W of each pixel in the overlapping area:

[0089] W = ω 1 ×Q+ω 2 ×G+ω 3 ×R+ω 4 ×exp(-d 1 / σ 1 ),

[0090] Among them, Q is the quality index score, G is the geometric feature score of the pixel to be tested, R is the radiation feature score of the pixel to be tested, and d 1 is the distance from the pixel to be tested to the center line of the overlapping area, σ 1 is the preset distance attenuation parameter, ω 1 ,ω 2 ,ω 3 ,ω 4 is the preset adjustment coefficient, and Σω i =1.

[0091] In some examples, the quality indicator score Q can be calculated according to the following formula:

[0092] Q=(CI×k1+SI×k2+(1-CC)×k3+(1-NL)×k4) / (k1+k2+k3+k4).

[0093] The Q calculated in this example integrates four key indicators: clarity index (CI), spectral uniformity index (SI), cloud coverage (CC) and noise level (NL). The weight coefficients k1-k4 can be used to flexibly adjust different indicators. The design of (1-CC) and (1-NL) ensures that lower cloud coverage and noise levels correspond to higher quality scores. In addition, the score is normalized through the denominator to ensure that the Q value is in the range of [0,1].

[0094] In some examples, the geometric feature score G of the pixel to be tested can be calculated according to the following formula:

[0095] G=1-(Dp / Dmax)²,

[0096] Among them, Dp is the distance from the pixel point p to be tested to the center of the image to which it belongs, and Dmax is the maximum center distance of the image. The score decreases nonlinearly with increasing distance in a quadratic form, so that the area close to the center of the image can be preferentially selected, effectively avoiding the geometric distortion problem of the edge of the image.

[0097] In some examples, the radiation signature score R may be calculated according to the following formula:

[0098] R=1-|μ-μ_ref| / μ_ref,

[0099] Among them, μ is the local point mean of the pixel to be tested in the current image, and μ_ref is the local average mean of the pixel to be tested in all images. By focusing on the relative difference, the ability to identify radiation anomaly areas can be improved, ensuring the radiation consistency of the final mosaic result.

[0100] In particular, after extensive research and experiments, the inventors introduced the spatial position influence term exp(-d 1 / σ 1 ), whose exponential form ensures that the weight decays smoothly with distance, which is very helpful in generating natural transition effects.

[0101] In the case of satisfying Σω i =1, those skilled in the art can adjust ω according to different application scenarios. 1 ,ω 2 ,ω 3 ,ω 4 , to adjust the importance of each feature. For example, for urban building areas, ω can be appropriately increased. 1 To highlight the impact of quality characteristics, for homogeneous areas such as farmland, its ω 3 To emphasize radiation consistency.

[0102] By establishing a comprehensive weighted scoring model, it is possible to comprehensively consider multi-dimensional features and comprehensively evaluate image quality. In particular, in some embodiments, by introducing the spatial position influence term exp(-d 1 / σ 1 ), which can significantly smooth the spatial variation characteristics and help generate natural transition effects.

[0103] Step 5: construct a weighted Voronoi diagram based on the comprehensive weight value of each pixel in the overlapping area to obtain an adaptive mosaic line.

[0104] In some implementations, constructing a weighted Voronoi diagram based on the comprehensive weight values ​​of each pixel point in the overlapping area to obtain an adaptive mosaic line may include:

[0105] Filter out the initial seed points according to the comprehensive weight values ​​of each pixel point in the overlapping area;

[0106] Calculate the weighted distance field of each seed point;

[0107] Construct a weighted Voronoi diagram based on the weighted distance field of each seed point and extract the initial tessellation line;

[0108] Adaptive optimization of tessellation lines.

[0109] The seed points can be screened out from the pixels in the overlapping area according to the comprehensive weight values ​​of the pixels in the overlapping area, taking into account the spatial distribution uniformity of the seed points, the correlation with the image features, the boundary constraints, etc. For example, the initial seed points can be obtained through the spatial analysis function of PostGIS, which is conducive to ensuring the reasonable distribution of the seed points and laying the foundation for the subsequent construction of the Voronoi diagram.

[0110] In some implementations, the weighted distance field for each seed point may be calculated based on the following formula:

[0111] D(p,si)=W i ×[(1-λ 1 )×De(p,si)+λ 1 ×Dg(p,si)],

[0112] Where D(p,si) is the weighted distance from the point p to be classified to the seed point si in the overlapping area, and W i is the comprehensive weight value of the seed point si, De(p,si) is the Euclidean distance component, Dg(p,si) is the geodesic distance component, Dg(p,si)=∫[1+α 2 ×|∇I g (r)|β 2 ]dt, r = γ(t) represents the path connecting p and si, I g(r) is the grayscale value of the image on path r, ∇I g (r) represents the gray value of the image I g The gradient of (r), λ 1 ,α 2 ,β 2 To adjust the parameters.

[0113] Weighted distance field is an important concept in image processing. For each seed point, its weighted distance field defines the weighted distance distribution from any point in the target area to the seed point. By calculating the weighted distance field of each seed point, it is possible to determine which seed point's influence area each point to be classified in the overlapping area belongs to, thereby achieving spatial division.

[0114] This implementation introduces a new weighted distance field calculation method, which fully considers the geometric distance and image feature information, and its calculation of geodesic distance takes into account the gradient change along the path, and can be calculated by λ 1 The parameters adjust the weights of the two distances and introduce a comprehensive weight value through Wi, which has good adaptability.

[0115] In the process of constructing the weighted Voronoi diagram, any pixel to be classified is divided into the region of the seed point with the smallest distance. After all pixels are divided, the boundaries of different regions constitute the initial mosaic line.

[0116] Adaptively optimizing the tessellated lines may include energy function optimization and / or control point optimization.

[0117] In some embodiments, the shape and topological features of the tessellated line may be adaptively optimized based on the following objective energy function E:

[0118] E=Ed+Ec+Es+Et,

[0119] Among them, Ed is the data item based on the image gradient, Ec is the curvature constraint item, which is used to constrain the curvature of the mosaic line, Es is the smoothness constraint, Et is the topology preservation item, and Et=exp(-d 2 (L,L 0 ) / σ 2 ), where L(s) is the current tessellation line parameter equation, L 0 is the initial tessellation line, d 2 (L,L 0 ) is the deviation distance between two mosaic lines, σ 2 is the attenuation parameter.

[0120] In this embodiment, the data item Ed based on the image gradient is used to guide the mosaic line to approach the edge feature of the image; the curvature constraint item Ec is used to control the curvature of the mosaic line; the smoothness constraint Es is used to ensure the continuity of the mosaic line; in particular, the topology preservation item Et is introduced to prevent the mosaic line from deviating too far from the initial position during the optimization process. For example: if the local optimization causes the mosaic line to deviate too far from the initial position, the topology preservation item will impose a large penalty, thereby suppressing such over-optimization.

[0121] In some implementations, control points may be selected on the mosaic line first, for example, evenly selected, and the spacing between adjacent control points may be determined according to the length and complexity of the mosaic line, typically 10-30 pixels, and then the control points of the mosaic line are iteratively updated based on the following formula:

[0122] P(t+1)=P(t)+η×F(P(t)), F(P)=Fd+Fs+Fe,

[0123] Among them, P(t) and P(t+1) are the control point position vectors after the t-th iteration and the t+1-th iteration respectively, Fd is the data driving force based on image difference, Fs is the shape preserving force, which is used to maintain the relative position relationship between the control points, Fe is the edge attraction, Fe=g(|∇I|)×∇I, g(x)=exp(-x² / k²), where I is the image grayscale value of the control point neighborhood, ∇I represents the gradient of the image grayscale value I, η is the learning rate, and k is the preset Gaussian function adjustment parameter.

[0124] The data-driven force Fd is calculated based on the local difference of the image, driving the control points to move to the position where the image features are obvious. The shape-preserving force Fs prevents local distortion of the mosaic line by maintaining the relative position relationship between adjacent control points. The edge attraction Fe guides the control points to approach the edge features in the image, where the Gaussian form of g(x)=exp(-x² / k²) produces greater attraction at strong edges and less attraction in smooth areas.

[0125] During the iteration, the learning rate η controls the step size of each update, and the local neighborhood range determines the range of feature calculation. Through multiple iterations, the mosaic line will gradually adjust to the optimal position, which not only maintains the overall shape but also fits the local image features well.

[0126] In some examples, adaptive optimization of mosaic lines can use both energy function optimization and control point optimization. This makes the optimization process more adaptive, can adapt well to different types of surface features, and provides fine adjustment capabilities while ensuring the quality of mosaic lines, and can also avoid over-optimization. Furthermore, through the parallel processing of PostGIS, the computational efficiency can be improved and fast convergence can be achieved.

[0127] Step 6: Use a progressive fusion algorithm to fuse the transition zones on both sides of the obtained mosaic line to achieve seamless transition of the overlapping area.

[0128] Based on the above mosaic line optimization results, a progressive fusion algorithm can be used to achieve a smooth transition on both sides of the mosaic line by introducing a local adaptability factor. The transition zone is usually set to a certain width (such as 30-50 pixels) on both sides of the mosaic line. The specific width can be adjusted according to the image resolution and ground features.

[0129] In some implementations, the pixel value P(x, y) of the transition zone after fusion may be obtained based on the following formula:

[0130] P(x,y)=Σ j (P j ×F j ) / Σ j (F j ),

[0131] If the transition zone is a transition zone in the overlapping area of ​​2 source images, then j = 1, 2; if the transition zone is a transition zone in the overlapping area of ​​3 source images, then j = 1, 2, 3. j is the pixel value of the j-th source image at (x, y), F j is the local adaptability factor, F j =(1+λ 2 ×L j )×(1+μ×E j )×(1+ν×T j ), L j is the local brightness coordination, E j is the edge strength, T j is the texture complexity, λ 2 , μ, ν are adaptive adjustment parameters.

[0132] The core idea of ​​the progressive fusion according to this embodiment is that, for the transition zone, the contribution weights of different source images can be adaptively adjusted according to the positional relationship and local features of the pixel points. The inventor believes that the influence of each source image is mainly determined by two factors: the source image pixel value P j and the local adaptability factor F j Among them, the local adaptability factor F j =(1+λ 2 ×L j )×(1+μ×E j )×(1+ν×T j ) considers three key features: local brightness coordination L j , edge strength E j and texture complexity T j .

[0133] The local brightness coordination reflects the brightness consistency between the pixel to be fused and the surrounding area, which helps to eliminate local brightness mutations. Edge strength is used to maintain important boundary features of objects and ensure that details at the edge will not be blurred due to fusion. Texture complexity helps to maintain more detailed information in areas with rich textures. 2 By adjusting μ, μ, and ν, the relative influence of these three characteristics can be controlled.

[0134] According to this embodiment, the fusion strategy can be dynamically adjusted according to local features, effectively maintaining important details such as edges and textures, avoiding the blurring effect that is easily produced by traditional weighted averaging methods, and achieving a visually natural transition effect.

[0135] The image seamless mosaic method provided in this embodiment achieves high-quality image seamless mosaic by cleverly combining multi-dimensional feature extraction and adaptive mosaic line generation technology. This embodiment innovatively establishes a comprehensive weight scoring model for fusion quality indicators, geometric features, and radiation features, providing a reliable basis for spatial division; the weighted Voronoi diagram constructed based on the comprehensive weight can adaptively generate the optimal mosaic line, and ensures the smoothness and topology preservation characteristics of the mosaic line through energy function optimization; through the progressive fusion algorithm, a natural transition effect is achieved. The entire processing process is based on the PostGIS spatial database, which not only improves the efficiency of large-scale image processing, but also provides a complete data management mechanism, with good practicality and promotion value.

[0136] The following takes the mosaicking of multiple SPOT satellite images of a certain area as an example to explain in detail the specific implementation process of the method proposed in this application.

[0137] First, the five SPOT images were imported into the PostGIS database. Each image was approximately 12,000 × 12,000 pixels in size, with a spatial resolution of 2.5 meters and containing four multispectral bands. The system automatically built a spatial index and extracted image range information.

[0138] Through PostGIS spatial query, the system detected 12 pairs of overlapping image combinations, with overlapping areas ranging from 2km² to 5km². Multi-dimensional feature extraction was performed on these overlapping areas: for example, in a typical overlapping area, the clarity index of image A was 0.85, the spectral uniformity index was 0.78, the cloud coverage was 0.05, and the noise evaluation value was 0.08; the corresponding indicators of image B were 0.82, 0.75, 0.02, and 0.06, respectively.

[0139] For each pixel in the overlapping area, the system calculates its comprehensive weight value. Taking a pixel near the center of the overlapping area as an example, its quality index score is 0.83, the geometric feature score is 0.92 (closer to the center of the image), and the radiation feature score is 0.88, and the final comprehensive weight value is 0.87.

[0140] Based on the comprehensive weight distribution of pixel points, the system selected about 200 points with high comprehensive weight values ​​in the overlapping area as seed points. The initial mosaic line was generated by calculating the weighted distance field and constructing the weighted Voronoi diagram. After energy function optimization, the obtained mosaic line avoided the boundaries of the objects well and was mainly distributed along natural transition zones such as roads and farmland boundaries.

[0141] Finally, a seamless transition was achieved through a progressive fusion algorithm. The entire process took about 15 minutes to complete in the PostGIS environment. The resulting mosaic image was visually continuous and natural, with clear boundaries and no obvious traces of mosaicking.

[0142] This example fully demonstrates the effectiveness and practicality of this method in processing actual remote sensing images. Through reasonable parameter configuration and optimization strategy, the seamless mosaic of multi-view images is successfully achieved, meeting the needs of practical applications. For other details and beneficial effects of this example, please refer to the relevant introduction above, which will not be repeated here.

[0143] Figure 2 An electronic device provided for at least one embodiment of the present application includes a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the PostGIS-based image mosaic method described in any embodiment or implementation of the present application when executing the computer instructions.

[0144] At least one embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the PostGIS-based image mosaic method described in any embodiment or implementation of the present application.

[0145] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0146] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0147] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0148] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.

[0149] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0150] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0151] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A PostGIS-based image mosaic method, characterized in that: include: Use PostGIS spatial database to build spatial indexes for multiple input images; Detect overlapping areas between multiple input images based on spatial index; Perform multi-dimensional feature extraction on the detected overlapping areas, including image quality indicators, geometric features, and radiation features; A comprehensive weight scoring model is established based on the extracted multi-dimensional features to determine the comprehensive weight value of each pixel in the overlapping area; A weighted Voronoi diagram is constructed based on the comprehensive weight values ​​of each pixel in the overlapping area to obtain an adaptive mosaic line. The transition zones on both sides of the obtained mosaic line are merged using a progressive fusion algorithm to achieve seamless transition of the overlapping area. The weighted Voronoi diagram is constructed based on the comprehensive weight values ​​of each pixel in the overlapping area to obtain the adaptive mosaic line, including: Filter out the initial seed points according to the comprehensive weight values ​​of each pixel point in the overlapping area; Calculate the weighted distance field of each seed point; Construct a weighted Voronoi diagram based on the weighted distance field of each seed point and extract the initial tessellation line; Adaptive optimization of tessellation lines; Calculating the weighted distance field for each seed point includes: The weighted distance field of each seed point is calculated based on the following formula: D(p,si)=W i ×[(1-λ1)×De(p,si)+λ1×Dg(p,si)], Where D(p,si) is the weighted distance from the point p to be classified to the seed point si in the overlapping area, and W i is the comprehensive weight value of the seed point si, De(p,si) is the Euclidean distance component, Dg(p,si) is the geodesic distance component, Dg(p,si)=∫[1+α2×|∇I g (r)|β2]dt, r=γ(t) represents the path connecting p and si, I g (r) is the grayscale value of the image on path r, ∇I g (r) represents the gray value of the image I g The gradient of (r), λ1, α2, β2 are adjustment parameters; Adaptive optimization of tessellation lines includes: The shape and topological features of the tessellation line are adaptively optimized based on the following objective energy function E: E=Ed+Ec+Es+Et, Wherein, Ed is a data item based on image gradient, Ec is a curvature constraint item used to constrain the curvature of the mosaic line, Es is a smoothness constraint, Et is a topology preservation item, Et=exp(-d2(L,L0) / σ2), where L is the current mosaic line parameter equation, L0 is the initial mosaic line, d2(L,L0) is the deviation distance between the two mosaic lines, and σ2 is the attenuation parameter; Adaptive optimization of tessellation lines includes: Select control points on the tessellation line; The control points of the mosaic line are iteratively updated based on the following formula: P(t+1)=P(t)+η×F(P(t)), F(P)=Fd+Fs+Fe, Wherein, P(t) and P(t+1) are the control point position vectors after the t-th iteration and the t+1-th iteration, respectively; Fd is the data driving force based on image difference; Fs is the shape preserving force, which is used to maintain the relative position relationship between the control points; Fe is the edge attraction, Fe=g(|∇I|)×∇I, g(x)=exp(-x² / k²), where I is the image gray value of the control point neighborhood, ∇I represents the gradient of the image gray value I, η is the learning rate, and k is the preset Gaussian function adjustment parameter; The transition zones on both sides of the obtained mosaic line are merged using a progressive fusion algorithm, including: The pixel value P(x,y) of the transition zone after fusion is obtained based on the following formula: P(x,y)=Σ j (P j ×F j ) / S j (F j ), Among them, P j is the pixel value of the j-th source image at (x, y), F j is the local adaptability factor, F j =(1+λ2×L j )×(1+μ×E j )×(1+ν×T j ), L j is the local brightness coordination, E j is the edge strength, T j is the texture complexity, λ2, μ, ν are adaptive adjustment parameters.

2. The method according to claim 1, characterized in that: The image quality indicators include clarity index CI, spectral uniformity index SI, cloud coverage CC, and noise evaluation value NL.

3. The method according to claim 1, characterized in that A comprehensive weight scoring model is established based on the extracted multi-dimensional features to determine the comprehensive weight value of each pixel in the overlapping area, including: The following comprehensive weight scoring model is established to calculate the comprehensive weight value W of each pixel in the overlapping area: W=ω1×Q+ω2×G+ω3×R+ω4×exp(-d1 / σ1), Where Q is the quality index score, G is the geometric feature score of the pixel to be tested, R is the radiation feature score of the pixel to be tested, d1 is the distance from the pixel to be tested to the center line of the overlapping area, σ1 is the preset distance attenuation parameter, ω1, ω2, ω3, ω4 are preset adjustment coefficients, and Σω i =1.

Citation Information

Patent Citations

  • Large-area geographic information overlapping area determination method and device, equipment and medium

    CN113919433A

  • GIS data sharing method and system

    CN115061989A