CN114691252A - Screen display method and device - Google Patents

Screen display method and device Download PDF

Info

Publication number
CN114691252A
CN114691252A CN202011584617.4A CN202011584617A CN114691252A CN 114691252 A CN114691252 A CN 114691252A CN 202011584617 A CN202011584617 A CN 202011584617A CN 114691252 A CN114691252 A CN 114691252A
Authority
CN
China
Prior art keywords
color value
color values
pixel
target color
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011584617.4A
Other languages
Chinese (zh)
Other versions
CN114691252B (en
Inventor
周志国
邢玮
彭庆凯
庞志慧
朱润亚
谢云龙
李大中
宋雨伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Unicom Big Data Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Unicom Big Data Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd, Unicom Big Data Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202011584617.4A priority Critical patent/CN114691252B/en
Publication of CN114691252A publication Critical patent/CN114691252A/en
Application granted granted Critical
Publication of CN114691252B publication Critical patent/CN114691252B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/147Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels

Abstract

The embodiment of the application provides a screen display method and a screen display device, wherein the method comprises the following steps: the color values of a plurality of pixel points of the display screen are subjected to aggregation processing to obtain N first target color values, each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1. And aggregating the color values of a plurality of pixel points of the first image to obtain N second target color values. And determining a second target color value corresponding to each first target color value in the N second target color values. And according to the second target color values, respectively replacing the color values of a plurality of pixel points corresponding to the first target color values corresponding to the second target color values in the display screen. Through carrying out color value extraction and polymerization to display screen and first image, and then can realize substituting the color value of display screen for the color value that first image corresponds to can be based on first image, quick effectual realization has effectively promoted the speed that the theme switched to the switching of visual interface's theme.

Description

Screen display method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a screen display method and apparatus.
Background
With the advent of the big data age, data visualization display technology becomes a mainstream data display mode, wherein data visualization can enhance the data presentation effect.
When data visualization is realized in a screen, a visual interface often presents a certain theme, and when the theme of the visual interface needs to be changed, the existing technical scheme changes the theme of the existing data visualization large screen by secondary redevelopment of codes or by adding a filter to a cascading style sheet (css).
However, whether the code is re-opened twice or the filter is added, the operation needs a long time, so that the requirement of theme change cannot be responded quickly, and the theme change speed is slow.
Disclosure of Invention
The embodiment of the application provides a screen display method and a screen display device, and aims to solve the problem that the speed of changing a theme is slow.
In a first aspect, an embodiment of the present application provides a screen display method, including:
aggregating color values of a plurality of pixel points of a display screen to obtain N first target color values, wherein each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1;
aggregating the color values of a plurality of pixel points of the first image to obtain N second target color values;
determining a second target color value corresponding to each first target color value in the N second target color values;
and according to the second target color values, respectively replacing the color values of a plurality of pixel points corresponding to the first target color values corresponding to the second target color values in the display screen.
In one possible design, aggregating color values of a plurality of pixel points of a display screen to obtain N first target color values includes:
dividing the pixel points in the display screen to obtain a plurality of first pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each first pixel unit to obtain the color value of each first pixel unit;
and performing aggregation processing on the color values of the plurality of first pixel units to obtain the N first target color values.
In one possible design, aggregating the color values of the first pixel units to obtain the N first target color values includes:
performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiA color value;
wherein, i takes 1, 2, 3, … … in sequence until MiIs N, the N first target color values are obtained.
In one possible design, i is 1; performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiIndividual color values, comprising:
determining a plurality of first-level pixel sets in the plurality of first pixel units, wherein each first-level pixel set comprises at least two first pixel units;
respectively carrying out aggregation processing on the color values of the first pixel units in each first-level pixel set to obtain the color value corresponding to each first-level pixel set, wherein the number of the color values corresponding to the plurality of first-level pixel sets is M1
In one possible design, i is greater than 1; performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiIndividual color values, comprising:
determining a plurality of ith-level pixel sets in the plurality of ith-1 level pixel sets, wherein each ith-level pixel set comprises at least two ith-1 level pixel sets;
respectively carrying out aggregation processing on color values corresponding to the (i-1) th-level pixel sets in each ith-level pixel set to obtain the color values corresponding to each ith-level pixel set, wherein the number of the color values corresponding to the plurality of ith-level pixel sets is Mi
In one possible design, the aggregation process includes:
acquiring K color values corresponding to a plurality of objects to be subjected to aggregation processing, wherein the objects are any one of the following objects: pixel points, pixel units and a pixel set, wherein K is an integer greater than or equal to 1;
if the K is 1, determining the color value after the aggregation processing as the color value corresponding to the plurality of objects;
and if the K is larger than 1, determining the color value after the polymerization treatment according to the hue rotation error of each color value.
In one possible design, determining the aggregated color values based on the hue rotation error for each color value includes:
dividing the K color values into T color value sets according to the hue rotation error of each color value, wherein the hue rotation error of the color values in one color value set is less than or equal to a first threshold value, and T is an integer greater than or equal to 1;
acquiring an average color value corresponding to each color value set, wherein the average color value is an average value of the color values in the color value set;
and determining the color values after the aggregation processing according to the T and the average color value corresponding to each color value set.
In one possible design, determining the aggregated processed color values according to the T and the average color value corresponding to each color value set includes:
if the T is 1, determining the average color value corresponding to the color value set as the color value after the aggregation processing;
if the T is larger than 1, judging whether hue rotation errors of the average color values corresponding to the T color value sets are smaller than or equal to a second threshold value, if so, determining the average color values of the average color values corresponding to the T color value sets as the aggregated color values, otherwise, determining a target color value set in the T color value sets, and determining the average color values corresponding to the target color value set as the aggregated color values, wherein the number of objects corresponding to the target color value set is the largest.
In one possible design, according to each of the second target color values, in the display screen, replacing color values of a plurality of pixel points corresponding to a first target color value corresponding to each of the second target color values, respectively, includes:
acquiring an aggregation path of each first target color value, wherein the aggregation path is used for indicating at least one first pixel unit of the first target color value obtained through aggregation;
determining a second target color value corresponding to each first target color value as a replacement color value corresponding to each first pixel unit indicated by the aggregation path of each first target color value;
determining a replacement color value of each pixel point within the range of the first pixel unit according to the replacement color value corresponding to each first pixel unit, wherein the difference value between the replacement color value of each pixel point and the replacement color value of the corresponding first pixel unit is less than or equal to a preset threshold value;
and replacing the color value of each pixel point with the replacement color value.
In a possible design, aggregating color values of a plurality of pixel points of a first image to obtain N second target color values includes:
dividing the pixel points in the first image to obtain a plurality of second pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each second pixel unit to obtain the color value of each second pixel unit;
and performing aggregation processing on the color values of the plurality of second pixel units to obtain the N second target color values.
In one possible design, determining the second target color value corresponding to each first target color value among the N second target color values includes:
sequencing the N first target color values according to the sequence of the number of pixel points corresponding to each first target color value from high to low;
sequencing the N second target color values according to the sequence of the number of pixel points corresponding to each second target color value from high to low;
determining a second target color value corresponding to each first target color value according to the sequenced N first target color values and the sequenced N second target color values; for any one of the first target color values, an order of the first target color value among the N first target color values is the same as an order of a second target color value corresponding to the first target color value among the N second target color values.
In a second aspect, an embodiment of the present application provides a screen display device, including:
the processing module is used for carrying out aggregation processing on color values of a plurality of pixel points of the display screen to obtain N first target color values, wherein each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1;
the processing module is further configured to aggregate the color values of the multiple pixel points of the first image to obtain N second target color values;
a determining module, configured to determine, among the N second target color values, a second target color value corresponding to each first target color value;
and the replacing module is used for respectively replacing the color values of a plurality of pixel points corresponding to the first target color value corresponding to each second target color value in the display screen according to each second target color value.
In one possible design, the processing module is specifically configured to:
dividing the pixel points in the display screen to obtain a plurality of first pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each first pixel unit to obtain the color value of each first pixel unit;
and performing aggregation processing on the color values of the plurality of first pixel units to obtain the N first target color values.
In one possible design, the processing module is specifically configured to:
performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiA color value;
wherein, the i is 1, 2, 3 and … … in sequence until M isiIs N, the N first target color values are obtained.
In one possible design, i is 1; the processing module is specifically configured to:
determining a plurality of first-level pixel sets in the plurality of first pixel units, wherein each first-level pixel set comprises at least two first pixel units;
respectively carrying out aggregation processing on the color values of the first pixel units in each first-level pixel set to obtain the color value corresponding to each first-level pixel set, wherein the number of the color values corresponding to the plurality of first-level pixel sets is M1
In one possible design, i is greater than 1; the processing module is specifically configured to:
determining a plurality of ith-level pixel sets in the plurality of ith-1 level pixel sets, wherein each ith-level pixel set comprises at least two ith-1 level pixel sets;
respectively carrying out aggregation processing on color values corresponding to the (i-1) th-level pixel sets in each ith-level pixel set to obtain the color values corresponding to each ith-level pixel set, wherein the number of the color values corresponding to the plurality of ith-level pixel sets is Mi
In one possible design, the aggregation process includes:
acquiring K color values corresponding to a plurality of objects to be subjected to aggregation processing, wherein the objects are any one of the following objects: pixel points, pixel units and pixel sets, wherein K is an integer greater than or equal to 1;
if the K is 1, determining the color value after the aggregation processing as the color value corresponding to the plurality of objects;
and if the K is larger than 1, determining the color value after the polymerization treatment according to the hue rotation error of each color value.
In one possible design, the determining module is specifically configured to:
dividing the K color values into T color value sets according to the hue rotation error of each color value, wherein the hue rotation error of the color values in one color value set is less than or equal to a first threshold value, and T is an integer greater than or equal to 1;
acquiring an average color value corresponding to each color value set, wherein the average color value is an average value of the color values in the color value set;
and determining the color values after the aggregation processing according to the T and the average color value corresponding to each color value set.
In one possible design, the determining module is specifically configured to:
if the T is 1, determining the average color value corresponding to the color value set as the color value after the aggregation processing;
if the T is larger than 1, judging whether hue rotation errors of the average color values corresponding to the T color value sets are smaller than or equal to a second threshold value, if so, determining the average color values of the average color values corresponding to the T color value sets as the aggregated color values, otherwise, determining a target color value set in the T color value sets, and determining the average color values corresponding to the target color value set as the aggregated color values, wherein the number of objects corresponding to the target color value set is the largest.
In a possible design, the replacement module is specifically configured to:
acquiring an aggregation path of each first target color value, wherein the aggregation path is used for indicating at least one first pixel unit of the first target color value obtained through aggregation;
determining a second target color value corresponding to each first target color value as a replacement color value corresponding to each first pixel unit indicated by the aggregation path of each first target color value;
determining a replacement color value of each pixel point within the range of the first pixel unit according to the replacement color value corresponding to each first pixel unit, wherein the difference value between the replacement color value of each pixel point and the replacement color value of the corresponding first pixel unit is less than or equal to a preset threshold value;
and replacing the color value of each pixel point with the replacement color value.
In one possible design, the processing module is specifically configured to:
dividing the pixel points in the first image to obtain a plurality of second pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each second pixel unit to obtain the color value of each second pixel unit;
and performing aggregation processing on the color values of the plurality of second pixel units to obtain the N second target color values.
In a possible design, the determining module is specifically configured to:
sequencing the N first target color values according to the sequence of the number of pixel points corresponding to each first target color value from high to low;
sequencing the N second target color values according to the sequence of the number of pixel points corresponding to each second target color value from high to low;
determining a second target color value corresponding to each first target color value according to the sequenced N first target color values and the sequenced N second target color values; for any one first target color value, the order of the first target color value in the N first target color values is the same as the order of the second target color value corresponding to the first target color value in the N second target color values.
In a third aspect, an embodiment of the present application provides a screen display device, including:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being adapted to perform the method as described above in the first aspect and any one of the various possible designs of the first aspect when the program is executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, comprising instructions which, when executed on a computer, cause the computer to perform the method as described above in the first aspect and any one of the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product, comprising a computer program, wherein the computer program is configured to be executed by a processor to perform the method as described in the first aspect and any one of various possible designs of the first aspect.
The embodiment of the application provides a screen display method and a screen display device, wherein the method comprises the following steps: the color values of a plurality of pixel points of the display screen are subjected to aggregation processing to obtain N first target color values, each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1. And aggregating the color values of a plurality of pixel points of the first image to obtain N second target color values. And determining a second target color value corresponding to each first target color value in the N second target color values. And according to the second target color values, respectively replacing the color values of a plurality of pixel points corresponding to the first target color values corresponding to the second target color values in the display screen. Through carrying out color value extraction and polymerization to the display screen to and carry out color value extraction and polymerization to first image, obtain the first target color and the second target color of the same quantity, later confirm the corresponding relation of first target color and second target color, and then can realize substituting the color value of each pixel point for the color value that first image corresponds in the display screen, thereby can be based on first image, quick effectual realization is to the switching of visual interface's theme, has effectively promoted the speed that the theme switches.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic diagram illustrating an implementation of data visualization provided by an embodiment of the present application;
FIG. 2 is a flowchart of a screen display method according to an embodiment of the present application;
FIG. 3 is a flowchart of a screen display method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating an implementation of a first pixel unit according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a pixel division unit according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating an implementation of a first-level pixel set according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram illustrating an implementation of a second-level pixel set according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram of a correspondence relationship between a first target color value and a second target color value provided in the embodiment of the present application;
fig. 9 is a schematic implementation diagram of an aggregation path provided in an embodiment of the present application;
fig. 10 is a flowchart of a screen display method according to an embodiment of the present application;
FIG. 11 is a flowchart illustrating a screen display method according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a screen display device according to an embodiment of the present application;
fig. 13 is a schematic hardware structure diagram of a screen display device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to better understand the technical solution of the present application, first, the background art related to the present application is further described in detail:
with the advent of the big data era, the data visualization display technology becomes a mainstream data display mode, data visualization can enhance the data presentation effect, and a user can observe data in a more intuitive mode conveniently so as to discover hidden information in the data.
For example, data visualization may be understood with reference to fig. 1, and fig. 1 is a schematic diagram of an implementation of data visualization provided in an embodiment of the present application.
As shown in fig. 1, in data visualization, for example, graphical means can be used to clearly and effectively present information.
The visualization application field is very wide, and the visualization application field mainly relates to the fields of network data visualization, traffic data visualization, text data visualization, data mining visualization, biomedical visualization, social visualization and the like.
Although the data large-screen visualization display technology is mature day by day. However, large screen visualization still has many problems and faces significant challenges.
In one aspect, the visual interface displayed in the screen usually presents a certain theme, wherein the subject may be understood as a style of the current interface, for example, the current theme is mainly blue, or the current theme is mainly pink, or the current theme presents a certain specific style.
On the basis that a certain theme is presented on a visual interface, when the theme of the visual interface needs to be modified, the existing technical scheme changes the existing data visual large-screen theme through secondary re-development of codes or by adding a filter by css.
However, the theme switched in the above manner is often poor in effect or poor in coordination, and cannot respond to the theme change demand quickly, so that it takes a long time to change the theme.
Aiming at the problems in the prior art, the application provides the following technical concepts: the method comprises the steps of providing a picture needing a theme, including but not limited to a new design drawing, analyzing and calculating the provided picture of the theme, then carrying out dynamic color matching on the existing data large-screen theme and the new design drawing theme, calculating through a certain algorithm, obtaining an optimal value, replacing the existing theme, and achieving the purpose of quickly switching to the required theme without changing codes.
The following detailed embodiments describe the screen display method provided in the present application, and fig. 2 is a flowchart of the screen display method provided in the embodiments of the present application.
As shown in fig. 2, the method includes:
s201, carrying out aggregation processing on color values of a plurality of pixel points of the display screen to obtain N first target color values, wherein each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer larger than 1.
In this embodiment, the visual interface is displayed in the display screen, and to change the theme of the visual interface in the current display screen, the color in the current display screen may be first obtained, so as to perform targeted replacement in the following.
It is understood that, in a possible implementation manner, a representative color value may be selected from the color values of the plurality of pixel points, for example, the color values of the plurality of pixel points in the display screen may be aggregated, so as to obtain N first target color values.
Each first target color value can correspond to a plurality of pixel points on the display screen, and the color values of the pixel points can be aggregated to obtain the first target color value.
It can be understood that the first target color value may be, for example, a color value in color values of a plurality of pixel points, or the first target color value may also be a color value newly obtained after aggregation processing, which is not particularly limited in this embodiment.
In an actual implementation process, a specific implementation manner of the aggregation processing may be selected according to actual requirements, for example, the pixel points may be divided according to a fixed unit, and then an average value of the pixel points in one unit is used as the aggregated first target color value. Or the color values of the multiple pixels may also be processed by using a clustering algorithm, so as to obtain N first target color values, and the specific implementation manner of obtaining the N first target color values is not particularly limited in this embodiment.
S202, carrying out aggregation processing on the color values of a plurality of pixel points of the first image to obtain N second target color values.
The first image is an image corresponding to a theme which needs to be changed for the visualization interface at present, and may be, for example, a design drawing, a concept drawing, and the like made according to the theme which needs to be changed, or may also be a picture which needs to be uploaded to the visualization interface, and then the visualization interface may adaptively adjust the theme according to the first image, so that the theme of the visualization interface and the first image are adapted.
In this embodiment, the first image includes a plurality of pixel points, each pixel point corresponds to a respective color value, and the color values of the plurality of pixel points of the first image may be aggregated, so that N second target color values are obtained.
In this embodiment, the numbers of the first target color and the second target color are the same, and are both N, where N is an integer greater than or equal to 1, and in an actual implementation process, how many N are specifically selected may be selected according to an actual requirement, which is not limited in this embodiment.
S203, determining a second target color value corresponding to each first target color value in the N second target color values.
In this embodiment, N first target color values are obtained for the display screen, and N second target color values are obtained for the first image, where the numbers of the first target color values and the second target color values are the same, so that a corresponding second target color value may be determined for each first target color value.
In this embodiment, it is necessary to adaptively adjust the theme of the display screen according to the first image, and therefore, a correspondence relationship may be determined between the N first target color values determined according to the display screen and the N second color values determined according to the first image, so as to perform theme replacement in the following.
And S204, according to the second target color values, respectively replacing the color values of a plurality of pixel points corresponding to the first target color values corresponding to the second target color values in the display screen.
In this embodiment, each first target color value corresponds to a plurality of pixel points, and then after determining the second target color value corresponding to each first target color value, the color values that the plurality of pixel points corresponding to each corresponding first target color value need to be replaced can be determined according to each second target color value, because the second target color value is a color obtained by aggregating the color values of the pixel points of the first image, the theme in the display screen can be replaced by the theme corresponding to the first image.
In a possible implementation manner, because the first target color value corresponds to a plurality of pixel points, for example, color values of the plurality of pixel points corresponding to the first target color value may be randomly replaced with colors close to the corresponding second target color value; or, a plurality of pixel points corresponding to the first target color value may also be directly replaced with the second target color value corresponding to the first target color value, the specific implementation manner of the replacement is not limited in this embodiment, as long as the color value of each pixel point is determined according to the corresponding second target color value, the switching of the theme may be implemented, and this embodiment is not particularly limited.
In this embodiment, color values of the first image are extracted and aggregated, and then, a corresponding relationship between the color values of the display screen and the color values of the first image is determined, so that the theme color in the display screen can be replaced by the theme color corresponding to the first image quickly and effectively.
The screen display method provided by the embodiment of the application comprises the following steps: the color values of a plurality of pixel points of the display screen are subjected to aggregation processing to obtain N first target color values, each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1. And aggregating the color values of a plurality of pixel points of the first image to obtain N second target color values. And determining a second target color value corresponding to each first target color value in the N second target color values. And according to the second target color values, respectively replacing the color values of a plurality of pixel points corresponding to the first target color values corresponding to the second target color values in the display screen. Through carrying out color value extraction and polymerization to the display screen to and carry out color value extraction and polymerization to first image, obtain the first target color and the second target color of the same quantity, later confirm the corresponding relation of first target color and second target color, and then can realize substituting the color value of each pixel point for the color value that first image corresponds in the display screen, thereby can be based on first image, quick effectual realization is to the switching of visual interface's theme, has effectively promoted the speed that the theme switches.
Based on the foregoing embodiments, the screen display method provided by the present application is further described in detail with reference to fig. 3 to 9, where fig. 3 is a flowchart of the screen display method provided by the present application, fig. 4 is an implementation schematic diagram of a first pixel unit provided by the present application, fig. 5 is a schematic diagram of a pixel division unit provided by the present application, fig. 6 is an implementation schematic diagram of a first-level pixel set provided by the present application, fig. 7 is an implementation schematic diagram of a second-level pixel set provided by the present application, fig. 8 is a schematic diagram of a corresponding relationship between a first target color value and a second target color value provided by the present application, and fig. 9 is an implementation schematic diagram of an aggregation path provided by the present application.
As shown in fig. 3, the method includes:
s301, dividing the pixel points in the display screen to obtain a plurality of first pixel units, wherein each pixel unit comprises a preset number of pixel points.
In this embodiment, the number of the pixel points included in the display screen is very large, and in order to facilitate subsequent processing, the pixel points in the display screen may be divided according to a fixed unit, so as to obtain a plurality of first pixel units, for example, referring to fig. 4, a plurality of pixel points included in the display screen are schematically shown in fig. 4, and the plurality of pixel points are divided, so that a plurality of first pixel units shown in fig. 4 can be obtained.
Each pixel unit may include a preset number of pixel points, for example, in the example of fig. 4, each pixel unit includes 9 pixel points, where a specific implementation of the preset number may depend on a selection of the division unit, and this embodiment does not particularly limit this.
In a possible implementation manner, for example, the pixel points in the display screen may be divided in units of 8px, where px refers to pixel points (pixels), and the pixel points refer to pixels formed by tiles of the image, and the tiles all have a definite position and assigned color value, and the color and position of the tiles determine the appearance of the image.
Alternatively, the division may be performed by taking 16px and 20px as units, where 8px, 16px, and 20px may be understood with reference to fig. 5, for example, the specific unit of the division is not particularly limited in this embodiment, and may be selected according to actual requirements, for example, the unit may be a unit such as a centimeter or a millimeter in addition to the px unit described above, and the present embodiment does not limit this.
S302, respectively carrying out aggregation processing on the color values of the pixel points in each first pixel unit to obtain the color value of each first pixel unit.
In this embodiment, each first pixel unit includes a plurality of pixels, each pixel corresponds to a respective color value, and in this embodiment, aggregation is performed subsequently on the color values.
Taking the introduction in fig. 4 as an example, the current division obtains 16 first pixel units, and aggregation processing is performed on the color values of 9 pixel points in each pixel unit, that is, the respective color values of the 16 first pixel units can be obtained.
S303, performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiThe individual color values.
Wherein, i is 1, 2, 3 and … … in sequence until MiIs N, N first target color values are obtained.
After obtaining the color values of the plurality of first pixel units, the aggregation process may be continued according to the color values of the plurality of first pixel units, and finally the N first target colors are obtained.
However, since the final target is to obtain N first target colors, and therefore, the aggregation process may need to be performed a plurality of times, for example, the aggregation process may be performed an ith time, i may be 1, 2, 3, and … … in order, and M may be obtained each time, based on the color values of a plurality of first pixel unitsiColor value up to MiIs N, so that N first target color values can be obtained.
The polymerization process is described below with reference to fig. 6 and 7:
during the first polymerization, that is to say when i is equal to 1:
a plurality of first-level pixel sets may be determined among the plurality of first pixel units, each first-level pixel set including at least two first pixel units;
respectively carrying out aggregation processing on the color values of the first pixel units in each first-level pixel set to obtain the color value corresponding to each first-level pixel set, wherein the number of the color values corresponding to a plurality of first-level pixel sets is M1
For example, as will be understood in conjunction with fig. 6, there are currently 16 first pixel units, and for example, two adjacent pixel units above and below may be taken as a first-level pixel set, so that the first-level pixel set is determined in a plurality of first pixel units, for example, the first pixel unit 601 and the first pixel unit 602 in fig. 6 may constitute a first-level pixel set 603, and the remaining first-level pixel sets are similar.
In an actual implementation process, how to determine a plurality of first-level pixel sets in a plurality of first pixel units may be selected according to actual requirements, as long as each first-level pixel set is guaranteed to include at least two first pixel units, which may include 2, 3, 4, and the like, and this embodiment does not particularly limit a specific implementation manner of a specific first-level pixel set.
After determining that a plurality of first-level pixel sets are obtained, aggregation processing may be performed according to the plurality of first-level pixel sets, specifically, each first-level pixel set includes a plurality of first pixel units, where each first pixel unit corresponds to a respective color value, and aggregation processing may be performed on the color values of the first pixel units in each first-level pixel set, so as to obtain a color value corresponding to each first-level pixel set.
For example, as understood by referring to fig. 6, the first-level pixel set 603 includes first pixel units 601 and 602, aggregation processing may be performed according to the color value of the first pixel unit 601 and the color value of the first pixel unit 602, so as to obtain a color value corresponding to the first-level pixel set 603, and the processing manner of each first-level pixel set is similar, and details are not described here again.
It can be understood that, when the aggregation processing is performed for the first time, the number of color values corresponding to the obtained first-level pixel sets is M1
During the second and subsequent polymerization, that is to say when i is greater than 1:
a plurality of ith-level pixel sets can be determined in the plurality of ith-1 level pixel sets, and each ith-level pixel set comprises at least two ith-1 level pixel sets;
respectively carrying out aggregation processing on color values corresponding to the (i-1) th-level pixel sets in each ith-level pixel set to obtain the color values corresponding to each ith-level pixel set, wherein the number of the color values corresponding to a plurality of ith-level pixel sets is Mi
For example, taking the second aggregation process as an example in conjunction with fig. 7, it is understood that there are currently 8 first-level pixel sets, and for example, two first-level pixel sets adjacent to each other on the left and right may be taken as one second-level pixel set, so as to determine the second-level pixel set in the plurality of first-level pixel sets, for example, the first-level pixel set 702 and the first-level pixel set 702 in fig. 6 may form one second-level pixel set 703, and the remaining second-level pixel sets are similar.
In an actual implementation process, how to determine a plurality of second-level pixel sets in a plurality of first-level pixel sets may be selected according to actual requirements, as long as each second-level pixel set is guaranteed to include at least two first-level pixel sets, which may include 2, 3, 4, and the like, and this embodiment does not particularly limit a specific implementation manner of a specific second-level pixel set.
After determining that a plurality of second-level pixel sets are obtained, performing aggregation processing according to the plurality of second-level pixel sets, specifically, each second-level pixel set includes a plurality of first-level pixel sets, where each first-level pixel set has been aggregated to obtain a color value corresponding to each first-level pixel set, and then performing aggregation processing on the color values of the first-level pixel sets in each second-level pixel set to obtain a color value corresponding to each second-level pixel set.
For example, as understood by referring to fig. 6, the second-level pixel set 703 includes the first-level pixel sets 701 and 702, and aggregation processing may be performed according to the color values of the first-level pixel set 701 and the color values of the first-level pixel set 702, so as to obtain color values corresponding to the second-level pixel set 703, and the processing manner of each second-level pixel set is similar, which is not described herein again.
It is understood that, when the second aggregation processing is currently performed, the number of color values corresponding to the obtained plurality of second-level pixel sets is M2
Treatment is then continued in a manner similar to that described above until MiThe value of (2) is N, thus obtaining N first target color values.
S304, carrying out aggregation processing on the color values of the multiple pixel points of the first image to obtain N second target color values.
The implementation manner of performing aggregation processing on the color values of the plurality of pixel points in the first image is similar to the above-described processing on the display screen.
Specifically, the pixel points in the first image may be divided to obtain a plurality of second pixel units, where each pixel unit includes a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each second pixel unit to obtain the color value of each second pixel unit;
and aggregating the color values of the second pixel units to obtain N second target color values.
For specific implementation, reference may be made to the descriptions in the foregoing embodiments, which are not described herein again.
S305, sequencing the N first target color values according to the sequence from high to low of the number of pixel points corresponding to each first target color value.
It can be determined based on the above description that each first target color value is obtained by aggregating color values of multiple pixels, and then each first target color value may correspond to multiple pixels.
S306, sequencing the N second target color values according to the sequence from high to low of the number of pixel points corresponding to each second target color value.
The implementation of the sorting of the second target color values is similar to that described above and will not be described here.
S307, determining a second target color value corresponding to each first target color value according to the sorted N first target color values and the sorted N second target color values; for any one of the first target color values, the order of the first target color value among the N first target color values is the same as the order of the second target color value corresponding to the first target color value among the N second target color values.
In this embodiment, it is required to determine a correspondence between the N first target color values and the N second target color values, and it can be understood that, for the first target color value, the larger the number of corresponding pixel points is, the larger the occupation ratio of the first target color value in the display screen is, for example, the first target color value with the first ranked number of pixel points is a blue color, and the most colors in the current display screen are colors of the blue color.
The second target color values are similar, for example, if the second target color value with the first ranked number of pixel points is pink, it may indicate that the most colors in the current first image are the colors of the pink, and it may be determined approximately that the theme of the display screen with blue as dominant hue is to be replaced by a main body with pink as dominant hue.
Therefore, in this embodiment, after performing and sorting on the N first target color values and the N second target color values according to the number of pixels from high to low, the second target color values corresponding to the first target color values may be determined according to the sorting, where, for any one first target color value, the order of the first target color value in the N first target color values is the same as the order of the second target color value corresponding to the first target color value in the N second target color values.
For example, it can be understood with reference to fig. 8 that, assuming that the currently sorted first target color values are sequentially i, ii, iii, iv, and v, and the sorted second target color values are sequentially 1, 2, 3, 4, and 5, it may be determined according to the sorting that the second target color value corresponding to the first target color value i is 1, the second target color value corresponding to the first target color value ii is 2, the second target color value corresponding to the first target color value iii is 3, the second target color value corresponding to the first target color value iv is 4, and the second target color value corresponding to the first target color value v is 5.
S308, acquiring an aggregation path of each first target color value, wherein the aggregation path is used for indicating at least one first pixel unit of the first target color value obtained through aggregation.
In this embodiment, the first target color value is obtained by aggregating color values of a plurality of pixel points, and because the number of the pixel points is large, in order to facilitate processing, in this embodiment, the plurality of pixel points are divided into a plurality of first pixel units, and in order to facilitate subsequent replacement of color values, in this embodiment, in the process of aggregation processing, an aggregation path of each first target color value may be recorded, where the aggregation path is used to indicate that at least one first pixel unit of the first target color value is obtained by aggregation.
In the following, a possible implementation manner of the aggregation path is described with reference to fig. 9, assuming that first pixel units 91 to 97 exist currently, where each of the first pixel units corresponds to a respective color value, for example, the first pixel unit 91 corresponds to a color value a, the first pixel unit 92 corresponds to a color value b, and so on, and the rest of correspondence relations may be referred to the description in fig. 9, and are not described herein again.
And assuming that in the process of the first polymerization treatment, a color value j is obtained by polymerization according to the color value a and the color value b, a color value k is obtained by polymerization according to the color value c and the color value d, and a color value l is obtained by polymerization according to the color value e, the color value f and the color value i, assuming that the number of the required first target color values is 5, and assuming that after the first polymerization treatment is finished, the number of the obtained color values is more than 5, the next polymerization treatment needs to be carried out.
Assuming that the number of color values finally obtained during the second polymerization process is equal to 5, i.e.the polymerization is complete, in the course of which the color value I is obtained by polymerization from the color value k and the color value l and the color value j is determined as the final color value II, it is assumed that 5 first target color values I, II, III, IV, V are finally obtained.
For the first target color value i, the aggregation path comprises:
c. d → k, e, f, i → l, k, l → I; and
for the first target color value ii, the aggregation path comprises:
a、b→j,j→Ⅱ。
as can be understood from the above description, the aggregation path is how the current first target color value is aggregated according to the color values of each first pixel unit, and here, the aggregation path is obtained to facilitate the subsequent corresponding replacement of the color values.
S309, determining the second target color value corresponding to each first target color value as the replacement color value corresponding to each first pixel unit indicated by the aggregation path of each first target color value.
In this embodiment, a correspondence between N first target color values and N second target color values is determined, and an aggregation path is recorded for each first target color value, where a first pixel unit corresponding to each first target color value may be determined according to the aggregation path, and then a second target color value corresponding to each first target color value is determined as a respective replacement color value of each corresponding first pixel unit.
For example, as will be understood in conjunction with fig. 8 and 9, it may be determined from fig. 9 that the first target color value i is currently determined according to the aggregation path to be aggregated by the first pixel unit 93, the first pixel unit 94, the first pixel unit 95, the first pixel unit 96 and the first pixel unit 97, and it may be determined from fig. 8 that the second target color value corresponding to the first target color value i is the second target color value 1, and it may be determined that the replacement color values corresponding to the first pixel unit 93, the first pixel unit 94, the first pixel unit 95, the first pixel unit 96 and the first pixel unit 97 are all color values 1.
Similar to the other implementation manners, it can be understood by referring to the implementation manners described above, and therefore, in this embodiment, the replacement color value corresponding to each first pixel unit may be determined based on the aggregation path and the second target color value corresponding to each first target color value.
And S310, determining the replacement color value of each pixel point within the range of the first pixel unit according to the replacement color value corresponding to each first pixel unit, wherein the difference value between the replacement color value of each pixel point and the replacement color value of the corresponding first pixel unit is less than or equal to a preset threshold value.
In this embodiment, each first pixel unit includes a plurality of pixels, and after determining the replacement color value corresponding to each first pixel unit, it is further required to specifically determine the respective replacement color value of the pixel in each first pixel unit.
In a possible implementation manner, a color value which is relatively close to the replacement color value of the current first pixel unit can be randomly determined for each pixel point in the range of the first pixel unit, so that the replacement color value of each pixel point is determined; or, the replacement color value of each first pixel unit may be sequentially increased or decreased by a corresponding step length according to the position of each pixel point, so as to determine the replacement color value of each pixel point, or the replacement color value of each first pixel unit may be directly determined as the replacement color value of each pixel point corresponding to the first pixel unit, which is not particularly limited in this embodiment.
The specific implementation manner for determining the color value of each pixel point can be selected according to actual requirements, as long as the color value of each pixel point is determined according to the replacement color value of the corresponding first pixel unit, and the difference value between the replacement color value of each pixel point and the replacement color value of the corresponding first pixel unit is less than or equal to a preset threshold value, that is, as long as the color value of each pixel point and the replacement color value of the corresponding first pixel unit are similar color values.
And S311, replacing the color value of each pixel point with a replacement color value.
After the replacement color values of the pixel points are determined, the color values of the pixel points are replaced, and therefore replacement of the theme in the display screen is achieved, wherein the color values of specific replacement are obtained through extraction and aggregation according to the first image, and therefore the theme of the display screen can be replaced simply and effectively based on the first image.
The screen display method provided by the embodiment of the application obtains a plurality of first pixel units by dividing a plurality of pixel points in a display screen, then obtains color values corresponding to the first pixel units by performing aggregation processing on the plurality of pixel points in the first pixel units, then performs subsequent color value replacement based on the color values corresponding to the first pixel units, can effectively reduce workload, and can effectively ensure correctness and orderliness of theme replacement by sequencing based on the number of the pixel points corresponding to the first target color values and the second target color values and determining the corresponding relationship between the first target color values and the second target color values according to the sequencing, and when replacing the color values, specifically determines the replacement color values corresponding to the first pixel units according to the aggregation path of the first target color values and the second target color values corresponding to the first target color values, therefore, the accuracy and effectiveness of color value replacement can be effectively guaranteed, the replacement color values of the pixel points in respective ranges are determined according to the replacement color values corresponding to the first pixel units, the final replacement to the pixel point level can be guaranteed, the replacement of the color values is effective, and therefore the embodiment can quickly and effectively replace the theme of the display screen with the theme matched with the first image based on the first image.
Based on the above embodiments, a lot of aggregation processes are introduced, and a possible implementation manner of the aggregation processes is described below with reference to fig. 10, where fig. 10 is a flowchart of a screen display method provided in an embodiment of the present application.
As shown in fig. 10, the method includes:
s1001, acquiring K color values corresponding to a plurality of objects to be subjected to aggregation processing, wherein the objects are any one of the following: pixel point, pixel unit, pixel set, K is an integer greater than or equal to 1.
In this embodiment, the aggregation processing is performed according to a plurality of color values corresponding to a plurality of objects, for example, according to color values of a plurality of pixels, to obtain a color value of a first pixel unit; or aggregating according to the color values of a plurality of first pixel units to obtain the color values of the first-level pixel set; or aggregating according to the color values of multiple first-level pixel sets to obtain the color values of a second-level pixel set, and so on, so the object in this embodiment is any one of the following: pixel point, pixel unit, pixel set.
For example, if aggregation is currently performed according to the first pixel unit 1 and the first pixel unit 2, the color value of the first pixel unit 1 needs to be acquired, and the color values in the first pixel unit 2 need to be acquired, and then aggregation is performed according to the color values of the two pixel units, so that specific implementation of K in the K color values to be subjected to aggregation depends on the current object to be subjected to aggregation specifically, which is not particularly limited in this embodiment.
S1002 determines whether K is 1, if so, executes S1003, and if not, executes S1004.
In this embodiment, since the processing method of aggregating 1 color value and aggregating a plurality of color values are different, it is necessary to determine whether K is 1.
And S1003, determining the color value after the aggregation processing as the color value corresponding to the plurality of objects.
In a possible implementation manner, if K is 1, it indicates that only one color value currently needing aggregation processing is present, and color values corresponding to a plurality of objects may be directly determined as the color values after aggregation processing.
S1004, dividing the K color values into T color value sets according to the hue rotation error of each color value, wherein the hue rotation error of the color values in one color value set is less than or equal to a first threshold value, and T is an integer greater than or equal to 1.
In another possible implementation manner, if K is greater than 1, it indicates that there are actually multiple color values to be aggregated currently, and in order to improve the efficiency of aggregation processing in this embodiment, the K color values may be divided into T color value sets according to the hue rotation error of each color value.
It is worth noting that between any two colors, a color can be changed from one to another by hue rotation, and thus hue rotation errors can be used to indicate the distance between the two colors, e.g., hue rotation errors for light blue and deep blue are small, while hue rotation errors between light blue and pale yellow are certainly large.
In this embodiment, the K color values are divided according to the hue rotation error to obtain T color value sets, where the hue rotation error of the color values in one color value set is less than or equal to a first threshold value, that is, the color values in one color value set are relatively similar color values, and the first threshold value may be, for example, 5deg, where deg is deg, which is generally used to represent the number of angular degrees in metering.
In an actual implementation process, a specific implementation manner of the first threshold may be selected according to an actual requirement, and this embodiment does not particularly limit this.
That is to say, in the embodiment, the K color values that need to be aggregated are divided into a color value set with relatively similar color values, so as to obtain T color value sets.
S1005, obtaining an average color value corresponding to each color value set, wherein the average color value is an average value of the color values in the color value set.
And each color value set comprises at least one color value, so that the average value of the color values included in each color value set is obtained, and the average color value corresponding to each color value set is obtained.
S1006, determine whether T is equal to 1, if yes, execute S1007, and if no, execute S1008.
In this embodiment, the processing manner is different between the case where only one color value set currently exists and the case where a plurality of color value sets currently exist, and therefore, it may be determined whether T is equal to 1 or not first.
And S1007, determining the average color value corresponding to the color value set as the color value after the aggregation processing.
In a possible implementation manner, if T is equal to 1, it indicates that only 1 color value set currently exists, that is, K color values are all divided into this color value set, and an average color value corresponding to this color value set may be directly determined as the color value after aggregation processing.
In a possible example, assuming that 10 color values, namely color values 1-10, exist currently, and assuming that the 10 color values are divided into a color value set a, it indicates that the colors of the 10 color values are relatively similar, then the average color value corresponding to the color value set a, namely the average color value of the color values 1-10, is the color value after aggregation processing.
S1008 determines whether the hue rotation error of the average color value corresponding to the T color value sets is less than or equal to a second threshold, if so, executes S1009, and if not, executes S1010.
In another possible implementation, if T is greater than 1, this indicates that there are currently multiple color value sets, and in one possible example, it is assumed that there are currently 10 color values, respectively, color values 1 to 10, and it is assumed that the 10 color values are divided into 3 color value sets, respectively, a set of color values a {1, 2}, a set of color values B {3, 4, 5, 6, 7}, and a set of color values C {8, 9, 10}, where each color value set may determine a respective corresponding average color value.
Then, when performing aggregation processing, it needs to further determine whether the hue rotation error of the average color value corresponding to the T color value sets is smaller than or equal to a second threshold, where the second threshold and the first threshold may be set identically or differently, and this embodiment does not need to be particularly limited.
S1009 determines the average color value of the average color values corresponding to the T color value sets as the color value after the aggregation processing.
In a possible implementation manner, if the hue rotation error of the average color values corresponding to the T color value sets is less than or equal to the second threshold, it indicates that the average color values corresponding to the T color value sets are similar in color, so in this embodiment, the average color values of the average color values corresponding to the T color value sets may be directly determined as the aggregated color values.
For example, in the example described above, if the hue rotation errors of the average color values in the color value set a, the color value set B, and the color value set C are all smaller than the second preset threshold, it indicates that the average color values corresponding to the three color value sets are relatively similar, and therefore, the average color values of the three color value sets can be obtained according to the average color value in the color value set a, the average color value in the color value set B, and the average color value in the color value set C, so as to obtain the aggregated color value.
S1010, determining a target color value set in the T color value sets, and determining an average color value corresponding to the target color value set as a color value after aggregation processing, wherein the number of objects corresponding to the target color value set is the largest.
In another possible implementation manner, if the hue rotation error of the average color values corresponding to the T color value sets is not less than the second preset threshold, it indicates that there is still a certain difference between colors of the average color values corresponding to the T color value sets, and therefore in this embodiment, the target color value set may be determined in the T color value sets, and the average color values corresponding to the target color value set are determined as the aggregated color values.
In a possible implementation, the target color value set may be determined, for example, according to a ratio, where each color value set includes at least one color value, where the color values may correspond to respective objects, and then the color value set with the largest number of corresponding objects may be determined as the target color value set.
For example, in the example described above, the hue rotation error of the average color values of the color value set a, the color value set B, and the color value set C is not less than the second preset threshold, which indicates that there is a certain difference between the average color values corresponding to the three color value sets, and therefore, the target color value set may be determined according to the number of objects corresponding to the color value set a, the color value set B, and the color value set C.
For example, the color values 1 to 10 correspond to 10 objects, respectively, where the color value set a is {1, 2}, the color value set B is {3, 4, 5, 6, 7}, and the color value set C is {8, 9, 10}, it may be determined that the number of objects corresponding to the color value set a is 2, the number of objects corresponding to the color value set B is 5, and the number of objects corresponding to the color value set C is 3, and then the color value set B may be determined as a target color value set, and an average color value of the color value set B may be determined as an aggregated color value.
According to the screen display method provided by the embodiment of the application, the color values are firstly grouped according to the hue rotation error to obtain at least one color value set, then the final color values after aggregation processing are determined according to the average value of the at least one color value set, the orderliness of the aggregation processing can be effectively ensured, the processing efficiency is improved, in addition, through a grouping and re-averaging mode, and according to the error of the average color values among all the color value sets, the average value is finally determined, or the target color value set with the largest proportion is determined, so that the finally determined color values after aggregation processing can be ensured, the integral color in the current object can be reflected, and the accuracy of the aggregation processing can be improved.
On the basis of the foregoing embodiment, a system is performed on the screen display method provided in the present application with reference to fig. 11, and fig. 11 is a schematic flow chart of the screen display method provided in the present application.
As shown in fig. 11:
color value extraction and color value calculation can be currently performed for the display screen, and color value extraction and color value calculation can also be performed for the first image.
Taking the display screen as an example, for example, a color value extraction library of a third party open source can be used to extract all color values in the current display screen, and record the x coordinate and the y coordinate of a single pixel to generate a point set Pixels [ [ CX ] [ for example1,CY1,Col1],[CX2,CY2,Col2],......]. Wherein, CXjIs the x coordinate, CY, of pixel point jjIs the y coordinate, Col, of pixel point jjThe color value of pixel point j.
Then, for a plurality of pixels in the display screen, minimum atomic unit division may be performed, for example, taking a minimum unit 8px as a minimum atomic unit, and dividing a plurality of pixel points into a plurality of first pixel units, where the first pixel units may be expressed as:
ScrAunitAttr={ID,ColVAttr,PosAttr}
the unique identifier of the ID first pixel unit, the ColVAttr is an aggregation color value of the color values of the pixels in the first pixel unit, and the specific implementation of the aggregation color value may refer to the description in the foregoing embodiments, which is not described herein again, and the PosAttr is a set of coordinate information of the pixels included in the first pixel unit.
And according to the data visualization large screen design experience, a large screen theme conforming to the good human impression contains no more than 5 colors, so that aggregation calculation can be performed on the obtained multiple first pixel units to obtain 5 first target color values, and an aggregation path of each first target color value can be recorded by using the ID of each first pixel unit, wherein a plurality of first target colors are specifically obtained and can be selected according to actual requirements, which is not limited in this embodiment.
And the implementation manner of extracting color values and calculating color values according to the first picture is similar to that described above, and is not described herein again, and after the processing is completed, for example, 5 second target color values corresponding to the first picture may be obtained, that is, the theme color set to be replaced is obtained.
The first target color values and the second target color values are then sorted in the manner described in the above embodiment, and the first target color values and the second target color values are mapped one-to-one in order.
And then, according to the recorded aggregation path, determining first pixel units corresponding to each first target color value, and determining the replacement color values of the first pixel units as second target color values corresponding to the current first target color values.
And then, for each first pixel unit, generating pixel point color values with the same number by adopting a random algorithm according to the Pixels recorded in the step one and the similar colors, and replacing the similar colors generated randomly by the colors of the Pixels, so that a new data visualization large-screen theme is generated, wherein the theme after replacement is adaptive to the first picture.
In this embodiment, the adjusted theme may be further fine-tuned, for example, a hue, saturation, and darkness adjustment widget may be used to fine-tune the generated new theme to meet the requirement according to the requirement of the user.
In summary, the screen display method provided in the embodiment of the present application can extract and calculate color values based on the first picture and the display screen, and map the color values, thereby quickly and effectively implementing theme switching.
Fig. 12 is a schematic structural diagram of a screen display device according to an embodiment of the present application. As shown in fig. 9, the apparatus 120 includes: a processing module 1201, a determination module 1202, and a replacement module 1203.
The processing module 1201 is configured to aggregate color values of a plurality of pixels on a display screen to obtain N first target color values, where each first target color value corresponds to the plurality of pixels on the display screen, and N is an integer greater than 1;
the processing module 1201 is further configured to aggregate color values of multiple pixel points of the first image to obtain N second target color values;
a determining module 1202, configured to determine, in the N second target color values, a second target color value corresponding to each first target color value;
a replacing module 1203, configured to respectively replace, according to each of the second target color values, color values of a plurality of pixel points corresponding to the first target color value corresponding to each of the second target color values in the display screen.
In one possible design, the processing module 1201 is specifically configured to:
dividing the pixel points in the display screen to obtain a plurality of first pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each first pixel unit to obtain the color value of each first pixel unit;
and performing aggregation processing on the color values of the plurality of first pixel units to obtain the N first target color values.
In one possible design, the processing module 1201 is specifically configured to:
performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiA color value;
wherein, the i is 1, 2, 3 and … … in sequence until M isiIs N, the N first target color values are obtained.
In one possible design, i is 1; the processing module 1201 is specifically configured to:
determining a plurality of first-level pixel sets in the plurality of first pixel units, wherein each first-level pixel set comprises at least two first pixel units;
respectively carrying out aggregation processing on the color values of the first pixel units in each first-level pixel set to obtain the color value corresponding to each first-level pixel set, wherein the number of the color values corresponding to the plurality of first-level pixel sets is M1
In one possible design, i is greater than 1; the processing module 1201 is specifically configured to:
determining a plurality of ith-level pixel sets in the plurality of ith-1 level pixel sets, wherein each ith-level pixel set comprises at least two ith-1 level pixel sets;
respectively carrying out aggregation processing on color values corresponding to the (i-1) th-level pixel sets in each ith-level pixel set to obtain the color values corresponding to each ith-level pixel set, wherein the number of the color values corresponding to the plurality of ith-level pixel sets is Mi
In one possible design, the aggregation process includes:
acquiring K color values corresponding to a plurality of objects to be subjected to aggregation processing, wherein the objects are any one of the following objects: pixel points, pixel units and a pixel set, wherein K is an integer greater than or equal to 1;
if the K is 1, determining the color value after the aggregation processing as the color value corresponding to the plurality of objects;
and if the K is larger than 1, determining the color value after the polymerization treatment according to the hue rotation error of each color value.
In one possible design, the determining module 1202 is specifically configured to:
dividing the K color values into T color value sets according to the hue rotation error of each color value, wherein the hue rotation error of the color values in one color value set is less than or equal to a first threshold value, and T is an integer greater than or equal to 1;
acquiring an average color value corresponding to each color value set, wherein the average color value is an average value of the color values in the color value set;
and determining the color values after the aggregation processing according to the T and the average color value corresponding to each color value set.
In one possible design, the determining module 1202 is specifically configured to:
if the T is 1, determining the average color value corresponding to the color value set as the color value after the aggregation processing;
if the T is larger than 1, judging whether hue rotation errors of the average color values corresponding to the T color value sets are smaller than or equal to a second threshold value, if so, determining the average color values of the average color values corresponding to the T color value sets as the aggregated color values, otherwise, determining a target color value set in the T color value sets, and determining the average color values corresponding to the target color value set as the aggregated color values, wherein the number of objects corresponding to the target color value set is the largest.
In one possible design, the replacement module 1203 is specifically configured to:
acquiring an aggregation path of each first target color value, wherein the aggregation path is used for indicating at least one first pixel unit of the first target color value obtained through aggregation;
determining a second target color value corresponding to each first target color value as a replacement color value corresponding to each first pixel unit indicated by the aggregation path of each first target color value;
determining a replacement color value of each pixel point within the range of the first pixel unit according to the replacement color value corresponding to each first pixel unit, wherein the difference value between the replacement color value of each pixel point and the replacement color value of the corresponding first pixel unit is less than or equal to a preset threshold value;
and replacing the color value of each pixel point with the replacement color value.
In a possible design, the processing module 1201 is specifically configured to:
dividing the pixel points in the first image to obtain a plurality of second pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each second pixel unit to obtain the color value of each second pixel unit;
and performing aggregation processing on the color values of the plurality of second pixel units to obtain the N second target color values.
In one possible design, the determining module 1202 is specifically configured to:
sequencing the N first target color values according to the sequence of the number of pixel points corresponding to each first target color value from high to low;
sequencing the N second target color values according to the sequence of the number of pixel points corresponding to each second target color value from high to low;
determining a second target color value corresponding to each first target color value according to the N sorted first target color values and the N sorted second target color values; for any one first target color value, the order of the first target color value in the N first target color values is the same as the order of the second target color value corresponding to the first target color value in the N second target color values.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 13 is a schematic diagram of a hardware structure of a screen display device according to an embodiment of the present application, and as shown in fig. 13, the screen display device 130 according to the embodiment includes: a processor 1301 and a memory 1302; wherein
A memory 1302 for storing computer-executable instructions;
the processor 1301 is configured to execute the computer execution instructions stored in the memory to implement the steps performed by the screen display method in the foregoing embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 1302 may be separate or integrated with the processor 1301.
When the memory 1302 is independently provided, the screen display device further includes a bus 1303 for connecting the memory 1302 and the processor 1301.
The embodiment of the application also provides a computer-readable storage medium, wherein a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the screen display method executed by the screen display device is realized.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the scope of the technical solutions of the embodiments of the present application.

Claims (15)

1. A screen display method, comprising:
aggregating color values of a plurality of pixel points of a display screen to obtain N first target color values, wherein each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1;
aggregating the color values of a plurality of pixel points of the first image to obtain N second target color values;
determining a second target color value corresponding to each first target color value in the N second target color values;
and according to the second target color values, respectively replacing the color values of a plurality of pixel points corresponding to the first target color values corresponding to the second target color values in the display screen.
2. The method of claim 1, wherein aggregating color values of a plurality of pixels of a display screen to obtain N first target color values comprises:
dividing the pixel points in the display screen to obtain a plurality of first pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each first pixel unit to obtain the color value of each first pixel unit;
and performing aggregation processing on the color values of the plurality of first pixel units to obtain the N first target color values.
3. The method of claim 2, wherein aggregating the color values of the first plurality of pixel units to obtain the N first target color values comprises:
performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiA color value;
wherein, the i is 1, 2, 3 and … … in sequence until M isiIs N, the N first target color values are obtained.
4. The method of claim 3, wherein i is 1; performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiIndividual color values, comprising:
determining a plurality of first-level pixel sets in the plurality of first pixel units, wherein each first-level pixel set comprises at least two first pixel units;
respectively carrying out aggregation processing on the color values of the first pixel units in each first-level pixel set to obtain the color value corresponding to each first-level pixel set, wherein the number of the color values corresponding to the plurality of first-level pixel sets is M1
5. The method of claim 3, wherein i is greater than 1; performing polymerization treatment for the ith time according to the color values of the first pixel units to obtain MiIndividual color values, comprising:
determining a plurality of ith-level pixel sets in the plurality of ith-1 level pixel sets, wherein each ith-level pixel set comprises at least two ith-1 level pixel sets;
respectively carrying out aggregation processing on color values corresponding to the (i-1) th-level pixel sets in each ith-level pixel set to obtain the color values corresponding to each ith-level pixel set, wherein the number of the color values corresponding to the plurality of ith-level pixel sets is Mi
6. The method according to any one of claims 1 to 5, wherein the polymerization treatment comprises:
acquiring K color values corresponding to a plurality of objects to be subjected to aggregation processing, wherein the objects are any one of the following objects: pixel points, pixel units and a pixel set, wherein K is an integer greater than or equal to 1;
if the K is 1, determining the color value after the aggregation processing as the color value corresponding to the plurality of objects;
and if the K is larger than 1, determining the color value after the polymerization treatment according to the hue rotation error of each color value.
7. The method of claim 6, wherein determining the aggregated color values based on the hue rotation error for each color value comprises:
dividing the K color values into T color value sets according to the hue rotation error of each color value, wherein the hue rotation error of the color values in one color value set is less than or equal to a first threshold value, and T is an integer greater than or equal to 1;
obtaining an average color value corresponding to each color value set, wherein the average color value is an average value of the color values in the color value set;
and determining the color values after the aggregation processing according to the T and the average color value corresponding to each color value set.
8. The method of claim 7, wherein determining the aggregated processed color values from the T and the average color value corresponding to each set of color values comprises:
if the T is 1, determining the average color value corresponding to the color value set as the color value after the aggregation processing;
if the T is greater than 1, determining whether hue rotation errors of the average color values corresponding to the T color value sets are less than or equal to a second threshold, if so, determining the average color values of the average color values corresponding to the T color value sets as the aggregated color values, otherwise, determining a target color value set in the T color value sets, and determining the average color values corresponding to the target color value set as the aggregated color values, where the number of objects corresponding to the target color value set is the largest.
9. The method according to any one of claims 1 to 8, wherein, according to each of the second target color values, respectively replacing, in the display screen, color values of a plurality of pixels corresponding to the first target color value corresponding to each of the second target color values, comprises:
acquiring an aggregation path of each first target color value, wherein the aggregation path is used for indicating at least one first pixel unit of the first target color value obtained through aggregation;
determining a second target color value corresponding to each first target color value as a replacement color value corresponding to each first pixel unit indicated by the aggregation path of each first target color value;
determining a replacement color value of each pixel point within the range of the first pixel unit according to the replacement color value corresponding to each first pixel unit, wherein the difference value between the replacement color value of each pixel point and the replacement color value of the corresponding first pixel unit is less than or equal to a preset threshold value;
and replacing the color value of each pixel point with the replacement color value.
10. The method according to any one of claims 1 to 9, wherein aggregating the color values of a plurality of pixels of the first image to obtain N second target color values comprises:
dividing the pixel points in the first image to obtain a plurality of second pixel units, wherein each pixel unit comprises a preset number of pixel points;
respectively carrying out aggregation processing on the color values of the pixel points in each second pixel unit to obtain the color value of each second pixel unit;
and performing aggregation processing on the color values of the plurality of second pixel units to obtain the N second target color values.
11. The method of any of claims 1-10, wherein determining the second target color value corresponding to each first target color value among the N second target color values comprises:
sequencing the N first target color values according to the sequence of the number of pixel points corresponding to each first target color value from high to low;
sequencing the N second target color values according to the sequence of the number of pixel points corresponding to each second target color value from high to low;
determining a second target color value corresponding to each first target color value according to the sequenced N first target color values and the sequenced N second target color values; for any one first target color value, the order of the first target color value in the N first target color values is the same as the order of the second target color value corresponding to the first target color value in the N second target color values.
12. A screen display device, comprising:
the processing module is used for carrying out aggregation processing on color values of a plurality of pixel points of the display screen to obtain N first target color values, wherein each first target color value corresponds to the plurality of pixel points on the display screen, and N is an integer greater than 1;
the processing module is further configured to aggregate the color values of the multiple pixel points of the first image to obtain N second target color values;
a determining module, configured to determine, among the N second target color values, a second target color value corresponding to each first target color value;
and the replacing module is used for respectively replacing the color values of a plurality of pixel points corresponding to the first target color value corresponding to each second target color value in the display screen according to each second target color value.
13. A screen display device, comprising:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being configured to perform the method of any of claims 1 to 11 when the program is executed.
14. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any of claims 1-11 when executed by a processor.
CN202011584617.4A 2020-12-28 2020-12-28 Screen display method and device Active CN114691252B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011584617.4A CN114691252B (en) 2020-12-28 2020-12-28 Screen display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011584617.4A CN114691252B (en) 2020-12-28 2020-12-28 Screen display method and device

Publications (2)

Publication Number Publication Date
CN114691252A true CN114691252A (en) 2022-07-01
CN114691252B CN114691252B (en) 2023-05-30

Family

ID=82130207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011584617.4A Active CN114691252B (en) 2020-12-28 2020-12-28 Screen display method and device

Country Status (1)

Country Link
CN (1) CN114691252B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122389A (en) * 2010-01-12 2011-07-13 阿里巴巴集团控股有限公司 Method and device for judging image similarity
CN102831580A (en) * 2012-07-17 2012-12-19 西安电子科技大学 Method for restoring image shot by cell phone based on motion detection
US20150116227A1 (en) * 2013-10-30 2015-04-30 Htc Corporation Color Sampling Method and Touch Control Device thereof
CN105224315A (en) * 2015-09-11 2016-01-06 北京金山安全软件有限公司 Method and device for acquiring screen capture
CN105791659A (en) * 2014-12-19 2016-07-20 联想(北京)有限公司 Image processing method and electronic device
CN109191539A (en) * 2018-07-20 2019-01-11 广东数相智能科技有限公司 Oil painting generation method, device and computer readable storage medium based on image
CN110347456A (en) * 2019-05-28 2019-10-18 北京奇艺世纪科技有限公司 Image processing method, device, computer equipment and storage medium
CN111104193A (en) * 2018-10-25 2020-05-05 北京奇虎科技有限公司 Application program active interface display method and device, storage medium and terminal equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122389A (en) * 2010-01-12 2011-07-13 阿里巴巴集团控股有限公司 Method and device for judging image similarity
CN102831580A (en) * 2012-07-17 2012-12-19 西安电子科技大学 Method for restoring image shot by cell phone based on motion detection
US20150116227A1 (en) * 2013-10-30 2015-04-30 Htc Corporation Color Sampling Method and Touch Control Device thereof
CN105791659A (en) * 2014-12-19 2016-07-20 联想(北京)有限公司 Image processing method and electronic device
CN105224315A (en) * 2015-09-11 2016-01-06 北京金山安全软件有限公司 Method and device for acquiring screen capture
CN109191539A (en) * 2018-07-20 2019-01-11 广东数相智能科技有限公司 Oil painting generation method, device and computer readable storage medium based on image
CN111104193A (en) * 2018-10-25 2020-05-05 北京奇虎科技有限公司 Application program active interface display method and device, storage medium and terminal equipment
CN110347456A (en) * 2019-05-28 2019-10-18 北京奇艺世纪科技有限公司 Image processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114691252B (en) 2023-05-30

Similar Documents

Publication Publication Date Title
CN111080780B (en) Edge processing method and device for virtual character model
CN108765520B (en) Text information rendering method and device, storage medium and electronic device
CN110215695B (en) Game object selection method and device
CN107133909B (en) Method and device for recombining shaders
EP4035062A1 (en) Image analysis in pathology
CN113989167A (en) Contour extraction method, device, equipment and medium based on seed point self-growth
CN114492599A (en) Medical image preprocessing method and device based on Fourier domain self-adaptation
CN114723652A (en) Cell density determination method, cell density determination device, electronic apparatus, and storage medium
CN114691252A (en) Screen display method and device
US9754208B2 (en) Automatic rule coaching
WO2022226744A1 (en) Texture completion
CN108829882A (en) Formation gathering method, device, terminal and medium
CN113516738B (en) Animation processing method and device, storage medium and electronic equipment
CN110428453B (en) Data processing method, data processing device, data processing equipment and storage medium
CN109635839B (en) Unbalanced data set processing method and device based on machine learning
CN110766779A (en) Method and device for generating lens halo
CN110193201B (en) Game object selection method and device
CN114611170B (en) Shoe body generation method and device based on associated data
CN110175966A (en) Non-mated images generation method, system, server and storage medium
CN109670151A (en) File mergences method, apparatus and storage medium
CN113128253B (en) Reconstruction method and device of three-dimensional face model
CN117671040A (en) Color chart generation method and device, electronic equipment and computer readable storage medium
CN107193816B (en) Image searching method, virtual character image obtaining method and device
CN114495190A (en) Training method of face changing network model, image face changing method and related equipment
CN112565450A (en) Data processing method, system and platform based on artificial intelligence and Internet of things interaction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant