Map making method, device, electronic device and computer readable storage medium
By converting the digital elevation model into a high-resolution map, the problem that the existing technology cannot meet the high-resolution display needs of Internet maps is solved, and higher-resolution map display and better visual effects are achieved.
Patent Information
- Application Number
- CN202310803948.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2043-06-30
AI Technical Summary
The prior art cannot produce Terrain-RGB images with resolutions higher than digital elevation models, and cannot meet the needs of high-level resolution display of Internet maps.
By taking the pending map and converting it into a map containing more pixel points, the elevation value of each pixel point is calculated based on the elevation value in the target map, using filtering and RGB value encoding, high-resolution Terrain is generated -RGB map.
A higher resolution map display is achieved, avoiding the grid line phenomenon and improving the accuracy and visual effect of the map.
Smart Images

Figure CN117011406B_ABST
Abstract
Description
[0001] The present application belongs to the field of Internet maps, and specifically relates to a map making method, device, electronic device and computer-readable storage medium. Background Art
[0002] In order to reflect the changes of terrain or topography in the map more three-dimensionally and provide users with interactive and personalized terrain rendering and terrain data analysis services, the existing technology usually uses a digital elevation model (Digital Elevation Model, DEM for short) to produce corresponding Terrain-RGB images, and the height values corresponding to different positions can be determined based on the color values of different positions in the Terrain-RGB image. However, the existing technology can only produce Terrain-RGB images with a resolution equal to the resolution of the digital elevation model or a resolution less than the resolution of the digital elevation model. However, if the image is to be displayed in an Internet map, it is required to reach a higher resolution level. The highest resolution level that can be achieved by the digital elevation model obtained from the data source is generally lower than the resolution level that the map needs to be able to achieve in the Internet map. Therefore, the Terrain-RGB images produced by the existing technology cannot meet the actual use requirements of high-level resolution display of Internet maps.
[0003] For example, the resolution of a digital elevation model is 30m. After being converted into Terrain-RGB images, Terrain-RGB images of levels 1-12 can be produced (the resolution of level 12 is 38.218514m, the resolution of level 11 is 76.4327028m, the smaller the level, the lower the resolution). However, if a Terrain-RGB map tile of level 13 is produced, the resolution corresponding to level 13 is 19.109257m. Given that the resolution of the original digital elevation model is only 30m, it can be understood that the minimum pixel size per unit can only be To express the 30m terrain in the real world, if the unit pixel is to express the 19.109257m terrain in the real world as a minimum, the 30m terrain obviously lacks a lot of terrain data compared to the 19.109257m terrain. In the case where the original digital elevation model has missing terrain data, even if the Terrain-RGB image is divided into the same number of pixels as the 13-level resolution, grid lines will appear when displayed at the maximum level. As a result, the produced Terrain-RGB image cannot meet the actual usage requirements of high-resolution display of Internet maps. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a map production method, device, electronic device and computer-readable storage medium to improve the problem that the produced Terrain-RGB images cannot meet the actual use requirements of high-level resolution display of Internet maps.
[0005] The embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a map production method, including: obtaining a first map to be processed and a target map where the first map is located, wherein the first map contains a first number of first pixel points, and each of the first pixel points contains a first elevation value; when the first number is less than a preset second number, converting the first map into a second map containing the second number of second pixel points; based on the first number of first elevation values and the target map where the first map is located, determining the second elevation value corresponding to each of the second pixel points; based on the second map and the second elevation value corresponding to each of the second pixel points, obtaining a Terrain-RGB map.
[0007] In an embodiment of the present application, when a map with higher resolution needs to be produced, the first map containing a first number of first pixels is first converted into a second map containing a second number of second pixels. This can be understood as re-dividing the first map into a second number of pixels. However, since only the elevation values of the first number of first pixels are measured at most when surveying the first map, when the first map is re-divided into the second number of second pixels, the elevation value of each pixel cannot actually correspond one-to-one to the original first elevation value. Furthermore, it is necessary to determine the second elevation value corresponding to each second pixel in the first map based on the first number of first elevation values in the first map and the target map where the first map is located, and then obtain the Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel, so as to accurately produce a higher resolution map to meet the high-resolution display requirements.
[0008] In combination with a possible implementation manner of the embodiment of the first aspect, obtaining the target map where the first map is located includes: obtaining a plurality of third maps located around the first map in a world map where the first map is located, wherein each of the third maps contains the first number of pixel points; and splicing the first map and the plurality of third maps into the target map.
[0009] In an embodiment of the present application, when calculating the second number of second elevation values contained in the second map, it is necessary to use the first elevation values corresponding to multiple first pixel points surrounding the second elevation value for calculation. Considering that the second pixel points located on the boundary of the second map cannot find the first elevation values corresponding to a sufficient number of first pixel points in the first map, it is necessary to obtain multiple third maps located around the first map in the world map where the first map is located, which also contain the first number of pixel points, and then splice the multiple surrounding third maps with the first map to obtain the target map, so as to provide more accurate data for converting the first map into the second map and calculating the elevation value corresponding to the second pixel point in the second map, thereby making the calculated second elevation value corresponding to the second pixel point in the second map more accurate.
[0010] In combination with a possible implementation manner of the embodiment of the first aspect, obtaining the first map to be processed includes: obtaining a first initial map, and preprocessing the first initial map, the preprocessing including: filling the elevation value of each first pixel point whose elevation value is missing in the first initial map with a default height value; performing map projection on the preprocessed first initial map, and resampling and calculating the elevation value corresponding to each first pixel point in the first initial map to obtain the first map, wherein the first elevation value is obtained by resampling and calculating the elevation value corresponding to each first pixel point in the projected first initial map.
[0011] In the embodiment of the present application, since the first initial map obtained is the earth's spherical coordinate system, what is expressed is a curved coordinate system, but the Internet map needs to represent the map in a plane coordinate system. In order to improve the accuracy of the calculation results during the coordinate conversion process, it is necessary to fill the elevation values of each first pixel point with a missing elevation value in the first initial map with a default height value, and then perform map projection processing on the first initial map. However, when the first initial map is converted from a curved coordinate system to a plane coordinate system, it is equivalent to unfolding the curved surface into a plane for expression. After the conversion, the first initial map in the plane coordinate system will lack some elevation values compared to when it is in the curved coordinate system. In order to fill the missing data, it is necessary to resample the elevation values corresponding to each pixel point of the first initial map to obtain the first map, so that the data in the first map that can be obtained is more accurate.
[0012] In combination with a possible implementation method of the first aspect, based on the first number of first elevation values and the target map where the first map is located, the second elevation value corresponding to each second pixel point is determined, including: obtaining the first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point in the target map, wherein the target second pixel point is any second pixel point in the second map; based on the first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point, calculating the second elevation value corresponding to the target second pixel point.
[0013] In an embodiment of the present application, when determining the second elevation value corresponding to each second pixel point in the second map, it is necessary to first obtain the first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point in the target map, and then calculate the second elevation value corresponding to the target pixel point based on the obtained first elevation values corresponding to the multiple first pixel points adjacent to the target second pixel point, so that the missing elevation value of the second pixel point in the second map can be reasonably compensated.
[0014] In combination with a possible implementation manner of the embodiment of the first aspect, obtaining a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point includes: filtering the second elevation value corresponding to each second pixel point in the second map; and obtaining a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point after filtering.
[0015] In an embodiment of the present application, in order to ensure the rationality of the second elevation value corresponding to the second pixel point in the second map and avoid the problem of excessive deviation between the second elevation value corresponding to the second pixel point and the second elevation value corresponding to the adjacent second pixel point, it is necessary to filter the second elevation value corresponding to each second pixel point in the second map, and then obtain a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point after filtering, so that the produced map is more accurate.
[0016] In combination with a possible implementation manner of the embodiment of the first aspect, the second map contains M*M second pixel points, and the second elevation value corresponding to each second pixel point in the second map is filtered, including: using a filtering window with a size of N*N pixels to slide the window on the second map with a specified step size; for each sliding of the window, obtaining the absolute difference between the second elevation value corresponding to the pixel point to be filtered in the sliding window and the average value of the sliding window, wherein N is an odd number not greater than M, the pixel point to be filtered in the sliding window is the second pixel point in the sliding window that falls at the center position of the filtering window, and the average value of the sliding window is the average value of the second elevation values corresponding to all the second pixel points contained in the filtering window during the sliding of the window; if the absolute difference is greater than a set threshold, the second elevation value corresponding to the pixel point to be filtered in the sliding window is updated to the average value of the sliding window.
[0017] In an embodiment of the present application, when filtering the second elevation value corresponding to each second pixel point in the second map, a filtering window with a size of N*N pixels is used to slide the window on the second map with a specified step size. For each sliding of the window, the absolute difference between the second elevation value corresponding to the pixel point to be filtered in the sliding window and the average value of the sliding window is obtained. If the absolute difference is greater than the set threshold, it indicates that the difference between the second elevation value corresponding to the pixel point to be filtered in the sliding window and the second elevation value corresponding to the adjacent second pixel point is too large, which is actually unreasonable. In order to improve the rationality of the second elevation value corresponding to the pixel point to be filtered in the sliding window, the second elevation value corresponding to the pixel point to be filtered in the sliding window is updated to the average value of the sliding window. After filtering the second elevation value corresponding to each second pixel point in the second map, the second elevation value corresponding to the second pixel point in the second map is more accurate.
[0018] In combination with a possible implementation manner of the embodiment of the first aspect, a Terrain-RGB map is obtained based on the second map and the second elevation value corresponding to each second pixel point, including: determining the RGB value corresponding to each second elevation value based on the second elevation value and a preset analysis algorithm; encoding the calculated RGB value into the corresponding second pixel point to obtain the Terrain-RGB map.
[0019] In an embodiment of the present application, in order to express each second pixel point in the second map with an RGB value corresponding to the second elevation value, the RGB value corresponding to each second elevation value is first determined based on the second elevation value and a preset parsing algorithm, and then the calculated RGB value is encoded into the corresponding second pixel point to obtain a Terrain-RGB map, so that the second elevation value can be replaced by the RGB value, so that the obtained Terrain-RGB map can more intuitively display the elevation value of each second pixel point.
[0020] In combination with a possible implementation of the first aspect of the embodiment, after obtaining the Terrain-RGB map, the method further includes: performing a three-dimensional rendering of the mountain shadow on the Terrain-RGB map to generate a fourth map
[0021] In the embodiment of the present application, by rendering the Terrain-RGB map with a three-dimensional effect of mountain shadows to generate a fourth map, the produced map can have a more three-dimensional visual effect, thereby improving the user's visual perception when viewing the map.
[0022] In a second aspect, an embodiment of the present application provides a map making device, comprising: an acquisition unit, a conversion unit, a determination unit, and a generation unit; the acquisition unit is used to acquire a first map to be processed and a target map where the first map is located, wherein the first map contains a first number of first pixels, and each of the first pixels contains a first elevation value; the conversion unit, when the first number is less than a preset second number, converts the first map into a second map containing the second number of second pixels; the determination unit is used to determine the second elevation value corresponding to each of the second pixels based on the first number of first elevation values and the target map where the first map is located; the generation unit is used to obtain a Terrain-RGB map based on the second map and the second elevation value corresponding to each of the second pixels.
[0023] In combination with a possible implementation manner of the embodiment of the second aspect, the acquisition unit is specifically used to: acquire, in a world map where the first map is located, multiple third maps located around the first map, wherein each of the third maps contains the first number of pixel points; and splice the first map and the multiple third maps into the target map.
[0024] In combination with a possible implementation manner of the second aspect embodiment, the acquisition unit is specifically used to: acquire a first initial map, and preprocess the first initial map, the preprocessing comprising: filling the elevation value of each first pixel point whose elevation value is missing in the first initial map with a default height value; performing map projection on the preprocessed first initial map, and resampling and calculating the elevation value corresponding to each first pixel point in the first initial map to obtain the first map, wherein the first elevation value is obtained by resampling and calculating the elevation value corresponding to each first pixel point in the projected first initial map.
[0025] In combination with a possible implementation manner of the second aspect embodiment, the determination unit is specifically used to: obtain first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point in the target map, wherein the target second pixel point is any second pixel point in the second map; based on the first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point, calculate the second elevation value corresponding to the target second pixel point.
[0026] In combination with a possible implementation manner of the second aspect embodiment, the generation unit is specifically used to: filter the second elevation value corresponding to each second pixel point in the second map; and obtain a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point after filtering.
[0027] In combination with a possible implementation manner of the second aspect embodiment, the generation unit is specifically used to: use a filtering window with a size of N*N pixels to slide the window on the second map with a specified step size; for each sliding of the window, obtain the absolute difference between the second elevation value corresponding to the pixel to be filtered in the sliding window and the average value of the sliding window, wherein N is an odd number not greater than M, the pixel to be filtered in the sliding window is the second pixel in the sliding window that falls at the center position of the filtering window, and the average value of the sliding window is the average value of the second elevation values corresponding to all the second pixel points contained in the filtering window during the sliding of the window; if the absolute difference is greater than the set threshold, the second elevation value corresponding to the pixel to be filtered in the sliding window is updated to the average value of the sliding window.
[0028] In combination with a possible implementation manner of the second aspect embodiment, the generation unit is specifically used to: determine the RGB value corresponding to each of the second elevation values based on the second elevation value and a preset analysis algorithm; encode the calculated RGB value into the corresponding second pixel point to obtain the Terrain-RGB map.
[0029] Optionally, the device further includes: a rendering unit, configured to render the Terrain-RGB map with a three-dimensional effect of mountain shadows to generate a fourth map.
[0030] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the processor is coupled to the memory, and the processor is used to implement the method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment when executing a computer program stored in the memory.
[0031] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment.
[0032] It should be understood that the second to fourth aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be described in detail.
[0033] Other features and advantages of the present application will be described in the following description. The purpose and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The above and other purposes, features and advantages of the present application will be more clear as shown in the drawings.
[0035] Figure 1 A flowchart of a map making method provided in an embodiment of the present application is shown;
[0036] Figure 2 A schematic diagram of a first map provided in an embodiment of the present application is shown;
[0037] Figure 3 A schematic diagram of a target map provided in an embodiment of the present application is shown;
[0038] Figure 4 A schematic diagram of converting a first map into a second map provided by an embodiment of the present application is shown;
[0039] Figure 5A schematic diagram of calculating a second elevation value corresponding to a second pixel point of a target in a second map based on a target map provided by an embodiment of the present application is shown;
[0040] Figure 6 A schematic diagram of sliding a window on a second map using a filter window provided in an embodiment of the present application is shown;
[0041] Figure 7 A schematic diagram of calculating the elevation value corresponding to the second pixel point at the edge position provided by an embodiment of the present application is shown;
[0042] Figure 8 A schematic diagram of calculating the elevation value corresponding to the second pixel point at the edge position provided by an embodiment of the present application is shown;
[0043] Fig. 9 A schematic diagram of a map making device provided in an embodiment of the present application is shown;
[0044] Fig.10 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The following embodiments can be used as examples to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the scope of protection of the present application. It will be appreciated by those skilled in the art that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other.
[0046] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it is not necessary to further define and explain it in the subsequent drawings. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.
[0047] In the description of the embodiments of the present application, unless otherwise clearly specified or limited, the technical term "electrical connection" may refer to a direct electrical connection or an indirect electrical connection via an intermediate medium.
[0048] The inventors of the present application have discovered through research that a digital elevation model (DEM) map is a map created using digital elevation model data, which can represent the altitude values of different surfaces through elevation values. However, since the resolution of the DEM map is limited by the resolution of the equipment used in the surveying and mapping process, the prior art cannot produce the DEM map into a Terrain-RGB map with a resolution higher than that of the DEM map. The Terrain-RGB map needs to have a higher resolution when displayed on an Internet map, and the produced Terrain-RGB map cannot meet the actual usage requirements of high-resolution display of Internet maps.
[0049] In view of this, an embodiment of the present application provides a map production method, which can convert the first map to be processed into a second map containing more pixels when there is a need to produce a high-resolution Terrain-RGB map, and based on the first elevation values corresponding to the first pixels contained in the first map and the target map, more accurately calculate the elevation value of each pixel in the second map, thereby obtaining a Terrain-RGB map with a higher resolution.
[0050] The technical solution provided by the embodiment of the present application is introduced below in conjunction with the accompanying drawings. Figure 1 The present application embodiment provides a map making method, which is applied to an electronic device. The method flow is described as follows:
[0051] Step 101: Obtain a first map to be processed and a target map where the first map is located, wherein the first map contains a first number of first pixel points, and each first pixel point contains a first elevation value.
[0052] In the embodiment of the present application, the first map is a DEM map in units of sheets, the target map is a larger DEM map containing the first map, the resolution of the first map is limited by the resolution of the equipment used for surveying and mapping, so the resolution of the first map is a fixed value, and the number of first pixels contained in the first map is also a fixed number, so the first number is related to the resolution of the first map and is not limited here. Among them, each first pixel is the area of the minimum visible size expressed in the first map, and the first elevation value represents the altitude value of the area expressed by the corresponding first pixel.
[0053] like Figure 2 As shown, Figure 2A first map is shown. Assuming that the resolution of the first map is 3*3, it can be understood that the first map contains 9 first pixel points. Figure 2 Each grid in the can be regarded as a pixel point, and the number in m (meter) in each grid is the first elevation value corresponding to the first pixel point.
[0054] In one implementation manner, obtaining the first map to be processed may be performed by downloading the first map to be processed corresponding to the location information from a public data source and / or a commercial data source according to the preset location information of the first map to be processed.
[0055] In another embodiment, the method of obtaining the first map to be processed may be: obtaining the first initial map, and preprocessing the first initial map, the preprocessing comprising: filling the elevation value of each first pixel point whose elevation value is missing in the first initial map with a default height value; performing map projection on the preprocessed first initial map, and resampling and calculating the elevation value corresponding to each first pixel point in the first initial map to obtain the first map, wherein the first elevation value is obtained by resampling and calculating the elevation value corresponding to each first pixel point in the projected first initial map, and the first map obtained by preprocessing the first initial map makes the data in the first map more accurate.
[0056] In this embodiment, since the Internet map needs to express the map in plane coordinates, and the original DEM map (i.e., the first initial map obtained) is in the earth's spherical coordinate system, which expresses a curved surface coordinate system, the original DEM map needs to be preprocessed. In order to improve the accuracy of the calculation during the coordinate conversion process, the elevation value of each first pixel point with a vacant elevation value in the first initial map needs to be filled with a default height value, and then the preprocessed first initial map is projected. However, when the first initial map is converted from a curved surface coordinate system to a plane coordinate system, it is equivalent to unfolding the curved surface into a plane for expression. The surface coordinate system of the first initial map will lack some elevation values compared to the plane coordinate system (that is, after the first initial map is converted from surface coordinates to plane coordinates, not every pixel on the map has an elevation value). In order to fill the missing elevation values in some pixels, it is necessary to resample the elevation values corresponding to each pixel of the first initial map (the calculation method can use bilinear interpolation, which is not limited here, and the bilinear interpolation method is a prior art and will not be elaborated here) to obtain the first map, so that each pixel in the first map in the plane coordinates has elevation value data, thereby improving the accuracy of the produced map.
[0057] In another implementation manner, the target map where the first map is located may be obtained by downloading the target map corresponding to the location information from a public data source and / or a commercial data source according to the preset location information of the target map.
[0058] In another embodiment, the target map where the first map is located may be realized by: obtaining a plurality of third maps located around the first map in the world map where the first map is located, wherein each third map contains a first number of pixels; and splicing the first map and the plurality of third maps into a target map. Since when calculating the second number of second elevation values contained in the second map, it is necessary to use the first elevation values corresponding to the plurality of first pixels around the second elevation value for calculation, and considering that the second pixel located on the boundary of the second map cannot find the first elevation values corresponding to the sufficient number of first pixels in the first map, it is necessary to obtain the target map by splicing the plurality of third maps around the first map with the first map in the world map where the first map is located, so as to provide more accurate data for the subsequent calculation of the elevation values corresponding to the second pixels in the second map, thereby making the calculated second elevation values corresponding to the second pixels in the second map more accurate.
[0059] In this embodiment, the target map is actually a DEM map formed by splicing the first map and a plurality of third maps around it, and the third map is actually a DEM map adjacent to the first map and having the same size and resolution as the first map (i.e., the third map also contains the first number of first pixels). Figure 3 As shown, Figure 3 A target map is shown, wherein the first map to be processed is within the region of 30-31 degrees north latitude and 110-111 degrees east longitude (recorded as N30E110), wherein the resolution of the first map is 3*3 (i.e., it contains 9 first pixel points), assuming that the target map is spliced from the first map and eight DEM maps around the first map (the eight adjacent DEM maps are recorded as N29E109, N30E109, N31E109, N29E110, N31E110, N29E111, N30E111, N31E111), and the resolutions of the eight DEM maps are also 3*3 (i.e., they all contain 3 first pixel points), it can be seen that the resolution of the spliced target map is 9*9 (i.e., it contains 81 first pixel points). Step 102: When the first number is less than the preset second number, convert the first map into a second map containing a second number of second pixel points.
[0060] In an embodiment of the present application, after obtaining the first map, the number of first pixel points in the first map is compared, and when the first number is less than the preset second number, the first map is converted into a second map containing a second number of second pixel points. The preset second number represents the number of pixel points that the map to be produced needs to contain, and when the first number is less than the second number, it represents that the resolution of the map to be produced is higher than the resolution of the first map. It can be understood that the number of pixel points that the map to be produced needs to contain is higher than the number of pixel points contained in the first map, so at this time, the first map needs to be converted into a second map containing a second number of second pixel points, wherein the first map and the second map have the same size, and the size of the area expressed by the second pixel point is smaller than the size of the area expressed by the first pixel point.
[0061] For example, Figure 4 As shown, Figure 4 A schematic diagram of converting a first map into a second map is shown. Figure 4 In the example, the resolution of the first map is 3*3, the first number is 9, and the second number is 16, so a map with a resolution of 4*4 needs to be produced. This process can be understood as re-dividing the first map from the original 9 pixels into 16 pixels.
[0062] Step 103: Determine a second elevation value corresponding to each second pixel point based on the first number of first elevation values and the target map where the first map is located.
[0063] In the embodiment of the present application, since the size of the area expressed by the second pixel point is smaller than the size of the area expressed by the first pixel point, the elevation value of the second pixel point cannot actually correspond one-to-one with the original first elevation value, and thus it is necessary to use the first number of first elevation values in the first map and the target map where the first map is located to determine the second elevation value corresponding to the second pixel point in the second map in sequence.
[0064] In one embodiment, the process of converting the first map into a second map containing a second number of second pixel points may be: obtaining the first elevation values corresponding to the multiple first pixel points adjacent to the target second pixel point in the target map, wherein the target second pixel point is any second pixel point in the second map; based on the first elevation values corresponding to the multiple first pixel points adjacent to the target second pixel point, calculating the second elevation value corresponding to the target second pixel point. By selecting the corresponding first elevation value in the target map to calculate the second elevation value in the second map, all second pixel points in the second map have their corresponding accurate second elevation values.
[0065] In this embodiment, when determining the second elevation value corresponding to each second pixel point in the second map, it is necessary to use the first elevation values corresponding to multiple first pixel points surrounding the second elevation value for calculation. Considering that the second pixel point located on the boundary of the second map cannot find the first elevation values corresponding to a sufficient number of first pixel points in the first map, and the target map includes the first map, which also contains more first pixel points, when calculating the second elevation value corresponding to the second pixel point located at the boundary in the second map (since the first map and the second map are the same size but different in resolution, when calculating the elevation value corresponding to the target second pixel point in the second map, it is necessary to obtain the first elevation values corresponding to the first pixel point corresponding to multiple first pixel points surrounding the target second pixel point for calculation. If the target second pixel point is located at the boundary, it may be possible to obtain only half of the number (or even less than half of the number) of the first pixel points in the first map. point, the remaining first pixel points need to be obtained in a map other than the first map, that is, the elevation values corresponding to other first pixel points are obtained in the part of the target map other than the first map to calculate the second elevation value corresponding to the target second pixel point). In the target map, the first elevation value corresponding to the first pixel point that cannot be provided by the first map can be selected to calculate the second elevation value, and then the second elevation value corresponding to each second pixel point in the second map is calculated. Taking the calculation of the second elevation value corresponding to a second pixel point in the second map as an example, the second pixel point is called the target second pixel point at this time. First, multiple first pixel points adjacent to the target second pixel point are obtained in the target map, and based on the first elevation values corresponding to the multiple first pixel points obtained, the second elevation value corresponding to the target pixel point is calculated (the calculation method can adopt the cubic convolution method, which is a prior art and will not be described in detail here).
[0066] For example, Figure 5 As shown, Figure 5 The following is a schematic diagram of calculating the second elevation value corresponding to the second pixel point of the target in the second map based on the target map. It is assumed that the first map with a resolution of 3*3 is made into a second map of 4*4, and the second elevation values corresponding to the 16 second pixel points in the second map need to be calculated. In the large target map, for each second pixel point, the first pixel points around it can be selected for calculation. The specific selection method and the number of pixels to be selected for calculation are not limited here (the grid surrounded by dotted lines represents the first pixel point, the grid surrounded by solid lines represents the second pixel point, the bold range is the second map, and the grid surrounded by dotted lines in the second map represents the pixel points in the first map).
[0067] Step 104: Obtain a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point.
[0068] In the embodiment of the present application, after calculating the second elevation value corresponding to each second pixel point, the second elevation value corresponding to each second pixel point can be represented by a corresponding RGB value to generate a Terrain-RGB map.
[0069] In one implementation manner, the Terrain-RGB map can be obtained based on the second map and the second elevation value corresponding to each second pixel point by: determining the RGB value corresponding to each second elevation value based on the second elevation value and a preset parsing algorithm; encoding the calculated RGB value into the corresponding second pixel point to obtain the Terrain-RGB map, and replacing the second elevation value with the RGB value, so that the obtained Terrain-RGB map can more intuitively display the elevation value of each second pixel point.
[0070] In another embodiment, the Terrain-RGB map may be obtained based on the second map and the second elevation value corresponding to each second pixel point by filtering the second elevation value corresponding to each second pixel point in the second map; and obtaining the Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point after filtering.
[0071] In this embodiment, in order to ensure the rationality of the second elevation value corresponding to the second pixel point in the second map and avoid the problem of excessive deviation between the second elevation value corresponding to the second pixel point and the second elevation value corresponding to the adjacent second pixel point, the second elevation value corresponding to each second pixel point in the second map can be filtered, and then based on the second map and the second elevation value corresponding to each second pixel point after filtering, a Terrain-RGB map can be obtained, thereby making the produced map more accurate.
[0072] The second elevation value corresponding to each second pixel point in the second map is filtered. One implementation method may be to filter the second elevation value corresponding to the second pixel point calculated in the second map and a preset filtering function to obtain the second elevation value corresponding to each second pixel point after filtering, and then obtain the Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point after filtering.
[0073] In another embodiment, the second map includes M*M second pixel points, and the second elevation value corresponding to each second pixel point in the second map is filtered, including: using a filtering window with a size of N*N pixels to slide the window on the second map with a specified step size; for each sliding of the window, obtaining the absolute difference between the second elevation value corresponding to the pixel point to be filtered in the sliding window and the average value of the sliding window, wherein N is an odd number not greater than M, the pixel point to be filtered in the sliding window is the second pixel point in the sliding window that falls at the center position of the filtering window, and the average value of the sliding window is the average value of the second elevation values corresponding to all the second pixel points included in the filtering window during the sliding of the window; if the absolute difference is greater than a set threshold, the second elevation value corresponding to the pixel point to be filtered in the sliding window is updated to the average value of the sliding window.
[0074] In this embodiment, assuming that the resolution of the second map is M*M, the filtering process of the second elevation value corresponding to the second pixel point in the second map can specifically use a filtering window with a size of N*N pixels to slide the window on the second map with a specified step size, wherein N is an odd number not greater than M. For each window sliding, the absolute difference between the second elevation value corresponding to the pixel point to be filtered in the sliding window and the average value of the sliding window is obtained. If the absolute difference is greater than a set threshold (which can be set according to needs and is not limited here), it indicates that the second elevation value corresponding to the pixel point to be filtered in the sliding window is different from the corresponding value. The difference between the second elevation values corresponding to the adjacent second pixel points is too large, which is actually unreasonable. In order to improve the rationality of the second elevation values corresponding to the pixel points to be filtered in the secondary sliding window, the second elevation values corresponding to the pixel points to be filtered in the secondary sliding window are updated to the average value of the secondary sliding window. After filtering the second elevation values corresponding to each second pixel point in the second map, the second elevation values corresponding to the second pixel points in the second map are more accurate. Then, generating a Terrain-RGB map based on the filtered second elevation values can improve the accuracy of the Terrain-RGB map.
[0075] For example, Figure 6 As shown, Figure 6A schematic diagram of sliding a window on a second map using a filter window provided by an embodiment of the present application is shown. Assuming that the resolution of the second map is 9*9, that is, the second map includes 81 second pixels, a filter window of size 3*3 is used for sliding the window, and the threshold is set to 10m (meters). The second pixel located at the center of the filter window is the pixel to be filtered. According to the second elevation value corresponding to the second pixel included in the filter window, it can be calculated that the average value of the sliding window is about 77m (meters), and the absolute difference between the average value of the sliding window and the second elevation value corresponding to the pixel to be filtered is 67m (meters), which is much larger than the set threshold of 10m (meters). Obviously, the second elevation value corresponding to the pixel to be filtered is an unreasonable noise point, so the second elevation value needs to be replaced with a more reasonable value. At this time, the average value of the sliding window can be used to replace the second elevation value corresponding to the pixel to be filtered, so that the second elevation value corresponding to the second pixel in the second map is more accurate.
[0076] In one implementation manner, the Terrain-RGB map can be obtained based on the second map and the second elevation value corresponding to each second pixel point by: determining the RGB value corresponding to each second elevation value based on the second elevation value and a preset parsing algorithm; encoding the calculated RGB value into the corresponding second pixel point to obtain the Terrain-RGB map, and by using a preset function to calculate the RGB value to replace the second elevation value, the obtained Terrain-RGB map can more intuitively display the elevation value of each second pixel point.
[0077] In this mode, the parsing algorithm is:
[0078] value=int((height+10000)*10)
[0079] R=value>>16
[0080] G=(value>>8&255)
[0081] B=value&255
[0082] Among them, height represents the second elevation value, >> is the right shift operator, & is the bitwise AND operator. The specific calculation process is:
[0083] First, calculate the value based on the second elevation value, then convert the value from decimal to binary, shift the binary value right by 16 bits to get the R value, shift the binary value right by 8 bits to get the result and then perform a bitwise AND operation with the binary 255 to get the G value, and perform a bitwise AND operation with the binary value and the binary 255 to get the B value. The three RGB channels are used to jointly represent the terrain altitude of each second pixel point, so that the obtained Terrain-RGB map can more intuitively show the elevation value of each second pixel point.
[0084] In this implementation, the map production method also includes: rendering the Terrain-RGB map with a three-dimensional effect of mountain shadows to generate a fourth map, which can make the produced map have a more three-dimensional visual effect, thereby improving the user's visual perception when viewing the map.
[0085] As a possible implementation method, if you want to produce a Terrain-RGB map of the entire world map, you can use the above method to splice the Terrain-RGB maps produced by DEM maps of different regions in the world map to obtain the Terrain-RGB map of the entire world map. This process can be produced using the Python language.
[0086] In this embodiment, the Terrain-RGB maps produced based on the DEM maps of different regions in the world map are spliced in the above manner. When a certain DEM map (herein referred to as map A) is produced into a Terrain-RGB map, when calculating the second elevation value of the edge of map A, the first elevation value corresponding to the first pixel point in the adjacent DEM map (herein referred to as map B) may be obtained in the target map. However, when map B is produced into a Terrain-RGB map, when calculating the second elevation value of the edge of map B, the first elevation value of map A may be obtained in the target map corresponding to map B. For the first pixel point, when the Terrain-RGB maps of all local maps are all produced (the Terrain-RGB maps of the local maps include the Terrain-RGB maps produced based on map A and map B) and it is necessary to splice the Terrain-RGB maps of all local maps into the Terrain-RGB map of the world map, the Terrain-RGB map produced based on map A and the Terrain-RGB map produced based on map B are spliced together, and the second elevation value at the seam position can change more coherently, which is more in line with the geographical facts of the real world.
[0087] For example, see Figure 7, both map A and map B are DEM maps. When calculating the second elevation value corresponding to the second pixel point a in map A, it is necessary to obtain the first elevation value corresponding to the first pixel point b in map B for calculation. Please refer to Figure 8 When calculating the second elevation value corresponding to the second pixel point c in map B, it is necessary to obtain the first elevation value corresponding to the first pixel point d in map A for calculation. That is to say, in the process of producing adjacent DEM maps called Terrain-RGB maps, the elevation value corresponding to the second pixel point at the edge position needs to use the first elevation value corresponding to the first pixel point in the adjacent DEM map. This can make the change of the second elevation value corresponding to the second pixel point located at the seam of two adjacent maps more coherent, which is more in line with the geographical facts of the real world.
[0088] See also Fig. 9 Based on the same inventive concept, the embodiment of the present application further provides a map making device 100 , which includes: an acquisition unit 201 , a conversion unit 202 , a determination unit 203 and a generation unit 204 .
[0089] The acquisition unit 201 is used to acquire a first map to be processed and a target map where the first map is located, wherein the first map includes a first number of first pixel points, and each first pixel point includes a first elevation value.
[0090] The conversion unit 202 converts the first map into a second map including a second number of second pixel points when the first number is less than a preset second number.
[0091] The determination unit 203 is used to determine a second elevation value corresponding to each second pixel point based on a first number of first elevation values and a target map where the first map is located.
[0092] The generating unit 204 is configured to obtain a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point.
[0093] Optionally, the acquisition unit 201 is specifically used to: acquire a plurality of third maps located around the first map in the world map where the first map is located, wherein each third map contains a first number of pixel points; and splice the first map and the plurality of third maps into a target map.
[0094] Optionally, the acquisition unit 201 is specifically used to: acquire a first initial map, and preprocess the first initial map, the preprocessing comprising: filling the elevation value of each first pixel point whose elevation value is missing in the first initial map with a default height value; performing map projection on the preprocessed first initial map, and resampling and calculating the elevation value corresponding to each first pixel point in the first initial map to obtain a first map, wherein the first elevation value is obtained by resampling and calculating the elevation value corresponding to each first pixel point in the projected first initial map.
[0095] Optionally, the determination unit 203 is specifically used to: obtain first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point in the target map, wherein the target second pixel point is any second pixel point in the second map; and calculate the second elevation value corresponding to the target second pixel point based on the first elevation values corresponding to multiple first pixel points adjacent to the target second pixel point.
[0096] Optionally, the generating unit 204 is specifically used to: filter the second elevation value corresponding to each second pixel point in the second map; and obtain a Terrain-RGB map based on the second map and the second elevation value corresponding to each second pixel point after filtering.
[0097] Optionally, the generation unit 204 is specifically used to: use a filtering window with a size of N*N pixels to slide the window on the second map with a specified step size; for each sliding of the window, obtain the absolute difference between the second elevation value corresponding to the pixel to be filtered in the sliding window and the average value of the sliding window, where N is an odd number not greater than M, the pixel to be filtered in the sliding window is the second pixel in the sliding window that falls at the center of the filtering window, and the average value of the sliding window is the average value of the second elevation values corresponding to all the second pixels contained in the filtering window during the sliding of the window; if the absolute difference is greater than a set threshold, the second elevation value corresponding to the pixel to be filtered in the sliding window is updated to the average value of the sliding window.
[0098] Optionally, the generating unit 204 is specifically used to: determine the RGB value corresponding to each second elevation value based on the second elevation value and a preset parsing algorithm; encode the calculated RGB value into the corresponding second pixel point to obtain a Terrain-RGB map.
[0099] Optionally, the map making device 100 further includes: a rendering unit, configured to render the Terrain-RGB map with a three-dimensional effect of mountain shadows to generate a fourth map.
[0100] like Fig.10 As shown, Fig.10The electronic device 200 provided in the embodiment of the present application is shown in the structural block diagram. The electronic device 200 comprises: a transceiver 210, a memory 220, a communication bus 230 and a processor 240.
[0101] The transceiver 210, the memory 220, and the processor 240 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 230 or signal lines. The transceiver 210 is used to send and receive data. The memory 220 is used to store computer programs, such as storing Figure 5 The software function modules shown in the figure are the map making device 100. The map making device 100 includes at least one software function module that can be stored in the memory 220 in the form of software or firmware or fixed in the operating system (OS) of the electronic device 200. The processor 240 is used to execute the executable modules stored in the memory 220, such as the software function modules or computer programs included in the map making device 100. For example, the processor 240 is used to execute the computer program stored in the memory. When the processor 240 executes the computer program stored in the memory, it is used to: execute Figure 1 The method shown.
[0102] Among them, the memory 220 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0103] The processor 240 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a microprocessor, etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. Alternatively, the processor 240 may also be any conventional processor, etc.
[0104] The electronic device 200 mentioned above includes but is not limited to a mobile phone, a tablet, a computer, a server, etc.
[0105] The embodiment of the present application also provides a non-volatile computer-readable storage medium (hereinafter referred to as storage medium), on which a computer program is stored. When the computer program is run by a computer such as the above-mentioned electronic device 200, the map making method shown above is executed.
[0106] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0107] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0109] If the functions are implemented in the form of software function modules 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 the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a computer-readable storage medium, including several instructions for enabling a computer device (which can be a personal computer, a laptop, a server, or an electronic device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A map making method, characterized in that: include: Acquire a first map to be processed and a target map where the first map is located, wherein the first map includes a first number of first pixel points, and each of the first pixel points includes a first elevation value; When the first number is less than a preset second number, converting the first map into a second map including the second number of second pixel points; Determine, based on the first number of first elevation values and the target map where the first map is located, a second elevation value corresponding to each of the second pixel points; Obtaining a Terrain-RGB map based on the second map and the second elevation value corresponding to each of the second pixel points; The step of determining the second elevation value corresponding to each of the second pixel points based on the first number of first elevation values and the target map where the first map is located includes: Acquire first elevation values corresponding to a plurality of first pixel points adjacent to a target second pixel point in the target map, wherein the target second pixel point is any second pixel point in the second map; The second elevation value corresponding to the target second pixel point is calculated based on the first elevation values corresponding to the plurality of first pixels adjacent to the target second pixel point by using the cubic convolution method.
2. The method according to claim 1, characterized in that The obtaining the target map where the first map is located includes: In the world map where the first map is located, obtaining a plurality of third maps located around the first map, wherein each of the third maps contains the first number of pixel points; The first map and the plurality of third maps are spliced into the target map.
3. The method according to claim 1, characterized in that The step of obtaining a first map to be processed includes: Acquire a first initial map, and preprocess the first initial map, wherein the preprocessing includes: filling the elevation value of each first pixel point whose elevation value is vacant in the first initial map with a default height value; The first initial map after preprocessing is subjected to map projection, and the elevation value corresponding to each first pixel point in the first initial map is resampled and calculated to obtain the first map, wherein the first elevation value is obtained by resampling and calculating the elevation value corresponding to each first pixel point in the projected first initial map.
4. The method according to claim 1, characterized in that: Based on the second map and the second elevation value corresponding to each of the second pixel points, a Terrain-RGB map is obtained, including: Filtering the second elevation value corresponding to each of the second pixel points in the second map; A Terrain-RGB map is obtained based on the second map and the filtered second elevation value corresponding to each of the second pixel points.
5. The method according to claim 4, characterized in that The second map includes M*M second pixel points, and filtering the second elevation value corresponding to each second pixel point in the second map includes: Using a filter window with a size of N*N pixels to slide the window on the second map with a specified step size; For each window sliding, obtain the absolute difference between the second elevation value corresponding to the pixel point to be filtered in the window and the average value of the window, where N is an odd number not greater than M, the pixel point to be filtered in the window is the second pixel point in the window that falls at the center of the filter window, and the average value of the window is the average value of the second elevation values corresponding to all the second pixel points contained in the filter window during the window sliding; If the absolute difference is greater than a set threshold, the second elevation value corresponding to the pixel to be filtered in the sliding window is updated to the average value of the sliding window.
6. The method according to claim 1, characterized in that Based on the second map and the second elevation value corresponding to each of the second pixel points, a Terrain-RGB map is obtained, including: Based on the second elevation value and a preset analytical algorithm, determining an RGB value corresponding to each of the second elevation values; The calculated RGB value is encoded into the corresponding second pixel point to obtain the Terrain-RGB map.
7. The method according to claim 1, characterized in that After obtaining the Terrain-RGB map, the method further includes: The Terrain-RGB map is rendered with a three-dimensional effect of mountain shadows to generate a fourth map.
8. A map making device, characterized in that: The device comprises: An acquisition unit, used for acquiring a first map to be processed and a target map where the first map is located, wherein the first map includes a first number of first pixel points, and each of the first pixel points includes a first elevation value; a conversion unit, when the first number is less than a preset second number, converting the first map into a second map containing the second number of second pixel points; a determining unit, configured to determine a second elevation value corresponding to each of the second pixel points based on the first number of first elevation values and a target map where the first map is located; The determination unit is further used to: obtain first elevation values corresponding to a plurality of first pixel points adjacent to a target second pixel point in the target map, wherein the target second pixel point is any second pixel point in the second map; and calculate a second elevation value corresponding to the target second pixel point based on the first elevation values corresponding to the plurality of first pixel points adjacent to the target second pixel point by using a cubic convolution method; A generating unit is used to obtain a Terrain-RGB map based on the second map and a second elevation value corresponding to each of the second pixel points.
9. An electronic device, characterized in that: The electronic device comprises at least one processor and a memory connected to the at least one processor, and the at least one processor is configured to implement the steps of the method according to any one of claims 1 to 7 when executing a computer program in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Grid DEM (digital elevation model) data-based equidistant weight interpolation encryption method
CN106570936A
A method for producing and distributing color topographic map
CN109086286A
Multi-baseline InSAR elevation reconstruction method combining UKF and AMPM
CN112835041A
Digital elevation anomaly data conversion method and device
CN114764846A
Method and system for quickly generating elevation live-action map model
CN116186189A
