Image fusion processing method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202410300992.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2044-03-15
AI Technical Summary
[0005]本申请的目的在于,针对上述现有技术中的不足,提供一种图像融合处理方法、装置、电子设备及存储介质,以解决现有技术中处理效率慢,及处理效果不稳定的问题
[0055] The beneficial effects of this application are as follows: First, the highest and lowest grid levels are determined based on multiple vector spectra in the image to be processed. This allows for dynamic adjustment of the grid level during fusion based on the actual situation of the vector spectra at each grid level, selecting a more suitable grid level for better performance. Then, the image to be processed is divided into multiple grids based on the highest grid level, and the grid vector data is determined. Based on this grid vector data, starting with the multiple grids corresponding to the highest grid level, grid fusion is performed layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained. Finally, the fused image of the image to be processed is obtained based on the result of the cyclic fusion. In this embodiment, by fusion of vector spectra layer by layer, the workload of fusion calculation is reduced, the complexity of a single calculation is simplified, and the effect of fusion processing is improved. Furthermore, this embodiment is built on a big data system, possessing scalability and high fault tolerance. The system is stable and has lower storage and computation costs compared to using geographic information mapping software, offering high cost-effectiveness.
Smart Images

Figure CN118037567B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image fusion technology, and more specifically, to an image fusion processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the explosive growth of information contained in map images, how to fuse and process large-scale vector image data has become an urgent problem to be solved.
[0003] In existing technologies, the map processing module in geographic information mapping software is typically used to fuse overlapping parts in vector images.
[0004] However, directly performing global fusion processing on the images to be processed using geographic information mapping software may result in slow fusion processing efficiency and unstable processing results due to the huge amount of data contained in the images. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing an image fusion processing method, apparatus, electronic device, and storage medium to solve the problems of slow processing efficiency and unstable processing results in the prior art.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows:
[0007] In a first aspect, this application provides an image fusion processing method, the method comprising:
[0008] Based on multiple vector patterns in the image to be processed, the highest grid level and the lowest grid level for fusion are determined, wherein the number of first image grids corresponding to the highest grid level is greater than the number of second image grids corresponding to the lowest grid level.
[0009] The image to be processed is divided according to the number of first image grids corresponding to the highest grid level, resulting in multiple grids under the highest grid level;
[0010] Based on the vector patterns corresponding to each grid at the highest grid level, determine the grid data for each grid, which includes: grid identifier and grid vector data;
[0011] Starting with multiple grids at the highest grid level, grid fusion is performed layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained. The fused image of the image to be processed is obtained based on the result of the cyclic fusion.
[0012] Optionally, determining the highest and lowest grid levels for fusion based on multiple vector patterns in the image to be processed includes:
[0013] Traverse each grid level. For the current grid level, determine the average number of patches in each grid corresponding to the current grid level based on the number of vector patches in the image to be processed. If the difference between the average number of patches in each grid corresponding to the current grid level and the preset average number of patches is less than a first preset threshold, then the current grid level is taken as the highest grid level.
[0014] Optionally, determining the lowest mesh level for fusion includes:
[0015] Traverse each grid level. For the current grid level, determine the range of the current grid patch based on the current grid level and the number of patches on the grid corresponding to the current grid level. If the difference between the range of the current grid patch and the preset average range of patches on the grid is less than a second preset threshold, then the current grid level is taken as the lowest grid level.
[0016] Optionally, determining the grid data of each grid based on the vector patch corresponding to each grid at the highest grid level includes:
[0017] Obtain vector data of vector image patches located in the first grid under the highest grid level, wherein the first grid is any grid under the highest grid level;
[0018] Aggregate the vector data of all vector patterns within the first grid into the grid vector data of the first grid;
[0019] The preset identifier of the first grid at the highest grid level is used as the grid identifier of the first grid.
[0020] Optionally, the step of starting with multiple grids at the highest grid level and performing grid fusion layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained includes:
[0021] The highest grid level is taken as the initial current grid level, and the vector data of each grid under the highest grid level is taken as the initial vector data to be fused.
[0022] A. Perform fusion processing on the vector data to be fused in each grid under the current grid level, and generate vector data to be placed on disk and new vector data to be fused based on the fusion processing results;
[0023] B. Store the vector data to be placed on the disk and use the next level of the current grid level as the new current grid level;
[0024] C. Execute AB repeatedly until the current grid level is the lowest grid level, and store all vector data to be fused under the lowest grid level on disk.
[0025] Optionally, the step of fusing the vector data to be fused in each grid at the current grid level, and generating vector data to be dumped and new vector data to be fused based on the fusing result, includes:
[0026] The vector data to be fused in the first grid under the current grid level is fused to obtain multiple fused vector data;
[0027] The process iterates through the multiple fused vector data sets. For the current vector data set that is traversed, if the current vector data set is located at the boundary position of the first grid, then the current vector data set is used as a new vector data set to be fused; otherwise, the current vector data set is used as a vector data set to be placed on the disk.
[0028] Optionally, obtaining the fused image of the image to be processed based on the result of the cyclic fusion includes:
[0029] Based on all the vector data stored on disk, the fused image of the image to be processed is restored.
[0030] Secondly, this application provides an image fusion processing apparatus, the apparatus comprising:
[0031] The first determining module is used to determine the highest grid level and the lowest grid level during fusion based on multiple vector patterns in the image to be processed, wherein the number of first image grids corresponding to the highest grid level is greater than the number of second image grids corresponding to the lowest grid level.
[0032] The partitioning module is used to partition the image to be processed according to the number of first image grids corresponding to the highest grid level, so as to obtain multiple grids under the highest grid level;
[0033] The second determining module is used to determine the grid data of each grid based on the vector patterns corresponding to each grid under the highest grid level. The grid data includes: grid identifier and grid vector data.
[0034] The fusion module is used to start with multiple grids under the highest grid level, and perform grid fusion layer by layer according to the grid data of each grid until multiple grids under the lowest grid level are obtained. The fused image of the image to be processed is obtained according to the result of the cyclic fusion.
[0035] Optionally, the first determining module is specifically used for:
[0036] Traverse each grid level. For the current grid level, determine the average number of patches in each grid corresponding to the current grid level based on the number of vector patches in the image to be processed. If the difference between the average number of patches in each grid corresponding to the current grid level and the preset average number of patches is less than a first preset threshold, then the current grid level is taken as the highest grid level.
[0037] Optionally, the first determining module is specifically used for:
[0038] Traverse each grid level. For the current grid level, determine the range of the current grid patch based on the current grid level and the number of patches on the grid corresponding to the current grid level. If the difference between the range of the current grid patch and the preset average range of patches on the grid is less than a second preset threshold, then the current grid level is taken as the lowest grid level.
[0039] Optionally, the second determining module is specifically used for:
[0040] Obtain vector data of vector image patches located in the first grid under the highest grid level, wherein the first grid is any grid under the highest grid level;
[0041] Aggregate the vector data of all vector patterns within the first grid into the grid vector data of the first grid;
[0042] The preset identifier of the first grid at the highest grid level is used as the grid identifier of the first grid.
[0043] Optionally, the fusion module is specifically used for:
[0044] The highest grid level is taken as the initial current grid level, and the vector data of each grid under the highest grid level is taken as the initial vector data to be fused.
[0045] A. Perform fusion processing on the vector data to be fused in each grid under the current grid level, and generate vector data to be placed on disk and new vector data to be fused based on the fusion processing results;
[0046] B. Store the vector data to be placed on the disk and use the next level of the current grid level as the new current grid level;
[0047] C. Execute AB repeatedly until the current grid level is the lowest grid level, and store all vector data to be fused under the lowest grid level on disk.
[0048] Optionally, the fusion module is specifically used for:
[0049] The vector data to be fused in the first grid under the current grid level is fused to obtain multiple fused vector data;
[0050] The process iterates through the multiple fused vector data sets. For the current vector data set that is traversed, if the current vector data set is located at the boundary position of the first grid, then the current vector data set is used as a new vector data set to be fused; otherwise, the current vector data set is used as a vector data set to be placed on the disk.
[0051] Optionally, the fusion module is specifically used for:
[0052] Based on all the vector data stored on disk, the fused image of the image to be processed is restored.
[0053] Thirdly, this application provides an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the image fusion processing method described above.
[0054] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the image fusion processing method described above.
[0055] The beneficial effects of this application are as follows: First, the highest and lowest grid levels are determined based on multiple vector spectra in the image to be processed. This allows for dynamic adjustment of the grid level during fusion based on the actual situation of the vector spectra at each grid level, selecting a more suitable grid level for better performance. Then, the image to be processed is divided into multiple grids based on the highest grid level, and the grid vector data is determined. Based on this grid vector data, starting with the multiple grids corresponding to the highest grid level, grid fusion is performed layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained. Finally, the fused image of the image to be processed is obtained based on the result of the cyclic fusion. In this embodiment, by fusion of vector spectra layer by layer, the workload of fusion calculation is reduced, the complexity of a single calculation is simplified, and the effect of fusion processing is improved. Furthermore, this embodiment is built on a big data system, possessing scalability and high fault tolerance. The system is stable and has lower storage and computation costs compared to using geographic information mapping software, offering high cost-effectiveness. Attached Figure Description
[0056] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a schematic flowchart of an image fusion processing method provided in an embodiment of this application;
[0058] Figure 2 This is a schematic diagram illustrating the correspondence between mesh division and mesh levels provided in an embodiment of this application;
[0059] Figure 3 This is a flowchart illustrating a method for determining grid data for each grid according to an embodiment of this application;
[0060] Figure 4 This is a flowchart illustrating a grid data partitioning method provided in an embodiment of this application;
[0061] Figure 5 This is a flowchart illustrating a method for setting grid identifiers in a first grid level, a second grid level, and a third grid level, as provided in an embodiment of this application.
[0062] Figure 6 This is a flowchart illustrating a mesh fusion method provided in an embodiment of this application;
[0063] Figure 7 This is an example diagram illustrating the implementation of an image fusion processing method provided in an embodiment of this application;
[0064] Figure 8 This is a schematic diagram of the structure of an image fusion processing device provided in an embodiment of this application;
[0065] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0067] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0068] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0069] In existing technologies, the map processing module of geographic information mapping software is typically used to fuse overlapping parts of vector images. For example, ArcGIS can be used for this purpose. The specific fusion process is as follows: First, the fusion tool in ArcGIS's data management tools is used to fuse all overlapping vector polygons, deleting duplicate polygons in the overlapping areas to obtain multiple parts with no overlap. Then, the multiple parts to single parts tool in the data management tools is used to convert the multiple parts into a single part, thereby generating a complete single-sided vector image.
[0070] However, directly performing global fusion processing using geographic information mapping (GIS) software may lead to slow processing efficiency and unstable results due to the massive amount of image data. Furthermore, existing GIS software is standalone and cannot be horizontally scaled, potentially resulting in performance limitations when processing large-scale data, leading to slowness or instability. Additionally, limitations in integrating GIS software with other GIS plugins and open-source tools prevent it from meeting the diverse business needs of big data scenarios. Moreover, the extensive functionality of GIS software requires considerable experience to use, resulting in a high learning curve.
[0071] To address the aforementioned issues, this application proposes an image fusion processing method. This method first determines the highest and lowest grid levels based on multiple vector patches in the image to be processed. Then, based on the highest grid level, the image is divided into multiple grids. Finally, starting with the grids at the highest level, grid fusion is performed layer by layer according to the grid data of each grid until the grids at the lowest level are obtained. The fused image is then obtained based on the cyclic fusion result. In this process, by fusing grid data across multiple grid levels, the workload during step-by-step grid fusion is significantly less than fusing the entire image directly, resulting in faster processing efficiency and better processing results. Furthermore, this application can process various types of images, thus meeting the diverse business needs of big data scenarios. In addition, the method in this application does not involve stand-alone software, therefore avoiding slow performance or instability.
[0072] Next, refer to Figure 1 This paper provides a detailed introduction to image fusion processing methods. These methods can be built upon big data systems and applied to electronic devices with processing capabilities.
[0073] S101. Based on multiple vector patterns in the image to be processed, determine the highest grid level and the lowest grid level for fusion, wherein the number of first image grids corresponding to the highest grid level is greater than the number of second image grids corresponding to the lowest grid level.
[0074] Optionally, the image to be processed can be a processed remote sensing image. The image to be processed may contain geographic information such as multiple buildings, rivers, and mountains. Based on this geographic information, segmentation processing is performed on the image to be processed, resulting in multiple vector polygons. For example, one vector polygon can represent a city building complex, and another vector polygon can represent another city building complex. Since the edges of city building complexes identified based on remote sensing images are not precise, overlapping vector polygons representing city building complexes may occur. Therefore, in this embodiment, it is necessary to perform fusion processing on the vector polygons.
[0075] Optionally, the highest and lowest grid levels can be set based on the distribution of vector patches in the image to be processed. The grid level represents the degree of subdivision of the image to be processed. The correspondence between grid levels, grid division methods, and the number of divisions can be preset. For example, Figure 2 This diagram illustrates the grid division and corresponding grid levels provided in an embodiment of this application. First, the image to be processed is referenced to mutually perpendicular horizontal and vertical axes. When the grid level is 0, the image to be processed is an undivided, whole image. When the grid level is 1, the horizontal and vertical axes of the image to be processed can be divided into two equal parts each, meaning the image to be processed is divided into 4 grids. When the grid level is 2, the horizontal and vertical axes of the image to be processed can be divided into 4 equal parts each, meaning the image to be processed is divided into 16 grids. When the grid level is 3, the horizontal and vertical axes of the image to be processed can be divided into 8 equal parts each, meaning the image to be processed is divided into 64 grids. In other words, the horizontal and vertical axes of the image to be processed can be divided into 2... N The image to be processed is divided into (2) grids. N ) 2 The number of grid cells. Where N is the grid level. A higher grid level results in more grid cells, and a lower grid level results in fewer grid cells.
[0076] It is worth noting that the difference between the average number of patches per grid corresponding to the highest grid level and the preset average number of patches is less than the first preset threshold. Furthermore, the difference between the current patch range of the lowest grid level and the patch range of the preset average grid is less than the second preset threshold.
[0077] The smaller the first and second preset thresholds, the more accurate the determination of the highest and lowest grid levels. Specifically, if a vector patch spans two grids, then each of those grids contains a portion of that vector patch, and that portion is considered a complete vector patch. That is, if a vector patch spans two grids, then each of those grids contains one vector patch. Based on the above vector patch determination method, the average number of patches per grid is determined, and this number is compared with the preset average number of patches to determine the highest and lowest grid levels corresponding to the current image to be processed.
[0078] As an optional implementation, the preset average number of patches can be calculated in advance using a sampling algorithm to identify random small-area vector patches, and then the preset average number of patches is determined based on the number of vector patches within the small area and the computing power of the electronic device. The preset average patch range on the grid can be calculated in advance using a sampling algorithm to identify random small-area vector patches within each grid level below the highest grid level, and then the preset average patch range is determined based on the number of vector patches within the small area and the computing power of the electronic device.
[0079] S102. Divide the image to be processed according to the number of first image grids corresponding to the highest grid level to obtain multiple grids under the highest grid level.
[0080] As an optional implementation, the image to be processed can be evenly divided according to the number of first image grids corresponding to the highest grid level. That is, the image to be processed is evenly divided into images of the first number of image grids.
[0081] S103. Based on the vector patterns corresponding to each grid at the highest grid level, determine the grid data for each grid. The grid data includes: grid identifier and grid vector data.
[0082] Optionally, the grid identifier can be preset based on the grid location.
[0083] Optionally, each vector patch in the image to be processed has a unique identifier. When a vector patch spans multiple grids, the vector patches contained in each grid can be re-identified according to the grid identifier to obtain a new identifier for the vector patch. For example, if a vector patch A in the image to be processed spans 3 grids, including grid 1, grid 2, and grid 3, then the new identifiers for vector patch A can be: A1, A2, and A3.
[0084] Based on the above method of identifying vector graphics, the new identifiers of all vector graphics contained in each grid are combined to obtain grid vector data.
[0085] S104. Starting with multiple grids at the highest grid level, perform grid fusion layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained. Based on the result of the cyclic fusion, obtain the fused image of the image to be processed.
[0086] Specifically, starting with multiple grids at the highest grid level, grid fusion is performed on the grid data within each grid. Next, it is determined whether the next grid level is the lowest grid level. If not, the grid fusion result is divided according to the number of grids corresponding to the next grid level, and the fusion result of the previous level's grid data is used as the grid data for each grid at the current grid level. Grid fusion continues on the grid data of each grid at the current grid level, and it is determined again whether the next grid level is the lowest grid level. If not, the steps following the division of the grid fusion result according to the number of grids corresponding to the next grid level are repeated. If so, the grid fusion result is used as the fused image of the image to be processed. It is worth noting that the result of the cyclic fusion is the grid fusion result at the lowest grid level. The "next grid level" in the above description refers to a grid level smaller than the current grid level.
[0087] As an optional implementation, the mesh fusion results at the lowest mesh level can be globally fused, ultimately merging multiple components into a single component to generate an overall single-sided vector map.
[0088] It is worth noting that the mesh fusion process in each mesh level of this application can be performed simultaneously by multiple servers, which can improve the computing speed while reducing the risk of system crash and freezing due to excessive computing load on a single server, thus realizing distributed image processing.
[0089] In this embodiment, the highest and lowest grid levels are first determined based on multiple vector spectra in the image to be processed. This allows for dynamic adjustment of the grid level during fusion based on the actual situation of the vector spectra at each grid level, selecting a more suitable grid level for better performance. Next, the image to be processed is divided into multiple grids based on the highest grid level, and grid vector data is determined. Then, based on this grid vector data, starting with the multiple grids corresponding to the highest grid level, grid fusion is performed layer by layer iteratively according to the grid data of each grid until multiple grids at the lowest grid level are obtained. Finally, the fused image of the image to be processed is obtained based on the result of the iterative fusion. In this embodiment, by fusing vector spectra layer by layer iteratively, the workload of fusion calculation is reduced, the complexity of a single calculation is simplified, and the fusion processing effect is improved. Furthermore, this embodiment is built on a big data system, possessing scalability and high fault tolerance. The system is stable and has lower storage and computation costs compared to using geographic information mapping software, offering high cost-effectiveness.
[0090] As an optional implementation, the following describes how to determine the highest and lowest mesh levels during fusion:
[0091] Traverse each grid level. For the current grid level, determine the average number of patches in each grid corresponding to the current grid level based on the number of vector patches in the image to be processed. If the difference between the average number of patches in each grid corresponding to the current grid level and the preset average number of patches is less than the first preset threshold, then the current grid level is taken as the highest grid level.
[0092] As an optional implementation, the grid can be traversed from low to high levels. When the difference between the average number of patches and the preset average number of patches in the current grid level is less than a first preset threshold, the current grid level is taken as the highest grid level, and there is no need to continue to judge higher-level grid levels, so as to save computation time.
[0093] The preset average number of image patches and the first preset threshold can be test results obtained by the user through multiple vector image patch fusion tests in the early stages. These test results ensure stability during the vector image patch fusion calculation process, preventing system crashes or freezes. Simultaneously, they guarantee that the image to be processed is broken down into the largest possible stable computational units, i.e., a grid, thereby reducing the number of calculations.
[0094] For example, the preset average number of polygons can be 1000 vector polygons. When the second grid level is traversed, the number of vector polygons in each grid is 730, while the first preset threshold is 80. The current grid level does not meet the requirement that the difference between the average number of polygons and the preset average number of polygons is less than the first preset threshold. Then, the third network level is judged. The number of vector polygons in each grid in the third network level is 950. The difference between the average number of polygons and the preset average number of polygons is 50, which is less than the first preset threshold. Therefore, the third network level is taken as the highest network level.
[0095] In this embodiment, the highest grid level is determined based on the difference between the average number of patches in each grid corresponding to the current grid level and the preset average number of patches, and the relationship between the first preset threshold. This avoids the situation where the highest grid level is too high, resulting in too little data in each grid and too many iterations of fusion, which would increase the workload. It also avoids the situation where the highest grid level is too low, resulting in too much data in each grid, which would also lead to a large workload in processing the fusion of data in each grid.
[0096] As an optional implementation, the method for determining the lowest mesh level during fusion in step S101 can be as follows:
[0097] Traverse each grid level. For the current grid level, determine the range of the current grid patch based on the current grid level and the number of patches on the grid corresponding to the current grid level. If the difference between the range of the current grid patch and the preset average range of patches on the grid is less than the second preset threshold, then the current grid level is taken as the lowest grid level.
[0098] Optionally, the number of polygons on the grid can be the total number of polygons in contact with the grid edge. The current grid polygon range can be the average of the number of all vector polygons in contact with the grid edge at the current grid level. Specifically, the calculation process of the average can be expressed by formula (1):
[0099] L = T × (2N) 2 (1)
[0100] Where L represents the mean, T represents the total number of patches that are in contact with the grid edge, and N represents the current grid level.
[0101] Optionally, the preset average number of patches on the grid can be a pre-set average of the number of patches on all grids that meet the current electronic device's calculation conditions. The preset average patch range and the second preset threshold can be test results obtained by the user through multiple vector patch fusion tests. These test results ensure that the fusion calculation of all patches at the lowest grid level does not cause the calculation program to crash or freeze.
[0102] It is worth noting that as the grid level decreases, the grid area becomes larger, and therefore the number of patches on the grid edges may also increase. For example, the preset average patch range on the grid can be 1000, and the calculation is performed by increasing the grid level from 1 to the next grid level. If the current patch range on the grid is 960 and the second preset threshold is 60, then the current grid level is taken as the lowest grid level.
[0103] The method used in this embodiment is to calculate the lowest grid level in advance before grid fusion, which can improve the efficiency of the fusion process.
[0104] As another optional implementation, the method for determining the lowest mesh level during fusion in step S101 can be as follows:
[0105] In step S104, during the process of performing mesh fusion layer by layer, after each mesh fusion is completed, the result of each mesh fusion is judged and processed. The specific process includes: calculating the number of patches on the mesh based on the current mesh fusion result and the mesh area divided in the next level mesh layer, and determining the current mesh patch range based on the next level mesh layer and the number of patches on the mesh. If the difference between the current mesh patch range and the preset average mesh patch range is less than the second preset threshold, then the next level mesh layer is taken as the lowest mesh layer.
[0106] The method mentioned in this embodiment determines the lowest grid level step by step during the grid fusion process. Therefore, the working efficiency during the grid fusion process is lower than that of the previous embodiment. However, the identification of the lowest grid level is more accurate, and the overall fusion efficiency of the image to be processed can be improved in terms of the number of grid fusions.
[0107] In this embodiment, the current grid patch range is obtained based on the number of patches on each grid level and the grid level. The lowest grid level is determined based on the current grid patch range and the preset average grid patch range, thereby limiting the number of times the grid is fused step by step, reducing the workload of dividing the grid step by step and performing multiple fusions, and improving work efficiency.
[0108] Next, refer to Figure 3 The specific steps in step S103 above, which involve determining the grid data of each grid based on the vector image patches corresponding to each grid at the highest grid level, are described below:
[0109] S301. Obtain the vector data of the vector patch in the first grid under the highest grid level. The first grid is any grid under the highest grid level.
[0110] Optionally, the vector data can be patch data within the first grid of a vector map. For example, such as... Figure 4 As shown, there are three components within grid 1: a portion of vector patch A, vector patch B, and vector patch C, forming a multi-component vector array. Vector patch A spans three grids, including grid 1, grid 2, and grid 3. Therefore, the vector data of grid 1 can include A1, B, and C.
[0111] S302. Aggregate the vector data of all vector patterns within the first grid into the grid vector data of the first grid.
[0112] The grid vector data includes vector data from all grids. For example, as described above. Figure 4 In the diagram, the grid vector data for grid 1 can be A1, B, or C, and the vector data can be separated by commas.
[0113] S303. Use the preset identifier of the first grid at the highest grid level as the grid identifier of the first grid.
[0114] Optionally, the identifiers for each grid within each grid level can be pre-set. The grids within each grid level can be identified from left to right and from top to bottom. As an optional implementation, it can be done according to... Figure 5 The method shown identifies the grids at the first, second, and third grid levels. The identifiers can be binary, octal, or base-32.
[0115] In this embodiment, the vector data of the vector patch in the first grid located at the highest grid level is obtained and aggregated to obtain the grid vector data of the first grid. The preset identifier of the first grid at the highest grid level is used as the grid identifier of the first grid. This facilitates the fusion of grid vector data through the obtained grid identifier, ensuring a one-to-one correspondence between grids and vector data, thereby improving work efficiency.
[0116] After explaining how to determine grid data, refer to... Figure 6 A detailed explanation is provided for step S104, which involves starting with multiple meshes at the highest mesh level and performing mesh fusion layer by layer based on the mesh data of each mesh until multiple meshes at the lowest mesh level are obtained:
[0117] S601. Take the highest grid level as the initial current grid level, and take the vector data of each grid under the highest grid level as the initial vector data to be fused.
[0118] Optionally, the initial vector data to be fused can be aggregated into a complete image to be processed.
[0119] S602. Perform fusion processing on the vector data to be fused in each grid under the current grid level, and generate vector data to be dropped onto the disk and new vector data to be fused based on the fusion processing results.
[0120] Optionally, the fusion process can be performed using a lightweight, repetitive operation level system, such as GTIS. In this embodiment, the mesh identifier can be used as the key value, and the vector data to be fused can be used as the value value. The value value can include multi-part vectors. Based on the key value, the corresponding value value is fused to obtain a multi-part vector or a single-part vector. It is worth noting that the number of parts in the fused multi-part vector is less than or equal to the number of parts in the value value. Furthermore, the multi-part vectors are clustered into a single-sided vector image, which is then used as the single-part vector image.
[0121] Optionally, the vector data to be dumped can be vector data whose location does not coincide with the grid boundary at the current grid level. The vector data to be merged can be vector data whose location coincides with the grid boundary at the current grid level. It is worth noting that the vector data to be merged is different at each grid level.
[0122] S603. Store the vector data to be written to disk and use the next level of the current grid level as the new current grid level.
[0123] Among these features, the vector data to be dropped onto the disk can be stored in the memory.
[0124] As an optional implementation, during the fusion process, the number of decreasing layers can be determined based on the number of image patches on the grid corresponding to the next grid level after the fusion of the grid vector data of the highest grid level and a preset decreasing coefficient. Specifically, if the highest grid level is level 5, after fusing the grid vector data according to the highest grid level, the number T of vector image patches overlapping the grid boundary of the 4th grid level is obtained, and the average number M of decreasing image patches in the current layer is determined based on this number T and the preset decreasing coefficient. The specific process can be expressed by formula (2):
[0125] M = T × (2 n ) 2 (2)
[0126] Where n represents the current number of decreasing layers, and n increases from 1. If the difference between the average number of decreasing patches M and the preset decreasing coefficient is less than the third preset threshold, then the current number of decreasing layers is taken as the number of decreasing layers for this image fusion process.
[0127] Based on this, the next decreasing level of the current grid level is taken as the new current grid level.
[0128] S604. Repeat S602-S603 until the current grid level is the lowest grid level, and store all vector data to be fused at the lowest grid level on disk.
[0129] As an optional implementation, after all the vector data to be fused is stored on disk, in order to obtain a single-component vector, the data stored on disk in the above process can be extracted and subjected to global fusion processing to fuse the multi-component vectors into a single-component vector, and then the single-component vector can be stored on disk.
[0130] In this embodiment, the highest grid level is taken as the initial current grid level. The vector data to be fused in each grid under the current grid level are fused. Based on the fusion processing results, vector data to be placed on disk and new vector data to be fused are generated. The vector data to be placed on disk is stored and placed on disk, thereby avoiding the processing of unnecessary patches during the fusion process of the next network level, which would lead to redundancy. Then, the next level after the current grid level is taken as the new current grid level and the above process is repeated until the current grid level is the lowest grid level. All vector data to be fused under the lowest grid level are stored and placed on disk, thereby simplifying the complexity of a single global fusion calculation and improving the processing performance of large-scale data.
[0131] Furthermore, the process described above involves fusing the vector data to be merged in each grid at the current grid level, generating vector data to be dumped and new vector data to be merged based on the fusion results.
[0132] Optionally, the vector data to be fused in the first grid under the current grid level can be fused to obtain multiple fused vector data.
[0133] Optionally, the fusion process involves merging at least two overlapping vector patches into a single vector patch. The vector patch data corresponding to all vector patches in the first grid is used as the fused vector data.
[0134] Optionally, multiple fused vector data are traversed. For the current vector data that is traversed, if the current vector data is located at the boundary position of the first grid, the current vector data is used as a new vector data to be fused; otherwise, the current vector data is used as a vector data to be dropped onto the disk.
[0135] Optionally, the boundary position of the first grid is the position of the dividing line that divides each grid.
[0136] In this embodiment, the vector data to be fused in the first grid under the current grid level is fused to obtain multiple fused vector data. Then, it is determined that the current vector data is located at the boundary position of the first grid, and the current vector data is divided into new vector data to be fused and one vector data to be placed on disk, thereby reducing the workload of subsequent fusion work and improving work efficiency.
[0137] Next, we will explain the fused image obtained from the cyclic fusion result of step S104 above:
[0138] Optionally, the fused image of the image to be processed can be restored based on all the vector data stored on disk.
[0139] Optionally, all the vector data stored on disk are restored and merged based on the patch positions represented by the vector data to generate single-component vectors, and the single-component vectors are used as the fused image.
[0140] In this embodiment, the fused image of the image to be processed is obtained by restoring the vector data of all stored data on disk, thereby restoring and fusing the multi-component vectors of the stored data on disk into a single-component vector, thus generating complete image information.
[0141] Based on the same inventive concept, this application also provides an image fusion processing device corresponding to the image fusion processing method. Since the principle of the device in this application is similar to that of the image fusion processing method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0142] To clearly explain the image fusion processing method in this application, refer to Figure 7 An example illustrating image fusion processing is provided. First, the image to be processed is acquired. Then, based on multiple vector patterns in the image, the highest and lowest grid levels for fusion are determined. The image to be processed is as follows: Figure 7 As shown in Figure a, there are 27 vector plots. Based on the number of vector plots, the highest grid level for fusion is determined to be level three, and the lowest grid level is level one. After determining the grid data within each grid based on the third grid level, grid fusion is performed level by level, starting from the third grid level. Specifically, the third grid level is as follows: Figure 7 As shown in b, all vector data in each grid of the third grid level are fused separately. The vector patches in the fused result that are not located at grid boundaries are taken as the vector data to be placed on the disk. Figure 7 The black patches in c are used as the new vector data to be merged, and the vector patches located at the grid boundaries are used as the new vector data to be merged. After the vector data to be merged is merged, it is deleted from the next grid level, that is, the second grid level only contains the white patches from the third grid level. The second grid level is as follows: Figure 7 As shown in d, the vector data to be fused in each grid of the second grid level are fused. The vector patches in the fused result that are not located at grid boundaries are taken as the vector data to be placed on the disk. Figure 7 The black patches in e are used as the new vector data to be fused, and the vector patches located at the grid boundaries are used as the new vector data to be fused. After the data to be fused is fused to disk, it is deleted from the next level of grid, that is, the first grid level only contains the white patches from the second grid level, such as... Figure 7 As shown in f. At this point, since the first grid level is the lowest grid level, all the vector data to be fused in the first grid level are fused and then stored on disk, as shown in f. Figure 7As shown in g. Finally, the vector data stored on disk is fused together to restore the fused image of the image to be processed, i.e. Figure 7 h.
[0143] Reference Figure 8 The diagram shown is a schematic of an image fusion processing device provided in an embodiment of this application. The device includes: a first determining module 801, a dividing module 802, a second determining module 803, and a fusion module 804; wherein:
[0144] The first determining module 801 is used to determine the highest grid level and the lowest grid level during fusion based on multiple vector patterns in the image to be processed, wherein the number of first image grids corresponding to the highest grid level is greater than the number of second image grids corresponding to the lowest grid level.
[0145] The partitioning module 802 is used to partition the image to be processed according to the number of first image grids corresponding to the highest grid level, so as to obtain multiple grids under the highest grid level.
[0146] The second determining module 803 is used to determine the grid data of each grid based on the vector patterns corresponding to each grid under the highest grid level. The grid data includes: grid identifier and grid vector data.
[0147] The fusion module 804 is used to start with multiple grids at the highest grid level, and perform grid fusion layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained. The fused image of the image to be processed is obtained based on the result of the cyclic fusion.
[0148] Optionally, the first determining module 801 is specifically used for:
[0149] Traverse each grid level. For the current grid level, determine the average number of patches in each grid corresponding to the current grid level based on the number of vector patches in the image to be processed. If the difference between the average number of patches in each grid corresponding to the current grid level and the preset average number of patches is less than the first preset threshold, then the current grid level is taken as the highest grid level.
[0150] Optionally, the first determining module 801 is specifically used for:
[0151] Traverse each grid level. For the current grid level, determine the range of the current grid patch based on the current grid level and the number of patches on the grid corresponding to the current grid level. If the difference between the range of the current grid patch and the preset average range of patches on the grid is less than the second preset threshold, then the current grid level is taken as the lowest grid level.
[0152] Optionally, the second determining module 803 is specifically used for:
[0153] Obtain the vector data of the vector patch located in the first grid at the highest grid level. The first grid can be any grid at the highest grid level.
[0154] Aggregate the vector data of all vector patterns within the first grid into the grid vector data of the first grid;
[0155] Use the preset identifier of the first grid at the highest grid level as the grid identifier of the first grid.
[0156] Optionally, the fusion module 804 is specifically used for:
[0157] The highest grid level is used as the initial current grid level, and the vector data of each grid under the highest grid level is used as the initial vector data to be fused.
[0158] A. Perform fusion processing on the vector data to be fused in each grid under the current grid level, and generate vector data to be placed on disk and new vector data to be fused based on the fusion processing results;
[0159] B. Store the vector data to be written to disk, and use the next level of the current grid level as the new current grid level;
[0160] C. Execute AB repeatedly until the current grid level is the lowest grid level, and store all vector data to be merged under the lowest grid level on disk.
[0161] Optionally, the fusion module 804 is specifically used for:
[0162] The vector data to be fused in the first grid of the current grid level is fused to obtain multiple fused vector data;
[0163] Traverse multiple fused vector data sets. For the current vector data set, if it is located at the boundary of the first grid, treat it as a new vector data set to be fused; otherwise, treat it as a vector data set to be dumped onto disk.
[0164] Optionally, the fusion module 804 is specifically used for:
[0165] Based on all the vector data stored on disk, the fused image of the image to be processed is restored.
[0166] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0167] This application also provides an electronic device, such as... Figure 9The diagram shown is a schematic representation of an electronic device structure provided in an embodiment of this application, including: a processor 901, a memory 902, and a bus. The memory 902 stores machine-readable instructions executable by the processor 901 (e.g., ...). Figure 8 The first determining module 801, the dividing module 802, the second determining module 803, and the fusion module 804 in the device (and their corresponding execution instructions, etc.) are executed when the computer device is running. The processor 901 and the memory 902 communicate through the bus. When the machine-readable instructions are executed by the processor 901, the above-mentioned image fusion processing method is performed.
[0168] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described image fusion processing method.
[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0170] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0171] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. An image fusion processing method, characterized in that, The method includes: Based on multiple vector patterns in the image to be processed, the highest grid level and the lowest grid level for fusion are determined, wherein the number of first image grids corresponding to the highest grid level is greater than the number of second image grids corresponding to the lowest grid level. The image to be processed is divided according to the number of first image grids corresponding to the highest grid level, resulting in multiple grids under the highest grid level; Based on the vector patterns corresponding to each grid at the highest grid level, determine the grid data for each grid, which includes: grid identifier and grid vector data; Starting with multiple grids at the highest grid level, grid fusion is performed layer by layer according to the grid data of each grid until multiple grids at the lowest grid level are obtained. The fused image of the image to be processed is obtained based on the result of the cyclic fusion. Starting with multiple grids at the highest grid level, and performing grid fusion layer by layer based on the grid data of each grid until multiple grids at the lowest grid level are obtained, the process includes: The highest grid level is taken as the initial current grid level, and the vector data of each grid under the highest grid level is taken as the initial vector data to be fused. A. Perform fusion processing on the vector data to be fused in each grid under the current grid level, and generate vector data to be placed on disk and new vector data to be fused based on the fusion processing results; B. Store the vector data to be placed on the disk and use the next level of the current grid level as the new current grid level; C. Execute AB repeatedly until the current grid level is the lowest grid level, and store all vector data to be fused under the lowest grid level on disk; The process of fusing the vector data to be fused in each grid at the current grid level, and generating vector data to be dumped and new vector data to be fused based on the fusion processing results, includes: The vector data to be fused in the first grid under the current grid level is fused to obtain multiple fused vector data; The process iterates through the multiple fused vector data sets. For the current vector data set that is traversed, if the current vector data set is located at the boundary position of the first grid, then the current vector data set is used as a new vector data set to be fused; otherwise, the current vector data set is used as a vector data set to be placed on the disk.
2. The image fusion processing method according to claim 1, characterized in that, The step of determining the highest and lowest grid levels for fusion based on multiple vector patterns in the image to be processed includes: Traverse each grid level. For the current grid level, determine the average number of patches in each grid corresponding to the current grid level based on the number of vector patches in the image to be processed. If the difference between the average number of patches in each grid corresponding to the current grid level and the preset average number of patches is less than a first preset threshold, then the current grid level is taken as the highest grid level.
3. The image fusion processing method according to claim 1, characterized in that, The determination of the lowest grid level for fusion includes: Traverse each grid level. For the current grid level, determine the range of the current grid patch based on the current grid level and the number of patches on the grid corresponding to the current grid level. If the difference between the range of the current grid patch and the preset average range of patches on the grid is less than a second preset threshold, then the current grid level is taken as the lowest grid level.
4. The image fusion processing method according to claim 1, characterized in that, The step of determining the grid data of each grid based on the vector patterns corresponding to each grid at the highest grid level includes: Obtain vector data of vector image patches located in the first grid under the highest grid level, wherein the first grid is any grid under the highest grid level; Aggregate the vector data of all vector patterns within the first grid into the grid vector data of the first grid; The preset identifier of the first grid at the highest grid level is used as the grid identifier of the first grid.
5. The image fusion processing method according to claim 1, characterized in that, The step of obtaining the fused image of the image to be processed based on the result of the cyclic fusion includes: Based on all the vector data stored on disk, the fused image of the image to be processed is restored.
6. An image fusion processing apparatus, characterized in that, The device includes: The first determining module is used to determine the highest grid level and the lowest grid level during fusion based on multiple vector patterns in the image to be processed, wherein the number of first image grids corresponding to the highest grid level is greater than the number of second image grids corresponding to the lowest grid level. The partitioning module is used to partition the image to be processed according to the number of first image grids corresponding to the highest grid level, so as to obtain multiple grids under the highest grid level; The second determining module is used to determine the grid data of each grid based on the vector patterns corresponding to each grid under the highest grid level. The grid data includes: grid identifier and grid vector data. The fusion module is used to start with multiple grids under the highest grid level, and perform grid fusion layer by layer according to the grid data of each grid until multiple grids under the lowest grid level are obtained. The fused image of the image to be processed is obtained according to the result of the cyclic fusion. The fusion module is specifically used to: A) take the highest grid level as the initial current grid level, and take the vector data of each grid under the highest grid level as the initial vector data to be fused; A) perform fusion processing on the vector data to be fused in each grid under the current grid level, and generate vector data to be written to disk and new vector data to be fused based on the fusion processing results; B) store the vector data to be written to disk, and take the next level of the current grid level as the new current grid level; C) repeat steps A and B until the current grid level is the lowest grid level, and store all vector data to be fused under the lowest grid level; The fusion module is specifically used to perform fusion processing on the vector data to be fused in the first grid under the current grid level to obtain multiple fused vector data; traversing the multiple fused vector data, for the current vector data that is traversed, if the current vector data is located at the boundary position of the first grid, then the current vector data is used as a new vector data to be fused; otherwise, the current vector data is used as a vector data to be placed on the disk.
7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The processor executes the program instructions to perform the steps of the image fusion processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the image fusion processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Map preview method and device
CN117056626A
Image processing device and method for producing in real-time a digital composite image from a sequence of digital images
US20190279338A1