A three-dimensional map multi-level image slice white border automatic transparent processing method

By employing adaptive white edge detection and transparency conversion processing, the white edge problem in multi-level image tiles of 3D maps has been resolved, achieving efficient and automated processing, ensuring geographic coordinate accuracy and the coherence of 3D scenes, and improving user experience and processing efficiency.

CN120726072BActive Publication Date: 2025-11-21YANTAI JIERUI NETWORK TRADING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511194567.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-21
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

In existing technologies, the white border areas formed during the download process of multi-level image tiles in 3D maps affect the aesthetics and the continuity of 3D scene rendering. Existing processing methods are inefficient and may damage geographic coordinate accuracy or cause visual discontinuities, failing to meet the needs of high-precision map applications.

Method used

An adaptive white edge detection and transparency conversion method is adopted. The white edge region is identified by adaptive white edge detection and converted into a transparent region to generate an ARGB32 format PNG file. The transition is smoothed by combining linear interpolation algorithm and bilinear filtering algorithm to ensure image quality and geographic coordinate accuracy.

Benefits of technology

It achieves efficient automated processing, reduces human error, ensures the consistency and stability of data processing, and seamlessly synchronizes the system with the texture loading of the 3D engine, improving processing speed and efficiency, optimizing workflow, and ensuring the realism of 3D maps and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726072B_ABST
    Figure CN120726072B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image processing, and particularly relates to a three-dimensional map multi-level image slice white border automatic transparent processing method, comprising the following steps: S1, acquiring regional map image slice data; S2, performing adaptive white border detection on the regional map image slice data, and identifying a white border region; S3, performing transparency conversion processing on the white border region, and generating a PNG format image file; S4, storing the PNG format image file, and storing the PNG format image file in a specified directory where an original image file is located; S5, displaying the PNG format image file through an earth model, and simultaneously performing superimposed covering processing; when the present application is used, an efficient and intelligent automatic processing pipeline is constructed, a cumbersome and time-consuming manual operation link in a traditional scheme is completely converted into a highly programmed automatic process, so that the overall work efficiency is greatly improved, human error is reduced, and the consistency and stability of data processing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to a three-dimensional map multi-level image slice white edge automatic transparent processing method. BACKGROUND

[0002] In the production process of regional map image slices (specifically, local map image slices), the higher the image level, the larger the file size, so local partial level downloading is usually used. For regions that need to be displayed in high definition, high-level images are downloaded separately.

[0003] Term explanation:

[0004] 1. Flood fill: Starting from the edge white pixel, recursively check its four adjacent regions (up, down, left and right adjacent pixels), and mark all connected white regions.

[0005] 2. Edge trigger detection mechanism: Only scan from the four edges of the image, and mark the white edge by inward diffusion. It is suitable for regular map slices (white edges are usually located at the edges).

[0006] 3. ARGB32 format: 32-bit image format containing Alpha (transparency) channel (8 bits x 4 channels), which is supported by PNG.

[0007] 4. Regional map image slice (RegionalMapTile): Non-global map image data of a specific geographical region, stored in JPG format, used as input data for subsequent processing.

[0008] 5. Adaptive white edge detection: Automatically identify the white pixel region at the edge of the image slice, which is used for subsequent transparency conversion processing.

[0009] Transparency gradient optimization: Linear interpolation is performed on the pixels close to the white edge threshold (RGB 230-240) to make the Alpha value smoothly transition within the range of 30-200.

[0010] In the prior art, if a JPG format is encountered in the downloading process, the generated slices will often have invalid white edge areas at the edge of the slices due to incomplete cutting of the geographical boundary. This phenomenon not only affects the aesthetics of the map, but also brings many inconveniences in actual application. At present, the solutions to the problem of the formation of invalid white edge areas at the edge of the slices have significant limitations. First, manual processing methods, such as manual operation using professional image processing software such as Photoshop, can accurately remove the white edges, but the entire process is time-consuming and labor-intensive, and the efficiency is extremely low, making it difficult to meet the batch processing needs of a large number of slices, especially in scenarios where a large number of map slices need to be generated quickly. The limitations of this method are particularly prominent. Second, using general image background removal tools, such as various online cutout websites, can achieve the effect of making the white edge area transparent, but in this process, the original geographical coordinate accuracy of the slice will inevitably be damaged, affecting the accuracy of the map data and failing to meet the needs of high-precision map applications. Third, when using a three-dimensional engine to directly load these JPG format slices with white edges, the existence of white edge areas will cause obvious visual discontinuity between adjacent slices. This discontinuity phenomenon will seriously damage the rendering continuity of the three-dimensional scene, making the final three-dimensional map effect not smooth and realistic, greatly affecting user experience and the actual application effect of the map. In summary, the existing technology mainly removes the white edges by manual processing, general image background removal tools, and three-dimensional engine direct loading of slices with white edges. However, manual processing is time-consuming and labor-intensive, with low efficiency. The use of general image background removal tools will damage the original geographical coordinate accuracy of the slice, leading to a decrease in the accuracy of the map data and failing to meet the needs of high-precision map applications. The use of a three-dimensional engine to directly load slices with white edges will cause visual discontinuity between adjacent slices, damaging the rendering continuity of the three-dimensional scene and making the three-dimensional map effect unrealistic, affecting user experience and the actual application effect.

[0011] In summary, developing a three-dimensional map multi-level image slice white edge automatic transparentization processing method is still a key problem that needs to be solved in the field of image processing technology. SUMMARY

[0012] The purpose of the present application is to solve the problems of manual processing, time-consuming and labor-intensive, low efficiency, general image background removal tools damaging the original geographical coordinate accuracy of the slice, leading to a decrease in the accuracy of the map data and failing to meet the needs of high-precision map applications, and three-dimensional engine direct loading of slices with white edges causing visual discontinuity between adjacent slices, damaging the rendering continuity of the three-dimensional scene, making the three-dimensional map effect unrealistic, and affecting user experience and the actual application effect.

[0013] To achieve the above-mentioned purpose, the present application provides the following technical solutions:

[0014] This invention provides a method for automatically making white edges of multi-level image tiles in 3D maps transparent, comprising the following steps:

[0015] S1. Obtain regional map image tile data;

[0016] S2. Perform adaptive white edge detection on the map image tile data of the region to identify white edge regions;

[0017] S3. Perform transparency conversion on the white border area and generate a PNG format image file;

[0018] S4. The PNG format image file is stored in the specified directory where the original image file is located;

[0019] S5. Display the PNG format image file using an Earth model, and simultaneously perform overlay processing.

[0020] Furthermore, in step S1, the method for obtaining regional map image tile data is as follows:

[0021] The process involves acquiring regional map image tile data, specifically non-global map image tiles for a particular area. This regional map image tile data is in JPG format and stored in a pre-defined directory. Image information entropy is used to filter invalid and blank map data. The expression is:

[0022] ,

[0023] In the formula, The information entropy of an image, Represents the input image data, The summation symbol represents iterating through all possible grayscale values ​​from 0 to 255. Indicates the grayscale value in the image The probability of a pixel appearing. Indicates base 2 The logarithm of The range of grayscale value variables to be iterated is 0-255.

[0024] Further, in step S2, adaptive white border detection is performed on the regional map image tile data to identify white border regions. The method is as follows:

[0025] The image slice data is processed one by one, and in the processing, for the four boundary regions of each image slice data, specifically the upper edge, lower edge, left edge and right edge of the image, a comprehensive pixel-level initialization scanning detection is performed, in which a flexibly configurable RGB color threshold parameter is used as a judgment standard, the default value of the RGB color threshold parameter is set to 0.95, which is equivalent to 240 / 255 brightness value in 8-bit RGB color space, and whether each scanned pixel point meets the definition condition of white pixel is determined through the RGB color threshold, in the pixel-level initialization scanning detection process, the boundary region pixels of the image slice data are preferentially processed, and the four edges are independently detected in the form of line-by-line scanning, in the independent detection process, the coordinate position and RGB value of each identified white pixel point are recorded, and at the same time, through the built-in fault tolerance mechanism, when a pixel close to the threshold but not completely meeting the standard is encountered, a secondary verification is performed by using a normalized cosine similarity function, the expression is as follows:

[0026] ,

[0027] In the formula, represents the final calculated cosine similarity value, represents the RGB color vector of the pixel point with coordinates in the image, represents the RGB vector of the standard white color, defined as , represents the sum of the values of and after multiplying the corresponding channels, represents the 2-norm of the vector , represents the 2-norm of the standard white vector , , , and is regarded as a white pixel point.

[0028] Further, in step S2, the adaptive white edge detection is performed on the region map image slice data, and the method for identifying the white edge region is as follows:

[0029] In the traversal processing flow, when it is identified that the image edge region has white pixels meeting the white edge determination condition, a pixel coordinate collection mechanism is started, the position coordinates x and y of the target white pixel in the image matrix are captured in real time through a pixel scanning algorithm, and the position coordinates x and y are stored in a pre-allocated memory queue structure at a millisecond-level response speed. The memory queue structure is a special optimized first-in first-out queue using a ring buffer design. In the traversal processing flow, a two-dimensional state marker matrix corresponding to the original image size is introduced. The two-dimensional state marker matrix uses bit compression storage technology, and each white pixel point records the processing state in 1 bit of storage space. After one white pixel point is successfully identified and added to the processing queue, the state flag of the corresponding position in the two-dimensional state marker matrix is updated synchronously. Through the built-in exception handling mechanism, when a special situation is encountered, state rollback and error recovery are automatically performed. After the pixel-level initialization scanning detection, a flooding filling process is started, and the expression is:

[0030] ,

[0031] In the formula, represents the change rate of a certain state quantity of the pixel point with coordinates in the image matrix at time , is a partial derivative symbol representing the change rate of the state quantity with respect to time , is a coefficient used to control the speed and range expansion of the flooding filling, is a summation symbol representing the cumulative calculation of the contents in the brackets, represents the traversal summation of the four-neighbor pixel points of the pixel point with coordinates , are the four adjacent pixel positions above, below, left and right of the pixel point , are the coordinates of each position in the four neighbor positions, is an identification function of whether the pixel point with coordinates is a white pixel, a value of 1 indicates that the pixel is a white pixel point, a value of 0 indicates that the pixel is not a white pixel point, is an operation on the current state of the neighbor pixel point , close to 0 indicates that the neighbor pixel point has not been processed, Close to 1 indicates that the neighborhood pixel has been processed, the flood fill process will start from the edge white pixel, gradually and orderly expand its scope of inspection, check the four neighborhoods of each white pixel, through the design of whiteThreshold parameter, flexible adjustment between 0.8 to 1.0, handle the case of white edge difference under different light conditions.

[0032] Further, in step S3, the white edge region is subjected to a transparency conversion process, and the method for generating a PNG format image file is:

[0033] By traversing the region map image slice data, it is converted into ARGB32 format supporting Alpha channel. In the conversion process, an accurate traversal mechanism based on pixel coordinates is adopted, and the RGB value of each pixel point is checked one by one. For the pixel points meeting the RGB threshold condition, the Alpha channel value is forcibly set to 0, so that the pixel points meeting the RGB threshold condition achieve complete transparency, forming a transparent region. At the same time, for the pixel points in the region map image slice data that do not belong to the white edge region, the original RGB value is retained, and the Alpha channel value is set to 255. When the RGB value of the pixel point is in the region between 230 and 240, a linear interpolation algorithm is introduced, the Alpha value of the critical pixel point with RGB value between 230 and 240 is dynamically calculated, the brightness central degree of measure value of the critical pixel point is defined, the transparency is calculated based on the linear interpolation of brightness, so that the critical pixel point changes smoothly in the range of 30 to 200, and the expression is:

[0034] ,

[0035] In the formula, represents the calculated Alpha channel value of the pixel point at the image coordinate , represents the maximum value of the Alpha channel value, represents the minimum value of the Alpha channel value, represents the red channel component value of the pixel at the coordinate , represents the green channel component value of the pixel at the coordinate , represents the blue channel component value of the pixel at the coordinate , is the brightness related value of the pixel point, is the average brightness minus 230 in the previous step, represents the normalization and adjustment of the calculation scale.

[0036] Further, in step S3, the method for performing transparency conversion processing on the white border area and generating a PNG format image file is as follows:

[0037] The linear interpolation algorithm not only considers the color features of a single pixel, but also comprehensively analyzes the overall distribution pattern of the 8 neighboring pixels around the critical pixel. The generated transparency gradient conforms to the natural light attenuation characteristics, expressed as:

[0038] ,

[0039] In the formula, Indicates coordinates The result values ​​related to transparency gradient, etc., are calculated using a linear interpolation algorithm. It is a weighting coefficient. It is a limitation on the range of neighboring pixel coordinates. It is the current pixel The coordinates of the right-hand adjacent pixel. It is the current pixel The coordinates of the left adjacent pixel, It is the current pixel The coordinates of the adjacent pixels below, It is the current pixel The coordinates of the adjacent pixel above, It is the current pixel The coordinates of the adjacent pixel in the bottom right corner. It is the current pixel The coordinates of the top right adjacent pixel, It is the current pixel The coordinates of the bottom left adjacent pixel. It is the current pixel The coordinates of the top-left adjacent pixel, Indicates coordinates as The white-related feature values ​​of the pixels are used in the linear interpolation algorithm process, while the transition region is smoothed by a bilinear filtering algorithm.

[0040] Further, in step S4, the method for storing the PNG format image file to the specified directory where the original image file is located is as follows:

[0041] The PNG image file is stored via a file system module. This storage operation places the PNG image file in a specified directory containing the original image file. During storage, the image is named using the exact same name as the original JPG image of the regional map tile. The expression is:

[0042] ,

[0043] wherein, represents the whole operation logic of mapping JPG file path to PNG file path, represents the path of original JPG format image slice data, is regarded as the identifier to distinguish different slices, represents the path where the converted PNG format image slice data is to be stored, represents the root directory of storage, represents the file name of image slice, the file name corresponding to the first slice is consistent with the original JPG naming, the file suffix indicates that it is a PNG format file.

[0044] Further, in step S4, the method for storing the PNG format image file is as follows:

[0045] In the storage operation, the PNG format image file covers the original JPG format regional map image slice data, in the storage operation, the PNG format image file maintains the same spatial resolution as the original JPG format regional map image slice data, obtaining high-definition image data, setting the original JPG image , generating PNG image When the condition is not met , a size alignment correction function is triggered, the expression is:

[0046] ,

[0047] wherein, represents the final PNG image data after size alignment correction, is the size alignment correction function, represents the height and width of the generated PNG image, represents the height and width of the original JPG image, represents the pixel value of the corrected PNG image at coordinate , is a weight coefficient used for weighted calculation of pixels at different positions of the original PNG image during size correction, is the pixel value of the original PNG image at position , is the pixel coordinate of the original PNG image involved in the calculation, which is affected by .

[0048] ​Further, in step S5, the method for displaying the PNG format image file through the earth model while performing the superimposed covering processing is:

[0049] The PNG format image file is displayed through the earth model, the transparent area will expose the background color of the earth, and the transparent area is superimposed and covered by adding low-level global image data, and the superimposed formula is:

[0050] ,

[0051] In the formula, represents the color value corresponding to the latitude and longitude position on the spherical model after the final superimposed processing, is the latitude, is the longitude, represents the transparency weight factor, and the value range is 0-1, represents the input PNG format image file at the latitude and longitude, represents the color value of the global image data at the latitude and longitude position, which is used to fill the transparent area of the PNG image, and the low-level global image data is added, and the display level is lower than the high-definition display area that has been processed.

[0052] Further, in step S5, the method for displaying the PNG format image file through the earth model while performing the superimposed covering processing is:

[0053] When the user views closely, the intelligent display preferentially displays the high-definition image data that has been processed, and the low-level global image data below the transparent part is exposed, the user viewing distance is defined as , different layers are activated by a hierarchical control function, and the expression is:

[0054] ,

[0055] In the formula, represents that the user viewing distance belongs to a positive real number , represents the display level function output determined according to the viewing distance , which determines which layer of image data is activated according to the corresponding level, different display level values represent that the larger the value, the higher the image level corresponding to the higher definition and more details, and the higher level corresponds to the close viewing scene, is a viewing distance threshold value for dividing different viewing distance intervals, and different intervals correspond to different display levels.

[0056] Beneficial effects:

[0057] Compared with the known prior art, the technical scheme provided by the application has the following beneficial effects:

[0058] In use, the application constructs a set of efficient and intelligent automatic processing pipeline, aiming to completely transform the cumbersome and time-consuming manual operation link in the traditional scheme into a highly programmed automatic process, thereby greatly improving the overall work efficiency, reducing human error, and ensuring the consistency and stability of data processing.

[0059] In use, during the entire processing process, the system and the texture loading pipeline of the three-dimensional engine are seamlessly synchronized to ensure that each frame of output image can strictly maintain the original spatial resolution and perfectly meet the requirements of the tile coordinate system, thereby providing a high-quality visual basis for subsequent image analysis and application.

[0060] In use, based on the powerful graphics processor acceleration technology, the application designs and implements an efficient batch processing architecture, intelligently manages and executes multi-slice queue processing tasks through an automated script, and significantly improves the processing speed and efficiency compared with the traditional manual operation mode, greatly shortens the data processing period, and optimizes the workflow. BRIEF DESCRIPTION OF DRAWINGS

[0061] Fig. 1 A flowchart of the three-dimensional map multi-level image slice white edge automatic transparent processing method of the application.

[0062] Fig. 2 A principle diagram of the three-dimensional map multi-level image slice white edge automatic transparent processing method of the application. DETAILED DESCRIPTION

[0063] In order to enable personnel in the art to better understand the application scheme, the technical solutions in the embodiments of the application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the application.

[0064] It is to be understood that the terminology "first", "second" and the like used throughout this specification and the appended claims is merely used for distinguishing between similar objects, and is not intended to be construed as a specific order or sequence among the steps described herein. It is to be understood that the use of such terms as "first", "second" and the like, is not intended to limit the scope of the application to only those embodiments which can be described in the singular, but rather those embodiments only serve to provide one example of the application. It is also to be understood that the terminology "one example" or "an example" used throughout this specification and the appended claims is taken to mean that a particular feature, structure, or characteristic is included in at least one embodiment of the present application and can include, without limitation, many embodiments of the application. Thus, these terms indicate that the feature, structure, or characteristic can be included in, for example, one or more example embodiments of the application, and that such example embodiments can include, without limitation, many embodiments of the application. Furthermore, the use of the term "including" as well as "comprising" and variations thereof is intended to be broad and inclusive, and is used inclusively to mean that the process, method, system, product or device includes the recited elements, but not to the exclusion of other elements that can be added and / or other elements that can be useful in combination with the recited elements.

[0065] The application will be further described below in connection with the drawings:

[0066] Embodiments:

[0067] As shown in the figure, the application provides a three-dimensional map multi-level image slice white border automatic transparent processing method, comprising the following steps: Figs. 1-2

[0068] S1, acquiring regional map image slice data;

[0069] Further, in step S1, the method for acquiring regional map image slice data is:

[0070] The regional map image slice data is a non-global range map image slice of a specific region, the regional map image slice data is in JPG format, stored in a pre-set directory, and image information entropy is used to filter invalid and blank map data, the expression is:

[0071] ,

[0072] In the formula, represents the information entropy of the image, represents the input image data, is a summation symbol representing all possible traversed gray values from 0 to 255, represents the probability of the pixel with a gray value of appearing in the image, represents the logarithm with base 2, represents the traversed gray value variable value range 0-255.

[0073] ​​In the embodiment, after acquiring the non-global JPG format map image slices of a specific area, the image slice data is stored in a preset directory, and invalid or blank data is screened through an image information entropy formula. The image information entropy formula measures the uncertainty of image gray scale distribution by calculating the probability of pixels with a gray scale value of 0-255 and combining logarithmic operation: the lower the entropy value, the simpler the image gray scale, such as a blank slice with all white or all black, which is determined as invalid data and removed, thereby retaining the slice containing valid geographic information, facilitating reduction of the calculation burden of subsequent white edge detection and transparent processing, eliminating the need for manual intervention, adapting to various map sources and image sampling formats, and having strong versatility.

[0074] S2, adaptively detecting white edges of the regional map image slice data to identify white edge regions;

[0075] Further, in step S2, the method for adaptively detecting white edges of the regional map image slice data to identify white edge regions is as follows:

[0076] All the image slice data is processed one by one. In the processing, for the four boundary regions of each image slice data, specifically the upper edge, lower edge, left edge and right edge of the image, comprehensive pixel-level initialization scanning detection is performed. In the pixel-level initialization scanning detection process, a flexibly configurable RGB color threshold parameter is used as a judgment standard. The default value of the RGB color threshold parameter is 0.95, which is converted into an 8-bit RGB color space and is approximately equivalent to a brightness value of 240 / 255. Whether each scanned pixel point meets the definition condition of a white pixel is determined through the RGB color threshold. In the pixel-level initialization scanning detection process, the boundary region pixels of the image slice data are preferentially processed. The four edges are independently detected in a row-by-row scanning manner. In the independent detection process, the coordinate position and RGB value of each identified white pixel point are recorded. At the same time, through the built-in fault tolerance mechanism, when a pixel close to the threshold but not completely meeting the standard is encountered, a secondary verification is performed using a normalized cosine similarity function, and the expression is as follows:

[0077]

[0078] In the formula, represents the final calculated cosine similarity value, represents the RGB color vector of the pixel with coordinates in the image, represents the RGB vector of the standard white color, which is defined as , represents the sum of the values of and after multiplication of the corresponding channels, represents the vector​ 2-norm, Represents the standard white vector The 2-norm, in , If it is, then it is considered a white pixel.

[0079] Further, in step S2, adaptive white border detection is performed on the regional map image tile data to identify white border regions. The method is as follows:

[0080] In the traversal processing flow, when a white pixel meeting the white edge judgment condition is identified in the image edge region, a pixel coordinate acquisition mechanism is activated. The pixel scanning algorithm captures the position coordinates (x and y) of the target white pixel in the image matrix in real time, and stores these coordinates in a pre-allocated memory queue structure with a millisecond-level response speed. This memory queue structure is a specially optimized first-in-first-out queue using a circular buffer design. In the traversal processing flow, a two-dimensional state marker matrix corresponding to the original image size is introduced. This two-dimensional state marker matrix uses bit compression storage technology, with each white pixel recording its processing state with 1 bit of storage space. After a white pixel is successfully identified and added to the processing queue, the state flag at the corresponding position in the two-dimensional state marker matrix is ​​updated synchronously. Through a built-in exception handling mechanism, automatic state rollback and error recovery are performed in special circumstances. After the pixel-level initialization scan detection, a flooding filling process is initiated, expressed as:

[0081] ,

[0082] In the formula, Indicates at time The coordinates in the image matrix are A certain state quantity of location, It is represented by the partial derivative symbol. Over time rate of change, It is a coefficient used to control the speed and extent of flood filling. The summation symbol indicates that the contents within the parentheses are summed. Represents coordinates Sum the pixels of the four neighboring pixels. It is a pixel. The positions of four adjacent pixels: top, bottom, left, and right. These are the coordinates of each of the four neighboring locations. Indicates coordinates as A function to indicate whether a pixel is a white pixel. A value of 1 indicates that the pixel is a white pixel. The value of 0 indicates that the pixel is not a white pixel point, is a neighborhood pixel point current state an operation, Close to 0 indicates that the neighborhood pixel point has not been processed, Close to 1 indicates that the neighborhood pixel point has been processed, and the flood fill process will gradually and orderly expand its inspection range from the edge white pixel point, check the four neighborhoods of each white pixel point, and through the design of the whiteThreshold parameter, flexibly adjust between 0.8 and 1.0, handle the differences in white edges under different lighting conditions.

[0083] In this embodiment, when performing adaptive white edge detection, first traverse the image slice one by one, perform pixel-level initialization scanning for the four edges, use the flexibly configured RGB color threshold, which corresponds to the default 8-bit RGB 240 / 255 brightness, to preliminarily judge the white pixel, use the normalized cosine similarity for secondary verification when encountering a critical pixel, after identifying the edge white pixel, millisecond-level coordinates are collected and stored in the optimized ring buffer queue, a bit-compressed two-dimensional state marking matrix is used to record the processing state and support abnormal rollback, and then the flood fill is started, starting from the edge white pixel, combining four-neighborhood inspection and adjustable whiteThreshold parameter, adapting to white edge differences under different lighting conditions, combining RGB threshold and cosine similarity dual verification, facilitating to improve detection accuracy, adapting to various compression and shooting conditions, using bit-compressed state matrix and ring queue structure, facilitating to save memory resources and improve concurrent performance, through neighborhood propagation, completing automatic aggregation identification of edge continuous white area, facilitating to avoid isolated point misjudgment.

[0084] S3, performing transparency conversion processing on the white edge region, and generating a PNG format image file;

[0085] Further, in step S3, the method for performing transparency conversion processing on the white edge region and generating a PNG format image file is:

[0086] By traversing the area map image slice data, conversion to support Alpha channel ARGB32 format, in the conversion process, the use of pixel coordinates based on the precise traversal mechanism, check each pixel point RGB value, for the pixel points meet the RGB threshold conditions, forcedly set its Alpha channel value to 0, make the pixel points meet the RGB threshold conditions to achieve complete transparency, form a transparent area, at the same time, for the area map image slice data does not belong to the white edge region of the pixel points, then keep its original RGB value, and set the Alpha channel value to 255, when checking the RGB value of the pixel point is in the area between 230 to 240, by introducing the linear interpolation algorithm, by dynamic calculation of the Alpha value of the critical pixel point whose RGB value is between 230 to 240, define the critical pixel point brightness center degree of measurement, based on the brightness linear interpolation calculation of transparency, make the critical pixel point in the range of 30 to 200 smooth change, expression:

[0087] ,

[0088] In the formula, represents the calculated Alpha channel value of the pixel point at the image coordinate , represents the maximum value of the Alpha channel value, represents the minimum value of the Alpha channel value, represents the red channel component value of the pixel at the coordinate , represents the green channel component value of the pixel at the coordinate , represents the blue channel component value of the pixel at the coordinate , is the calculated brightness related value of the pixel point, is the average brightness minus 230 in the previous step, represents the normalized, adjusted calculation scale.

[0089] Further, in step S3, the white edge region is subjected to transparency conversion processing, and the method for generating a PNG format image file is:

[0090] The linear interpolation algorithm not only considers the color characteristics of a single pixel, but also comprehensively analyzes the overall distribution law of the 8 neighborhood pixels around the critical pixel point, and the generated transparency gradient conforms to the natural light attenuation characteristics, expression:

[0091] ,

[0092] In the formula, represents the calculated Alpha channel value of the pixel point at the image coordinate a result value related to the transparency gradient and the like is calculated by a linear interpolation algorithm, is a weight coefficient, is a limitation on the coordinate range of the neighborhood pixels, is the coordinate of the current pixel is the coordinate of the right neighboring pixel, is the coordinate of the current pixel is the coordinate of the left neighboring pixel, is the coordinate of the current pixel is the coordinate of the lower neighboring pixel, is the coordinate of the current pixel is the coordinate of the upper neighboring pixel, is the coordinate of the current pixel is the coordinate of the right lower corner neighboring pixel, is the coordinate of the current pixel is the coordinate of the right upper corner neighboring pixel, is the coordinate of the current pixel is the coordinate of the left lower corner neighboring pixel, is the coordinate of the current pixel is the coordinate of the left upper corner neighboring pixel, represents the white-related feature value of the pixel point with the coordinate In the linear interpolation algorithm processing, a bilinear filter algorithm is used to perform smoothing processing on the transition region.

