Data visualization method and apparatus, and electronic device and computer-readable storage medium
By introducing opacity as a supplement to color mapping, and adjusting the upper and lower limits of the color band and the filtering range, the problems of poor display effect and low adjustment freedom of traditional color band diagrams are solved. This enables the highlighting of areas of interest and the filtering of areas of no interest, thereby improving the display effect and adjustment freedom.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHINING 3D TECH CO LTD
- Filing Date
- 2025-10-29
- Publication Date
- 2026-05-07
Smart Images

Figure CN2025130947_07052026_PF_FP_ABST
Abstract
Description
Data visualization methods, devices, electronic equipment, and computer-readable storage media
[0001] Cross-references to related applications
[0002] This disclosure claims priority to Chinese Patent Application No. 2024115232664, filed on October 29, 2024, entitled “Data Visualization Method, Apparatus, Electronic Device and Computer-Readable Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This disclosure relates to the field of image processing technology, and in particular to a data visualization method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0004] A color band chart is an image used to represent the correspondence between data values and colors, where different colors represent different data values. Color band charts enable data visualization, allowing users to easily understand data changes. For example, when comparing the data difference between a measured 3D face model and a reference model, the difference can be represented by color bands. That is, the obtained difference data can be used to color the 3D face model, resulting in a difference data color band chart. Clearly, different colors in the difference data color band chart correspond to different difference values, allowing users to intuitively see the magnitude of the data difference in different areas through the colors in the chart.
[0005] Traditional color band charts have the following problems: poor display of data values and limited freedom in adjusting the range of color band changes.
[0006] Application content
[0007] The purpose of this disclosure is to provide a data visualization method, apparatus, electronic device, and computer-readable storage medium to improve the display effect and the degree of freedom in adjusting the range of color band variations.
[0008] This disclosure provides a data visualization method, including:
[0009] Acquire visualization data and color band parameter data; wherein, the visualization data includes the base image and the measurement values at multiple locations, and the color band parameter data includes the upper limit value of the color band, the lower limit value of the color band, and the filtering interval;
[0010] Based on the visualization data and color band parameter data, the color information and opacity information corresponding to each position are determined; among them, the opacity corresponding to the measured value at each position increases as the distance from the filter interval increases;
[0011] The base image is colored based on the color and opacity information corresponding to each position to obtain the target visualization image.
[0012] Optionally, based on the visualization data and color band parameter data, the color information and opacity information corresponding to each position are determined, including:
[0013] Based on the color stripe parameter data, determine the color mapping function and opacity function;
[0014] Based on the measured values at each location and the color mapping function, the color information corresponding to each location is determined, and based on the measured values at each location and the opacity function, the opacity information corresponding to each location is determined.
[0015] Optionally, based on the color band parameter data, the color mapping function and opacity function are determined, including:
[0016] Based on the preset color sequence, the color band range consisting of the upper limit value and the lower limit value of the color band is divided into multiple sub-ranges, and the upper limit color and lower limit color of each sub-range are determined.
[0017] A color mapping function is generated based on the upper and lower limits of the colors of each sub-interval, the filtering interval, and the preset mapping rules. The mapping rules include that the color corresponding to the first measurement value belonging to the filtering interval is gray, and the color corresponding to the second measurement value not belonging to the filtering interval is obtained by interpolation of the upper and lower limits of the colors of the sub-interval.
[0018] Optionally, the color mapping functions corresponding to sub-intervals that do not belong to the filtering interval include:
[0019] Where, val u val is the upper limit of the sub-interval. d The lower limit value of the sub-interval, color u The upper limit color of the sub-range, color d The lower limit color of the sub-interval.
[0020] Optionally, determining the color mapping function and opacity function based on the color band parameter data also includes:
[0021] Based on the upper limit value of the color band, the lower limit value of the color band, and the filtering interval, determine multiple segmented intervals corresponding to the opacity function;
[0022] An opacity function is generated based on preset opacity rules. The opacity rules include the first segment interval corresponding to the upper limit of the color band and the upper limit of the filter interval, where the opacity gradually changes from 1 to 0; the second segment interval corresponding to the filter interval has an opacity of 0; and the third segment interval corresponding to the lower limit of the filter interval and the lower limit of the color band, where the opacity gradually changes from 0 to 1.
[0023] Optionally, the measured value is the difference between the actual value and the standard value, the upper limit of the color band is equal to the absolute value of the lower limit of the color band, and the upper limit of the filter interval is equal to the absolute value of the lower limit of the filter interval.
[0024] The first and third segmented intervals are merged into a normalized interval, and the opacity function corresponding to the normalized interval is a preset nonlinear curve.
[0025] Optionally, based on the measured values and the opacity function at each location, the opacity information corresponding to each location is determined, including:
[0026] When the measured value at a location falls within the normalized interval, the absolute value of the measured value is divided by the upper limit of the color band to obtain the input value corresponding to the location.
[0027] By substituting the input value corresponding to the position into the nonlinear curve, the opacity value corresponding to the position can be obtained.
[0028] This disclosure also provides a data visualization device, including:
[0029] The acquisition module is configured to acquire visualization data and color band parameter data; wherein, the visualization data includes the base image and the measurement values at multiple locations, and the color band parameter data includes the upper limit value of the color band, the lower limit value of the color band, and the filtering interval;
[0030] The determination module is configured to determine the color information and opacity information corresponding to each position based on the visualization data and color band parameter data; wherein, the opacity corresponding to the measured value at each position increases as the distance from the filter interval increases;
[0031] The coloring module is configured to color the base image based on the color and opacity information corresponding to each position, thereby obtaining the target visualization image.
[0032] This disclosure also provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the data visualization method of the first aspect.
[0033] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the data visualization method of the first aspect.
[0034] The data visualization method, apparatus, electronic device, and computer-readable storage medium provided in this disclosure can acquire visualization data and color band parameter data. The visualization data includes a base image and measurement values at multiple locations. The color band parameter data includes an upper limit value, a lower limit value, and a filtering range. Based on the visualization data and color band parameter data, color information and opacity information corresponding to each location are determined. The opacity corresponding to the measurement value at each location increases with the distance from the filtering range. Based on the color information and opacity information corresponding to each location, the base image is colored to obtain the target visualization image. By introducing opacity as a supplement to color mapping, an adjustable filtering range is added, highlighting the region of interest corresponding to measurement values far from the filtering range, and filtering out the region of uninterested areas corresponding to the filtering range, thus facilitating user observation and improving the display effect. Simultaneously, users can adjust not only the upper and lower limits of the color band but also the filtering range. Adjusting the filtering range allows users to precisely adjust the color band to their desired numerical range, increasing the freedom of adjusting the color band's range of variation. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0036] Figure 1 is a flowchart illustrating a data visualization method provided in an embodiment of this disclosure;
[0037] Figure 2 is a schematic diagram of the three color stripes provided in the embodiments of this disclosure;
[0038] Figure 3 shows a nonlinear curve of an opacity function provided in an embodiment of this disclosure;
[0039] Figure 4 is a visualization image of a four-channel RGBA provided in an embodiment of this disclosure;
[0040] Figure 5 is a visualization image of a three-channel RGB provided in an embodiment of this disclosure;
[0041] Figure 6 is a visualization image showing the dynamic changes in the range of color band changes according to an embodiment of this disclosure;
[0042] Figure 7 is a schematic diagram of the structure of a data visualization device provided in an embodiment of this disclosure;
[0043] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0044] The technical solutions of this disclosure will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0045] Currently, different color bands typically exhibit gradient changes without transparency variations, only supporting adjustments to the range size of each color band; alternatively, different color bands may have transitional color changes without transparency variations, only supporting adjustments to the overall range size of the color band. Taking the difference between the actual and standard values as an example, users tend to focus more on areas with larger absolute differences and less on areas with smaller absolute differences. Under existing color band schemes, the colors displayed for areas of interest with larger absolute differences are not prominent enough, failing to filter out uninteresting areas with smaller absolute differences, and the adjustment of the color band variation range is not flexible enough. Therefore, this disclosure provides a data visualization method, apparatus, electronic device, and computer-readable storage medium that introduces opacity A as a supplement to the traditional three-channel red (R), green (G), and blue (B) color mapping, increasing the adjustable filtering range. This allows for highlighting areas with larger absolute differences and semi-transparent display of areas with smaller absolute differences, achieving filtering of uninteresting areas and improving the flexibility of adjusting the color band variation range.
[0046] To facilitate understanding of this embodiment, a data visualization method disclosed in this disclosure will first be described in detail.
[0047] This disclosure provides a data visualization method that can be executed by an electronic device with image processing capabilities. Referring to Figure 1, a flowchart of a data visualization method is shown, which mainly includes the following steps S110 to S130:
[0048] Step S110: Obtain visualization data and color band parameter data; wherein, the visualization data includes the base image and the measurement values at multiple locations, and the color band parameter data includes the upper limit value of the color band, the lower limit value of the color band, and the filtering interval.
[0049] The aforementioned visualization data can be any data with visualization requirements. For example, when visualizing the data difference between the measured 3D face model and the reference model, the visualization data can include the 3D face model and the measured values at multiple locations in the 3D face model. The measured value is the difference between the actual value measured in the 3D face model and the standard value of the reference model. Specifically, it can be the distance (scalar value) from any grid vertex in the region where the location is in the 3D face model to the nearest point of the grid in the reference model. The sign is determined by the normal.
[0050] This embodiment proposes an RGBA four-channel color band with a filtering range. Users can adjust the upper limit, lower limit, and filtering range of the color band according to their actual needs. The upper limit is the maximum measured value of the entire color band, the lower limit is the minimum measured value, and the filtering range is the range of measured values that the user is not interested in; it can be one or more ranges of measured values between the upper and lower limits. Taking a 3D face model as an example, the filtering range can be a range of measured values defined by the lower and upper limits, and the lower and upper limits can be adjusted symmetrically around 0.
[0051] Step S120: Based on the visualization data and color band parameter data, determine the color information and opacity information corresponding to each position; wherein, the opacity corresponding to the measured value at each position increases as the distance between the measured value and the filter interval increases.
[0052] Opacity information refers to the opacity of the color band itself. The farther away from the filter range, the higher the opacity of the color band and the more obvious the color of the color band. Conversely, the closer to the filter range, the lower the opacity of the color band and the less obvious the color of the color band.
[0053] In this embodiment, not only is the color corresponding to a given position determined based on the measured value, but the opacity of that position is also determined based on the measured value, thus obtaining the color and opacity information for that position. Taking the RGB color model as an example, this method can obtain the RGBA four-channel data corresponding to each position. To highlight the region of interest and filter out regions of little interest, the opacity of the filtering interval can be minimized. The closer the measured value is to the filtering interval, the lower the opacity, and the farther the measured value is from the filtering interval, the higher the opacity. Optionally, the opacity corresponding to the filtering interval can be 0; the opacity corresponding to measured values greater than or equal to the upper limit of the color band and less than or equal to the lower limit of the color band can be 1, and the opacity corresponding to other measured values is between 0 and 1.
[0054] In some possible embodiments, the color mapping function and opacity function can be determined first based on the color band parameter data; then, the color information corresponding to each position can be determined based on the measured values at each position and the color mapping function, and the opacity information corresponding to each position can be determined based on the measured values at each position and the opacity function. It should be noted that there is no specific order of execution between the steps of determining the color information corresponding to each position and the steps of determining the opacity information corresponding to each position.
[0055] Users can adjust the color mapping function and opacity function by adjusting the color band parameter data, thereby adjusting the display effect of the target visualization image.
[0056] In one possible implementation, the color mapping function can be determined as follows: Based on a preset color sequence, the color band interval, consisting of the upper and lower limits of the color band, is divided into multiple sub-intervals, and the upper and lower limits of each sub-interval are determined; based on the upper and lower limits of each sub-interval, the filtering interval, and a preset mapping rule, a color mapping function is generated; wherein the mapping rule includes that the color corresponding to the first measurement value belonging to the filtering interval is gray, and the color corresponding to the second measurement value not belonging to the filtering interval is obtained by interpolation of the upper and lower limits of the sub-interval.
[0057] The aforementioned color sequence can be set according to actual needs. For example, the color sequence can be arranged in the order of dark blue, light blue, cyan, green, yellow, orange, and red, thus dividing the color band range into 7 sub-intervals. Dark blue corresponds to the sub-interval containing the lower limit of the color band, red corresponds to the sub-interval containing the upper limit of the color band, and the other colors are distributed sequentially in the sub-intervals between dark blue and red. By setting the color corresponding to the filtering interval to gray, the filtering of uninteresting areas within the filtering interval can be effectively achieved, improving the display effect.
[0058] Optionally, the color corresponding to the second measurement value that does not belong to the filtering interval is obtained by linear interpolation of the upper and lower limit colors of the sub-interval (but the scope of protection of this disclosure is not limited to linear interpolation; non-linear interpolation can also be used in other embodiments). Based on this, the color mapping function corresponding to the sub-interval that does not belong to the filtering interval may include:
[0059] Where, val u val is the upper limit of the sub-interval. d The lower limit value of the sub-interval, color u The upper limit color of the sub-range, color d The lower limit color of the sub-interval.
[0060] In one possible implementation, the opacity function can be determined as follows: based on the upper limit of the color band, the lower limit of the color band, and the filtering interval, multiple segmented intervals corresponding to the opacity function are determined; the opacity function is generated according to a preset opacity rule; wherein, the opacity rule includes the first segmented interval corresponding to the upper limit of the filtering interval from the upper limit of the color band gradually changing from 1 to 0, the second segmented interval corresponding to the filtering interval having an opacity of 0, and the third segmented interval corresponding to the lower limit of the filtering interval from the lower limit of the color band gradually changing from 0 to 1.
[0061] Optionally, the measured value can be the difference between the actual value and the standard value, the upper limit of the color band is equal to the absolute value of the lower limit of the color band, and the upper limit of the filtering interval is equal to the absolute value of the lower limit of the filtering interval. Based on this, the first segmented interval and the third segmented interval can be merged into a normalized interval, and the opacity function corresponding to the normalized interval is a preset non-linear curve. It should be noted that the opacity function corresponding to the normalized interval can be set according to actual needs and is not limited to a non-linear curve. In other embodiments, a linear curve can also be used.
[0062] Optionally, the opacity function corresponding to the normalization interval is a preset non-linear curve. When the measured value at a certain position belongs to the normalization interval, the absolute value of the measured value is divided by the upper limit value of the color band to obtain the input value corresponding to that position. The input value corresponding to that position is substituted into the non-linear curve to solve for the opacity value corresponding to that position.
[0063] Step S130: Color the base image according to the color information and opacity information corresponding to each position to obtain the target visualization image.
[0064] In practice, to improve the display effect of the target visualization image, the base image can be converted into a grayscale image first. Then, based on the color and opacity information corresponding to each position, the color and opacity of the corresponding position in the grayscale image can be modified accordingly to obtain the target visualization image.
[0065] The data visualization method of this disclosure can acquire visualization data and color band parameter data. The visualization data includes a base image and measurement values at multiple locations. The color band parameter data includes an upper limit value, a lower limit value, and a filtering range. Based on the visualization data and color band parameter data, color information and opacity information corresponding to each location are determined. The opacity corresponding to the measurement value at each location increases with the distance from the filtering range. Based on the color information and opacity information corresponding to each location, the base image is colored to obtain the target visualization image. By introducing opacity as a supplement to color mapping, an adjustable filtering range is added, highlighting the region of interest corresponding to measurement values far from the filtering range, and filtering out the region of uninterestedness corresponding to the filtering range, thus facilitating user observation and improving the display effect. Simultaneously, users can adjust not only the upper and lower limits of the color band but also the filtering range. Adjusting the filtering range allows users to precisely adjust the color band to their desired numerical range, increasing the freedom of adjusting the color band's range of variation.
[0066] To facilitate understanding, the above data visualization method will be explained in detail below, taking the visualization of the data difference between the measured 3D face model and the reference model as an example.
[0067] This disclosure proposes a method for nonlinear mapping of color bands and measured values, namely, a nonlinear four-channel mapping color band coloring technique. It introduces opacity A as a supplement to the traditional three-channel red (R), green (G), and blue (B) color mapping, highlighting areas with large absolute measured values and semi-transparently displaying areas with small absolute measured values.
[0068] 1. Color band mapping function
[0069] Figure 2 shows three types of color bands. B is the legend for a discrete color block, A is the legend for a generated gradient color band, and C is the legend for a color band after adjusting the filter interval. For A, the color band is displayed for measured values between 0 and 3 and between -3 and 0. For C, the user only needs to focus on a portion of the color band's measured values; the color band is only displayed for values between 1.2 and 3 and between -3 and 1.2. By adjusting the filter interval, the area of the color band displayed can be changed, allowing the user to focus on displaying the specific range of interest.
[0070] The input to the color band mapping function is the measured value. The upper and lower limits of the color band variation range can be adjusted (from -3.0 to 3.0 in Figure 2), and the output is three-channel color (RGB). The mapping rules are as follows: measured values exceeding the upper limit of the color band are output as the reddest color, and measured values exceeding the lower limit of the color band are output as the bluest color; measured values less than the upper limit and greater than the lower limit are output as gray; other values are obtained by a piecewise interpolation function. For example, the segmented interval is divided into 7 sub-intervals as shown in B in Figure 2, and the interval width is the difference between the upper and lower limits of the sub-interval. The output is obtained by linear interpolation of the upper and lower limit colors. The interpolation formula is as follows:
[0071] Where, val u val is the upper limit of the sub-interval. d The lower limit value of the sub-interval, color u The upper limit color of the sub-range, color d The lower limit color of the sub-interval.
[0072] 2. Opacity function
[0073] The input is a measured value. First, the absolute value of the measured value is taken and then divided by the upper limit of the color band. Values greater than 1 are normalized to 1, thus normalizing the measured value to between 0 and 1. Then, it is substituted into the non-linear curve shown in Figure 3 (e.g., y = x² + 0.3) to obtain the corresponding x-coordinate value, which is output as the opacity value of the fourth channel. When the input y equals 1, the opacity is 1.0; when y is between the upper and lower filter limits, the opacity is 0. For example, in C of Figure 2, the opacity is 0 in the range of -1.2 to 1.2.
[0074] 3. Four-channel RGBA color ribbon color mixing output
[0075] As shown in Figure 4, the four-channel RGBA visualization highlights areas with larger absolute values and semi-transparent areas with smaller absolute values. Figure 5 shows the three-channel RGB visualization, i.e., the color banding effect without opacity channels; comparing Figure 5 with Figure 4, it is clear that the non-linear RGBA four-channel color banding provides a more intuitive visual effect.
[0076] 4. Color band variation range adjustment logic
[0077] As shown in Figure 6, (a) when the upper limit of the color band is adjusted, the measurement value corresponding to the reddest color increases; when the lower limit of the color band is adjusted, the measurement value corresponding to the bluest color decreases; (b) when the filter limit is adjusted (i.e., the filter interval is adjusted), the opacity interpolation function changes dynamically.
[0078] The embodiments disclosed herein have the following advantages:
[0079] 1. By using non-linear RGBA four-channel color banding technology, the area with a large absolute value of the measured value is highlighted, while the area with a small absolute value of the measured value is filtered out by semi-transparency, making it easier for users to observe and resulting in a beautiful display effect.
[0080] 2. When adjusting the upper and lower limits of the color band, the color corresponding to the maximum value of the measurement remains unchanged, while the colors corresponding to other values change adaptively, making the visual effect change intuitive; the filter adjustment allows users to accurately adjust the color band to the numerical range of their interest.
[0081] Corresponding to the data visualization method described above, this disclosure also provides a data visualization device. Referring to Figure 7, which shows a schematic diagram of a data visualization device, the device includes:
[0082] The acquisition module 701 is configured to acquire visualization data and color band parameter data; wherein, the visualization data includes the base image and the measurement values at multiple locations, and the color band parameter data includes the upper limit value of the color band, the lower limit value of the color band, and the filtering interval;
[0083] The module 702 is configured to determine the color information and opacity information corresponding to each position based on the visualization data and color band parameter data; wherein, the opacity corresponding to the measured value at each position increases as the distance from the filter interval increases;
[0084] The coloring module 703 is configured to color the base image according to the color information and opacity information corresponding to each position to obtain the target visualization image.
[0085] The data visualization apparatus provided in this disclosure can acquire visualization data and color band parameter data. The visualization data includes a base image and measurement values at multiple locations. The color band parameter data includes an upper limit value, a lower limit value, and a filtering range. Based on the visualization data and color band parameter data, color information and opacity information corresponding to each location are determined. The opacity corresponding to the measurement value at each location increases with the distance from the filtering range. Based on the color information and opacity information corresponding to each location, the base image is colored to obtain a target visualization image. By introducing opacity as a supplement to color mapping, an adjustable filtering range is added, highlighting the region of interest corresponding to measurement values far from the filtering range, and filtering out the region of uninterested areas corresponding to the filtering range, thus facilitating user observation and improving the display effect. Simultaneously, users can adjust not only the upper and lower limits of the color band but also the filtering range. Adjusting the filtering range allows users to precisely adjust the color band to their desired numerical range, increasing the freedom of adjusting the color band's range of variation.
[0086] Optionally, the aforementioned determining module 702 is specifically configured to: determine the color mapping function and the opacity function based on the color band parameter data; determine the color information corresponding to each position based on the measurement values at each position and the color mapping function; and determine the opacity information corresponding to each position based on the measurement values at each position and the opacity function.
[0087] Optionally, the determining module 702 is further configured to: divide the color band interval consisting of the upper limit value and the lower limit value of the color band into multiple sub-intervals according to a preset color sequence, and determine the upper limit color and lower limit color of each sub-interval; generate a color mapping function according to the upper limit color and lower limit color of each sub-interval, as well as the filtering interval and a preset mapping rule; wherein the mapping rule includes that the color corresponding to the first measurement value belonging to the filtering interval is gray, and the color corresponding to the second measurement value not belonging to the filtering interval is obtained by interpolation of the upper limit color and lower limit color of the sub-interval to which it belongs.
[0088] Optionally, the color mapping functions corresponding to sub-intervals that do not belong to the filtering interval include:
[0089] Where, val u val is the upper limit of the sub-interval. d The lower limit value of the sub-interval, color u The upper limit color of the sub-range, color d The lower limit color of the sub-interval.
[0090] Optionally, the determining module 702 is further configured to: determine multiple segmented intervals corresponding to the opacity function based on the upper limit value of the color band, the lower limit value of the color band, and the filtering interval; and generate an opacity function according to a preset opacity rule; wherein the opacity rule includes the first segmented interval corresponding to the upper limit value of the filtering interval from the upper limit value of the color band gradually changing from 1 to 0, the second segmented interval corresponding to the filtering interval having an opacity of 0, and the third segmented interval corresponding to the lower limit value of the color band gradually changing from 0 to 1.
[0091] Optionally, the measured value is the difference between the actual value and the standard value, the upper limit of the color band is equal to the absolute value of the lower limit of the color band, and the upper limit of the filter interval is equal to the absolute value of the lower limit of the filter interval; the first segment interval and the third segment interval are merged into a normalized interval, and the opacity function corresponding to the normalized interval is a preset nonlinear curve.
[0092] Optionally, the determination module 702 is further configured to: when the measured value at the position belongs to the normalized interval, take the absolute value of the measured value and divide it by the upper limit value of the color band to obtain the input value corresponding to the position; substitute the input value corresponding to the position into the nonlinear curve to solve for the opacity value corresponding to the position.
[0093] The data visualization device provided in this embodiment has the same implementation principle and technical effects as the aforementioned data visualization method embodiment. For the sake of brevity, any parts not mentioned in the data visualization device embodiment can be referred to the corresponding content in the aforementioned data visualization method embodiment.
[0094] As shown in Figure 8, an electronic device 800 provided in this embodiment includes a processor 801, a memory 802, and a bus. The memory 802 stores a computer program that can run on the processor 801. When the electronic device 800 is running, the processor 801 and the memory 802 communicate through the bus, and the processor 801 executes the computer program to realize the above-mentioned data visualization method.
[0095] Optionally, the memory 802 and processor 801 described above can be general-purpose memory and processor, without specific limitations.
[0096] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the data visualization method described in the preceding method embodiments. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), RAM, magnetic disk, or optical disk.
[0097] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0098] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values.
[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0100] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0101] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0102] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0103] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this disclosure. Industrial applicability
[0104] This disclosure provides a data visualization method, apparatus, electronic device, and computer-readable storage medium. By introducing opacity as a supplement to color mapping, it increases the adjustable filtering range and improves the degree of freedom in adjusting the display effect and the range of color band changes.
Claims
1. A data visualization method, wherein, include: Acquire visualization data and color band parameter data; wherein, the visualization data includes a base image and measurement values at multiple locations, and the color band parameter data includes upper limit value, lower limit value, and filtering interval of the color band; Based on the visualization data and the color band parameter data, the color information and opacity information corresponding to each position are determined; wherein, the opacity corresponding to the measured value at each position increases as the distance from the filter interval increases; The base image is colored based on the color and opacity information corresponding to each position to obtain the target visualization image.
2. The data visualization method according to claim 1, wherein, The step of determining the color information and opacity information corresponding to each position based on the visualization data and the color band parameter data includes: Based on the color band parameter data, determine the color mapping function and the opacity function; Based on the measured values at each of the locations and the color mapping function, the color information corresponding to each of the locations is determined, and based on the measured values at each of the locations and the opacity function, the opacity information corresponding to each of the locations is determined.
3. The data visualization method according to claim 2, wherein, The step of determining the color mapping function and opacity function based on the color band parameter data includes: According to a preset color sequence, the color band interval consisting of the upper limit value and the lower limit value of the color band is divided into multiple sub-intervals, and the upper limit color and lower limit color of each sub-interval are determined. The color mapping function is generated based on the upper and lower limit colors of each sub-interval, the filtering interval, and the preset mapping rules; wherein the mapping rules include that the color corresponding to the first measurement value belonging to the filtering interval is gray, and the color corresponding to the second measurement value not belonging to the filtering interval is obtained by interpolation of the upper and lower limit colors of the sub-interval.
4. The data visualization method according to claim 3, wherein, The color mapping functions corresponding to the sub-intervals that do not belong to the filtering interval include: Where, val u val is the upper limit value of the sub-interval. d The lower limit value of the sub-interval, color u The upper limit color of the sub-interval, color d The lower limit color of the sub-interval.
5. The data visualization method according to claim 2, wherein, The step of determining the color mapping function and opacity function based on the color band parameter data further includes: Based on the upper limit value of the color band, the lower limit value of the color band, and the filtering interval, determine multiple segmented intervals corresponding to the opacity function; The opacity function is generated according to a preset opacity rule; wherein the opacity rule includes the first segment interval corresponding to the upper limit value of the color band and the upper limit value of the filter interval gradually changing from 1 to 0, the opacity of the second segment interval corresponding to the filter interval being 0, and the opacity of the third segment interval corresponding to the lower limit value of the filter interval and the lower limit value of the color band gradually changing from 0 to 1.
6. The data visualization method according to claim 5, wherein, The measured value is the difference between the actual value and the standard value, the upper limit value of the color band is equal to the absolute value of the lower limit value of the color band, and the upper limit value of the filtration interval is equal to the absolute value of the lower limit value of the filtration interval. The first segmented interval and the third segmented interval are merged into a normalized interval, and the opacity function corresponding to the normalized interval is a preset nonlinear curve.
7. The data visualization method according to claim 6, wherein, The step of determining the opacity information corresponding to each of the aforementioned locations based on the measured values at each location and the opacity function includes: When the measured value at the location belongs to the normalized interval, the absolute value of the measured value is divided by the upper limit value of the color band to obtain the input value corresponding to the location. The input value corresponding to the position is substituted into the nonlinear curve to obtain the opacity value corresponding to the position.
8. A data visualization device, wherein, include: The acquisition module is configured to acquire visualization data and color band parameter data; wherein, the visualization data includes a base image and measurement values at multiple locations, and the color band parameter data includes the upper limit value of the color band, the lower limit value of the color band, and the filtering interval; The determination module is configured to determine the color information and opacity information corresponding to each of the positions based on the visualization data and the color band parameter data; wherein the opacity corresponding to the measured value of each position increases as the distance between it and the filter interval increases; The coloring module is configured to color the base image according to the color information and opacity information corresponding to each position to obtain the target visualization image.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein... When the processor executes the computer program, it implements the data visualization method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, wherein, The computer program is executed by the processor to perform the data visualization method according to any one of claims 1-7.