A method of color scale optimization of a DEM hillshade to highlight ancient dams
By adjusting the color levels of the DEM shaded image, optimizing the elevation range of the ancient dam, and inserting transition colors, the problem of the preset color levels failing to highlight the ancient dam was solved, resulting in a more vivid contrast and improved visual effect.
Patent Information
- Application Number
- CN202410566279.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-05-09
AI Technical Summary
In existing DEM shaded maps, the preset color levels are divided into grades at equal intervals, which makes it difficult to highlight ancient dams in specific altitude ranges, resulting in fewer and less aesthetically pleasing colors.
By adjusting the elevation range of the target ancient dam to the optimization range, selecting a rich set of base colors, setting the gradation evenly within the optimization range, setting fewer gradations within the non-optimization range, inserting transition colors, generating custom color levels, and optimizing the initial DEM shading map.
The ancient dam was distinguished from the surrounding landform by contrasting colors, highlighting the target ancient dam and improving the visual effect of the DEM shading map.
Smart Images

Figure CN118505885B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of DEM hill shading map making and image processing, and particularly relates to a method for color scale optimization of a DEM hill shading map to highlight an ancient dam. BACKGROUND
[0002] A digital elevation model (DEM) is a digital model that describes the elevation information of the earth's surface and is an important part of a geographic information system. This digital form of terrain model can be processed and analyzed by a computer, has the advantages of terrain visualization, high accuracy, and efficient processing, and can provide more abundant spatial geographic information data for archaeological research, greatly expanding the perspective of archaeological research. DEM can be generated through data acquisition (three-dimensional coordinate data), data preprocessing, and interpolation. The DEM hill shading map can be generated by coloring different altitudes of the landform with different colors, so as to intuitively show the terrain undulations. The archaeological remains saved so far have mostly been destroyed, but their elevations are still different from the surrounding landforms, and can show unique landform features in the digital elevation model (DEM). Further, the DEM hill shading map can be used to highlight this feature, thereby achieving the purpose of highlighting the archaeological remains. An ancient dam can also be highlighted by the above method.
[0003] The DEM hill shading map can help to more clearly distinguish the landform features and improve the data visualization effect. The core principles of color matching include natural reality, clear contrast, color gradient, and color blindness friendliness. Gradual color is usually used to help show the elevation changes, for example, using blue to represent low-altitude areas, gradually transitioning to green and yellow to represent medium-high-altitude areas, and finally to orange-red-purple to represent high mountain areas.
[0004] Image processing technology is a technology that uses computers to analyze, enhance, compress, and reconstruct images. In the process of producing DEM hill shading maps, image processing techniques that can be used include color scale processing, threshold division, filtering, feature extraction, and three-dimensional visualization. Color scale processing adjusts the color scale of the DEM hill shading map to improve the contrast and visual effect of the image. Commonly used color scale processing methods today include (1) gray scale stretching, which enhances the contrast of the image through linear stretching, (2) histogram equalization, which enhances the contrast of the image by redistributing the pixel values, and (3) adaptive histogram equalization, which performs histogram equalization based on local regions of the image, suitable for images with uneven lighting. Threshold division is commonly used for image enhancement and feature extraction. Common threshold determination methods include the following: (1) automatic threshold determination, such as Otsu's method, which automatically determines the threshold based on the histogram of the image; (2) manual threshold determination, which manually determines the threshold based on experience or specific application scenarios, such as determining the threshold based on specific features of the image; (3) statistical-based methods, such as determining the threshold based on the mean, variance, or other statistical characteristics of the image pixel values; (4) gradient-based methods, which determine the threshold by analyzing the gradient information of the image, such as the Sobel operator; and (5) clustering-based methods, which use clustering algorithms (such as K-means clustering) to determine the threshold of the image.
[0005] In summary, after color matching and image processing optimization, the DEM hill shading map shows clearer topographic features, more obvious elevation changes, and more natural color gradients. However, there are still problems with color scale optimization for specific elevation ranges, such as general DEM hill shading maps that use equal elevation intervals to divide the color scale, which can not effectively highlight specific elevation ranges of ancient dams. SUMMARY
[0006] The present application aims to solve the problems in the prior art and provide a method for color scale optimization of DEM hill shading maps to highlight ancient dams.
[0007] To achieve the above-mentioned application purposes, the present application specifically adopts the following technical solutions:
[0008] A method for color scale optimization of DEM hill shading maps to highlight ancient dams, comprising the following steps:
[0009] S1. Generate an initial DEM hill shading map using the preset color scale of the geographic information system software, and determine the elevation range of the total terrain;
[0010] S2. Superimpose the initial DEM hill shading map with the obtained digital contour map to obtain a superimposed DEM hill shading map, and determine the elevation range of the target ancient dam in the superimposed DEM hill shading map based on the pre-obtained target ancient dam location and the elevation data in the digital contour map.
[0011] S3. Optimize the color scale of the initial DEM hillshade map by using the elevation range of the total terrain and the elevation range of the target ancient dam, to obtain a final optimized DEM hillshade map;
[0012] The specific process of the color scale optimization is as follows:
[0013] S31. Re-adjust the elevation range of the target ancient dam as an optimization range, and the remaining range of the total terrain with an elevation lower or higher than the optimization range as a non-optimization range;
[0014] S32. Select a preset number of different colors as base colors in the order of the elevations of the total terrain from low to high;
[0015] S33. Uniformly set corresponding levels in the optimization range with a preset elevation interval size, and set corresponding levels in the non-optimization range, the number of levels in the non-optimization range being less than that in the optimization range; after the levels are divided, a unique base color is allocated to each level of the non-optimization range and the optimization range, the number of base colors in the optimization range being greater than that in the non-optimization range, if the number of levels in the non-optimization range is greater than the number of base colors in the non-optimization range, then find the elevation interval corresponding to the level that has not been allocated a base color, and insert a transition color between the adjacent base colors corresponding to the elevation interval as the color of the level that has not been allocated a base color; if the number of levels in the optimization range is greater than the number of base colors in the optimization range, then find the elevation interval corresponding to the level that has not been allocated a base color, and insert a transition color between the adjacent base colors corresponding to the elevation interval as the color of the level that has not been allocated a base color;
[0016] S34. Generate a custom color scale by using the base colors set after the levels are divided, and optimize the initial DEM hillshade map by using the custom color scale, to obtain a preliminary optimized DEM hillshade map;
[0017] S35. Determine whether the preliminary optimized DEM hillshade map needs to be adjusted: if the number of base colors corresponding to the levels in the optimization range reaches a preset number standard threshold, then the preliminary optimized DEM hillshade map is taken as the final optimized DEM hillshade map, otherwise, the number of levels in the optimization range is increased and the number of levels in the non-optimization range is decreased until the number of base colors corresponding to the levels in the optimization range reaches the preset number standard threshold.
[0018] On the basis of the above scheme, each step can be implemented in the following preferred specific manner.
[0019] Preferably, in step S1, the geographic information system software adopts Global Mapper software or Arcgis software.
[0020] Preferably, in step S1, the total terrain has an elevation range of 31.7-91.2 m.
[0021] Preferably, in step S2, the target ancient dam has an elevation range of 40-43 m.
[0022] Preferably, in step S31, the optimization range is 38-45 m.
[0023] Preferably, in step S32, the selected basic colors in order of low to high elevation are blue, cyan, green, yellow, orange, red, magenta, purple, dark purple, brown, and brown.
[0024] Preferably, in step S33, the corresponding basic colors in the optimization range in order of low to high elevation are cyan, green, yellow, orange, red, magenta, purple, and dark purple.
[0025] Preferably, in step S33, the preset elevation interval is 1 m.
[0026] Preferably, in step S33, one classification is set in the non-optimization range with an elevation lower than the optimization range, and two classifications are set in the non-optimization range with an elevation higher than the optimization range.
[0027] The present application has the following beneficial effects relative to the prior art:
[0028] The method of the present application solves the problem that the software preset color scale divides the levels by equal intervals, and the levels are few, the colors are few and not beautiful, and the target ancient dam cannot be highlighted. Through the method of the present application, the ancient dam in the DEM hill-shading map and the landforms below and above its elevation can be distinguished by contrasting colors, achieving the purpose of highlighting the target ancient dam. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 is a flowchart of the present application;
[0030] Figure 2 is a schematic diagram of the software preset color scale in the present application;
[0031] Figure 3 is a schematic diagram of the initial DEM hill-shading map of the present application;
[0032] Figure 4 is a schematic diagram of the initial DEM hill-shading map and the digital contour topographic map of the present application after superposition;
[0033] Figure 5 A schematic diagram for setting a custom color scale of the present application;
[0034] Figure 6 A schematic diagram for comparison before and after the color scale optimization of the DEM hillshade map of the present application. DETAILED DESCRIPTION
[0035] In order to make the above objectives, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described in detail below with reference to the accompanying drawings. In the following description, a large number of specific details are set forth in order to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the concept of the present application, so the present application is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present application can be combined accordingly without conflict.
[0036] In a preferred embodiment of the present application, a method for color scale optimization of a DEM hillshade map to highlight an ancient dam is provided, which relates to the field of DEM hillshade map making, in particular, to the making of an initial DEM hillshade map, and the color scale optimization of the DEM hillshade map based on the elevation range of the ancient dam, and belongs to the field of image processing. The present application takes the identified suspected ancient dam as the target, and the purpose is to highlight the identified suspected ancient dam in the DEM hillshade map.
[0037] As shown in Figure 1 In a preferred implementation of the present application, the above method includes the following steps S1-S3. The specific implementation process will be described in detail below.
[0038] S1. Generate an initial DEM hillshade map using the preset color scale of the geographic information system software, and determine the elevation range of the total terrain.
[0039] It should be noted that the initial DEM hillshade map is generated in step S1 of the present application. Specifically, based on the recognition habit of human eyes to the ups and downs of the terrain, the initial DEM hillshade map is generated using the preset blue-red color scale in the geographic information system software, and the elevation range of the total terrain is determined, from low to high in the order of the terrain transition from cool to warm color. Wherein, an example of a preset color scale in a geographic information system software is shown as Figure 2
[0040] It should be noted that in step S1, the geographic information system software uses Global Mapper software or Arcgis software.
[0041] In the embodiment, the initial DEM hill shading map is generated by using the preset color ring shader in the Global Mapper software, as shown in the effect diagram of the initial DEM hill shading map in FIG. 2. Figure 3 As shown in FIG. 2, the elevation range of the total terrain is 31.7-91.2 m.
[0042] S2. Superimpose the initial DEM hill shading map and the obtained digital contour map to obtain a superimposed DEM hill shading map, and determine the elevation range of the target ancient dam in the superimposed DEM hill shading map according to the position of the target ancient dam and the elevation data in the digital contour map obtained in advance.
[0043] It should be noted that in step S2 of the present application, the elevation range in which the target ancient dam is located needs to be determined. Specifically, the initial DEM hill shading map is superimposed with the digital contour map to obtain a superimposed DEM hill shading map, as shown in FIG. 3. Figure 4 Then, the elevation range of the target ancient dam is determined in the superimposed DEM hill shading map according to the position of the target ancient dam and the elevation data in the digital contour map obtained in advance.
[0044] In the embodiment, the elevation range of the target ancient dam is 40-43 m, as shown in FIG. 4. Figure 4 It can be seen that the target ancient dam is located in an elevation range of 40-43 m, and the target ancient dam and the surrounding landform have a color tone and are not clearly distinguished, so it is necessary to increase rich and contrasting color changes.
[0045] S3. Perform color scale optimization processing on the initial DEM hill shading map by using the elevation range of the total terrain and the elevation range of the target ancient dam to obtain a final optimized DEM hill shading map.
[0046] It should be noted that in step S3 of the present application, the color scale optimization processing is performed to make the adjusted elevation range of the target ancient dam (i.e., the optimization range) present rich and contrasting color changes, while the landforms below and above the optimization range present relatively monotonous color changes, so that the target ancient dam in the DEM hill shading map is distinguished from the landforms below and above its elevation in rich and contrasting colors.
[0047] In step S3, the specific process of the color scale optimization processing is as follows:
[0048] S31. Re-adjust the elevation range of the target ancient dam as an optimization range, and take the remaining range of the total terrain below or above the optimization range as a non-optimization range.
[0049] In step S31 of the embodiment, the elevation range of the target ancient dam is appropriately enlarged downwards and upwards respectively, and the adjusted elevation range is taken as the optimization range, so that the color of the optimized target ancient dam and the landforms below and above the elevation of the target ancient dam present a sharp color contrast. In the embodiment, the elevation range of the target ancient dam 40-43m is expanded to 38-45m, and 38-45m is the optimization range. The total terrain elevation range is 31.7-91.2m, and the remaining 31.7-38m and 45-91.2m after removing the optimization range are the non-optimization range.
[0050] S32. Select a preset number of different colors as the base colors in the order of the elevations of the total terrain from low to high.
[0051] In step S32 of the embodiment, the number of the base colors selected in order is 11, and the specific colors are blue, cyan, green, yellow, orange, red, magenta, purple, dark purple, brown and brown.
[0052] It should be noted that in step S32 of the embodiment, the self-defined color scale is realized by enriching the base colors. Specifically, in order to make the optimized color scale present rich and sharp contrast colors, the types of the base colors are further enriched according to the previous practical experience, such as Figure 5 As shown in the table, blue (R0, G0, B255), cyan (R0, G255, B255), green (R0, G255, B0), yellow (R241, G250, B86), orange (R255, G131, B6), red (R255, G0, B0), magenta (R238, G30, B181), purple (R185, G55, B227), dark purple (R128, G0, B255), brown (R128, G0, B64) and brown (R128, G0, B128) are selected as the base colors in the order of the terrain from low to high.
[0053] S33. Setting the corresponding levels uniformly with preset altitude interval size in the optimization range, and setting the corresponding levels in the non-optimization range, the number of levels in the non-optimization range is less than that in the optimization range; after the levels are divided, assigning a unique base color to each level of the non-optimization range and the optimization range, the number of base colors in the optimization range is greater than that in the non-optimization range, if the number of levels in the non-optimization range is greater than the number of base colors in the non-optimization range, finding the altitude interval corresponding to the level which is not assigned a base color, and inserting a transition color between the adjacent base colors corresponding to the altitude interval as the color of the level which is not assigned a base color; if the number of levels in the optimization range is greater than the number of base colors in the optimization range, finding the altitude interval corresponding to the level which is not assigned a base color, and inserting a transition color between the adjacent base colors corresponding to the altitude interval as the color of the level which is not assigned a base color.
[0054] It should be noted that in step S33 of the present application, a preset number of base colors are reserved for the non-optimization range, and the remaining base colors are all assigned to the optimization range. Meanwhile, more levels are set in the optimization range (the altitude range where the target ancient dam is located) with uniform intervals, and each level corresponds to a specific base color. Fewer levels are set for the altitude range below or above the optimization range, and the number of levels can be flexibly set according to the effect presented by the optimized DEM and the size of the altitude range, and non-uniform intervals can be set, so that the topography below and above the target ancient dam presents a monotonous color change. For the optimization range and the non-optimization range, if the number of levels is not enough (the number of levels exceeds the number of base colors), a transition color can be inserted between adjacent base colors, so that the target ancient dam corresponding to the optimized altitude range presents rich color transitions.
[0055] In addition, in order to highlight the target ancient dam, the upper limit of the altitude (H) of the target ancient dam should be set as a warm color tone, such as orange-red, and the lower limit of the altitude (L) should be set as a cold color tone, such as cyan-green. The altitude range where the target ancient dam is located can be appropriately expanded to the low and high sides, so that the color after the levels presents a sudden change effect.
[0056] In this embodiment, the altitude range below the optimization range 31-38m is set as one level corresponding to blue, the optimization range 38-45m is set as eight levels with one meter interval corresponding to cyan-green-yellow-orange-red-magenta-purple-deep purple, and the altitude range above the optimization range 45m-92m is set as two levels with 25 meter interval corresponding to brown and brown. Finally, a new custom color scale is created according to the above steps as shown in Figure 5 .
[0057] S34. Generate a custom color level using the base colors after setting the gradation, and use the custom color level to optimize the initial DEM shading image to obtain a preliminary optimized DEM shading image.
[0058] S35. Determine whether the preliminary optimized DEM shading map needs adjustment: If the number of basic colors after the corresponding grading in the optimization range reaches the preset quantity standard threshold, then the preliminary optimized DEM shading map is used as the final optimized DEM shading map; otherwise, increase the number of gradings in the optimization range and decrease the number of gradings in the non-optimized range until the number of basic colors after the corresponding grading in the optimization range reaches the preset quantity standard threshold.
[0059] It should be noted that in step S35, the quantity standard threshold can be determined based on experience or statistical data. Setting this threshold requires ensuring that the target ancient dam stands out prominently in the optimized DEM rendering image. If the number of base colors corresponding to the graded levels within the optimized range does not reach the preset quantity standard threshold, it indicates that the altitude range where the target ancient dam is located does not exhibit strong color contrast. The number of grades and corresponding colors needs to be adjusted, i.e., further increasing the number of grades within the optimized range and decreasing the number of grades for altitude ranges below and above the optimized range, so that the target ancient dam is distinguished from the landforms below and above its altitude with rich and contrasting colors. The entire process requires multiple adjustments to ultimately achieve the desired effect.
[0060] In this embodiment, it can be seen that in the optimized DEM shaded rendering, as shown... Figure 6 As shown, the ancient dam exhibits a rich transition from orange to red to magenta, and is clearly distinguished from the landforms below and above its elevation.
[0061] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. A method of color scale optimization of a DEM hillshade map to highlight ancient dams, characterized in that, The method comprises the following steps: S1. generating an initial DEM hillshade map using a preset color scale of geographic information system software, and determining an elevation range of the total terrain; S2. superimposing the initial DEM hillshade map and the obtained digital contour map to obtain a superimposed DEM hillshade map, and determining an elevation range of the target ancient dam in the superimposed DEM hillshade map according to the target ancient dam position obtained in advance and the elevation data in the digital contour map; S3. performing color scale optimization processing on the initial DEM hillshade map using the elevation range of the total terrain and the elevation range of the target ancient dam to obtain a final optimized DEM hillshade map; The specific process of the color scale optimization processing is as follows: S31. readjusting the elevation range of the target ancient dam as an optimization range, and taking the remaining range of the total terrain with an elevation lower than or higher than the optimization range as a non-optimization range; S32. selecting a preset number of different colors as base colors in the order of the elevation of the total terrain from low to high; S33. uniformly setting corresponding levels in the optimization range at a preset elevation interval, setting corresponding levels in the non-optimization range, and the number of levels in the non-optimization range is less than that in the optimization range; after the levels are divided, a unique base color is allocated to each level of the non-optimization range and the optimization range, the number of base colors in the optimization range is greater than that in the non-optimization range, if the number of levels in the non-optimization range is greater than the number of base colors in the non-optimization range, the elevation interval corresponding to the level not allocated with a base color is found, and a transition color is additionally inserted between adjacent base colors in the elevation interval as the color of the level not allocated with a base color; if the number of levels in the optimization range is greater than the number of base colors in the optimization range, the elevation interval corresponding to the level not allocated with a base color is found, and a transition color is additionally inserted between adjacent base colors in the elevation interval as the color of the level not allocated with a base color; S34. generating a custom color scale using the base colors after the levels are set, and performing hillshade optimization on the initial DEM hillshade map using the custom color scale to obtain a preliminary optimized DEM hillshade map; S35. determining whether the preliminary optimized DEM hillshade map needs to be adjusted: if the number of base colors corresponding to the levels after the adjustment in the optimization range reaches a preset number standard threshold, the preliminary optimized DEM hillshade map is taken as the final optimized DEM hillshade map, otherwise, the number of levels in the optimization range is increased and the number of levels in the non-optimization range is reduced until the number of base colors corresponding to the levels after the adjustment in the optimization range reaches the preset number standard threshold; In step S1, the elevation range of the total terrain is 31.7-91.2 m; In step S2, the elevation range of the target ancient dam is 40-43 m; In step S31, the optimization range is 38-45 m; In step S33, 1 level is set in the non-optimization range with an elevation lower than the optimization range, and 2 levels are set in the non-optimization range with an elevation higher than the optimization range.
2. A method of color scale optimization of a DEM hillshade map to highlight ancient dams as claimed in claim 1, wherein, In step S1, the geographic information system software adopts Global Mapper software or Arcgis software.
3. The method of color scale optimization for DEM hill shading maps to highlight ancient dams of claim 1, wherein, In step S32, in the order of low to high altitudes, the selected base colors are respectively blue, cyan, green, yellow, orange, red, magenta, purple, deep purple, brown, and tan.
4. A method of color scale optimization of a DEM hillshade map to highlight ancient dams as recited in claim 3, wherein, In step S33, in the order of low to high altitudes, the corresponding base colors in the optimization range are respectively cyan, green, yellow, orange, red, magenta, purple, and deep purple.
5. The method of color scale optimization for DEM hillshade maps to highlight ancient dams of claim 1, wherein, In step S33, the preset altitude interval size is 1 m.