[0093] In this embodiment, when the region map image slice data is processed to generate a PNG file, the data is first converted into ARGB32 format, the pixels are accurately traversed, and the Alpha channel is set according to the RGB value: the Alpha of the white border pixel meeting the threshold value is set to 0, which is completely transparent, the non-white border is set to 255, which is opaque, the Alpha value of the critical pixel with RGB in 230-240 is set by linear interpolation, so that the transparency is smoothly changed from 30 to 200. Linear interpolation is combined with the distribution of the critical pixel 8 neighborhood, and the transition is optimized by bilinear filtering, so that the transparency gradient is consistent with the natural light attenuation, the white border region is intelligently identified and the transparency is automatically set, the obvious white frame or layer overlap is avoided when the map slices are spliced, the edge transparency transition is smoothly processed by the critical region brightness interpolation, which is consistent with the visual fading logic, which is convenient for improving the professionalism and aesthetics, the peripheral neighborhood weighting and bilinear filtering fusion processing generate a transparency gradient graph close to the natural light attenuation law, realize high-quality visual transition, and the processing result is output as an ARGB32 format PNG image, which has good cross-platform and cross-system adaptability, and is suitable for subsequent earth model rendering and browsing.

[0094] S4, store the PNG format image file and store it in the specified directory where the original image file is located;

[0095] Further, in step S4, the PNG format image file is stored in the specified directory where the original image file is located, and the method is:

[0096] The PNG format image file is stored in the specified directory where the original image file is located by a file system module, and the storage operation uses the same name as the original JPG format region map image slice data to name when storing, and the expression is:

[0097] ,

[0098] In the formula, represents the entire operation logic of mapping the JPG file path to the PNG file path, represents the path of the original JPG format image slice data, is regarded as an identifier to distinguish different slices, represents the path where the converted PNG format image slice data is to be stored, represents the root directory of storage, represents the file name of the image slice, the file name corresponding to the first slice is consistent with the original JPG naming, The file suffix indicates that it is a PNG format file.

[0099] Further, in step S4, the PNG format image file is stored in the specified directory where the original image file is located, and the method is:

[0100] In the storage operation, the PNG format image file covers the original JPG format region map image slice data, and in the storage operation, the PNG format image file maintains the same spatial resolution as the original JPG format region map image slice data, obtaining high-definition image data, and setting the original JPG image , generating a PNG image When the condition is not met , the size alignment correction function is triggered, and the expression is:

[0101] ,

[0102] In the formula, represents the final PNG image data after size alignment correction, is the size alignment correction function, represents the height and width of the generated PNG image, represents the height and width of the original JPG image, represents the pixel value of the corrected PNG image at coordinates , is a weight coefficient for weighting calculation of pixels at different positions of the original PNG image during size correction, is the pixel value of the original PNG image at position , is the pixel coordinate of the original PNG image involved in the calculation, affected by .

[0103] In this embodiment, the storage operation is performed on the PNG format image file, which is stored in the specified directory of the original image file by means of the file system module, and is named the same as the original JPG format regional map image slice data. The original JPG data is overwritten during storage, and a consistent spatial resolution is maintained to obtain high-definition images. If the PNG and JPG image sizes are inconsistent, the size alignment correction function is triggered to correct the pixels through weighting calculation, improve the adaptability of the stored data, seamlessly replace and consistently name the mechanism, facilitate automatic identification and loading of the processed image data, reduce manual intervention, automatically perform size alignment verification and correction, facilitate the avoidance of image stretching, misplacement and other display problems, and ensure the accuracy of map stitching and rendering.

[0104] S5, display the PNG format image file through the earth model, and perform superimposed coverage processing at the same time;

[0105] Further, in step S5, the method for displaying the PNG format image file through the earth model while performing superimposed coverage processing is:

[0106] The PNG format image file is displayed through the earth model, and the transparent area will reveal the base color of the earth. The transparent area is superimposed and covered by adding low-level global image data, and the superimposition formula is:

[0107] ,

[0108] In the formula, represents the color value corresponding to the latitude and longitude position on the spherical model after the final superimposed processing, which is the result of the superposition, is the latitude, is the longitude, represents the transparency weight factor, whose value range is 0-1, represents the color value of the input PNG format image file at latitude and longitude represents the color value of the global image data at the latitude and longitude position, which is used to fill the transparent area of the PNG image. The low-level global image data is added, and its display level is lower than that of the high-definition display area that has been processed.

[0109] Furthermore, in step S5, the method for displaying the PNG format image file using an Earth model and simultaneously performing overlay processing is as follows:

[0110] When a user views the image up close, the system intelligently prioritizes displaying processed high-resolution image data, while transparent areas reveal the lower-level global image data below. The user's viewing distance is defined as... Different layers are activated through a layer control function, expressed as:

[0111] ,

[0112] In the formula, This indicates that the user's view distance is a positive real number. , Indicates based on line of sight The output of the defined display layer function is the image data that determines which layer is activated at the corresponding layer. The higher the value representing the display level, the higher the resolution and the more detailed the image. A higher display level corresponds to viewing scenes at close range. The viewing distance threshold is used to divide different viewing distance intervals. Different intervals correspond to different display levels being activated.

