A color mapping method for ocean data visualization based on Unreal Engine

By dividing data intervals and creating multiple linear color curves in Unreal Engine, the shortcomings of linear color mapping methods in uneven data and specific area display are solved, and the diversity and accuracy of color mapping of marine data visualization is improved, and the scientific research is met need.

CN118840464BActive Publication Date: 2024-12-27青岛国实科技集团有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411313290.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-27
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

The linear color mapping method in the prior art cannot effectively reflect data accuracy when processing uneven data or paying attention to data in specific areas, resulting in a decrease in the diversity of visual resolution space and the inability to highlight the display of data characteristics.

Method used

Using the Unreal Engine-based marine data visual color mapping method, we can evenly divide data intervals, set the threshold of the number of data points, adjust the interval width, create multiple linear color curves, and perform segmented mapping and normalization in Unreal Engine. The color axis has a smooth gradient effect.

Benefits of technology

It improves the diversity and accuracy of color mapping in marine data visualization, increases image contrast, can better display local regional data differences, meet scientific research needs, and allows users to customize mapping accuracy and range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118840464B_ABST
    Figure CN118840464B_ABST
Patent Text Reader

Abstract

The present invention designs a method for color mapping of ocean data visualization based on Unreal Engine, which includes the following steps: S1: constructing an ocean environment data set; S2: evenly dividing the data set into n continuous intervals; S3: setting a minimum threshold and a maximum threshold; S4: re-dividing the intervals with a number of data points greater than the maximum threshold based on a predetermined interval width; merging the intervals with a number of data points less than the minimum threshold into adjacent intervals; S5: repeating step S4 until the number of data points in each interval is between the minimum threshold and the maximum threshold, and obtaining an updated interval array; S6: creating multiple different linear color curves, and mapping them in sections to the updated interval array. The present invention can perform custom color mapping for areas with small differences in ocean environment data, improve the diversity and accuracy of color mapping in ocean data visualization, increase image contrast, and better meet scientific research needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of marine science and technology, and in particular relates to an ocean data visualization color mapping method based on Unreal Engine. Background Art

[0002] Ocean data visualization is an important part of the digitization of ocean information. Through visualization technology, complex and large-scale ocean environmental data can be presented in a dynamic and intuitive form to observe the changes and trends in various regions of the ocean. At the same time, through the visualization of real-time or historical data, the health of the ocean can be monitored, including marine pollution, changes in plankton, etc. This information is crucial for taking marine protection measures and managing marine resources.

[0003] In data visualization, color maps are often used to correspond data within a certain range to colors within a certain range. Different colors are used to represent differences in the size, density, or other numerical attributes of the data. Changes in color are used to map changes in data, helping observers to more easily identify and distinguish different subsets or patterns in marine environmental data sets.

[0004] Reasonable color mapping can enhance the attractiveness and expressiveness of visualization, making it easier for observers to understand the meaning of data and make effective analysis and decisions. However, the color mapping method in the prior art is usually linear mapping. When the data is unevenly distributed or the observer needs to focus on the data in a specific area, linear mapping cannot reflect the data accuracy, reduces the spatial diversity of visual resolution, and makes it impossible to highlight the data features through visualization effects. Summary of the invention

[0005] The purpose of the present invention is to solve one of the above technical problems and provide an ocean data visualization color mapping method based on Unreal Engine.

[0006] To achieve the above object, the technical solution adopted by the present invention is:

[0007] A method for visualizing color mapping of ocean data based on Unreal Engine, characterized by comprising the following steps:

[0008] S1: Obtain marine environment data and construct a marine environment dataset containing m data points;

[0009] S2: Divide the data in the marine environment dataset evenly into n continuous intervals to obtain the initial interval array ;

[0010] S3: Set the minimum and maximum thresholds for the number of data points in the interval;

[0011] S4: Count the number of data points in each interval after division; based on the predetermined interval width w The interval where the number of data points is greater than the maximum threshold is evenly divided into k subintervals; merge the intervals whose number of data points is less than the minimum threshold into the adjacent interval with the smallest data volume;

[0012] S5: Repeat step S4 until the number of data points in each interval is between the minimum threshold and the maximum threshold, and obtain an updated interval array , where n+L is the number of intervals finally generated;

