WO2020063030A1 - 主题色彩的调节方法、装置、存储介质及电子设备 - Google Patents
主题色彩的调节方法、装置、存储介质及电子设备 Download PDFInfo
- Publication number
- WO2020063030A1 WO2020063030A1 PCT/CN2019/095435 CN2019095435W WO2020063030A1 WO 2020063030 A1 WO2020063030 A1 WO 2020063030A1 CN 2019095435 W CN2019095435 W CN 2019095435W WO 2020063030 A1 WO2020063030 A1 WO 2020063030A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- color
- target
- data
- pixel information
- image
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G3/00—Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes
- G09G3/20—Control arrangements or circuits, of interest only in connection with visual indicators other than cathode-ray tubes for presentation of an assembly of a number of characters, e.g. a page, by composing the assembly by combination of individual elements arranged in a matrix no fixed position being assigned to or needed to be assigned to the individual characters or partial characters
- G09G3/2003—Display of colours
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/50—Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G5/00—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
- G09G5/10—Intensity circuits
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2360/00—Aspects of the architecture of display systems
- G09G2360/14—Detecting light within display terminals, e.g. using a single or a plurality of photosensors
- G09G2360/144—Detecting light within display terminals, e.g. using a single or a plurality of photosensors the light being ambient light
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2360/00—Aspects of the architecture of display systems
- G09G2360/14—Detecting light within display terminals, e.g. using a single or a plurality of photosensors
- G09G2360/145—Detecting light within display terminals, e.g. using a single or a plurality of photosensors the light originating from the display screen
Definitions
- the present application relates to the field of information processing technologies, and in particular, to a method, a device, a storage medium, and an electronic device for adjusting theme colors.
- the card information is The theme colors are fixed and may not be compatible with the display color of the display interface of the application currently running on the foreground, which requires manual adjustment by the user. The adjustment process is cumbersome and the theme color adjustment efficiency is poor.
- the embodiments of the present application provide a method, a device, a storage medium, and an electronic device for adjusting theme colors, which can improve the adjustment efficiency of theme colors.
- an embodiment of the present application provides a method for adjusting theme colors, including:
- the target display style data is loaded to generate a corresponding target theme color, and the target theme color and display information are combined and displayed.
- an apparatus for adjusting a theme color provided by an embodiment of the present application includes:
- An obtaining unit configured to obtain a currently displayed image to be identified
- An analysis unit configured to analyze the image to be identified to obtain target color data corresponding to the image to be identified
- a determining unit configured to perform similarity matching according to the target color data and preset display style data to determine target display style data that the target color data matches;
- a combining unit is configured to load the target display style data to generate a corresponding target theme color, and combine and display the target theme color and display information.
- a storage medium provided in an embodiment of the present application stores a computer program thereon, and when the computer program is run on a computer, the computer is caused to execute a method for adjusting a theme color as provided in any embodiment of the present application. .
- the electronic device includes a processor and a memory, and the processor executes steps by calling a computer program stored in the memory:
- the target display style data is loaded to generate a corresponding target theme color, and the target theme color and display information are combined and displayed.
- FIG. 1 is a system architecture diagram of an electronic device running according to an embodiment of the present application.
- FIG. 2 is a schematic flowchart of a theme color adjustment method according to an embodiment of the present application.
- FIG. 3 is another schematic flowchart of a theme color adjustment method according to an embodiment of the present application.
- FIG. 4 is a schematic block diagram of a theme color adjusting device according to an embodiment of the present application.
- FIG. 5 is another schematic block diagram of the theme color adjusting device according to an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- FIG. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
- module can be considered as a software object executing on the computing system.
- the different components, modules, engines, and services described in this article can be considered as implementation objects on this computing system.
- the device and method described herein are preferably implemented in software, and of course, they can also be implemented in hardware, which are all within the protection scope of this application.
- FIG. 1 is a system architecture diagram of an electronic device running provided by an embodiment of the present application.
- the system architecture is an Android system architecture.
- the system architecture may also be Apple (iphone Operating System). , IOS) system framework.
- the Android system architecture is the Android system architecture.
- the Android system architecture like its operating system, uses a layered architecture that is divided into four layers. From high to low are the Android application layer and the Android application framework. Layer (Application Framework), Android system running layer and Linux kernel layer.
- the application is a program written in the Java language that runs on a virtual machine, such as a desktop negative screen application, a camera application, an email client, an SMS message program, and a calendar.
- the desktop negative screen application is very powerful. , Can be used to search for applications in electronic devices, can also recommend applications commonly used in this machine, and so on.
- Application framework layer This layer is an application programming interface (API) framework used when writing core applications published by Google. Developers can also use these frameworks to develop their own applications, which simplifies Structural design of program development, but must adhere to the development principles of its framework.
- API application programming interface
- Linux kernel layer Android's core system services are given to the Linux 2.6 kernel, such as security, memory management, process management, network protocol stack, and driver model, etc. all depend on this kernel, such as the Binder IPC (Internet Process Connection Connection) driver , A special driver for Android, with a separate device node that provides inter-process communication.
- the Binder IPC Internet Process Connection Connection
- the display information transfer between different applications requires the Binder communication method to transmit the corresponding code information of the card information across processes.
- the theme color displayed after opening the card information in each application is fixed and will be the same as the current one in the foreground.
- the display color of the display interface of the running application is not suitable, which brings inconvenience to the user. Therefore, it is necessary to provide a theme color adjustment method, which can dynamically adjust the theme color of the card information and display the application currently running in the foreground. Interface display hue adaptation.
- the theme color adjusting device may be specifically integrated into an electronic device, such as a mobile phone, a tablet computer, a personal digital assistant (PDA, Personal Assistant), and the like.
- PDA personal digital assistant
- An embodiment of the present application provides a method for adjusting theme colors, including:
- the step of analyzing the image to be identified to obtain target color data corresponding to the image to be identified may include: calculating first color data of the image to be identified; and combining the first color data with The second color data corresponding to each pixel information in the image to be identified are compared to determine target pixel information with a color difference greater than a preset threshold; corresponding target color data is determined according to the number of the target pixel information.
- the step of calculating the first color data of the image to be identified may include: obtaining RGB image data corresponding to each pixel information on the image to be identified; and calculating the RGB image data of each pixel information. An average value, and the average value is determined as the first color data of the image to be identified; the first color data is compared with the second color data corresponding to each pixel information in the image to be identified to determine the color difference
- the step of the target pixel information whose degree is greater than a preset threshold includes: calculating a Euclidean distance between the RGB image data of each pixel information and the first color data; and determining the pixel information whose Euclidean distance is greater than the preset distance as the target pixel information.
- the step of determining the corresponding target color data according to the quantity of the target pixel information may include: determining whether the quantity of the target pixel information exceeds a preset quantity; when determining the quantity of the target pixel information When the preset number is exceeded, the color average value of each target pixel information is calculated, and the color average value is determined as the target color data; when it is determined that the number of target pixel information does not exceed the preset number, the first color is determined The data is determined as the target color data.
- the step of performing similarity matching according to the target color data and the preset display style data to determine the target display style data that the target color data matches may include: calculating the target color data and the preset Display the color difference of the pattern data; compare the size of each color difference to determine the preset display pattern data with the lowest color difference as the target display pattern data.
- the step of calculating the color difference between the target color data and the preset display style data may include: calculating the RGB image data in the target color data corresponding to the color matching style of each of the stacked style sheets. Euclidean distance of RGB image data; the step of comparing the size of each color difference and determining the preset display style data with the lowest color difference as the target display style data includes: comparing the size of each Euclidean distance, and the Euclidean distance The lowest cascading style sheet is determined as the target display style data.
- the step of loading the target display style data to generate a corresponding target theme color, and combining and displaying the target theme color with display information may include: displaying the target through a preset script frame The style data is analyzed to generate the corresponding theme color; the theme color is adjusted according to the current ambient light intensity to generate the target theme color; and the display information is rendered and displayed based on the target theme color.
- the embodiment of the present application provides a method for adjusting the theme color.
- the method for adjusting the theme color may include the following steps:
- step S101 a currently displayed image to be recognized is acquired.
- the trigger condition for acquiring the currently displayed image to be recognized may be a trigger when a display instruction is received on a third-party application running on the foreground, and the display instruction is used to display target display information on the third-party application.
- the target display information may be picture information, text information, card information, etc.
- the card information may be a dynamic view component running in a third-party application for displaying information simply and intuitively.
- the third-party application may include multiple information.
- a variety of applications such as browser applications, voice assistant applications, search applications, or desktop one-screen applications.
- a screenshot of the current display interface of the third-party application currently running in the foreground is taken, and the screenshot of the current display interface is determined as the currently displayed image to be identified, and the image to be identified It can be an RGB color mode image.
- the RGB color mode is a color standard in the industry. It is based on the changes of the three color channels of red (R), green (G), and blue (B) and their superposition. To obtain a variety of colors, RGB is the color representing the three channels of red, green, and blue. This standard includes almost all colors that human vision can perceive. It is one of the most widely used color systems.
- the three color channels of red (R), green (G), and blue (B) each have 256 levels of brightness, which are represented by numbers from 0, 1, 2, and 255. According to calculations, a total of 256 levels of RGB colors can be combined to about 1678. Thousands of colors.
- step S102 the image to be identified is analyzed to obtain target color data corresponding to the image to be identified.
- the RGB color data analysis of the image to be identified can be performed to determine the average RGB color data of the entire image to be identified, that is, the RGB color data of each pixel information in the image to be identified can be summed to calculate the average RGB color data.
- the RGB The average value of the color data is combined to express the corresponding color, and the average value of the RGB color data can be determined as the target color data corresponding to the image to be identified.
- the image to be identified may also be analyzed according to the HSV color model (Hue, Saturation, Value, HSV) to obtain target color data corresponding to the image to be identified, that is, the hue (H), The saturation (S) and lightness (V) colors are analyzed to obtain target color data composed of the corresponding average hue, average saturation, and average lightness of the image to be identified.
- HSV color model Hue, Saturation, Value, HSV
- HSV hue
- S saturation
- V lightness
- the color model may also have multiple types, and examples are not given here one by one.
- the step of analyzing the image to be identified to obtain target color data corresponding to the image to be identified may include:
- the average RGB color of the image to be identified can be calculated, and the average RGB color is used as the first color data. It is easy to understand that the average RGB color is to synthesize the RGB color data of the entire image to be identified The value obtained can reflect the average hue of the entire image to be identified.
- the average value of the RGB color can be compared with the corresponding RGB color data of each pixel information in the image to be identified, and the pixel information whose degree of difference of the RGB color data is greater than a preset threshold is determined as the target pixel information. Pixel information that is relatively prominent in relative display colors.
- the target color data can be determined according to the number of significant pixel information. When the number of significant pixel information is large, the color is rich, and the average RGB color of the target pixel information can be determined as the target color data. When the number of significant pixel information is small, it means that the colors are all concentrated, and the average RGB color of the image to be identified can be directly used as the target pixel information. Therefore, the accuracy of the target color data can be improved.
- the step of calculating the first color data of the image to be identified may include:
- the RGB image data corresponding to each pixel information on the image to be identified can be obtained in the order from top to bottom and from left to right, and the color values of the red (R) color channels corresponding to all pixels are summed. Calculate the average, sum the color values of the green (G) color channels of all pixels and average the color values of the blue (B) color channels of all pixels, and average the RGB image data. And determine the average value of the RGB image data as the first color data of the image to be identified.
- the first color data is compared with the second color data corresponding to each pixel information in the image to be identified, and the target pixel information having a color difference greater than a preset threshold is determined.
- Steps can include:
- the Euclidean distance is a distance formula between two points x1 and x2 in an N-dimensional Euclidean space.
- the RGB image data is RGB color data and is composed of three groups of data between 0 and 255.
- a suitable preset distance can be set, and the preset distance is a critical value for determining the size of the color difference.
- the European distance is greater than the preset distance, the RGB color data of the pixel information and the RGB color data of the image to be identified are explained.
- the color difference is large, and the pixel information is correspondingly determined as the target pixel information.
- step S103 similarity matching is performed with the preset display style data according to the target color data to determine the target display style data that the target color data matches.
- the card color mapping table may be stored in the database of the electronic device.
- the card color mapping table may include multiple preset display style data, and the preset display style data is a cascading style sheet (CascadingStyleSheets, CSS).
- This CSS can accurately control the layout of elements in the display information at the pixel level, supports almost all font size styles, and has the ability to edit web object and model styles. Therefore, the average value of RGB color data can be compared with Similarity matching is performed on the RGB color data corresponding to the color matching style of each cascading style sheet, and the cascading style sheet with the most similar RGB color data is determined as the target display style data.
- the step of performing similarity matching according to the target color data and the preset display style data to determine the target display style data matching the target color data may include:
- the color difference between the RGB color data in the target color data and the RGB color data corresponding to the color matching style of each layered style sheet is calculated.
- the color difference may be the Euclidean distance between the two.
- the size of each Euclidean distance is compared, and the cascading style sheet with the lowest Euclidean distance is determined as the target display style data, and the target display style data includes an adapted color matching style.
- step S104 the target display style data is loaded to generate a corresponding target theme color, and the target theme color and display information are combined and displayed.
- a cascading style sheet (that is, target display style data) containing an adapted color matching style can be loaded through a preset script framework of a third-party application.
- the preset script framework can be understood as a rendering engine, and the preset script framework can be JavaScript Scripting language framework.
- This JavaScript is a scripting language belonging to the web. It has been widely used in web application development. It is commonly used to add a variety of dynamic functions to web pages to provide users with a smoother and more beautiful browsing effect.
- This JavaScript script The language framework can render and parse the cascading style sheets.
- the target theme color corresponding to the matching color matching style and the display information generated by the layout code template are generated.
- the target theme color is combined with the display information to complete the drawing process of the theme color of the display information.
- the target theme color drawn on the display information matches the color of the current display interface of the third-party application.
- the step of loading the target display style data to generate the corresponding target theme color, and combining and displaying the target theme color with the display information may include:
- a cascading style sheet ie, target display style data
- a cascading style sheet ie, target display style data
- a JavaScript scripting language framework in a third-party application to generate a theme color corresponding to the adapted color matching style.
- the electronic device can detect the current ambient light intensity in real time through the ambient light sensor, and adjust the theme color accordingly according to the current ambient light intensity. Specifically, when the ambient light intensity is greater than the first preset threshold, the current The ambient light intensity is too large, and the color of the theme color is correspondingly deepened to generate the target theme color.
- the first preset threshold value is greater than the second preset threshold value, indicating that the current ambient light intensity is too low, and the color of the theme color is reduced accordingly to generate the target theme color.
- the ambient light intensity is between the first preset threshold and the second preset threshold, it indicates that the current ambient light intensity is more suitable, and the theme color can be directly determined as the target theme color.
- the target theme color is combined with the display information generated by the layout code template to complete the drawing process of the theme color of the display information, and the target theme color drawn on the display information is adapted to the color of the current display interface of the third-party application. , And adapt to the current ambient light intensity, can give users a more appropriate visual experience.
- the subject color adjustment method obtains the currently displayed image to be identified; analyzes the image to be identified to obtain target color data corresponding to the image to be identified; and according to the target color data and the preset display Similarity matching is performed on the style data to determine the target display style data that matches the target color data; the target display style data is loaded to generate the corresponding target theme color, and the target theme color and display information are combined and displayed.
- the target color of the subject can be dynamically determined based on the color data of the currently displayed image to be identified, and the display information can be rendered and combined according to the target color.
- the adjustment process is simple and convenient, and the adjustment efficiency of the theme color is improved.
- FIG. 3 is another schematic flowchart of a theme color adjustment method according to an embodiment of the present application.
- the method includes:
- step S201 a currently displayed to-be-recognized image is acquired.
- Card information usually refers to a rectangle containing certain pictures and text information as a guide. An entry for more details.
- the card-like design has even become the default approach to balance the aesthetics of the interface. Because the card information is very convenient to display that the content in the interface is composed of different elements, multiple applications can share one card information, such as browser applications, desktop one-screen applications, and weather applications can share one card information.
- the mobile phone When a third-party application running in the foreground on a mobile phone receives a display instruction, the mobile phone will take a screenshot of the current display interface on the third-party application, and determine the screenshot of the current display interface as the image to be identified. It is an RGB image, that is, the image to be identified is composed of multiple pixels, and each pixel can be represented by a corresponding proportion of RGB color data.
- step S202 RGB image data corresponding to each pixel information on the image to be identified is obtained, an average value of the RGB image data of each pixel information is calculated, and the average value is determined as the first color data of the image to be identified.
- the mobile phone obtains RGB image data corresponding to each pixel information on the image to be identified.
- the corresponding RGB image data of each pixel information includes the color value X of the red (R) color channel and the color of the green (G) color channel.
- Value Y and the color value Z of the blue (B) color channel sum the color value X of the R color channel of all pixels, the color value Y of the G color channel, and the color value Z of the B color channel, respectively.
- To obtain the total value of X, Y, and Z and respectively divide the total value of X, Y, and Z by the number of pixel information to obtain the average value of X, Y, and Z, and determine the average value of X, Y, and Z.
- the first color data can reflect the color of the image to be identified. For example, when the average value of X, Y, and Z is 255, 192, and 203, it is expressed as a pink color.
- step S203 the Euclidean distance between the RGB image data of each pixel information and the first color data is calculated, and the pixel information whose Euclidean distance is greater than the preset distance is determined as the target pixel information.
- the mobile phone calculates the square of the difference between the color value X of the R color channel and the average value X of the RGB image data of each pixel information, the square of the difference between the color value Y of the G color channel and the average value Y, and the B color.
- the squared value of the difference between the color value Z and the average value Z of the channel is summed up and squared up to obtain the Euclidean distance between the RGB image data of each pixel information and the first color data.
- the preset distance is a critical value for determining the color difference. When the distance is greater than the preset distance, it indicates that the color difference exceeds a certain value, which is pixel information with more prominent colors. By analogy, the pixel information whose Euclidean distance is greater than the preset distance is determined as the target pixel information.
- step S204 it is determined whether the number of target pixel information exceeds a preset number.
- the preset number may be a corresponding proportion of the total number of pixel information. For example, when there is 100 pixel information, the preset number may be 20, which is one fifth of the total number of pixel information.
- step S205 a color average value of each target pixel information is calculated, and the color average value is determined as the target color data.
- the calculation process is to sum the corresponding values of the R channel of each target pixel information to calculate the average value, to calculate the average values of the corresponding value of the G channel, and to calculate the average value of the corresponding value of the B channel, to calculate the target pixel information.
- the color average is determined as the target color data.
- step S206 the first color data is determined as the target color data.
- the mobile phone determines that the number of target pixel information does not exceed a preset number, it indicates that the colors of the image to be identified are concentrated and the contrast is small, so the first color data may be directly determined as the target color data.
- step S207 the degree of color difference between the target color data and the preset display style data is calculated, the magnitude of each color difference is compared, and the preset display style data with the lowest color difference is determined as the target display style data.
- the database on the mobile phone can store multiple preset display style data, and each preset display style data includes RGB image data, which represents a theme of a corresponding color matching style. Therefore, the RGB image of the target color data can be calculated.
- the Euclidean distance of the RGB image data corresponding to each preset display style data, and the preset display style data with the smallest Euclidean distance is determined as the target display style data, and the color matching style of the target display style data and the current display of the third-party application The interface is closest.
- step S208 the target display style data is parsed through a preset script frame to generate a corresponding theme color.
- the mobile phone parses the target display style data through a preset JavaScript scripting language framework to generate the corresponding theme color.
- step S209 the theme color is adjusted correspondingly according to the current ambient light intensity to generate a target theme color, and the display information is rendered and displayed based on the target theme color.
- the mobile phone can detect the ambient light intensity in real time through the ambient light sensor.
- the ambient light intensity is greater than the first preset threshold, it indicates that the current ambient light intensity is too large, and the theme color is correspondingly deepened to generate a target. Theme color.
- the first preset threshold value is greater than the second preset threshold value, indicating that the current ambient light intensity is too low, and the color of the theme color is reduced accordingly to generate the target theme color.
- the ambient light intensity is between the first preset threshold and the second preset threshold, it indicates that the current ambient light intensity is more suitable, and the theme color can be directly determined as the target theme color.
- the mobile phone combines the target theme color with the display information generated by the layout code template, completes the color drawing process of the display information, and displays the drawn display information on a third-party application.
- the subject color adjustment method obtains the currently displayed image to be identified, calculates an average value of RGB image data corresponding to each pixel information on the image to be identified, and uses the average value as the first A color data, the pixel information having the Euclidean distance between the RGB image data of the pixel information and the first color data greater than a preset distance is determined as the target pixel information, the target color data is dynamically determined according to the amount of the target pixel information, and the target color data is determined The target display style data with the most similar colors is loaded, and the target display style data is loaded to generate an adapted theme color. The theme color is adjusted according to the ambient light to obtain the target theme color. The target theme color is combined with the display information and displayed.
- the target color of the subject can be dynamically determined based on the color data of the currently displayed image to be identified, and the display information can be rendered and combined according to the target color.
- the adjustment process is simple and convenient, and the adjustment efficiency of the theme color is improved.
- the embodiment of the present application further provides a device based on the above-mentioned theme color adjustment method.
- the meaning of the nouns is the same as in the above-mentioned theme color adjustment method.
- An embodiment of the present application provides a theme color adjusting device, including:
- An obtaining unit configured to obtain a currently displayed image to be identified
- An analysis unit configured to analyze the image to be identified to obtain target color data corresponding to the image to be identified
- a determining unit configured to perform similarity matching according to the target color data and preset display style data to determine target display style data that the target color data matches;
- a combining unit is configured to load the target display style data to generate a corresponding target theme color, and combine and display the target theme color and display information.
- the analysis unit includes a calculation subunit for calculating first color data of the image to be identified, and a comparison subunit for each of the first color data and the image to be identified.
- the second color data corresponding to one pixel information is compared to determine target pixel information with a color difference greater than a preset threshold; a determination subunit is configured to determine corresponding target color data according to the number of the target pixel information.
- the calculation subunit is specifically configured to: obtain RGB image data corresponding to each pixel information on the image to be identified; calculate an average value of the RGB image data of each pixel information, and set the average value Determine the first color data of the image to be identified;
- the comparison subunit is specifically configured to calculate the Euclidean distance between the RGB image data of each pixel information and the first color data; and determine the pixel information whose Euclidean distance is greater than a preset distance Is the target pixel information.
- the determining subunit is specifically configured to: determine whether the number of the target pixel information exceeds a preset number; when it is determined that the number of the target pixel information exceeds the preset number, calculate each target pixel information And determine the target color data as the target color data; when it is determined that the number of target pixel information does not exceed a preset number, determine the first color data as target color data.
- the determining unit is specifically configured to: calculate a degree of color difference between the target color data and the preset display style data; compare the size of each color difference to a preset display style with the lowest color difference The data is determined as the target display style data.
- FIG. 4 is a schematic block diagram of a theme color adjusting device according to an embodiment of the present application.
- the theme color adjusting device 300 includes: an obtaining unit 31, an analyzing unit 32, a determining unit 33, and a combining unit 34.
- the generating unit 31 is configured to obtain a currently displayed to-be-recognized image.
- the generating unit 31 when the generating unit 31 detects that a display instruction is received on the third-party application, it takes a screenshot of the current display interface of the third-party application currently running in the foreground, and determines the screenshot of the current display interface as the currently displayed image to be identified.
- the image to be identified may be an RGB color mode image.
- the analysis unit 32 is configured to analyze the image to be identified to obtain target color data corresponding to the image to be identified.
- the analysis unit 32 can perform RGB color data analysis on the image to be identified, and determine the average RGB color data of the entire image to be identified. That is, the RGB color data of each pixel information in the image to be identified can be summed to calculate the average value of the RGB color data. The average value of the RGB color data is combined to show the corresponding color, and the average value of the RGB color data can be determined as the corresponding target color data of the image to be identified.
- the analysis unit 32 may further analyze the image to be identified according to the HSV color model (Hue, Saturation, Value, HSV) to obtain target color data corresponding to the image to be identified, that is, the hue ( H), saturation (S), and lightness (V) analysis, to obtain target color data composed of the average hue, average saturation, and average lightness corresponding to the image to be identified.
- HSV color model Hue, Saturation, Value, HSV
- HSV hue
- S saturation
- V lightness
- the color model may also have multiple types, and examples are not given here one by one.
- the analysis unit 32 is specifically configured to calculate first color data of the image to be identified; and compare the first color data with second color data corresponding to each pixel information in the image to be identified To determine target pixel information with a color difference greater than a preset threshold; and determine corresponding target color data according to the number of the target pixel information.
- the analysis unit 32 is further specifically configured to obtain RGB image data corresponding to each pixel information on the image to be identified; calculate an average value of the RGB image data of each pixel information, and determine the average value Is the first color data of the image to be identified; calculate the Euclidean distance between the RGB image data of each pixel information and the first color data; determine the pixel information whose Euclidean distance is greater than a preset distance as the target pixel information; according to the target pixel information The corresponding target color data is determined by the number of.
- a determining unit 33 is configured to perform similarity matching with preset display style data according to the target color data to determine target display style data that the target color data matches.
- the card color mapping table may be stored in the database of the electronic device.
- the card color mapping table may include multiple preset display style data, and the preset display style data is a cascading style sheet (CascadingStyleSheets, CSS), which can perform pixel-level precise control on the layout of the element position in the display information, supports almost all font size styles, and has the ability to edit web object and model styles. Therefore, the determination unit 33 can convert RGB color data The average value is matched with the RGB color data corresponding to the color matching style of each cascading style sheet, and the cascading style sheet with the most similar RGB color data is determined as the target display style data.
- a cascading style sheet CSS
- the determining unit 33 is specifically configured to calculate a degree of color difference between the target color data and the preset display style data; compare the magnitude of each color difference to set the preset display style data with the lowest color difference Determine the target display style data.
- the combining unit 34 is configured to load the target display style data to generate a corresponding target theme color, and combine and display the target theme color and display information.
- the combining unit 34 can load a cascading style sheet (that is, target display style data) containing a suitable color matching style through a preset script framework of a third-party application.
- the preset script framework can be understood as a rendering engine and the preset script framework.
- the combining unit 34 will generate a target theme color corresponding to the matching color matching style and display information generated by the layout code template, and combine the target theme color with the display information to complete the theme color of the display information.
- the color of the target theme drawn on the display information is adapted to the color of the current display interface of the third-party application.
- the combining unit 34 is specifically configured to parse the target display style data through a preset script frame to generate a corresponding theme color; adjust the theme color accordingly according to the current ambient light intensity to generate a target Theme color; render and display the display information based on the target theme color.
- FIG. 5 is a schematic diagram of another module of the theme color adjusting device according to an embodiment of the present application.
- the theme color adjusting device 300 may further include:
- the analysis unit 32 may include a calculation subunit 321, a comparison subunit 322, and a determination subunit 323.
- the calculation subunit 321 is configured to calculate first color data of the image to be identified.
- the comparison subunit 322 is configured to compare the first color data with the second color data corresponding to each pixel information in the image to be identified, and determine target pixel information with a color difference greater than a preset threshold.
- the determining subunit 323 is configured to determine corresponding target color data according to the quantity of the target pixel information.
- the subject color adjustment device obtains the currently displayed image to be identified through the obtaining unit 31; the analysis unit 32 analyzes the image to be identified to obtain target color data corresponding to the image to be identified; and a determining unit 33 Perform similarity matching according to the target color data and the preset display style data to determine the target display style data that the target color data matches; the combining unit 34 loads the target display style data to generate the corresponding target theme color, and the target theme color and The display information is combined and displayed.
- the target color of the subject can be dynamically determined based on the color data of the currently displayed image to be identified, and the display information can be rendered and combined according to the target color.
- the adjustment process is simple and convenient, and the adjustment efficiency of the theme color is improved.
- the electronic device 500 includes a processor 501 and a memory 502.
- the processor 501 is electrically connected to the memory 502.
- the processor 500 is a control center of the electronic device 500, and uses various interfaces and lines to connect various parts of the entire electronic device.
- the processor 500 runs or loads a computer program stored in the memory 502, and calls data stored in the memory 502 to execute Various functions of the electronic device 500 and data are processed to perform overall monitoring of the electronic device 500.
- the memory 502 can be used to store software programs and modules.
- the processor 501 executes various functional applications and data processing by running computer programs and modules stored in the memory 502.
- the memory 502 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, a computer program (such as a sound playback function, an image playback function, etc.) required for at least one function; the storage data area may store data according to Data created by the use of electronic devices, etc.
- the memory 502 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may further include a memory controller to provide the processor 501 with access to the memory 502.
- the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and the processor 501 runs the stored data in the memory 502
- a computer program in the computer to achieve various functions, as follows:
- the processor 501 may specifically perform the following steps:
- the corresponding target color data is determined according to the amount of the target pixel information.
- the processor 501 may specifically perform the following steps:
- the step of comparing the first color data with the second color data corresponding to each pixel information in the image to be identified to determine target pixel information with a color difference greater than a preset threshold includes:
- Pixel information whose Euclidean distance is greater than a preset distance is determined as target pixel information.
- the processor 501 may specifically perform the following steps:
- the first color data is determined as the target color data.
- the processor 501 may specifically perform the following steps:
- the magnitude of each color difference is compared, and the preset display style data with the lowest color difference is determined as the target display style data.
- the processor 501 when calculating the color difference between the target color data and the preset display style data, the processor 501 may specifically perform the following steps:
- the step of comparing the size of each color difference and determining the preset display style data with the lowest color difference as the target display style data includes:
- the size of each Euclidean distance is compared, and the cascading style sheet with the lowest Euclidean distance is determined as the target display style data.
- the processor 501 may specifically perform the following steps:
- the electronic device in the embodiment of the present application obtains the currently displayed to-be-recognized image; analyzes the to-be-recognized image to obtain target color data corresponding to the to-be-recognized image; performs similarity based on the target color data and preset display style data Match to determine the target display style data that the target color data matches; load the target display style data to generate the corresponding target theme color, combine and display the target theme color with the display information.
- the target color of the subject can be dynamically determined based on the color data of the currently displayed image to be identified, and the display information can be rendered and combined according to the target color.
- the adjustment process is simple and convenient, and the adjustment efficiency of the theme color is improved.
- the electronic device 500 may further include a display 503, a radio frequency circuit 504, an audio circuit 505, and a power supply 506.
- the display 503, the radio frequency circuit 504, the audio circuit 505, and the power supply 506 are electrically connected to the processor 501, respectively.
- the display 503 may be used to display information input by the user or information provided to the user and various graphical user interfaces. These graphical user interfaces may be composed of graphics, text, icons, videos, and any combination thereof.
- the display 503 may include a display panel.
- the display panel may be configured by using a liquid crystal display (Liquid Crystal Display, LCD), or an organic light emitting diode (Organic Light-Emitting Diode, OLED).
- the radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic devices through wireless communication, and transmit and receive signals to and from the network device or other electronic devices.
- the audio circuit 505 may be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
- the power supply 506 can be used to power various components of the electronic device 500.
- the power supply 506 may be logically connected to the processor 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
- the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
- An embodiment of the present application further provides a storage medium.
- the storage medium stores a computer program, and when the computer program is run on a computer, the computer is caused to execute the method for adjusting a theme color in any of the foregoing embodiments, for example,
- the currently displayed to-be-recognized image is analyzed; the to-be-recognized image is analyzed to obtain target color data corresponding to the to-be-recognized image; similarity matching is performed according to the target color data and the preset display style data to determine the target display style data matching the target color data; Load the target display style data to generate the corresponding target theme color, combine and display the target theme color with the display information.
- the storage medium may be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (Random Access Memory, RAM).
- ROM read-only memory
- RAM Random Access Memory
- the computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device.
- the flow of the embodiment of the color adjustment method may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
- the theme color adjusting device in the embodiment of the present application its functional modules may be integrated in one processing chip, or each module may exist separately physically, or two or more modules may be integrated in one module.
- the above integrated modules may be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- Computer Hardware Design (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Processing Or Creating Images (AREA)
- Image Processing (AREA)
- Color Image Communication Systems (AREA)
- Image Analysis (AREA)
Abstract
本申请公开了一种主题色彩的调节方法,包括:获取当前显示的待识别图像并进行分析,得到待识别图像相应的目标色彩数据;根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据;加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示。
Description
本申请要求于2018年09月29日提交中国专利局、申请号为201811151238.9、发明名称为“一种主题色彩的调节方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及信息处理技术领域,尤其涉及一种主题色彩的调节方法、装置、存储介质及电子设备。
随着电子技术的不断发展,电子设备如手机的功能越来越强大,用户可以通过各式各样的应用程序去浏览信息,如浏览文字信息、图像信息、音视频信息以及卡片信息等等。
目前,手机在通过当前应用程序对卡片信息进行浏览时,由于卡片信息的显示样式数据都是固定不变的,所以在通过应用程序中的渲染引擎对卡片信息进行渲染并显示后,卡片信息的主题色彩都是固定不变的,可能与当前运行在前台上的应用程序的显示界面的显示色调不适配,需要用户进行手动调节,调节过程比较繁琐,主题色彩的调节效率较差。
发明内容
本申请实施例提供一种主题色彩的调节方法、装置、存储介质及电子设备,可以提升主题色彩的调节效率。
第一方面,本申请实施例提供了一种主题色彩的调节方法,包括:
获取当前显示的待识别图像;
对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据;
根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据;
加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示。
第二方面,本申请实施例提供了的一种主题色彩的调节装置,包括:
获取单元,用于获取当前显示的待识别图像;
分析单元,用于对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据;
确定单元,用于根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据;
结合单元,用于加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示。
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请任一实施例提供的主题色彩的调节方法。
第四方面,本申请实施例提供的电子设备,包括处理器和存储器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行步骤:
获取当前显示的待识别图像;
对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据;
根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据;
加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示。
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其它有益效果显而易见。
图1为本申请实施例所提供电子设备运行的系统架构图。
图2是本申请实施例提供的主题色彩的调节方法的流程示意图。
图3为本申请实施例提供的主题色彩的调节方法的另一流程示意图。
图4为本申请实施例提供的主题色彩的调节装置的模块示意图。
图5为本申请实施例提供的主题色彩的调节装置的另一模块示意图。
图6为本申请实施例提供的电子设备的结构示意图。
图7为本申请实施例提供的电子设备的另一结构示意图。
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。
本文所使用的术语「模块」可看做为在该运算系统上执行的软件对象。本文该的不同组件、模块、引擎及服务可看做为在该运算系统上的实施对象。而本文该的装置及方法优选的以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。
请参阅图1,图1为本申请实施例所提供电子设备运行的系统架构图,该系统架构为安卓(Android)系统架构,在一实施方式中,该系统架构还可以为苹果(iphone Operating System,IOS)系统框架等。该安卓系统架构是安卓系统的体系结构,安卓的系统架构和其操作系统一样,采用了分层的架构,共分为四层,从高到低分别是安卓应用层(Application),安卓应用框架层(Application Framework),安卓系统运行层和Linux内核层。
应用层:应用是用java语言编写的运行在虚拟机上的程序,比如桌面负一屏应用、摄像机应用、Email客户端、SMS短消息程序以及日历等,该桌面负一屏应用的功能很强大,可以用于搜索电子设备中的应用,也可以推荐本机常用的应用程序等等。
应用框架层:这一层是编写谷歌(Google)发布的核心应用时所使用的应用程序编程接口(Application Programming Interface,API)框架,开发人员同样可以使用这些框架来开发自己的应用,这样便简化了程序开发的结构设计,但是必须要遵守其框架的开发原则。
系统运行库(C/C++库以及安卓运行库)层:当使用安卓应用框架时,安卓系统会通过一些C/C++库来支持我们使用的各个组件,使其更好的为我们服务,比如其中的SQLite(关系数据库),Webkit(Web浏览器引擎)。
Linux内核层:安卓的核心系统服务给予Linux2.6内核,如安全性、内存管理、进程 管理、网络协议栈和驱动模型等都依赖于该内核,比如Binder IPC(Internet Process Connection进程间通信)驱动,安卓的一个特殊驱动程序,具有单独的设备节点,提供进程间通信的功能。
其中,彼此不同的应用之间的显示信息传递,如桌面负一屏应用与桌面应用之间的卡片信息传递,需要通过Binder通讯方式,将卡片信息相应的代码信息进行跨进程传输。需要说明的是,由于代码信息中的显示样式数据都是固定不变的,会导致传递的卡片信息在每一个应用中打开后显示的主题色彩都是固定不变的,会与当前在前台上运行的应用的显示界面的显示色调不适配,给用户带来不便,因此,需要提供一种主题色彩的调节方法,可以动态调节卡片信息的主题色彩,与当前在前台上运行的应用的显示界面的显示色调适配。
以下进行具体分析说明。
在本实施例中,将从主题色彩的调节装置的角度进行描述,该主题色彩的调节装置具体可以集成在电子设备,比如手机、平板电脑、掌上电脑(PDA,Personal Digital Assistant)等。
本申请实施例提供一种主题色彩的调节方法,包括:
获取当前显示的待识别图像;
对该待识别图像进行分析,得到该待识别图像相应的目标色彩数据;
根据该目标色彩数据与预设显示样式数据进行相似度匹配,以确定该目标色彩数据匹配的目标显示样式数据;
加载该目标显示样式数据,以生成相应的目标主题色彩,将该目标主题色彩与显示信息进行结合并显示。
在一种实施方式中,该对该待识别图像进行分析,得到该待识别图像相应的目标色彩数据的步骤,可以包括:计算该待识别图像的第一色彩数据;将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;根据该目标像素信息的数量确定出相应的目标色彩数据。
在一种实施方式中,该计算该待识别图像的第一色彩数据的步骤,可以包括:获取该待识别图像上每一像素信息相应的RGB图像数据;计算每一像素信息的RGB图像数据的平均值,并将该平均值确定为待识别图像的第一色彩数据;该将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息的步骤,包括:计算每一像素信息的RGB图像数据与该第一色彩数据的欧式距离;将欧式距离大于预设距离的像素信息确定为目标像素信息。
在一种实施方式中,该根据该目标像素信息的数量确定出相应的目标色彩数据的步骤,可以包括:判断该目标像素信息的数量是否超过预设数量;当判断出该目标像素信息的数量超过预设数量时,计算每一目标像素信息的色彩平均值,并将该色彩平均值确定为目标色彩数据;当判断出该目标像素信息的数量不超过预设数量时,将该第一色彩数据确定为目标色彩数据。
在一种实施方式中,该根据该目标色彩数据与预设显示样式数据进行相似度匹配,以确定该目标色彩数据匹配的目标显示样式数据的步骤,可以包括:计算该目标色彩数据与 预设显示样式数据的色彩差异度;比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
在一种实施方式中,该计算该目标色彩数据与预设显示样式数据的色彩差异度的步骤,可以包括:计算该目标色彩数据中的RGB图像数据与每一层叠样式表的配色风格相应的RGB图像数据的欧式距离;该比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据的步骤,包括:比较每一欧式距离的大小,将欧式距离最低的层叠样式表确定为目标显示样式数据。
在一种实施方式中,该加载该目标显示样式数据,以生成相应的目标主题色彩,将该目标主题色彩与显示信息进行结合并显示的步骤,可以包括:通过预设脚本框架对该目标显示样式数据进行解析,生成相应的主题色彩;根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色彩;基于目标主题色彩对显示信息进行渲染并显示。
本申请实施例提供一种主题色彩的调节方法,如图2所示,该主题色彩的调节方法,可以包括以下步骤:
在步骤S101中,获取当前显示的待识别图像。
需要说明的是,获取当前显示的待识别图像的触发条件可以为运行在前台上的第三方应用上接收到显示指令时进行触发,该显示指令用于在第三方应用上进行显示目标显示信息,该目标显示信息可以为图片信息、文字信息以及卡片信息等等,该卡片信息可以为运行于第三方应用中的动态化视图组件,用于简单直观的进行显示信息,该第三方应用可以包括多种多样的应用程序,如浏览器应用、语音助手应用、搜索应用或者桌面负一屏应用等等。
其中,当检测到第三方应用上接收到显示指令时,截取当前运行在前台上的第三方应用当前显示界面的截图,将当前显示界面的截图确定为当前显示的待识别图像,该待识别图像可以为RGB色彩模式图像,该RGB色彩模式是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。该红(R)、绿(G)、蓝(B)三个颜色通道各有256级亮度,用数字表示从0、1、2直至255,按照计算,256级的RGB色彩总共能组合约1678万种色彩。
在步骤S102中,对待识别图像进行分析,得到待识别图像相应的目标色彩数据。
其中,可以对待识别图像进行RGB色彩数据分析,确定整个待识别图像的平均RGB色彩数据,即可以对待识别图像中的每一像素信息的RGB色彩数据进行求和算RGB色彩数据平均值,该RGB色彩数据平均值进行组合,可表现出相应的色彩,可以将该RGB色彩数据平均值确定为待识别图像相应的目标色彩数据。
在一实施方式中,还可以根据HSV颜色模型(Hue,Saturation,Value,HSV)对待识别图像进行分析,得到待识别图像相应的目标色彩数据,即还可以通过对待识别图像的色调(H)、饱和度(S)以及明度(V)颜进行分析,得到待识别图像相应的平均色调、平均饱和度以及平均明度组成的目标色彩数据。该颜色模型还可以有多种,此处不一一进行举例。
在一些实施方式中,对待识别图像进行分析,得到待识别图像相应的目标色彩数据的 步骤,可以包括:
(1)计算该待识别图像的第一色彩数据;
(2)将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;
(3)根据该目标像素信息的数量确定出相应的目标色彩数据。
其中,首先可以计算出待识别图像的RGB色彩平均值,将该RGB色彩平均值作为第一色彩数据,容易理解的是,该RGB色彩平均值为对整个待识别图像的RGB色彩数据进行综合而得出的值,可以反映出整个待识别图像的平均色调。
进一步的,可以将RGB色彩平均值与待识别图像中的每一像素信息相应的RGB色彩数据进行对比,将RGB色彩数据差异度大于预设阈值的像素信息确定为目标像素信息,该目标像素信息为相对显示颜色比较显著的像素信息。最后可以根据比较显著的像素信息的数量确定出目标色彩数据,当比较显著的像素信息的数量较多时,说明颜色比较丰富,可以单独的将目标像素信息的RGB色彩平均值确定为目标色彩数据,当比较显著的像素信息的数量较少时,说明颜色均为集中,可以直接将待识别图像的RGB色彩平均值作为目标像素信息。因此,可以提升目标色彩数据的准确性。
在一些实施方式中,该计算该待识别图像的第一色彩数据的步骤,可以包括:
(1.1)获取该待识别图像上每一像素信息相应的RGB图像数据;
(1.2)计算每一像素信息的RGB图像数据的平均值,并将该平均值确定为待识别图像的第一色彩数据。
其中,可以根据自上而下以及自左向右的顺序获取该待识别图像上的每一像素信息相应的RGB图像数据,并且将所有像素相应的红(R)颜色通道的色彩值进行求和算平均,将所有像素相应的绿(G)颜色通道的色彩值进行求和算平均以及将所有像素相应的蓝(B)颜色通道的色彩值进行求和算平均,得到RGB图像数据的平均值,并将该RGB图像数据的平均值确定为待识别图像的第一色彩数据。
相应的,在一些实施方式中,该将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息的步骤,可以包括:
(2.1)计算每一像素信息的RGB图像数据与该第一色彩数据的欧式距离;
(2.2)将欧式距离大于预设距离的像素信息确定为目标像素信息。
其中,该欧式距离为N维欧氏空间中两点x1与x2间的距离公式,该RGB图像数据即为RGB色彩数据,为三组0至255之间的数据组成。通过计算每一像素信息的RGB图像数据与待识别图像的RGB色彩平均值之间的欧式距离,可以得到两者在3维欧式空间中的距离,该欧式距离越大,说明该像素信息的RGB色彩数据与待识别图像的RGB色彩数据的色差越大,该欧式距离越小,说明该像素信息的RGB色彩数据与待识别图像的RGB色彩数据的色差越小。
进一步的,可以设置一个合适的预设距离,该预设距离为判定色差大小的临界值,当欧式距离大于该预设距离时,说明该像素信息的RGB色彩数据与待识别图像的RGB色彩数据的色差较大,相应的将该像素信息确定为目标像素信息。
在步骤S103中,根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据。
其中,电子设备的数据库中会存储卡片配色映射表,该卡片配色映射表中可以包括多个预设显示样式数据,该预设显示样式数据为多个配色风格的层叠样式表(Cascading Style Sheets,CSS),该CSS能够对显示信息中的元素位置的排版进行像素级精确控制,支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力,因此,可以将RGB色彩数据平均值与每一层叠样式表的配色风格相应的RGB色彩数据进行相似度匹配,将RGB色彩数据最相似的层叠样式表确定为目标显示样式数据。
在一些实施方式中,该根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据的步骤,可以包括:
(1)计算该目标色彩数据与预设显示样式数据的色彩差异度;
(2)比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
其中,计算目标色彩数据中的RGB色彩数据与每一层叠样式表的配色风格相应的RGB色彩数据的色彩差异度,在一实施方式中,该色彩差异度可以为两者之间的欧式距离。比较每一欧式距离的大小,将欧式距离最低的层叠样式表确定为目标显示样式数据,该目标显示样式数据包括适配的配色风格。
在步骤S104中,加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示。
其中,可以通过第三方应用的预设脚本框架加载包含适配的配色风格的层叠样式表(即目标显示样式数据),该预设脚本框架可以理解为渲染引擎,该预设脚本框架可以为JavaScript脚本语言框架,该JavaScript是一种属于网络的脚本语言,已经被广泛用于Web应用开发,常用来为网页添加各式各样的动态功能,为用户提供更流畅美观的浏览效果,该JavaScript脚本语言框架可以对层叠样式表进行渲染解析。
进一步的,在渲染解析后,会生成适配的配色风格相应的目标主题色彩以及由布局代码模板生成的显示信息,将目标主题色彩结合到显示信息上,可以完成显示信息的主题色彩的绘制过程,且在该显示信息上绘制的目标主题色彩与第三方应用程序当前显示界面的色彩适配。
在一些实施方式中,该加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示的步骤,可以包括:
(1)通过预设脚本框架对该目标显示样式数据进行解析,生成相应的主题色彩;
(2)根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色彩;
(3)基于目标主题色彩对显示信息进行渲染并显示。
其中,可以通过第三方应用中的JavaScript脚本语言框架对包含适配的配色风格的层叠样式表(即目标显示样式数据)进行加载,生成适配的配色风格相应的主题色彩。
进一步的,由于环境光强度的大小会影响用户对显示信息的浏览效果,如环境光强度过大时,会导致用户看不清楚屏幕上的显示信息,而环境光强度过低时,屏幕上显示信息会过于刺眼,影响用户的浏览效果。针对以上情况,电子设备可以通过环境光传感器实时 检测当前的环境光强度,并根据当前的环境光强度对主题色彩进行相应调节,具体可以为当环境光强度大于第一预设阈值时,说明当前的环境光强度过大,将主题色彩的色彩进行相应的色彩加深,以生成目标主题色彩。当环境光强度小于第二预设阈值时,该第一预设阈值大于该第二预设阈值,说明当前的环境光强度过低,将主题色彩的色彩进行相应的色彩降低,以生成目标主题色彩。当环境光强度处于第一预设阈值至第二预设阈值之间时,说明当前的环境光强度较为合适,可以直接将主题色彩确定为目标主题色彩。将目标主题色彩结合到由布局代码模板生成的显示信息上,可以完成显示信息的主题色彩的绘制过程,且在该显示信息上绘制的目标主题色彩与第三方应用程序当前显示界面的色彩适配,并且与当前环境光强度适配,可以给用户更合适的视觉体验感。
由上述可知,本实施例提供的一种主题色彩的调节方法,通过获取当前显示的待识别图像;对待识别图像进行分析,得到待识别图像相应的目标色彩数据;根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据;加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示。以此可以根据当前显示的待识别图像的色彩数据,动态的确定相适配的目标主题色彩,并根据目标主题色彩对显示信息进行渲染结合,调节过程简单便利,提升了主题色彩的调节效率。
根据上述实施例所描述的方法,以下将举例作进一步详细说明。
请参阅图3,图3为本申请实施例提供的主题色彩的调节方法的另一流程示意图。
具体而言,该方法包括:
在步骤S201中,获取当前显示的待识别图像。
需要说明的是,为了更好的说明本实施例,将电子设备以手机、显示信息为卡片信息为例进行说明,卡片信息通常是指那些包含一定图片和文本信息在内的一个长方形,作为指向更多详细信息的一个入口。现如今,在保证界面具有优秀可用性的同时,卡片式的设计甚至成为了平衡界面美学的默认做法。因为卡片信息很方便的显示出界面中的内容由不同的元素组成的,多个应用之间可以共用一个卡片信息,如浏览器应用、桌面负一屏应用以及天气应用可以公用一个卡片信息。
其中,当手机上的运行在前台的第三方应用接收到显示指令时,手机会截取该第三方应用上当前显示界面的截图,将该当前显示界面的截图确定为待识别图像,该待识别图像为RGB图像,即该待识别图像由多个像素构成,每一个像素都可以由相应比例的RGB色彩数据表示。
在步骤S202中,获取待识别图像上每一像素信息相应的RGB图像数据,计算每一像素信息的RGB图像数据的平均值,并将平均值确定为待识别图像的第一色彩数据。
其中,手机获取该待识别图像上的每一像素信息相应的RGB图像数据,每一像素信息相应的RGB图像数据都包括红(R)颜色通道的色彩值X、绿(G)颜色通道的色彩值Y以及蓝(B)颜色通道的色彩值Z,分别将所有像素的R颜色通道的色彩值X进行求和、G颜色通道的色彩值Y进行求和以及B颜色通道的色彩值Z进行求和,得到X、Y、Z的总值,并分别将X、Y、Z的总值分别处以像素信息的数量,得到X、Y、Z的平均值,将X、Y、Z的平均值确定为待识别图像的第一色彩数据,该第一色彩数据可以反映出待识别图像的色 彩情况,如X、Y、Z的平均值为255、192、203时,表示为粉红色色彩。
在步骤S203中,计算每一像素信息的RGB图像数据与第一色彩数据的欧式距离,将欧式距离大于预设距离的像素信息确定为目标像素信息。
其中,手机分别计算每一像素信息的RGB图像数据的R颜色通道的色彩值X与平均值X的差的平方值、G颜色通道的色彩值Y与平均值Y的差的平方值以及B颜色通道的色彩值Z与平均值Z的差的平方值,将三个平方值进行求和并进行开二次根,以得到每一像素信息的RGB图像数据与第一色彩数据的欧式距离。
进一步的,该欧式距离越小,说明像素信息与平均值的色差越小,该欧式距离越大,说明像素信息与平均值的色差越大,该预设距离为判定色差的临界值,当欧式距离大于预设距离时,表明色差超过一定值,为色彩比较显著的像素信息,依次类推,将欧式距离大于预设距离的像素信息确定为目标像素信息。
在步骤S204中,判断目标像素信息的数量是否超过预设数量。
其中,该预设数量可以为像素信息的总数的相应比例,比如像素信息有100个时,该预设数量可以为20个,即为像素信息的总数的五分之一,当手机判断出目标像素信息的数量超过预设数量时,执行步骤S205,当手机判断出目标像素信息的数量不超过预设数量时,执行步骤S206。
在步骤S205中,计算每一目标像素信息的色彩平均值,并将色彩平均值确定为目标色彩数据。
其中,当手机判断出目标像素信息的数量超过预设数量时,说明待识别图像的色彩比较丰富,反差较大,所以需要计算所有欧式距离超过大于预设距离的目标像素信息的色彩平均值,计算过程为将每一目标像素信息的R通道相应的值进行求和算平均值、G通道相应的值进行求和算平均值以及B通道相应的值进行求和算平均值,将目标像素信息的色彩平均值确定为目标色彩数据。
在步骤S206中,将第一色彩数据确定为目标色彩数据。
其中,当手机判断出目标像素信息的数量不超过预设数量时,说明待识别图像的色彩比较集中,反差较小,所以可以直接将第一色彩数据确定为目标色彩数据。
在步骤S207中,计算目标色彩数据与预设显示样式数据的色彩差异度,比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
其中,手机上的数据库中可以存储多个预设显示样式数据,每一个预设显示样式数据均包括RGB图像数据,代表一种对应的配色风格的主题,因此,可以计算目标色彩数据的RGB图像数据与每一预设显示样式数据相应的RGB图像数据的欧式距离,将欧式距离最小的预设显示样式数据确定为目标显示样式数据,该目标显示样式数据的配色风格与第三方应用的当前显示界面最为接近。
在步骤S208中,通过预设脚本框架对目标显示样式数据进行解析,生成相应的主题色彩。
其中,手机通过预设的JavaScript脚本语言框架对目标显示样式数据进行解析,生成相应配色的主题色彩。
在步骤S209中,根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色 彩,基于目标主题色彩对显示信息进行渲染并显示。
其中,手机可以通过环境光传感器实时检测出环境光强度,当环境光强度大于第一预设阈值时,说明当前的环境光强度过大,将主题色彩的色彩进行相应的色彩加深,以生成目标主题色彩。当环境光强度小于第二预设阈值时,该第一预设阈值大于该第二预设阈值,说明当前的环境光强度过低,将主题色彩的色彩进行相应的色彩降低,以生成目标主题色彩。当环境光强度处于第一预设阈值至第二预设阈值之间时,说明当前的环境光强度较为合适,可以直接将主题色彩确定为目标主题色彩。手机将目标主题色彩结合由布局代码模板生成的显示信息上,完成对显示信息的色彩绘制过程,且将绘制后的显示信息显示在第三方应用上。
由上述可知,本实施例提供的一种主题色彩的调节方法,通过获取当前显示的待识别图像,计算出待识别图像上每一像素信息相应的RGB图像数据平均值,并将平均值作为第一色彩数据,将像素信息的RGB图像数据与第一色彩数据的欧式距离大于预设距离的像素信息确定为目标像素信息,根据目标像素信息的数量动态确定出目标色彩数据,根据目标色彩数据确定出色彩最相似的目标显示样式数据,加载目标显示样式数据,生成适配的主题色彩,根据环境光对主题色彩进行调节,得到目标主题色彩,将目标主题色彩结合到显示信息上并显示。以此可以根据当前显示的待识别图像的色彩数据,动态的确定相适配的目标主题色彩,并根据目标主题色彩对显示信息进行渲染结合,调节过程简单便利,提升了主题色彩的调节效率。
为便于更好的实施本申请实施例提供的主题色彩的调节方法,本申请实施例还提供一种基于上述主题色彩的调节方法的装置。其中名词的含义与上述主题色彩的调节方法中相同,具体实现细节可以参考方法实施例中的说明。
本申请实施例提供一种主题色彩的调节装置,包括:
获取单元,用于获取当前显示的待识别图像;
分析单元,用于对该待识别图像进行分析,得到该待识别图像相应的目标色彩数据;
确定单元,用于根据该目标色彩数据与预设显示样式数据进行相似度匹配,以确定该目标色彩数据匹配的目标显示样式数据;
结合单元,用于加载该目标显示样式数据,以生成相应的目标主题色彩,将该目标主题色彩与显示信息进行结合并显示。
在一种实施方式中,该分析单元,包括:计算子单元,用于计算该待识别图像的第一色彩数据;对比子单元,用于将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;确定子单元,用于根据该目标像素信息的数量确定出相应的目标色彩数据。
在一种实施方式中,该计算子单元,具体用于:获取该待识别图像上每一像素信息相应的RGB图像数据;计算每一像素信息的RGB图像数据的平均值,并将该平均值确定为待识别图像的第一色彩数据;该对比子单元,具体用于:计算每一像素信息的RGB图像数据与该第一色彩数据的欧式距离;将欧式距离大于预设距离的像素信息确定为目标像素信息。
在一种实施方式中,该确定子单元,具体用于:判断该目标像素信息的数量是否超过 预设数量;当判断出该目标像素信息的数量超过预设数量时,计算每一目标像素信息的色彩平均值,并将该色彩平均值确定为目标色彩数据;当判断出该目标像素信息的数量不超过预设数量时,将该第一色彩数据确定为目标色彩数据。
在一种实施方式中,该确定单元,具体用于:计算该目标色彩数据与预设显示样式数据的色彩差异度;比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
请参阅图4,图4为本申请实施例提供的主题色彩的调节装置的模块示意图。具体而言,该主题色彩的调节装置300,包括:获取单元31、分析单元32、确定单元33以及结合单元34。
生成单元31,用于获取当前显示的待识别图像。
其中,当生成单元31检测到第三方应用上接收到显示指令时,截取当前运行在前台上的第三方应用当前显示界面的截图,将当前显示界面的截图确定为当前显示的待识别图像,该待识别图像可以为RGB色彩模式图像。
分析单元32,用于对该待识别图像进行分析,得到该待识别图像相应的目标色彩数据。
其中,分析单元32可以对待识别图像进行RGB色彩数据分析,确定整个待识别图像的平均RGB色彩数据,即可以对待识别图像中的每一像素信息的RGB色彩数据进行求和算RGB色彩数据平均值,该RGB色彩数据平均值进行组合,可表现出相应的色彩,可以将该RGB色彩数据平均值确定为待识别图像相应的目标色彩数据。
在一实施方式种,分析单元32还可以根据HSV颜色模型(Hue,Saturation,Value,HSV)对待识别图像进行分析,得到待识别图像相应的目标色彩数据,即还可以通过对待识别图像的色调(H)、饱和度(S)以及明度(V)颜进行分析,得到待识别图像相应的平均色调、平均饱和度以及平均明度组成的目标色彩数据。该颜色模型还可以有多种,此处不一一进行举例。
在一些实施方式中,该分析单元32,具体用于计算该待识别图像的第一色彩数据;将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;根据该目标像素信息的数量确定出相应的目标色彩数据。
在一些实施方式中,该分析单元32,具体还用于获取该待识别图像上每一像素信息相应的RGB图像数据;计算每一像素信息的RGB图像数据的平均值,并将该平均值确定为待识别图像的第一色彩数据;计算每一像素信息的RGB图像数据与该第一色彩数据的欧式距离;将欧式距离大于预设距离的像素信息确定为目标像素信息;根据该目标像素信息的数量确定出相应的目标色彩数据。
确定单元33,用于根据该目标色彩数据与预设显示样式数据进行相似度匹配,以确定该目标色彩数据匹配的目标显示样式数据。
其中,电子设备的数据库中会存储卡片配色映射表,该卡片配色映射表中可以包括多个预设显示样式数据,该预设显示样式数据为多个配色风格的层叠样式表(Cascading Style Sheets,CSS),该CSS能够对显示信息中的元素位置的排版进行像素级精确控制,支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力,因此,确定单元33可以 将RGB色彩数据平均值与每一层叠样式表的配色风格相应的RGB色彩数据进行相似度匹配,将RGB色彩数据最相似的层叠样式表确定为目标显示样式数据。
在一些实施方式中,该确定单元33,具体用于计算该目标色彩数据与预设显示样式数据的色彩差异度;比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
结合单元34,用于加载该目标显示样式数据,以生成相应的目标主题色彩,将该目标主题色彩与显示信息进行结合并显示。
其中,结合单元34可以通过第三方应用的预设脚本框架加载包含适配的配色风格的层叠样式表(即目标显示样式数据),该预设脚本框架可以理解为渲染引擎,该预设脚本框架可以为JavaScript脚本语言框架。
进一步的,在渲染解析后,结合单元34会生成适配的配色风格相应的目标主题色彩以及由布局代码模板生成的显示信息,将目标主题色彩结合到显示信息上,可以完成显示信息的主题色彩的绘制过程,且在该显示信息上绘制的目标主题色彩与第三方应用程序当前显示界面的色彩适配。
在一些实施方式中,该结合单元34,具体用于通过预设脚本框架对该目标显示样式数据进行解析,生成相应的主题色彩;根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色彩;基于目标主题色彩对显示信息进行渲染并显示。
可一并参考图5,图5为本申请实施例提供的主题色彩的调节装置的另一模块示意图,该主题色彩的调节装置300还可以包括:
其中,该分析单元32可以包括计算子单元321、对比子单元322以及确定子单元323。
进一步的,该计算子单元321,用于计算该待识别图像的第一色彩数据。该对比子单元322,用于将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息。确定子单元323,用于根据该目标像素信息的数量确定出相应的目标色彩数据。
由上述可知,本实施例提供的一种主题色彩的调节装置,通过获取单元31获取当前显示的待识别图像;分析单元32对待识别图像进行分析,得到待识别图像相应的目标色彩数据;确定单元33根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据;结合单元34加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示。以此可以根据当前显示的待识别图像的色彩数据,动态的确定相适配的目标主题色彩,并根据目标主题色彩对显示信息进行渲染结合,调节过程简单便利,提升了主题色彩的调节效率。
本申请实施例还提供一种电子设备。请参阅图6,电子设备500包括处理器501以及存储器502。其中,处理器501与存储器502电性连接。
该处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据,从而对电子设备500进行整体监控。
该存储器502可用于存储软件程序以及模块,处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存 储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器501对存储器502的访问。
在本申请实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器502中,并由处理器501运行存储在存储器502中的计算机程序,从而实现各种功能,如下:
获取当前显示的待识别图像;
对该待识别图像进行分析,得到该待识别图像相应的目标色彩数据;
根据该目标色彩数据与预设显示样式数据进行相似度匹配,以确定该目标色彩数据匹配的目标显示样式数据;
加载该目标显示样式数据,以生成相应的目标主题色彩,将该目标主题色彩与显示信息进行结合并显示。
在某些实施方式中,该对该待识别图像进行分析,得到该待识别图像相应的目标色彩数据时,处理器501可以具体执行以下步骤:
计算该待识别图像的第一色彩数据;
将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;
根据该目标像素信息的数量确定出相应的目标色彩数据。
在某些实施方式中,在计算该待识别图像的第一色彩数据时,处理器501可以具体执行以下步骤:
获取该待识别图像上每一像素信息相应的RGB图像数据;
计算每一像素信息的RGB图像数据的平均值,并将该平均值确定为待识别图像的第一色彩数据;
该将该第一色彩数据与该待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息的步骤,包括:
计算每一像素信息的RGB图像数据与该第一色彩数据的欧式距离;
将欧式距离大于预设距离的像素信息确定为目标像素信息。
在某些实施方式中,在根据该目标像素信息的数量确定出相应的目标色彩数据时,处理器501可以具体执行以下步骤:
判断该目标像素信息的数量是否超过预设数量;
当判断出该目标像素信息的数量超过预设数量时,计算每一目标像素信息的色彩平均值,并将该色彩平均值确定为目标色彩数据;
当判断出该目标像素信息的数量不超过预设数量时,将该第一色彩数据确定为目标色彩数据。
在某些实施方式中,在根据该目标色彩数据与预设显示样式数据进行相似度匹配,以确定该目标色彩数据匹配的目标显示样式数据时,处理器501可以具体执行以下步骤:
计算该目标色彩数据与预设显示样式数据的色彩差异度;
比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
在某些实施方式中,在计算该目标色彩数据与预设显示样式数据的色彩差异度时,处理器501可以具体执行以下步骤:
计算该目标色彩数据中的RGB图像数据与每一层叠样式表的配色风格相应的RGB图像数据的欧式距离;
该比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据的步骤,包括:
比较每一欧式距离的大小,将欧式距离最低的层叠样式表确定为目标显示样式数据。
在某些实施方式中,在加载该目标显示样式数据,以生成相应的目标主题色彩,将该目标主题色彩与显示信息进行结合并显示时,处理器501可以具体执行以下步骤:
通过预设脚本框架对该目标显示样式数据进行解析,生成相应的主题色彩;
根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色彩;
基于目标主题色彩对显示信息进行渲染并显示。
由上述可知,本申请实施例的电子设备,通过获取当前显示的待识别图像;对待识别图像进行分析,得到待识别图像相应的目标色彩数据;根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据;加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示。以此可以根据当前显示的待识别图像的色彩数据,动态的确定相适配的目标主题色彩,并根据目标主题色彩对显示信息进行渲染结合,调节过程简单便利,提升了主题色彩的调节效率。
请一并参阅图7,在某些实施方式中,电子设备500还可以包括:显示器503、射频电路504、音频电路505以及电源506。其中,其中,显示器503、射频电路504、音频电路505以及电源506分别与处理器501电性连接。
该显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。
该射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。
该音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。
该电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理系统与处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管图7中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。
本申请实施例还提供一种存储介质,该存储介质存储有计算机程序,当该计算机程序在计算机上运行时,使得该计算机执行上述任一实施例中的主题色彩的调节方法,比如: 通过获取当前显示的待识别图像;对待识别图像进行分析,得到待识别图像相应的目标色彩数据;根据目标色彩数据与预设显示样式数据进行相似度匹配,以确定目标色彩数据匹配的目标显示样式数据;加载目标显示样式数据,以生成相应的目标主题色彩,将目标主题色彩与显示信息进行结合并显示。
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)、或者随机存取记忆体(Random Access Memory,RAM)等。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
需要说明的是,对本申请实施例的主题色彩的调节方法而言,本领域普通测试人员可以理解实现本申请实施例的主题色彩的调节方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如主题色彩的调节方法的实施例的流程。其中,该的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。
对本申请实施例的主题色彩的调节装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,该存储介质譬如为只读存储器,磁盘或光盘等。
以上对本申请实施例所提供的一种主题色彩的调节方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (20)
- 一种主题色彩的调节方法,其中,包括:获取当前显示的待识别图像;对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据;根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据;加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示。
- 如权利要求1所述的主题色彩的调节方法,其中,所述对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据的步骤,包括:计算所述待识别图像的第一色彩数据;将所述第一色彩数据与所述待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;根据所述目标像素信息的数量确定出相应的目标色彩数据。
- 如权利要求2所述的主题色彩的调节方法,其中,所述计算所述待识别图像的第一色彩数据的步骤,包括:获取所述待识别图像上每一像素信息相应的RGB图像数据;计算每一像素信息的RGB图像数据的平均值,并将所述平均值确定为待识别图像的第一色彩数据;所述将所述第一色彩数据与所述待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息的步骤,包括:计算每一像素信息的RGB图像数据与所述第一色彩数据的欧式距离;将欧式距离大于预设距离的像素信息确定为目标像素信息。
- 如权利要求2所述的主题色彩的调节方法,其中,所述根据所述目标像素信息的数量确定出相应的目标色彩数据的步骤,包括:判断所述目标像素信息的数量是否超过预设数量;当判断出所述目标像素信息的数量超过预设数量时,计算每一目标像素信息的色彩平均值,并将所述色彩平均值确定为目标色彩数据;当判断出所述目标像素信息的数量不超过预设数量时,将所述第一色彩数据确定为目标色彩数据。
- 如权利要求1所述的主题色彩的调节方法,其中,所述根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据的步骤,包括:计算所述目标色彩数据与预设显示样式数据的色彩差异度;比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
- 如权利要求5所述的主题色彩的调节方法,其中,所述计算所述目标色彩数据与预设显示样式数据的色彩差异度的步骤,包括:计算所述目标色彩数据中的RGB图像数据与每一层叠样式表的配色风格相应的RGB图像数据的欧式距离;所述比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据的步骤,包括:比较每一欧式距离的大小,将欧式距离最低的层叠样式表确定为目标显示样式数据。
- 如权利要求1所述的主题色彩的调节方法,其中,所述加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示的步骤,包括:通过预设脚本框架对所述目标显示样式数据进行解析,生成相应的主题色彩;根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色彩;基于目标主题色彩对显示信息进行渲染并显示。
- 一种主题色彩的调节装置,其中,包括:获取单元,用于获取当前显示的待识别图像;分析单元,用于对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据;确定单元,用于根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据;结合单元,用于加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示。
- 如权利要求8所述的主题色彩的调节装置,其中,所述分析单元,包括:计算子单元,用于计算所述待识别图像的第一色彩数据;对比子单元,用于将所述第一色彩数据与所述待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;确定子单元,用于根据所述目标像素信息的数量确定出相应的目标色彩数据。
- 如权利要求9所述的主题色彩的调节装置,其中,所述计算子单元,具体用于:获取所述待识别图像上每一像素信息相应的RGB图像数据;计算每一像素信息的RGB图像数据的平均值,并将所述平均值确定为待识别图像的第一色彩数据;所述对比子单元,具体用于:计算每一像素信息的RGB图像数据与所述第一色彩数据的欧式距离;将欧式距离大于预设距离的像素信息确定为目标像素信息。
- 如权利要求9所述的主题色彩的调节装置,其中,所述确定子单元,具体用于:判断所述目标像素信息的数量是否超过预设数量;当判断出所述目标像素信息的数量超过预设数量时,计算每一目标像素信息的色彩平均值,并将所述色彩平均值确定为目标色彩数据;当判断出所述目标像素信息的数量不超过预设数量时,将所述第一色彩数据确定为目标色彩数据。
- 如权利要求8所述的主题色彩的调节装置,其中,所述确定单元,具体用于:计算所述目标色彩数据与预设显示样式数据的色彩差异度;比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
- 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1所述的主题色彩的调节方法。
- 一种电子设备,包括存储器和处理器,其中,所述处理器通过调用所述存储器中存储的计算机程序,用于执行步骤:获取当前显示的待识别图像;对所述待识别图像进行分析,得到所述待识别图像相应的目标色彩数据;根据所述目标色彩数据与预设显示样式数据进行相似度匹配,以确定所述目标色彩数据匹配的目标显示样式数据;加载所述目标显示样式数据,以生成相应的目标主题色彩,将所述目标主题色彩与显示信息进行结合并显示。
- 如权利要求14所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:计算所述待识别图像的第一色彩数据;将所述第一色彩数据与所述待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息;根据所述目标像素信息的数量确定出相应的目标色彩数据。
- 如权利要求15所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:获取所述待识别图像上每一像素信息相应的RGB图像数据;计算每一像素信息的RGB图像数据的平均值,并将所述平均值确定为待识别图像的第一色彩数据;所述将所述第一色彩数据与所述待识别图像中的每一像素信息相应的第二色彩数据进行对比,确定出色彩差异度大于预设阈值的目标像素信息的步骤,包括:计算每一像素信息的RGB图像数据与所述第一色彩数据的欧式距离;将欧式距离大于预设距离的像素信息确定为目标像素信息。
- 如权利要求15所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:判断所述目标像素信息的数量是否超过预设数量;当判断出所述目标像素信息的数量超过预设数量时,计算每一目标像素信息的色彩平均值,并将所述色彩平均值确定为目标色彩数据;当判断出所述目标像素信息的数量不超过预设数量时,将所述第一色彩数据确定为目标色彩数据。
- 如权利要求14所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:计算所述目标色彩数据与预设显示样式数据的色彩差异度;比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据。
- 如权利要求18所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:计算所述目标色彩数据中的RGB图像数据与每一层叠样式表的配色风格相应的RGB图像数据的欧式距离;所述比较每一色彩差异度的大小,将色彩差异度最低的预设显示样式数据确定为目标显示样式数据的步骤,包括:比较每一欧式距离的大小,将欧式距离最低的层叠样式表确定为目标显示样式数据。
- 如权利要求14所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:通过预设脚本框架对所述目标显示样式数据进行解析,生成相应的主题色彩;根据当前的环境光强度对主题色彩进行相应调节,以生成目标主题色彩;基于目标主题色彩对显示信息进行渲染并显示。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP19864022.9A EP3859521A4 (en) | 2018-09-29 | 2019-07-10 | THEME COLOR ADJUSTMENT METHOD AND APPARATUS, INFORMATION CARRIER AND ELECTRONIC DEVICE |
US17/211,428 US20210209404A1 (en) | 2018-09-29 | 2021-03-24 | Method for Adjusting Thematic Color, Storage Medium, and Electronic Device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811151238.9 | 2018-09-29 | ||
CN201811151238.9A CN109298912B (zh) | 2018-09-29 | 2018-09-29 | 主题色彩的调节方法、装置、存储介质及电子设备 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/211,428 Continuation US20210209404A1 (en) | 2018-09-29 | 2021-03-24 | Method for Adjusting Thematic Color, Storage Medium, and Electronic Device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020063030A1 true WO2020063030A1 (zh) | 2020-04-02 |
Family
ID=65161255
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/095435 WO2020063030A1 (zh) | 2018-09-29 | 2019-07-10 | 主题色彩的调节方法、装置、存储介质及电子设备 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20210209404A1 (zh) |
EP (1) | EP3859521A4 (zh) |
CN (1) | CN109298912B (zh) |
WO (1) | WO2020063030A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112328345A (zh) * | 2020-11-02 | 2021-02-05 | 百度(中国)有限公司 | 用于确定主题色的方法、装置、电子设备及可读存储介质 |
CN114035879A (zh) * | 2021-11-12 | 2022-02-11 | 北京沃东天骏信息技术有限公司 | 页面主题色更换方法、装置、电子设备和计算机可读介质 |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109298912B (zh) * | 2018-09-29 | 2020-06-02 | Oppo广东移动通信有限公司 | 主题色彩的调节方法、装置、存储介质及电子设备 |
CN111798525A (zh) * | 2019-04-08 | 2020-10-20 | 阿里巴巴集团控股有限公司 | 图像数据处理、色卡推荐方法、装置、设备及存储介质 |
CN111338627B (zh) * | 2020-03-05 | 2023-05-16 | 苏宁云计算有限公司 | 前端网页主题颜色调节方法及装置 |
CN113641429A (zh) * | 2021-07-14 | 2021-11-12 | 广州市玄武无线科技股份有限公司 | 一种主题配色客制化生成方法、系统、设备和存储介质 |
CN114595019A (zh) * | 2022-02-16 | 2022-06-07 | 北京梧桐车联科技有限责任公司 | 应用程序的主题设置方法、装置、设备及存储介质 |
CN115346432B (zh) * | 2022-07-27 | 2023-12-08 | 徐州神艺数字科技有限公司 | 广告设计展示机构 |
CN117376718B (zh) * | 2023-12-08 | 2024-03-26 | 深圳市尊正数字视频有限公司 | 基于摄像机输出信号进行实时色彩调整方法及系统 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103927102A (zh) * | 2014-04-28 | 2014-07-16 | 深圳市中兴移动通信有限公司 | 主题配色方法和移动终端 |
CN104978119A (zh) * | 2014-05-22 | 2015-10-14 | 腾讯科技(深圳)有限公司 | 一种信息窗口显示方法、装置及用户终端 |
KR20160108893A (ko) * | 2015-03-09 | 2016-09-21 | 한동수 | 성향 분석을 기반으로 하는 배색이미지 팔레트 제공 시스템 및 방법 |
CN107391150A (zh) * | 2017-07-28 | 2017-11-24 | 闻泰通讯股份有限公司 | 移动终端主题色调自适应变更方法及系统 |
CN109298912A (zh) * | 2018-09-29 | 2019-02-01 | Oppo广东移动通信有限公司 | 主题色彩的调节方法、装置、存储介质及电子设备 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9262385B2 (en) * | 2012-05-16 | 2016-02-16 | Sap Portals Israel Ltd | Automatic retrieval of themes and other digital assets from an organizational website |
CN104537021B (zh) * | 2014-12-18 | 2017-12-12 | 北京奇虎科技有限公司 | 设置浏览器背景的方法和浏览器客户端 |
CN104978198A (zh) * | 2015-07-06 | 2015-10-14 | 百度在线网络技术(北京)有限公司 | 配置键盘皮肤的方法和装置 |
US10297227B2 (en) * | 2015-10-16 | 2019-05-21 | Sap Se | Dynamically-themed display utilizing physical ambient conditions |
CN105744317A (zh) * | 2016-01-29 | 2016-07-06 | 深圳市美贝壳科技有限公司 | 一种快速修改显示背景的方法 |
US9846951B2 (en) * | 2016-03-31 | 2017-12-19 | Konica Minolta Laboratory U.S.A., Inc. | Determining a consistent color for an image |
CN106339499A (zh) * | 2016-09-07 | 2017-01-18 | 珠海市魅族科技有限公司 | 一种主题模式推送方法及装置 |
CN108334531A (zh) * | 2017-09-19 | 2018-07-27 | 平安普惠企业管理有限公司 | 图片色调提取方法、设备以及计算机可读存储介质 |
CN108124140A (zh) * | 2017-12-05 | 2018-06-05 | 广东小天才科技有限公司 | 一种颜色拾取方法、装置、电子画笔及存储介质 |
-
2018
- 2018-09-29 CN CN201811151238.9A patent/CN109298912B/zh not_active Expired - Fee Related
-
2019
- 2019-07-10 EP EP19864022.9A patent/EP3859521A4/en not_active Withdrawn
- 2019-07-10 WO PCT/CN2019/095435 patent/WO2020063030A1/zh active Application Filing
-
2021
- 2021-03-24 US US17/211,428 patent/US20210209404A1/en not_active Abandoned
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103927102A (zh) * | 2014-04-28 | 2014-07-16 | 深圳市中兴移动通信有限公司 | 主题配色方法和移动终端 |
CN104978119A (zh) * | 2014-05-22 | 2015-10-14 | 腾讯科技(深圳)有限公司 | 一种信息窗口显示方法、装置及用户终端 |
KR20160108893A (ko) * | 2015-03-09 | 2016-09-21 | 한동수 | 성향 분석을 기반으로 하는 배색이미지 팔레트 제공 시스템 및 방법 |
CN107391150A (zh) * | 2017-07-28 | 2017-11-24 | 闻泰通讯股份有限公司 | 移动终端主题色调自适应变更方法及系统 |
CN109298912A (zh) * | 2018-09-29 | 2019-02-01 | Oppo广东移动通信有限公司 | 主题色彩的调节方法、装置、存储介质及电子设备 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3859521A4 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112328345A (zh) * | 2020-11-02 | 2021-02-05 | 百度(中国)有限公司 | 用于确定主题色的方法、装置、电子设备及可读存储介质 |
CN112328345B (zh) * | 2020-11-02 | 2024-05-14 | 百度(中国)有限公司 | 用于确定主题色的方法、装置、电子设备及可读存储介质 |
CN114035879A (zh) * | 2021-11-12 | 2022-02-11 | 北京沃东天骏信息技术有限公司 | 页面主题色更换方法、装置、电子设备和计算机可读介质 |
Also Published As
Publication number | Publication date |
---|---|
EP3859521A4 (en) | 2021-12-01 |
EP3859521A1 (en) | 2021-08-04 |
US20210209404A1 (en) | 2021-07-08 |
CN109298912B (zh) | 2020-06-02 |
CN109298912A (zh) | 2019-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020063030A1 (zh) | 主题色彩的调节方法、装置、存储介质及电子设备 | |
US11443462B2 (en) | Method and apparatus for generating cartoon face image, and computer storage medium | |
WO2021238469A1 (zh) | 第三方应用程序的页面展示方法、装置、电子设备 | |
WO2020063019A1 (zh) | 信息处理方法、装置、存储介质、电子设备及系统 | |
US10108323B2 (en) | Method and device for drawing a graphical user interface | |
US10847073B2 (en) | Image display optimization method and apparatus | |
US9665247B2 (en) | Method and device for applying a new skin to a display environment | |
US10237454B2 (en) | Method for detecting terminal static layer information, terminal and television | |
US10978027B2 (en) | Electronic display partial image frame update systems and methods | |
CN110865758B (zh) | 一种显示方法及电子设备 | |
WO2022001553A1 (zh) | 字体调节方法、装置、存储介质及电子设备 | |
EP2677501A2 (en) | Apparatus and method for changing images in electronic device | |
US20210335391A1 (en) | Resource display method, device, apparatus, and storage medium | |
EP2461256A2 (en) | Method and apparatus for providing an electronic book service in a mobile device | |
WO2023125273A1 (zh) | 电子设备的图像显示方法、图像处理电路和电子设备 | |
CN114119431A (zh) | 图像处理方法、装置、电子设备及存储介质 | |
CN110263301A (zh) | 用于确定文字的颜色的方法和装置 | |
CN110618852B (zh) | 视图处理方法、视图处理装置及终端设备 | |
CN112817555A (zh) | 音量控制方法及音量控制装置 | |
CN113645476A (zh) | 画面处理方法、装置、电子设备及存储介质 | |
CN114242023A (zh) | 显示屏亮度调节方法、显示屏亮度调节装置和电子设备 | |
KR20150134998A (ko) | 전자 장치 및 이의 출력 특성 제어 방법 | |
KR20130134546A (ko) | 동영상의 섬네일 이미지 생성 방법 및 그 전자 장치 | |
CN108604367B (zh) | 一种显示方法以及手持电子设备 | |
CN110737323A (zh) | 屏幕显示方法、装置、存储介质以及终端 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19864022 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2019864022 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 2019864022 Country of ref document: EP Effective date: 20210429 |