[0113] In this embodiment, PNG image files are displayed and overlaid using a globe model. On one hand, an overlay formula is used to fuse PNG images with low-level global imagery data based on a transparency weighting factor, allowing transparent areas of the PNG to be filled by the low-level global imagery. On the other hand, based on the user's viewing distance, different layers are activated through a layer control function. High-definition images are prioritized for close-up viewing, while low-level global imagery shows through transparent areas, achieving reasonable image display at different viewing distances. Through transparency control and layer fusion, the image stitching is seamless and the visual transition is natural, effectively eliminating the visual disjointedness caused by the white edges of the original image. A layer scheduling mechanism based on the user's viewing distance is introduced to dynamically load image data of appropriate resolution, improving the rendering efficiency and user interaction experience of the 3D globe platform, balancing display quality and computing resource utilization, and facilitating the loading and visualization of massive map data.

[0114] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for automatically transparentizing white borders of multi-level image slices of a three-dimensional map, characterized by, The method comprises the following steps: S1, acquiring regional map image slice data; S2, performing adaptive white edge detection on the regional map image slice data to identify a white edge region; S3, performing transparency conversion processing on the white edge region and generating a PNG format image file; S4, storing the PNG format image file in a specified directory where the original image file is located; S5, displaying the PNG format image file through an earth model while performing superimposed overlay processing; In step S1, the method for acquiring regional map image slice data is as follows: The method for acquiring regional map image slice data is to acquire non-global range map image slices of a specific region, and the regional map image slice data is in JPG format and stored in a pre-set directory. Image information entropy is used to filter invalid and blank map data, and the expression is as follows: , wherein, represents the information entropy of the image, represents the input image data, is a summation symbol representing the traversal of all possible values of the gray scale from 0 to 255, represents the probability of a pixel in the image having a gray scale value of , represents the logarithm to the base 2, represents the logarithm to the base 2, represents the range of values of the traversed gray scale variable from 0 to 255; In step S2, the method for performing adaptive white edge detection on the regional map image slice data to identify a white edge region is as follows: All the image slice data is processed one by one. In the traversal processing, four boundary regions of each image slice data, including the upper edge, lower edge, left edge and right edge of the image, are subjected to comprehensive pixel-level initialization scanning detection. In the pixel-level initialization scanning detection process, a flexibly configurable RGB color threshold parameter is used as a judgment standard. The default value of the RGB color threshold parameter is 0.95, which is equivalent to a brightness value of 240 / 255 in an 8-bit RGB color space. Whether each scanned pixel point meets the definition condition of a white pixel is determined through the RGB color threshold. In the pixel-level initialization scanning detection process, the boundary region pixels of the image slice data are preferentially processed. Four edges are independently detected in a row-by-row scanning manner. In the independent detection process, the coordinate position and RGB value of each identified white pixel point are recorded. Meanwhile, through an internal fault tolerance mechanism, when a pixel close to the threshold but not completely meeting the standard is encountered, a normalized cosine similarity function is used to perform secondary verification, and the expression is as follows: , wherein, denotes the final computed cosine similarity value, denotes the RGB color vector of the pixel point in the image with coordinates , denotes the RGB vector of the standard white color, defined as , denotes the sum of the products of the values of the corresponding channels of and , denotes the 2-norm of the vector , denotes the 2-norm of the standard white vector , , then the pixel point is considered as a white pixel. In step S2, the method for performing adaptive white edge detection on the regional map image slice data to identify a white edge region is as follows: In the traversal processing flow, when it is identified that the image edge region has a white pixel meeting the white edge determination condition, a pixel coordinate collection mechanism is started, the position coordinates x and y of the target white pixel in the image matrix are captured in real time through a pixel scanning algorithm, and the position coordinates x and y are stored in a pre-allocated memory queue structure at a millisecond-level response speed. The memory queue structure is a special-optimized first-in-first-out queue using a ring buffer design. In the traversal processing flow, a two-dimensional state marker matrix corresponding to the original image size is introduced. The two-dimensional state marker matrix uses bit compression storage technology, and each white pixel point records the processing state in a 1-bit storage space. After one white pixel point is successfully identified and added to the processing queue, the state flag of the corresponding position in the two-dimensional state marker matrix is updated synchronously. Through the built-in exception handling mechanism, state rollback and error recovery are automatically performed when special conditions are encountered. After the pixel-level initialization scanning detection, a flooding filling process is started, and the expression is: , In the formula, represents the coordinate of the image matrix at time Position of a certain state quantity, is the partial derivative symbol The rate of change over time , is a coefficient for controlling the speed of the flood fill, the speed of the range expansion, is the summation symbol representing the cumulative calculation of the contents in the back bracket, represents the traversal summation of the four-neighbor pixel points of the coordinate , are the four adjacent pixel positions of the pixel point , are the coordinates of each position in the four-neighbor positions, represents whether the pixel point with coordinate is a white pixel or not, The value of 1 indicates that the pixel is a white pixel point, The value of 0 indicates that the pixel is not a white pixel point, is an operation on the current state of the neighbor pixel point , Close to 0 indicates that the neighbor pixel point has not been processed, Close to 1 indicates that the neighbor pixel point has been processed, and the flood fill process will gradually and orderly expand its inspection range from the edge white pixel point, check the four-neighbor of each white pixel point, and through the design whiteThreshold parameter, flexibly adjust between 0.8 to 1.0, handle the difference of white edge under different light conditions; In step S3, the white edge region is subjected to transparency conversion processing, and the method for generating a PNG format image file is: By traversing the regional map image slice data, the ARGB32 format supporting the Alpha channel is converted. In the conversion process, an accurate traversal mechanism based on pixel coordinates is used to check the RGB value of each pixel point one by one. For a pixel point meeting the RGB threshold condition, the Alpha channel value is forcibly set to 0, so that the pixel point meeting the RGB threshold condition becomes completely transparent, forming a transparent region. Meanwhile, for the pixel points in the regional map image slice data that do not belong to the white edge region, the original RGB value is retained, and the Alpha channel value is set to 255. When the RGB value of a pixel point is found to be between 230 and 240, a linear interpolation algorithm is introduced to dynamically calculate the Alpha value of the critical pixel point with an RGB value between 230 and 240, define the luminance center metric value of the critical pixel point, calculate the transparency based on luminance linear interpolation, and make the critical pixel point change smoothly in the range of 30 to 200, and the expression is: , In the formula, represents the Alpha channel value of the pixel at the image coordinate , represents the maximum value of the Alpha channel value, represents the minimum value of the Alpha channel value, represents the red channel component value of the pixel at the coordinate , represents the green channel component value of the pixel at the coordinate , represents the blue channel component value of the pixel at the coordinate , is the luminance-related value of the pixel point, is the luminance-related value of the pixel point minus 230 on the basis of the average luminance in the previous step, represents the normalization and adjustment of the calculation scale; In step S3, the white edge region is subjected to transparency conversion processing, and the method for generating a PNG format image file is: The linear interpolation algorithm not only considers the color characteristics of a single pixel, but also comprehensively analyzes the overall distribution law of the 8-neighborhood pixels around the critical pixel point, so that the generated transparency gradient conforms to the natural light attenuation characteristics, and the expression is: , In the formula, Indicates coordinates The result values ​​related to transparency gradient, etc., are calculated using a linear interpolation algorithm. It is a weighting coefficient. It is a limitation on the range of neighboring pixel coordinates. It is the current pixel The coordinates of the right-hand adjacent pixel. It is the current pixel The coordinates of the left adjacent pixel, It is the current pixel The coordinates of the adjacent pixels below, It is the current pixel The coordinates of the adjacent pixel above, It is the current pixel The coordinates of the adjacent pixel in the bottom right corner. It is the current pixel The coordinates of the top right adjacent pixel, It is the current pixel The coordinates of the bottom left adjacent pixel. It is the current pixel The coordinates of the top-left adjacent pixel, Indicates coordinates as The white-related feature values ​​of the pixels are used in the linear interpolation algorithm process, while the transition region is smoothed by a bilinear filtering algorithm.

2. The method of claim 1, wherein the method further comprises: In step S4, the PNG format image file is stored, and the method for storing the PNG format image file in the specified directory of the original image file is: The PNG format image file is stored through the file system module, and the storage operation stores the PNG format image file in the specified directory of the original image file. In the storage operation, the same name as the regional map image slice data in the original JPG format is used for naming during storage, and the expression is: , In the formula, This represents the entire logic for mapping JPG file paths to PNG file paths. This indicates the path to the original JPG format image slice data. It can be seen as a marker to distinguish different slices. This indicates the path where the converted PNG format image tile data will be stored. Indicates the root directory of storage. The filename of the image slice, numbered... The filenames for each slice are the same as those for the original JPG. The file extension indicates that it is a PNG file.

3. The method of claim 2, wherein the method further comprises: determining a white border of the three-dimensional map multi-level image slice; and automatically transparentizing the white border of the three-dimensional map multi-level image slice. In step S4, the PNG format image file is stored in a specified directory where the original image file is located, and the method is as follows: The storage operation covers the original JPG format regional map image slice data with the PNG format image file, the PNG format image file maintains the same spatial resolution as the original JPG format regional map image slice data in the storage operation, and high-definition image data is obtained, and the original JPG image is set , and a PNG image is generated When the condition is not met , a size alignment correction function is triggered, and the expression is , In the formula, represents the final PNG image data after size alignment correction, is a size alignment correction function, represents the height and width of the generated PNG image, represents the height and width of the original JPG image, represents the pixel value of the corrected PNG image at coordinates , is a weight coefficient used for weighted calculation of pixels at different positions of the original PNG image during size correction, is the pixel value of the original PNG image at position , is the pixel coordinate of the original PNG image involved in the calculation, affected by .

4. The method of claim 3, wherein the method further comprises: In step S5, the PNG format image file is displayed through the earth model, and the method of superimposed overlay processing is as follows: The PNG format image file is displayed through the earth model, the transparent area will expose the background color of the earth, and the transparent area is superimposed and overlaid by adding low-level global image data, and the superimposition formula is as follows: , wherein, represents the corresponding latitude and longitude on the globe model after the final overlay processing The color value of the position is the result presented after the overlay, is the latitude, is the longitude, represents the transparency weight factor value range is 0-1, represents the first input PNG format image file in latitude and longitude, represents the color value of the global image data at the latitude and longitude position used to fill the transparent area of the PNG image, adding the low-level global image data, which shows a lower level than the high-definition display area that has been processed.

5. The method of claim 4, wherein the method further comprises: In step S5, the PNG format image file is displayed through the earth model, and the method of superimposed overlay processing is as follows: When the user is in close distance, the smart display will display the high-definition image data which has been processed, and the transparent part will show the underlying global image data of low level, defining the user's visual distance as , different layers are activated by hierarchical control functions, expression: , In the formula, represents that the user's visual distance belongs to a positive real number , represents that the display level function output determined according to the visual distance is image data for determining which layer is activated according to the corresponding level, represents that the greater the different display level values correspond to the higher image level of the higher definition and more detailed image, the higher level corresponds to the close distance view of the scene, is a visual distance threshold for dividing different visual distance intervals, and different intervals correspond to the activation of different display levels.

Citation Information

Patent Citations

  • Model lightweight method and system based on model outer surface extraction

    CN118196335A

  • Edge enhancement for sky replacement

    US20240338794A1