[0013] S6: Create n+L different linear color curves, and map the n+L different linear color curves to the updated interval array in segments Each interval in .

[0014] In some embodiments of the present invention, the marine environment data includes the latitude and longitude information of each data point and the data point value.

[0015] In some embodiments of the present invention, step S1 further includes the following steps:

[0016] Set the predetermined latitude and longitude range;

[0017] The acquired marine environment data is sliced ​​based on a predetermined longitude and latitude range, and data points within the predetermined longitude and latitude range are selected to construct a marine environment data set.

[0018] In some embodiments of the present invention, the initial interval array The expression for each interval in is:

[0019] ;

[0020] in, ;

[0021] The expression of each of the k subintervals is:

[0022] ;

[0023] in, , For interval The jth subinterval in .

[0024] In some embodiments of the present invention, the predetermined interval width w is between the minimum and maximum thresholds, and .

[0025] In some embodiments of the present invention, the method for creating a linear color curve is:

[0026] Save the linear color in a table with a data structure of [index, R channel, G channel, B channel, A channel], and import the table into the Unreal Engine to generate the corresponding linear color curve. Alternatively, directly create and set the linear color curve in the Unreal Engine.

[0027] In some embodiments of the present invention, the method for performing segment mapping specifically includes the following steps:

[0028] Create a first key-value pair array variable of floating-point data to linear color curve in Unreal Engine, for storing multiple sets of different linear color curves;

[0029] Updated interval array A plurality of corresponding data intervals are set in the Unreal Engine, and each data interval is mapped to a plurality of different linear color curves stored in the first key-value pair array variable; during the corresponding mapping process, the data points in each data interval are evenly distributed within the value range of the corresponding linear color curve.

[0030] In some embodiments of the present invention, the uniform distribution method specifically includes the following steps:

[0031] Updated interval array After setting multiple corresponding data intervals in the Unreal Engine, each data interval is normalized, and the formula is as follows:

[0032] ;

[0033] in, for The original value in the interval, is the normalized value, is the smallest value in the interval, is the largest value in the interval;

[0034] Create a second key-value array variable of floating point data to color values ​​in Unreal Engine;

[0035] After normalizing the data segment interval, call the GetLinearColorValue node in the Unreal Engine to get the normalized value As input key The value parameter reads the corresponding linear color value from the linear color curve corresponding to the first key-value pair array variable in this interval , and its corresponding original value With linear color values Store them respectively into the second key-value pair array variable;

[0036] In Unreal Engine, create a structure for storing color index points and color values, declare an array object of the structure object, and initialize the array object using the second key-value pair array variable;

[0037] Define a function to create a color transition effect from the color index start point to the color index end point through linear interpolation based on the color index point and the corresponding color value. Use this function to generate a color axis with a smooth gradient effect based on the color index point and color value in the array object to obtain the mapped linear color curve.

[0038] Some embodiments of the present invention further provide an ocean data visualization color mapping system based on Unreal Engine, characterized in that it includes:

[0039] at least one processor;

[0040] at least one memory for storing at least one program;

[0041] When at least one program is executed by at least one processor, the at least one processor implements the above-mentioned ocean data visualization color mapping method based on Unreal Engine.

[0042] Some embodiments of the present invention further provide a storage medium storing a program executable by a processor, wherein the program executable by the processor is used to implement the above-mentioned ocean data visualization color mapping method based on Unreal Engine when executed by the processor.

[0043] The beneficial effects of the present invention are:

[0044] 1. The color mapping method provided by the present invention solves the problem that the linear color mapping visualization effect in the prior art is single, or when the data is concentrated in a certain range, the corresponding color values ​​will also be concentrated in a smaller range, which loses the spatial diversity of visual resolution and cannot reflect the data differences in local areas. It can perform custom color mapping for areas with small differences in marine environmental data, improve the diversity and accuracy of color mapping in marine data visualization, increase image contrast, and better meet scientific research needs;

[0045] 2. The color mapping method provided by the present invention is not limited by the numerical index range and the color index range, and can be customized by the user to generate a color axis with higher mapping accuracy and wider mapping range to improve the display effect of data visualization;

