Automatic color mapping generation method and system for two-dimensional scalar field
By segmenting the value range of the two-dimensional scalar field and optimizing the color mapping, the problem of being unable to automatically generate a suitable color map in the existing technology is solved, and effective color map generation and data structure revelation in various visualization tasks are achieved.
Patent Information
- Application Number
- CN202410747363.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-08
AI Technical Summary
Existing techniques cannot automatically generate a suitable color map for a given two-dimensional scalar field, and it is difficult for existing methods to effectively support color map modifications in various visualization tasks and data distributions.
By splitting the value range of scalar data into meaningful intervals and associating each interval with a divergent color map, fitting the data with a Gaussian mixture model, selecting control point locations and colors, and optimizing the color map using a simulated annealing algorithm, Ensure high contrast and significant color name distance.
Automatically generated color maps suitable for two-dimensional scalar fields are implemented, capable of revealing data structures, supporting easy-to-use modifications, and satisfying discriminative capabilities and perceptual constraints.
Smart Images

Figure CN118747778A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of automatic creation of data-driven color mapping, and in particular relates to an automatic color mapping generation method and system for a two-dimensional scalar field. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Visualization of two-dimensional scalar fields is of vital importance in the field of scientific and information visualization. This process usually involves using a color map to associate each value in a two-dimensional scalar field with a specific color. The main tasks of visual analysis of scalar fields include accurately interpreting data values, identifying regions based on their value ranges, and revealing structures hidden in the data. The success of these tasks depends heavily on the choice of color map. However, manually finding the most appropriate color map for a given visualization is a complex and time-consuming process, even for experts in the field.
[0004] To simplify the color mapping process, commonly used data analysis tools provide some predefined color mappings, such as Rainbow and Viridis, for users to choose from. In addition to these color mappings, there are tools such as ColorCrafter proposed by Smart et al. (S. Smart, K. Wu, and DASzafir. Color crafting: Automating the construction of designer quality color ramps. IEEE Transactions on Visualization and Computer Graphics, 26(1): 1215–1225, Jan 2020.) that can create and optimize color mappings based on analysis tasks or aesthetics. In order to integrate specific application semantics, Nardini et al. (P. Nardini, M. Chen, F. Samsel, R. Bujack, M. and G.Scheuermann.The making of continuous colormaps.IEEE transactions on visualization and computer graphics, 27(6):3048–3063, 2019.) The CCC-tool tool proposed by allows users to interactively create and edit a color map that can be used for various datasets with similar characteristics. However, the creation of such color maps usually ignores the specific data of the visualization, resulting in color maps that may not be suitable for diverse application domains, data features, and tasks. To address this issue, one approach is to use the ColorMoves tool proposed by Samsel et al. (F.Samsel, S.Klaassen, and DHRogers.Colormoves: Real-time inter-active colormap construction for scientific visualization.IEEE Computer Graphics and Applications, 38(1):20–29, Jan 2018.) to manually adjust the selected color map to match the characteristics of a specific dataset, such as specific data values. Alternatively, the adjustment process can also be automated based on data attributes, such as histograms or spatial variations. Despite these efforts, no existing techniques can automatically generate color maps for a given dataset or data series that are effective across a variety of visualization tasks and distributions.
[0005] In the field of data-aware color mapping, there are several color mappings to emphasize the characteristics of continuous data. At the same time, Braun et al. (D. Braun, K. Ebell, V. Schemann, L. Pelchmann, S. Crewell, R. Borgo, and T. von Landesberger. Color coding of large value ranges applied to meteorological data. In 2022 IEEE Visualization and Visual Analytics (VIS), pp. 125–129, Oct 2022.) proposed a special nested color mapping to represent data spanning a large value range, using the hue of the color to represent the exponent and the sequential brightness gradient to represent the mantissa.
[0006] C.Ware et al. (C.Ware, TL Turton, R.Bujack, F.Samsel, P.Shrivastava, and D.H.Rogers.Measuring and modeling the feature detection threshold functionsof colormaps.IEEE Transactions on Visualization and Computer Graphics, 25(9):2777–2790, Sep.2019.) proposed an improved version of CIELAB, adjusting the a in the CIELAB color distance calculation formula * and b * The weight of the term evaluates the effectiveness of the color map for feature detection based on contrast sensitivity (the contrast required to make the pattern visible at different spatial frequencies).
[0007] Schulze-Wollgast et al. (P. Schulze-Wollgast, C. Tominski, and H. Schumann. Enhancing visual exploration by appropriate color coding. In International Conference in Central Europe on Computer Graphics and Visualization, 2005.) use automatic or data-driven color mapping conversion methods to adjust existing colors to better match the potential meaning of the data, and these methods use statistical metadata extracted from the data set to modify the color mapping accordingly. In addition, Eisemann et al. (M. Eisemann, G. Albuquerque, and M. Magnor. Data Driven Color Mapping. In S. Miksch and G. Santucci, eds., EuroVA 2011: International Workshop on Visual Analytics. The Eurographics Association, 2011.) use data-driven color mapping transformation technology with adjustable interpolation schemes, which allows users to switch focus between enhancing the ability to distinguish data points and highlighting outliers.
[0008] Zeng et al. (Q. Zeng, Y. Zhao, Y. Wang, J. Zhang, Y. Cao, C. Tu, I. Viola, and Y. Wang. Data-driven colormap adjustment for exploring spatial variations in scalar fields. IEEE Transactions on Visualization and Computer Graphics, 28(12): 4902–4917, Dec 2022.) proposed an optimization method to highlight the features of two-dimensional continuous scalar data, which can flexibly support interactive features by formulating color map adjustment as an objective function. Elmqvist et al. (N. Elmqvist, P. Dragicevic, and J.-D. Fekete. Color lens: Adaptive color scale optimization for visual exploration. IEEE Transactions on Visualization and Computer Graphics, 17(6): 795–807, June 2011.) proposed ColorLens to visualize local color maps of continuous data with a large value range using a user-specified value range within the lens. Zhou et al. (L. Zhou, M. Rivinius, CR Johnson, and D. Weiskopf. Photographic high dynamic-range scalar visualization. IEEE Transactions on Visualization and Computer Graphics, 26(6): 2156–2167, June 2020.) proposed a perceptually driven method that combines color mapping data with perceptually driven value range conversion and flickering to highlight high values in high dynamic scalar data.
[0009] However, none of these methods can generate a good color map for a given 2D scalar field on the fly, automatically adapt to the characteristics of continuous scalar data and support easy-to-use modifications.
[0010] In summary, there is currently no method that can automatically generate color maps for a given dataset or data series that are effective across a variety of visualization tasks and distributions while supporting easy-to-use modifications. Summary of the invention
[0011] In order to solve the above problems, the present invention proposes an automatic color mapping generation method and system for two-dimensional scalar fields. The present invention divides the value range of scalar data into meaningful intervals and associates each interval with a divergent color mapping to ensure high contrast while also maintaining a significant name distance between the original colors of these color mappings, thereby automatically generating a color mapping that is effective in various visualization tasks and distributions for a given data set or data series.
[0012] According to some embodiments, the present invention adopts the following technical solutions:
[0013] An automatic color map generation method for a two-dimensional scalar field comprises the following steps:
[0014] Obtain scalar field data, fit and partition the scalar field data, and select the number and position of control points in each interval;
[0015] The color of each control point is preliminarily set, and the preliminary setting scheme is evaluated. According to the evaluation results, hard constraints are constructed. Under the hard constraints, the preliminary setting scheme is optimized to obtain the final color mapping generation scheme.
[0016] As an optional implementation, the specific process of fitting and partitioning the scalar field data includes: using a Gaussian mixture model to fit the histogram of the scalar field and divide it into different intervals, corresponding the position of the control point to the average value of the Gaussian component; calculating the probability that the scalar value x enters the value range represented by the Gaussian component; and calculating the combined probability at the x position based on a mixture of k Gaussian components.
[0017] As a further step, the specific process of calculating the probability that the scalar value x enters the value range represented by the Gaussian component includes:
[0018]
[0019] Among them, μ is the mean value of the Gaussian component and σ is the standard deviation;
[0020] The specific process of calculating the combined probability at position x includes:
[0021]
[0022] where θ=(θ 1 , ...θ k )=((w 1 , μ 1 , σ 1 ),...,(w k , μ k , σ k )), is a parameter set containing k Gaussian components, g jis the probability that x is generated by a particular component j.
[0023] As an optional implementation, in each interval, the specific process of selecting the position of the control point includes:
[0024] The EM algorithm is used for iterative optimization to obtain the optimal solution for a set of control points, which is:
[0025]
[0026] Among them, x i is the i-th position of the histogram, h(x i ) is the position x i The density at , the solution goal is to maximize and h(x i )’s likelihood.
[0027] As an optional implementation, in each interval, the process of selecting the number of control points includes: using the minimum description length method to determine the number k of Gaussian components, the formula is as follows:
[0028]
[0029] Where L is the number of parameters, n is the size of the dataset, and τ is the weight between model fidelity and complexity.
[0030] As an optional implementation, the color of each control point is initially set to divide the hue range [0,360] into m-1 intervals, and sample the hue value from the color wheel in a counterclockwise direction to obtain m-1 colors, and set the chromaticity of each color to a fixed value to ensure obvious color distinction;
[0031] Introduce the gray color as the first color and merge it with the m-1 colors obtained previously to form a complete set.
[0032] As an optional implementation, during the evaluation of the preliminary setting scheme, evaluation is performed from the perspectives of contrast sensitivity, name distance, minimum noticeable difference constraint, and hue constraint, wherein the minimum noticeable difference constraint is that the minimum noticeable difference is greater than a set threshold, and the hue constraint is that the hues of adjacent colors must be in the clockwise direction on the color wheel.
[0033] As an optional implementation, the process of constructing the hard constraint condition includes: verifying whether the color difference distance between each color pair satisfies the minimum perceptible difference constraint, and if not, adjusting the colors in the current palette again;
[0034] Make sure the perturbed color still satisfies the hue constraint of its adjacent color on the color wheel, otherwise swap the two adjacent colors while maintaining their chroma and brightness.
[0035] As an optional implementation, the process of optimizing the preliminary setting scheme includes: using a simulated annealing algorithm to perform optimization and solution, randomly selecting one of m-1 colors, and then introducing a small random perturbation to its hue and chroma value, wherein the step size of the random perturbation follows a Gaussian distribution;
[0036] The perturbed hue and chroma values are truncated to the interval [0,360] and [0,100], respectively.
[0037] An automatic color map generation system for two-dimensional scalar fields, comprising:
[0038] A control point determination module is configured to obtain scalar field data, fit and partition the scalar field data, and select the number and position of control points in each interval;
[0039] The optimization and adjustment module is configured to preliminarily set the color of each control point and evaluate the preliminary setting plan. According to the evaluation result, hard constraints are constructed. Under the hard constraints, the preliminary setting plan is optimized to obtain the final color mapping generation plan.
[0040] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the steps in the above method are completed.
[0041] An electronic device comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the above method are completed.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] 1. The present invention can automatically generate a two-dimensional scalar field visualization with customized color mapping, which can reveal the hidden structure in the data set, allowing users to identify the structure in the visualization, accurately read the data values, and identify areas with specific value ranges;
[0044] 2. The present invention employs a customized simulated annealing optimization algorithm, in which the generated color mapping is nameable and satisfies the discrimination ability and perceptual constraints.
[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0047] Figure 1 is a flow chart of automatic distribution-based color mapping for a two-dimensional scalar field according to an embodiment;
[0048] Figure 2 is a flowchart of running the algorithm of the present invention on an example data set, wherein (a) starting from two-dimensional scalar field data, (b) determining the number and location of control points in the histogram in a data-centric manner, (c) obtaining the colors of the control points through an optimization process, and (d) finally creating a continuous color map through interpolation;
[0049] Figure 3 This is a comparison of the effects of different numbers of Gaussian components on the characteristics of medical datasets. (a) is a curve describing the relationship between the minimum description length (MDL) and the number of components; (b), (c), and (d) respectively describe the color mapping used for visualization. The color mapping is generated by fitting the control points of the histogram of the input dataset with the same grayscale combined with different numbers of Gaussian components;
[0050] Figure 4 Comparison of the results without (a) and with (b) hue constraints;
[0051] Figure 5 Initialize m colors and interpolate them into a color map. 0 The initial m-1 colors are uniformly sampled in counterclockwise order, alternating between brightness values 30 and 80. In addition, a color with the same hue as the last color but chroma zero is added as the first color to complete the setup. (b): The color map is created by linearly interpolating between adjacent control point colors in the CIELAB color space.
[0052] Figure 6 is a pseudo code of a simulated annealing algorithm customized by an embodiment. DETAILED DESCRIPTION
[0053] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0054] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0055] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. 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 when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0056] In the absence of conflict, the embodiments in this application and the features in the embodiments may be combined with each other.
[0057] Embodiment 1
[0058] An automatic color map generation method for a two-dimensional scalar field, comprising:
[0059] Obtain scalar field data, fit and partition the scalar field data, and select the number and position of control points in each interval;
[0060] The color of each control point is preliminarily set, and the preliminary setting scheme is evaluated. According to the evaluation results, hard constraints are constructed. Under the hard constraints, the preliminary setting scheme is optimized to obtain the final color mapping generation scheme.
[0061] In this embodiment, the specific process of fitting and partitioning the scalar field data includes: using a Gaussian mixture model to fit the histogram of the scalar field, and dividing it into different intervals, corresponding the position of the control point to the average value of the Gaussian component; calculating the probability that the scalar value x enters the value range represented by the Gaussian component; based on the mixture of k Gaussian components, calculating the combination probability at the x position.
[0062] In this embodiment, the color of each control point is initially set by dividing the hue range [0,360] into m-1 intervals, sampling the hue value from the color wheel in a counterclockwise direction, obtaining m-1 colors, and setting the chromaticity of each color to a fixed value to ensure obvious color distinction;
[0063] Introduce the gray color as the first color and merge it with the m-1 colors obtained previously to form a complete set.
[0064] In the process of evaluating the preliminary setting scheme, the contrast sensitivity, name distance, minimum perceptible difference constraint and hue constraint are evaluated. Among them, the minimum perceptible difference constraint is that the minimum perceptible difference is greater than the set threshold, and the hue constraint is to limit the hues of adjacent colors to be in the clockwise direction on the color wheel.
[0065] The process of constructing hard constraints includes: verifying whether the color difference distance between each color pair meets the minimum perceptible difference constraint, and if not, adjusting the colors in the current palette again;
[0066] Make sure the perturbed color still satisfies the hue constraint of its adjacent color on the color wheel, otherwise swap the two adjacent colors while maintaining their chroma and brightness.
[0067] The process of optimizing the preliminary setting scheme includes: using a simulated annealing algorithm to perform optimization and solving, randomly selecting one of m-1 colors, and then introducing a small random perturbation to its hue and chroma value, wherein the step size of the random perturbation follows a Gaussian distribution;
[0068] The perturbed hue and chroma values are truncated to the interval [0,360] and [0,100], respectively.
[0069] Embodiment 2
[0070] A distribution-based automatic color map generation method for two-dimensional scalar fields, such as Figure 1 As shown, the following steps are included:
[0071] (1) Analyze the scalar field data to select the number and location of control points for color mapping in a distribution-based manner;
[0072] (2) Setting the colors of the control points during the optimization process generates an interpolated continuous color map.
[0073] In step (1) of this embodiment, analyzing the scalar field data to select the number and positions of control points for color mapping in a distribution-based manner includes the following steps: Figure 2 As shown in (a) and (b), Figure 3 An example of applying the control point setting method to the CT image shown is shown:
[0074] (1-1) A Gaussian mixture model (GMM) is used to fit the histogram of the scalar field and divide it into different intervals. GMM can intuitively align the value range with the characteristics of the histogram. By corresponding the position of the control point to the average value of the Gaussian component, potential clusters in the entire value range can be identified and emphasized;
[0075] (1-2) Using the Expectation-Maximization (EM) algorithm for iterative optimization, we can obtain the optimal solution for a set of control points.
[0076] (1-3) The minimum description length (MDL) technique is used to determine the number of Gaussian components k, the model fidelity is the log-likelihood value of the data, and the model complexity is the number of free parameters.
[0077] In step (1-1) of this embodiment, using a Gaussian mixture model (GMM) to fit the histogram of the scalar field mainly includes the following steps:
[0078] (1-1-1) Correspond the position of the control point to the average value of the Gaussian component;
[0079] (1-1-2) Calculate the probability that the scalar value x falls into the value range represented by the Gaussian component;
[0080] (1-1-3) Based on the mixture of k Gaussian components, calculate the combined probability at position x.
[0081] In this embodiment, the probability in step (1-1-2) is defined by the following formula:
[0082]
[0083] Where μ is the mean value of the Gaussian component and σ is the standard deviation.
[0084] In this embodiment, the combined probability in step (1-1-3) is defined by the following formula:
[0085]
[0086] where θ=(θ 1 , ...θ k )=((w 1 , μ 1 , σ 1 ),...,(w k , μ k , σ k )), is a parameter set containing k Gaussian components, g i is the probability that x is generated by a particular component j.
[0087] In this embodiment, in step (1-2), the Expectation-Maximization (EM) algorithm is used for iterative optimization to obtain the formula for the optimal solution of a set of control points as follows:
[0088]
[0089] Among them, x i is the i-th position of the histogram, h(x i ) is the position x i The density at , the solution goal is to maximize and h(x i )’s likelihood.
[0090] In this embodiment, in step (1-3), the formula for determining the number k of Gaussian components using the minimum description length (MDL) technique is as follows:
[0091]
[0092] Where L is the number of parameters, i.e., k×3 (weight w, mean μ, covariance σ), n is the size of the dataset, and τ is the weight between model fidelity and complexity. This approach can balance model fit and complexity, resulting in the optimal number of control points that fit the underlying data distribution.
[0093] In this embodiment, in step (2), setting the color of the control point in the optimization process to generate an interpolated continuous color map mainly includes the following steps: Figure 2 (c) and (d) are schematic diagrams of the process:
[0094] (2-1) Given the colors of m control points in the color map, score them;
[0095] (2-2) After obtaining the preliminary plan, a customized simulated annealing algorithm is used to continuously adjust the preliminary plan based on the score to solve the constrained optimization problem.
[0096] In this embodiment, in step (2-1), given the colors of m control points in the color map, scoring them mainly includes the following steps:
[0097] (2-1-1) Contrast sensitivity: To ensure that the colors in the color mapping have sufficient discrimination ability, adjust the a in the CIELAB color distance calculation formula. * and b * The weight of the term can more accurately model the high-frequency features in the colored scalar field in a way that is consistent with human perception;
[0098] (2-1-2) Name distance: The nameability of color establishes the connection between human visual perception and symbolic cognition. The cognitive ability of color mapping is improved by introducing the name distance term.
[0099] (2-1-3) In order to ensure the discriminability of color mapping, the just noticeable difference (JND) constraint is defined;
[0100] (2-1-4) By limiting the adjacent colors c i and c j The hue must be in the clockwise direction on the color wheel, thus introducing a hue constraint. Figure 4 As shown in (b), the optimization result when applying the hue order constraint produces a Figure 4 (a) A clearer color mapping. More specifically, interpolation without hue constraints may produce misleading color mappings. For example, Figure 4 The two marked regions in the color map of (a) have similar colors, but the corresponding values are very different, leading to misleading interpretation. In contrast, the visualization generated by imposing a hue constraint does not have this problem.
[0101] Specifically, in step (2-1-1), the function of contrast sensitivity is defined as:
[0102]
[0103] Where ΔE is the color difference measure in the modified CIELAB space and is defined as:
[0104]
[0105] In this embodiment, the weight is ω a =ω b = 0.1. Δs is the normalized distance along the color map. The final contrast sensitivity for a given color map is defined as the sum of the contrast sensitivities between all color pairs:
[0106]
[0107] Where P is a palette consisting of the colors of m control points.
[0108] In this embodiment, in step (2-1-2), the name distance item is defined as:
[0109]
[0110] Where ND is a value between 0 and 1, T c is the name statistic corresponding to color c. The final name difference score of a color is defined as the minimum distance between all color pairs:
[0111]
[0112] Since the ranges of these two items are different, they need to be balanced to obtain good optimization results. The balance weight is λ, and the objective function is defined as:
[0113]
[0114] In this embodiment, in step (2-1-3), the just noticeable difference (JND) constraint is:
[0115]
[0116] Here, η is the JND threshold, which is set to 3.0 by default.
[0117] In this embodiment, in step (2-1-4), the hue constraint is:
[0118]
[0119] Among them, HO(c i,c j )=Hue(c j )-Hue(c i ), Hue(c i ) represents color c i The hue value.
[0120] In this embodiment, in step (2-2), a customized simulated annealing algorithm is used to solve the constrained optimization problem such as Figure 6 As shown in Figure 1, it mainly includes three components: initialization of P; selection of neighborhood solution Q from P; refinement of Q under hard constraints. Specifically, it mainly includes the following steps:
[0121] (2-2-1) Generate the initial solution P 0 ;
[0122] (2-2-2) Generate a new solution Q;
[0123] (2-2-3) Improve Q based on the minimum noticeable difference constraint and hue constraint so that it satisfies these two constraints.
[0124] In this embodiment, in step (2-2-1), an initial solution P is generated 0 The main steps include:
[0125] (2-2-1-1) Divide the hue range [0,360] into m-1 intervals, and sample the hue value from the color wheel in a counterclockwise direction to obtain m-1 colors. Set the chroma of each color to 100 to ensure obvious color distinction;
[0126] (2-2-1-2) Introduce gray color (chroma = 0) as the first color (background color), and merge it with the m-1 colors obtained previously to form a complete set. For this set of m colors, specify the brightness of the last color as 30, and set the brightness of the remaining colors to alternate between 30 and 80. Figure 5 As shown in (a), the last color and the first color have the same hue (red), but their different chromaticity values result in different color names.
[0127] In this embodiment, in step (2-2-2), generating a new solution Q mainly includes the following steps:
[0128] (2-2-2-1) Randomly select one of the m-1 colors above, and then introduce small random perturbations to its hue and chroma values. The step sizes of these perturbations follow a Gaussian distribution with standard deviations of 7.2 and 2.5, respectively. Throughout the process, keep the brightness of all colors unchanged, while explicitly ensuring that the first color (gray background color) is not selected for perturbation;
[0129] (2-2-2-2) To prevent the values from exceeding the range, the disturbed hue and chroma values are truncated to the intervals [0,360] and [0,100] respectively.
[0130] In this embodiment, in step (2-2-3), improving Q according to the minimum perceptible difference constraint and the hue constraint so as to satisfy these two constraints mainly includes the following steps:
[0131] (2-2-3-1) Verify whether the CIEDE2000 distance between each color pair satisfies the JND constraint. If it is violated, adjust the colors in the current palette again;
[0132] (2-2-3-2) Make sure the perturbed color still satisfies the hue constraint of its adjacent color on the color wheel. Otherwise, swap the two adjacent colors while maintaining their chroma and brightness.
[0133] The values of the various parameters in the above embodiments are only examples and are not limited to the above specific values.
[0134] Embodiment 3
[0135] An automatic color map generation system for two-dimensional scalar fields, comprising:
[0136] A control point determination module is configured to obtain scalar field data, fit and partition the scalar field data, and select the number and position of control points in each interval;
[0137] The optimization and adjustment module is configured to preliminarily set the color of each control point and evaluate the preliminary setting plan. According to the evaluation result, hard constraints are constructed. Under the hard constraints, the preliminary setting plan is optimized to obtain the final color mapping generation plan.
[0138] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0139] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0140] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principle of the present invention without creative labor shall be included in the protection scope of the present invention.
Claims
1. A method for automatically generating color maps for two-dimensional scalar fields, characterized in that: The following steps are involved: Obtain scalar field data, fit and partition the scalar field data, and select the number and position of control points in each interval; The color of each control point is preliminarily set, and the preliminary setting scheme is evaluated. According to the evaluation results, hard constraints are constructed. Under the hard constraints, the preliminary setting scheme is optimized to obtain the final color mapping generation scheme.
2. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: The specific process of fitting and partitioning the scalar field data includes: fitting the histogram of the scalar field using a Gaussian mixture model and dividing it into different intervals, corresponding the position of the control point to the average value of the Gaussian component; calculating the probability that the scalar value x enters the value range represented by the Gaussian component; and calculating the combined probability at the x position based on the mixture of k Gaussian components.
3. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: The specific process of calculating the probability of a scalar value x falling into the range of values represented by the Gaussian component includes: Among them, μ is the mean value of the Gaussian component and σ is the standard deviation; The specific process of calculating the combined probability at position x includes: where θ=(θ1,...θ k )=((w1,μ1,σ1),...,(w k ,μ k ,σ k )), is a parameter set containing k Gaussian components, g j is the probability that x is generated by a particular component j.
4. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: In each interval, the specific process of selecting the location of the control point includes: The EM algorithm is used for iterative optimization to obtain the optimal solution for a set of control points, which is: Among them, x i is the i-th position of the histogram, h(x i ) is the position x i The density at , the solution goal is to maximize and h(x i )’s likelihood.
5. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, wherein For each interval, the process of selecting the number of control points includes: using the minimum description length method to determine the number of Gaussian components k, the formula is as follows: Where L is the number of parameters, n is the size of the dataset, and τ is the weight between model fidelity and complexity.
6. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: Set the color of each control point to divide the hue range [0,360] into m-1 intervals, and sample the hue value from the color wheel in a counterclockwise direction to obtain m-1 colors, and set the chroma of each color to a fixed value to ensure obvious color distinction; Introduce the gray color as the first color and merge it with the m-1 colors obtained previously to form a complete set.
7. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: In the process of evaluating the preliminary setting scheme, the contrast sensitivity, name distance, minimum perceptible difference constraint and hue constraint are evaluated. Among them, the minimum perceptible difference constraint is that the minimum perceptible difference is greater than the set threshold, and the hue constraint is to limit the hues of adjacent colors to be in the clockwise direction on the color wheel.
8. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: The process of constructing hard constraints includes: verifying whether the color difference distance between each color pair meets the minimum perceptible difference constraint, and if not, adjusting the colors in the current palette again; Make sure the perturbed color still satisfies the hue constraint of its adjacent color on the color wheel, otherwise swap the two adjacent colors while maintaining their chroma and brightness.
9. The method for generating an automatic color map for a two-dimensional scalar field as claimed in claim 1, characterized in that: The process of optimizing the preliminary setting scheme includes: using a simulated annealing algorithm to perform optimization and solving, randomly selecting one of m-1 colors, and then introducing a small random perturbation to its hue and chroma value, wherein the step size of the random perturbation follows a Gaussian distribution; The perturbed hue and chroma values are truncated to the interval [0,360] and [0,100], respectively.
10. An automatic color mapping generation system for a two-dimensional scalar field, characterized in that: include: A control point determination module is configured to obtain scalar field data, fit and partition the scalar field data, and select the number and position of control points in each interval; The optimization and adjustment module is configured to preliminarily set the color of each control point and evaluate the preliminary setting plan. According to the evaluation result, hard constraints are constructed. Under the hard constraints, the preliminary setting plan is optimized to obtain the final color mapping generation plan.
Citation Information
Cited By
Color table extraction neural network model construction method and system and color table extraction method and system
CN120510231A