[0046] 3. The color mapping method provided by the present invention can be applied to the visualization of data-enriched areas and local data. By customizing the initial interval number, maximum threshold, minimum threshold and other parameters and the corresponding linear color curve to adjust the range and method of color mapping, the user's interpretation of data can be changed to highlight specific data trends or patterns. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 A flowchart of the color mapping method for ocean data visualization based on Unreal Engine;

[0049] Figure 2 It is a flowchart of the data interval partitioning process;

[0050] Figure 3 This is a schematic diagram of the linear color curve in Unreal Engine;

[0051] Figure 4 A schematic diagram of segmented mapping between data intervals and linear color value curves in an embodiment provided by the present invention;

[0052] Figure 5 for Figure 4 The embodiment shown is a schematic diagram of the merging process after linear color curve mapping. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0054] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0055] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0056] The technical solution of the present invention is described in detail below in conjunction with specific embodiments and the accompanying drawings.

[0057] As attached Figure 1 -Attached Figure 5 As shown, in an exemplary embodiment of an ocean data visualization color mapping method based on Unreal Engine of the present invention, the color mapping method includes the following steps:

[0058] S1: Obtain ocean environment data such as temperature, salinity, flow field data, etc., which at least includes the latitude and longitude information and data point value corresponding to each data point; construct an ocean environment dataset A containing m data points.

[0059] In some embodiments of the present invention, when attention needs to be paid to the data distribution status within a certain area, step S1 further includes the following steps:

[0060] Set the predetermined latitude and longitude range.

[0061] In the data acquisition stage, the acquired marine environment data is sliced ​​based on the predetermined longitude and latitude range to obtain a data value range within the predetermined longitude and latitude range, and a marine environment data set is constructed using the data points within the predetermined longitude and latitude range.

[0062] S2: Set the number of initial intervals n, divide the data in the marine environment dataset A evenly into n continuous intervals, obtain the initial interval array and the index number corresponding to each interval in the array After generating the initial interval array, the data distribution can be presented by counting the number of data points in each interval. The number of initial intervals n can be customized according to the range and distribution characteristics of the data.

[0063] Initial interval array Each interval in The expression is:

[0064] ;

[0065] in, .

[0066] S3: Set the minimum threshold for the number of data points in the interval and the maximum threshold .

[0067] S4: Count the number of data points in each interval after division.

[0068] Traverse the initial interval array For each interval in which the number of data points is greater than the maximum threshold, based on the predetermined interval width w Divide evenly into k sub-intervals. The predetermined interval width w is between the minimum threshold and the maximum threshold, and .

[0069] Number of subintervals k The expression is:

[0070] .

[0071] in, Represents the number of elements in interval i.

[0072] Each of the k subintervals The expression is:

[0073] ;

[0074] in, , For interval The jth subinterval in .

[0075] For intervals where the number of data points is less than the minimum threshold, merge them into the adjacent interval with the smallest amount of data. , and re-execute step S4.

[0076] S5: Repeat step S4 until the number of data points in each interval is between the minimum threshold and the maximum threshold, and obtain the final interval range and interval array, that is, obtain the updated interval array , where n+L is the number of intervals finally generated, and L is the number of intervals increased compared to the initial interval array:

[0077] L .

[0078] S6: Create a linear color curve database in the Unreal Engine, and create at least n+L different linear color curves in the database. The created linear color curves are as shown in the attached figure. Figure 3 As shown, in the Unreal Engine, the corresponding color value is displayed above each linear color curve, and the corresponding index value is displayed below. It should be noted that different linear color curves may contain different color values ​​or have different arrangement orders of color values.

[0079] Based on the updated interval array Define the data mapping range, select n+L linear color curves from the database to combine, and update the interval array The intervals in the dataset are segmented and mapped to highlight the accuracy of the area in the dataset and the data distribution in the area of ​​interest.

[0080] It should be noted that, in order to reflect the difference in local area data, the colors contained in different linear color curves in the linear color curve database are not repeated.

[0081] In some embodiments of the present invention, the method for creating a linear color curve is:

[0082] The linear color is saved in a table with a data structure of [index, R channel, G channel, B channel, A channel], and the table is imported into the Unreal Engine to generate the corresponding linear color curve, or the linear color curve is directly created and set in the Unreal Engine. To facilitate post-processing and processing in the Unreal Engine, in this embodiment, the range of each curve index value is limited to between 0 and 1, such as Figure 3 shown.

[0083] In some embodiments of the present invention, the method for performing segment mapping specifically includes the following steps:

[0084] Create the first key-value array variable of floating-point data to linear color curve in Unreal Engine, whose data type is TMap<int,CurveLinearColor> , used to store multiple sets of different linear color curves.

[0085] As attached Figure 4 As shown, based on the updated interval array A plurality of corresponding data intervals are set in the Unreal Engine, and each data interval is mapped to a plurality of different linear color curves stored in the first key-value pair array variable. During the corresponding mapping process, the data points in each data interval are evenly distributed within the value range of the corresponding linear color curve.

[0086] Since the index value range of each linear color curve in the Unreal Engine is limited to between 0 and 1, in order to facilitate the correspondence between each data interval and the index value of each linear color curve in the blueprint for unified color mapping, each interval needs to be normalized separately. In some embodiments of the present invention, the uniform distribution method specifically includes the following steps.

[0087] Updated interval array After setting multiple corresponding data intervals in the Unreal Engine, each data interval is normalized, and the formula is as follows:

[0088] ;

[0089] in, for The original value in the interval, It is a normalized value, which is used to map the index value of the linear color curve in the segmented mapping process. is the smallest value in the interval, is the largest value in the interval.

[0090] Create a second key-value array variable of floating-point data to color value in Unreal Engine, whose data type is TMap<float, FColor> , used to store the final linear color curve.

[0091] After normalizing the data segment interval, call the GetLinearColorValue node in the Unreal Engine to get the normalized value As input key The value parameter reads the corresponding linear color value from the linear color curve corresponding to the first key-value pair array variable in this interval , and its corresponding original value With linear color values Store them respectively into the second key-value pair array variable.

[0092] Create a structure for storing color index points and color values ​​in the Unreal Engine, declare an array object of the structure object, and initialize the object using the second key-value pair array variable.

[0093] A function is defined in Unreal Engine to create a color transition effect from the color index start point to the color index end point through linear interpolation based on the color index point and the corresponding color value. The color index point and the corresponding color value in the array object are passed as parameters of the function to generate a color axis with a smooth gradient effect, and a mapped linear color curve is obtained. The mapped linear color curve is applied to the data visualization process, and finally the color mapping of high-precision data is realized.

[0094] The specific process of data segment mapping is described below in conjunction with a specific embodiment:

[0095] As attached Figure 4 As shown, in this embodiment, the marine environment data set is divided into four data intervals, namely A(1), A(2), A(3), and A(4). Four different linear color curves are created in the Unreal Engine, namely linear color curve 1, linear color curve 2, linear color curve 3, and linear color curve 4. The colors contained in the four linear color curves are shown in the attached figure. Figure 5 As shown, four color curves are mapped one-to-one with four data intervals, that is, linear color curve 1 corresponds to data interval A(1), linear color curve 2 corresponds to data interval A(2), linear color curve 3 corresponds to data interval A(3), and linear color curve 4 corresponds to data interval A(4). During the mapping process, the data points in each data interval are evenly distributed within the value range of the corresponding linear color curve. After segmented mapping, the linear color curves are combined into one linear color curve, as shown in the attached figure. Figure 5 As shown, a linear color curve containing the data mapping values ​​within the interval is finally obtained.

[0096] Some embodiments of the present invention further provide an ocean data visualization color mapping system based on Unreal Engine, characterized in that it includes:

[0097] at least one processor;

[0098] at least one memory for storing at least one program;

[0099] When at least one program is executed by at least one processor, the at least one processor implements the above-mentioned ocean data visualization color mapping method based on Unreal Engine.

[0100] Some embodiments of the present invention further provide a storage medium storing a program executable by a processor, wherein the program executable by the processor is used to implement the above-mentioned ocean data visualization color mapping method based on Unreal Engine when executed by the processor.

[0101] Finally, 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.

[0102] The above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. A method for visualizing color mapping of ocean data based on Unreal Engine, characterized in that: The following steps are involved: S1: Obtain marine environment data and construct a marine environment dataset containing m data points; S2: Evenly divide the data in the marine environment dataset into n continuous intervals to obtain an initial interval array ; S3: Set the minimum and maximum thresholds for the number of data points in the interval; S4: count the number of data points in each interval after division; Based on the predetermined interval width w The interval where the number of data points is greater than the maximum threshold is evenly divided into k subintervals; merge the intervals whose number of data points is less than the minimum threshold into the adjacent interval with the smallest data volume; S5: Repeat step S4 until the number of data points in each interval is between the minimum threshold and the maximum threshold, and obtain an updated interval array , where n+L is the number of intervals finally generated; S6: Create n+L different linear color curves, and segmentally map the n+L different linear color curves to the updated interval array Each interval in ; The method for performing segment mapping specifically includes the following steps: Create a first key-value pair array variable of floating-point data to linear color curve in Unreal Engine, for storing multiple sets of different linear color curves; Based on the updated interval array, a plurality of corresponding data intervals are set in the Unreal Engine, and each data interval is mapped to a plurality of different sets of linear color curves stored in the first key-value pair array variable; during the mapping process, data points in each data interval are evenly distributed within the value range of the corresponding linear color curve; The uniform distribution method specifically includes the following steps: An array of intervals based on the update After setting multiple corresponding data intervals in the Unreal Engine, each data interval is normalized, and the formula is as follows: ; in, for The original value in the interval, is the normalized value, is the smallest value in the interval, is the largest value in the interval; Create a second key-value array variable of floating point data to color values ​​in Unreal Engine; After normalizing the data segment interval, call the GetLinearColorValue node in the Unreal Engine to get the normalized value As input key The value parameter reads the corresponding linear color value from the linear color curve corresponding to the interval in the first key-value pair array variable , and its corresponding original value With linear color values Store them respectively into the second key-value pair array variable; In Unreal Engine, create a structure for storing color index points and color values, declare an array object of the structure object, and initialize the array object using the second key-value pair array variable; Define a function to create a color transition effect from the color index start point to the color index end point through linear interpolation based on the color index point and the corresponding color value. Use this function to generate a color axis with a smooth gradient effect based on the color index point and color value in the array object to obtain the mapped linear color curve.

2. The method for visualizing color mapping of ocean data based on Unreal Engine according to claim 1, characterized in that: The marine environment data includes the latitude and longitude information of each data point and the data point value.

3. The method for visualizing ocean data based on Unreal Engine according to claim 2, characterized in that: Step S1 further includes the following steps: Set the predetermined latitude and longitude range; The acquired marine environment data is sliced ​​based on the predetermined longitude and latitude range, and data points within the predetermined longitude and latitude range are selected to construct a marine environment data set.

4. The method for visualizing ocean data based on Unreal Engine according to claim 1, characterized in that: The initial interval array The expression for each interval in is: ; in, , is the initial interval array Middle i intervals; In step S4, based on the predetermined interval width w The initial interval array The intervals where the number of data points is greater than the maximum threshold are evenly divided into k subintervals, where the number of subintervals k The expression is: ; in, Represents the number of elements in interval i; The expression of each subinterval in the k subintervals is: ; in, , For interval The jth subinterval in .

5. The method for visualizing color mapping of ocean data based on Unreal Engine according to claim 1 or 4, characterized in that: The predetermined interval width w is between the minimum threshold and the maximum threshold, and .

6. The method for visualizing color mapping of ocean data based on Unreal Engine according to claim 1, characterized in that: To create a linear color curve: The linear color is saved in a table in a predetermined data structure, and the table is imported into the Unreal Engine to generate a corresponding linear color curve, or the linear color curve is directly created and set in the Unreal Engine; the predetermined data structure includes an index, an R channel, a G channel, a B channel, and an A channel.

7. An ocean data visualization color mapping system based on Unreal Engine, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the ocean data visualization color mapping method based on the Unreal Engine as described in any one of claims 1-6.

8. A storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the ocean data visualization color mapping method based on Unreal Engine as described in any one of claims 1 to 6 when executed by the processor.