Slide color matching method and device, electronic equipment and storage medium
By automatically obtaining and evaluating the background information of slide objects, color evaluation and clustering, the problem of inefficient slide color matching is solved, efficient and coordinated slide color matching is achieved, and readability and information transmission efficiency is improved.
Patent Information
- Application Number
- CN202411041846.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-10
AI Technical Summary
During the slide color matching process, the producer lacks professional art skills, resulting in inefficient color matching, which affects the readability and information transmission efficiency of the slide.
By obtaining the objects and their background information in the slide, determining representative color information, performing color evaluation and clustering, and automating color matching processing to ensure that the object color is consistent with the background.
Large-scale, automated and efficient slide color matching is achieved, reducing the requirements for professional capabilities, improving the readability and information transmission efficiency of slides, and reducing color conflicts.
Smart Images

Figure CN119107385A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic documents, and in particular to a slide color matching method, device, electronic equipment and storage medium. Background Art
[0002] Slides convey information to readers by displaying objects such as text, graphics, and pictures. The substantive content of a slide is presented through objects such as text, graphics, and pictures. Although the display color of these objects does not affect the substantive content, it will affect the reader's attention and other subjective feelings. Therefore, if a reasonable display color is configured for the objects in the slide, it can improve the reader's subjective feelings and enhance the readability and information transmission efficiency of the slide.
[0003] However, the creator of the actual content of the slides often does not have professional artistic skills, so they are not good at color matching for the slides. If the creator creates the actual content of the slides and then leaves it to specialized personnel to color match the objects in the slides, the problem of low efficiency will arise. Summary of the invention
[0004] In view of the technical problems faced when matching the colors of slides, such as lack of personnel skills and low production efficiency, as well as poor readability and low information transmission efficiency caused by poor slide color matching, the purpose of the present invention is to provide a slide color matching method, device, electronic device and storage medium.
[0005] In one aspect, an embodiment of the present invention includes a slide color matching method, the slide color matching method comprising the following steps:
[0006] Get the objects in the slide;
[0007] Performing a color matching process on the object; the color matching process includes:
[0008] Acquire background information corresponding to an object to be processed; the object to be processed is the object to be processed in the color matching process;
[0009] Determine at least one representative color information according to the background information;
[0010] Performing color evaluation according to each of the representative color information to obtain matching color information;
[0011] The object to be processed is matched in color according to the matching color information.
[0012] Further, obtaining at least one object in the slide includes:
[0013] Obtaining the level information of the slide;
[0014] Determine each of the objects in the slide and the level at which the objects are located according to the level information;
[0015] Each of the objects is set to a hidden state.
[0016] Furthermore, the color matching process for the object includes:
[0017] Traverse the objects in order from low to high levels;
[0018] Mark the traversed object as an object to be processed, and execute the color matching process;
[0019] Marking the object that has completed the color matching process as a processed object;
[0020] Sets the processed object to the visible state.
[0021] Furthermore, the obtaining of background information corresponding to the object to be processed includes:
[0022] Get the overall background of the slide;
[0023] Detecting a processed object; the processed object is the object on which the color matching process has been completed;
[0024] determining the background information according to the overall background when the processed object is not detected;
[0025] When the processed object is detected, the overall background is superimposed on the processed object to obtain the background information.
[0026] Further, determining at least one representative color information according to the background information includes:
[0027] Get the color of the background information;
[0028] Performing color clustering on the background information to obtain at least one color cluster;
[0029] A corresponding piece of representative color information is determined according to each of the color clusters.
[0030] Furthermore, the color clustering of the background information to obtain at least one color cluster includes:
[0031] Determine at least one working cluster according to the color of the background information;
[0032] determining at least one preprocessing cluster according to the color of the background information;
[0033] The pre-processing clusters are clustered based on the working clusters to obtain at least one color cluster.
[0034] Further, determining at least one working cluster according to the color of the background information includes:
[0035] Obtaining a hue value range, a saturation value range, and a brightness value range of each pixel in the background information;
[0036] Determine the number of clusters;
[0037] Determining a plurality of average hue values according to the hue value range and the number of clusters;
[0038] Determine the median saturation value according to the saturation value range;
[0039] Determining a brightness median according to the brightness value range;
[0040] Traversing each of the averaged hue values;
[0041] For any of the average hue values, a corresponding working cluster is determined based on the average hue value, the median saturation value, and the median brightness value.
[0042] Further, determining at least one preprocessing cluster according to the color of the background information includes:
[0043] Extracting pixels from the background information to obtain a plurality of sampling pixels;
[0044] Redundancy merging and noise interference elimination are performed on each of the sampling pixel points to obtain multiple key pixel points;
[0045] Traversing each of the key pixel points;
[0046] For any of the key pixel points, a corresponding preprocessing cluster is determined according to the color of the key pixel point.
[0047] Furthermore, clustering the pre-processing clusters based on the working clusters to obtain at least one color cluster includes:
[0048] Perform at least one clustering round. In any clustering round:
[0049] Determine one of the preprocessed clusters as a target to be clustered;
[0050] Obtaining the distance between the target to be clustered and each cluster center; wherein, if the clustering process in this round is the first round of clustering process, the cluster center is the working cluster, and if the clustering process in this round is not the first round of clustering process, the cluster center is obtained from the previous round of clustering process;
[0051] After allocating the target to be clustered to the cluster center that is closest to it, updating the cluster center;
[0052] Obtaining a cluster moving distance; the cluster moving distance is a moving distance of the same cluster center after the update relative to before the update;
[0053] In the case where the cluster moving distance is greater than the distance threshold and the accumulated round number of the clustering process is less than the round number threshold, executing the next round of the clustering process;
[0054] When the moving distances of all the clusters are less than the distance threshold, or the accumulated round number of the clustering process reaches the round number threshold, each cluster center is determined as a corresponding color cluster.
[0055] Furthermore, performing color evaluation according to each representative color information to obtain the adapted color information includes:
[0056] Get the color scheme;
[0057] Select candidate color information from the color scheme;
[0058] Comparing the candidate color information with each representative color information respectively;
[0059] In a case where the candidate color information and each representative color information meet the color specification standard, the candidate color information is determined as the adapted color information.
[0060] Furthermore, matching the color of the object to be processed according to the adapted color information includes:
[0061] Obtaining object attributes and object color of the object to be processed;
[0062] Comparing the adapted color information with the color scheme;
[0063] When the adapted color information does not match the color scheme, or the object attribute is not a preset attribute, or the object color is a theme color, maintaining the original color of the object to be processed;
[0064] When the adapted color information matches the color scheme, and the object attribute is a preset attribute and the object color is not a theme color, the color of the object to be processed is set according to the adapted color information.
[0065] On the other hand, an embodiment of the present invention includes a slide color matching device, the slide color matching device comprising:
[0066] An object acquisition module, used to acquire at least one object in a slide;
[0067] The object processing module is used to traverse each of the objects and perform a color matching process on the objects; the color matching process includes:
[0068] Acquire background information corresponding to the object to be processed; the object to be processed is the object to be processed in the current color matching process;
[0069] Determine at least one representative color information according to the background information;
[0070] Performing color evaluation according to each of the representative color information to obtain matching color information;
[0071] The object to be processed is matched in color according to the matching color information.
[0072] On the other hand, an embodiment of the present invention further includes an electronic device, including a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the slide color matching method described in the embodiment.
[0073] On the other hand, an embodiment of the present invention further includes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the slide color matching method in the embodiment is implemented.
[0074] The beneficial effects of the present invention are as follows: the slide color matching method in the embodiment can determine the adaptive color information according to the background information corresponding to each object in the slide, wherein the adaptive color information matches the representative color information of the background information (for example, satisfies a certain color matching scheme); by using the adaptive color information to match the object, the color of the object after color matching can be matched with the color of the background information of the object (for example, satisfies a certain color matching scheme), thereby realizing large-scale, automatic and efficient slide color matching; since the slide color matching method in the embodiment can be run using a computer program, the participation of personnel can be reduced, the requirements for the professional color matching ability of personnel can be reduced, and production efficiency can be improved; since the color of each object after color matching can be coordinated with the color of its background, anomalies such as color conflicts between different objects in the slide can be reduced, and the readability and information transmission efficiency of the slide can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 is a schematic diagram of a color scheme in an embodiment;
[0076] Figure 2 A schematic diagram of the steps of the slide color matching method in the embodiment;
[0077] Figure 3 Schematic diagram of collecting sampling pixels from background information in an embodiment;
[0078] Figure 4 A schematic diagram of noise interference removal in an embodiment;
[0079] Figure 5 A schematic diagram showing the effect of obtaining representative color information in an embodiment;
[0080] Figure 6 A schematic diagram of a color scheme in a gradient color form in an embodiment;
[0081] Figure 7 This is a schematic diagram of a slide to be color matched in the embodiment before color matching;
[0082] Figure 8 A schematic diagram of the hierarchical information to be color matched in the embodiment;
[0083] Fig. 9 This is a schematic diagram of the effect of setting each object to a hidden state in the embodiment;
[0084] Fig.10 A schematic diagram of the display effect of the slide in the embodiment;
[0085] Fig.11 A schematic diagram of the overall background in the embodiment;
[0086] Fig.12is a schematic diagram of representative color information in the embodiment;
[0087] Fig.13 A schematic diagram of adapting color information in an embodiment;
[0088] Fig.14 A schematic diagram of the display effect of the slide in the embodiment;
[0089] Fig.15 A schematic diagram of the overall background in the embodiment;
[0090] Fig.16 is a schematic diagram of representative color information in the embodiment;
[0091] Fig.17 A schematic diagram of adapting color information in an embodiment;
[0092] Fig.18 A schematic diagram of the display effect of the slide in the embodiment;
[0093] Fig.19 A schematic diagram of the display effect of the slide in the embodiment;
[0094] Fig. 20 is a schematic diagram of representative color information in the embodiment;
[0095] Fig.21 A schematic diagram of adapting color information in an embodiment;
[0096] Fig. 22 This is a schematic diagram of the slides to be color matched in the embodiment after color matching;
[0097] Fig.23 This is a schematic diagram of the effect of color matching on other slides in the embodiment;
[0098] Fig.24 Schematic diagram of the structure of the slide color matching device in the embodiment;
[0099] Fig.25 is a schematic diagram of the structure of an electronic device in an embodiment;
[0100] Fig.26 Schematic diagram of the working principle of the computer-readable storage medium in the embodiment. DETAILED DESCRIPTION
[0101] Terminology explanation:
[0102] Slide: It can also be called electronic slide, presentation, courseware, presentation, PowerPoint, PPT, etc. It is a form of computer data, and can also refer to the display form of computer data; a slide file generally includes at least one page, and each page can contain at least one object such as text, image, chart, audio and video; when displaying a slide, only the text, image, chart, audio and video objects in one page can be displayed at each moment, and then the text, image, chart, audio and video objects in the next page can be switched to display automatically or manually, achieving a projection effect similar to that of traditional slides made with negatives or films; compared with traditional slides, electronic slides can not only realize the switching projection of different pages, but also choose to switch to different objects when displaying the same page, and can display dynamic objects such as videos and animations, so the presentation of objects has greater flexibility and diversity;
[0103] Page: An element that makes up a slide file. For example, a slide file usually consists of multiple pages arranged in sequence. According to the order and content of the pages, each page can be divided into a cover page, a content page, an end page, etc.
[0104] Object: An element that makes up a slide file or a page therein, specifically data such as text, images, graphics, charts, audio, video, or animation. Each object occupies a certain position in the corresponding page, and multiple objects and their positional relationships form an object layout;
[0105] Hierarchy: Although the pages in a slide file are generally displayed on a flat display or projector, that is, when the pages in the slide file are projected, the various objects in it are finally displayed on a plane, the same page in the slide file can be divided into multiple hierarchies, and the various objects in the same page can be marked as corresponding hierarchies, so that the various objects in the same page are layered; by layering the various objects in the same page, a more flexible slide show method can be achieved; for example, the display order of the various objects in the same page can be set according to the hierarchy of the objects, so that different objects in the same page can be displayed in sequence instead of at the same time, which is conducive to achieving higher information transmission efficiency;
[0106] Color matching: Since slide files are generally projected for viewing, each displayed object has its own color to meet the requirements of beautiful content, echoing the theme of the content presented in the slide, mobilizing the audience's emotions, and attracting the audience's attention. Color matching is the process of setting the display color of objects in the slide file. The color matching process can be performed manually or automatically through computer programs. The color matching method can be arbitrary, that is, for any object, you can choose any color available in the system for color matching, or you can match colors according to certain rules, such as following the principles of art design or matching colors for multiple objects according to industry standards and other specifications. This can achieve more harmonious color matching, more outstanding visual effects, improve the audience's reading experience of the slide file, and improve the information transmission efficiency of the slide file.
[0107] Clustering: Clustering is an operation used to divide a set of data objects into similar groups or clusters; clustering can be performed using a clustering algorithm; a clustering algorithm is an unsupervised learning machine learning algorithm. The goal of a clustering algorithm is to cluster similar data points into the same cluster based on the similarity or distance measurement between the data, while the data points in different clusters are quite different. Clustering algorithms can be used in data mining, image processing, pattern recognition and other fields. They can help discover hidden patterns in data, organize data, reduce dimensionality, etc.
[0108] k-means: k-means is a clustering algorithm used to divide a set of data into k different clusters; the algorithm divides the data points into different clusters according to the similarities between them in an iterative manner, making the data points in the same cluster more similar and the data points between different clusters more different.
[0109] Euclidean distance: Euclidean distance is a measurement method used to measure the distance between two points. It is widely used in mathematics and computer science. Euclidean distance is also called Euclidean distance. It measures the difference between two points by calculating the straight-line distance between them.
[0110] Color scheme: A color scheme is a specific color or a specific color combination used to design a slide. It can include the color selection of various elements such as the slide background color, text color, shape color, etc. A good color scheme can improve the readability, consistency and attractiveness of the slide, making the entire presentation more professional and attractive; for example, Figure 1The color matrix of 10×6 shown can be used as a color scheme, which contains 60 colors. If this color scheme is selected for color matching of the slide, only one or more colors are selected from the 60 colors for color matching; the color scheme can be formulated according to the general art design standards, or according to the preferences of the slide maker or the audience, or according to the relevant industry standards;
[0111] Web Content Accessibility Guideline: Web Content Accessibility Guidelines is a single shared standard for web content accessibility that meets the needs of individuals, organizations, and governments internationally. The Web Content Accessibility Guidelines put forward requirements for color contrast, pointing out that if web content uses color combinations that meet the color contrast requirements, the interface information of the web content will be well readable. Since the Web Content Accessibility Guidelines put forward color combination selection standards, which can be applied to the color matching of slides, the Web Content Accessibility Guidelines can be regarded as a specific color scheme, or a test of whether a color meets the required color specification standards.
[0112] Contrast: Contrast is the difference between two colors calculated based on their brightness or luminous intensity. The range of contrast between any two colors is 1 (usually written as 1:1)-21 (usually written as 21:1). The higher the ratio between the two numbers, the greater the relative brightness of the colors. Only the contrast between pure black and pure white can reach the maximum value of 21:1.
[0113] RGB: It is a color model that represents the combination of three basic colors: red, green, and blue. In the RGB model, various colors can be produced by combining the three primary colors of red, green, and blue with different intensities. This model is widely used in electronic displays, photography, television, computer graphics, and other fields. In the RGB model, the value range of each color channel is 0-255, and different colors can be obtained according to the different values of each channel.
[0114] HSL: is a color model that represents three attributes: hue, saturation, and lightness. The HSL model is an intuitive way to represent colors. By adjusting the three parameters of hue, saturation, and lightness, various colors can be produced. In the HSL model, hue represents the basic attribute of color, and the value range is 0-360 degrees. Changes in hue can produce different colors, such as red, green, and blue. 0 degrees corresponds to red, 120 degrees corresponds to green, 240 degrees corresponds to blue, and so on. For example, Figure 1 In the color scheme shown, if the colors are represented by the HSL model, the horizontal axis of the color matrix of size 10×6 represents the change of hue H in the HSL model, and the vertical axis represents the change of brightness L in the HSL model; RGB and HSL describe colors from different perspectives, for example, a specific color can be represented by both the RGB model and the HSL model.
[0115] The theme color in the slide is a pre-designed color scheme to make the slide look more professional, unified and beautiful. By using different color contrasts and combinations, important information or ideas can be emphasized to guide the audience's attention. By using a theme color scheme, you can ensure that the visual effect of the entire slide is consistent, making the content more prominent and easy to understand. The slide editing software currently on the market allows users to set some theme colors. The theme colors include colors or color combinations that can reflect a certain theme. For example, light green usually represents themes such as environmental protection, and sky blue, dark blue and other color combinations usually represent themes such as commercial projects. However, when the slide editing software currently on the market uses the theme color for color matching, it simply replaces the colors of a few objects such as the background and title text in the slide page, while the colors of other objects in the slide page are maintained as the original colors. In this way, only when the color of the background or object in the slide page itself belongs to the theme color (or a similar color), can the best visual effect of the theme color be reflected; if other objects in the slide page use colors that are not similar to the theme color provided by the slide editing software, then not only can the best visual effect of the theme color not be reflected, but there may even be color conflicts between the objects whose colors have been changed and the objects whose colors have not been changed, affecting the reading of the slide page and other negative effects. In this case, the slide maker needs to manually match the colors of the objects whose colors have not been modified by the slide editing software, and also ensure that the colors of the objects after manual color matching and the colors of the objects automatically matched by the slide editing software meet the matching requirements of the theme color, which tests the art design professional ability of the slide maker and requires a lot of manpower.
[0116] Embodiment 1
[0117] In view of the problems existing in the related art, this embodiment provides a slide color matching method. Figure 2 , the slide color matching method includes the following steps:
[0118] S1. Get the object in the slide;
[0119] S2. Perform a color matching process on the object.
[0120] Steps S1-S2 and their sub-steps may be performed by a computer device.
[0121] In step S1, the computer obtains the slide that needs to be color matched and extracts the objects contained therein. Specifically, the slide can be decomposed into individual pages, and steps S1-S2 are performed on each page respectively. Since pages in a slide are also referred to as "slides" in some occasions, in this embodiment, it is not necessary to distinguish between slides and pages therein. For example, when a "slide" is mentioned, it can refer to a page in a slide.
[0122] In step S1, object is extracted from the slide file 1 、object 2 、object 3 ……object N There are N objects in the slide file. These objects are data of the type of text, image, graph, chart, audio, video or animation. These N objects can be all objects in the slide file or some of them.
[0123] Usually, the level information of each object is also marked in the slide file, indicating the level of the object in the page of the slide. Therefore, when executing step S1 to extract each object, the level information of each object is also extracted. For example, 1 Corresponding layer information layer 1 , object 2 Corresponding layer information layer 2 ...object N Corresponding layer information layer N wait.
[0124] Then execute step S2 to perform object 1 、object 2 、object 3 ……object N The color matching process is performed on N objects. Specifically, the color matching process is performed on the objects, that is, the color matching process of step S2 is performed once for each object.
[0125] Reference Figure 1 The color matching process performed in step S2 includes the following steps:
[0126] S20201. Obtain background information corresponding to the object to be processed;
[0127] S20202. Determine at least one representative color information according to the background information;
[0128] S20203. Perform color evaluation according to each representative color information to obtain matching color information;
[0129] S20204. Match the color of the object to be processed according to the adapted color information.
[0130] Because object 1 、object 2 、object 3 ……object N Steps S20201-S20204 must be executed for each of N objects. 1 Execute the first color matching process (the first set of steps S20201-S20204), 2 Execute the second color matching process (the second set of steps S20201-S20204)... N Execute the Nth color matching process (the Nth group of steps S20201-S20204) ... Therefore, one of the objects, such as the i-th object object i As an example, steps S20201-S20204 are described, where i=1, 2, ...N.
[0131] In this embodiment, since the corresponding color matching process is executed for each object, that is, each time the color matching process is executed, a corresponding object is processed. Therefore, when a color matching process is executed, the object to be processed by this color matching process is called the object to be processed. i When executing the i-th color matching process (the N-th group of steps S20201-S20204), in step S20201, the object object i It is the object to be processed.
[0132] In step S20201, obtain the object to be processed i Corresponding background information background i Specifically, the object to be processed object i Corresponding background information background i Is the object to be processed objecti In the slide, relative to the object to be processed i The part that belongs to the background. Background information i Included as the object to be processed object i The object of the background, as well as the size and color of these objects.
[0133] In step S20202, the background information background determined in step S20201 is i , determine at least one representative color information. The representative color information represents background information background i The various colors included can represent background information i The color of all contained colors.
[0134] For example, if the background information background i Contains only one color, so the representative color information is the same as the background information i The same color as the background information background i It can be divided into multiple regions, each region contains a color, then the color that occupies the largest number of regions or the largest area among these colors can be selected as the representative color information.
[0135] In step S20203, the background information background determined in step S20202 is i The representative color information is evaluated using a color evaluation algorithm to obtain the adapted color information adapt i .
[0136] Among them, the color evaluation algorithm can calculate the adaptive color information based on the representative color information. i , so that the color information is adapted i The representative color information conforms to a certain color scheme. The determined adaptive color information adapt i May be the same as the representative color information or may be different from the representative color information.
[0137] In step S20204, the adaptation color information color_adapt obtained in step S20203 is used i , to be processed object i Specifically, if the object to be processed is i Original color and adapted color information color_adapt iSame, then you can maintain the object to be processed i The original color remains unchanged; if the object to be processed i Original color and adapted color information color_adapt i Different, then the object to be processed object i The color is set to adapt the color information color_adapt i The color represented.
[0138] In this embodiment, by executing steps S20201-S20204, the adaptive color information can be determined according to the background information corresponding to each object in the slide, wherein the adaptive color information matches the representative color information of the background information (for example, satisfies a certain color scheme); by using the adaptive color information to match the color of the object, the color of the object after color matching can be matched with the color of the background information of the object (for example, satisfies a certain color scheme), thereby realizing large-scale, automated and efficient slide color matching; since steps S20201-S20204 can be run using a computer program, the participation of personnel can be reduced, the requirements for personnel's professional color matching capabilities can be reduced, and production efficiency can be improved; since the color of each object after color matching can be coordinated with the color of its background, anomalies such as color conflicts between different objects in the slide can be reduced, thereby improving the readability and information transmission efficiency of the slide.
[0139] In this embodiment, when executing step S1, that is, the step of obtaining at least one object in the slide, the following steps may be specifically performed:
[0140] S101. Get the level information of the slide;
[0141] S102. Determine each object in the slide and the level of the object according to the level information;
[0142] S103. Set each object to a hidden state.
[0143] In step S101, when the object is extracted from the slide file 1 、object 2 、object 3 ……object N When there are N objects, the hierarchical information of each object can be extracted at the same time, such as object 1 Corresponding layer information layer 1 , object 2 Corresponding layer information layer 2 ...object N Corresponding layer information layerN wait.
[0144] In step S102, the layer 1 、layer 2 ……layer N Wait, determine the object 1 、object 2 、object 3 ……object N Specifically, a page in a slide can be divided into multiple layers, for example, a total of 5 layers, then layer 1 、layer 2 ……layer N The value range is 1, 2, 3, 4 or 5. For example, if layer 1 =1 means object 1 Located at the bottom layer of the slide, layer N =5 means object N At the top level in a slide, etc.
[0145] In step S103, before executing step S2, object 1 、object 2 、object 3 ……object N Wait until N objects are set to hidden state.
[0146] The hidden object may not be displayed, and thus no color rendering or other processing will be performed, i.e., the hidden object will not affect the color of other objects. Therefore, by performing steps S101-S103, the mutual influence between different objects can be reduced, and the color matching process can be performed on each object separately.
[0147] In this embodiment, when executing step S2, that is, performing a color matching process on the object, the following steps may be specifically performed:
[0148] S201. Traverse each object in order from low to high level;
[0149] S202. Mark the traversed object as an object to be processed and execute the color matching process;
[0150] S203. Mark the object that has completed the color matching process as a processed object;
[0151] S204. Set the processed object to a visible state.
[0152] In step S201, the layer 1 、layer 2 ……layer N Equal size, determine the object 1 、object 2 、object 3 ……object N The levels of N objects in the slide, such as layer 1 (bottom layer), layer 2, layer 3, and so on.
[0153] In this embodiment, the first layer (bottom layer) is the lowest layer in the slide. The larger the number of the layer information of the object is, the higher the layer the object is. 1 、layer 2 ……layer N From small to large objects 1 、object 2 、object 3 ……object N Sort N objects.
[0154] In this embodiment, layer 1 ≤layer 2 ≤layer 3 ...≤layer N For example, object 1 、object 2 、object 3 ……object N When executing step S201, the N objects are sorted in the order of the level from low to high. 1 、object 2 、object 3 ……object N traverse in order.
[0155] In step S202, the traversed object is marked as an object to be processed, and the color matching process, namely steps S20201-S20204, is executed.
[0156] In step S203, for objects that have completed the color matching process, such objects are marked as processed objects.
[0157] For example, according to object 1 、object 2 、object 3……object N The order is first for the object object 1 Execute the color matching process, i.e. steps S20201-S20204, at which time object 1 Becomes the object to be processed, and steps S20201-S20204 are executed to match the color of the object object 1 After the color matching is completed, the object object 1 Become a processed object; then object object 2 Execute the color matching process, i.e. steps S20201-S20204, at which time object 2 Becomes the object to be processed, and steps S20201-S20204 are executed to match the color of the object object 2 After the color matching is completed, the object object 2 Become a processed object...Finally, object object N Execute the color matching process, i.e. steps S20201-S20204, at which time object N Becomes the object to be processed, and steps S20201-S20204 are executed to match the color of the object object N After the color matching is completed, the object object N Becomes a processed object, and all objects become processed objects.
[0158] Each object becomes a processed object after executing steps S20201-S20204 and completing color matching. In step S204, the object that has become a processed object is set to a visible state. In this embodiment, the visible state is the opposite state of the hidden state. The object set to the visible state can be displayed. Therefore, the object set to the visible state is subjected to color rendering and other processing, so that the object set to the visible state obtains color.
[0159] By executing steps S201-S204, the color matching process can be executed on each object in order from low to high levels, and the objects before the color matching process are set to a hidden state, so as to avoid the objects at a higher level from affecting the objects at a lower level; and by setting the objects that have completed the color matching process to a visible state, the objects at a lower level can be allowed to affect the objects at a higher level (for example, the objects at a lower level can become part of the background information of the objects at a higher level), so that when the color matching process is executed on the objects at a higher level, the background information obtained contains more color information, which is conducive to selecting more suitable adaptive color information for the objects at a higher level, so that the colors of each object after color matching are more beautiful and readable compared with the colors of the background and other objects.
[0160] In this embodiment, when executing step S20201, that is, the step of obtaining background information corresponding to the object to be processed, the following steps may be specifically performed:
[0161] S2020101. Get the overall background of the slide;
[0162] S2020102. Detect processed objects;
[0163] S2020103. In the case where the processed object is not detected, determining background information based on the overall background;
[0164] S2020104. When a processed object is detected, the overall background is superimposed on the processed object to obtain background information.
[0165] In step S2020101, the overall background of the slide is the background of the page of the slide itself. For example, if the slide contains objects, all objects in the slide (such as object 1 、object 2 、object 3 ……object N ) or set all objects in the slide to hidden state. At this time, the objects in the slide will not be displayed or rendered, and the background of the slide page itself can be displayed, thereby obtaining the overall background of the slide.
[0166] In step S2020102, the processed object can be determined by detecting the number of color matching processes. 1 、object 2 、object 3 ……object NThe order of traversing each object in turn to perform the color matching process, then the execution of the i-th color matching process is the object object i When executing the color matching process, the object that has been executed by the color matching process...object i-2 、object i-1 The objects are processed.
[0167] In step S2020102, if the i-th color matching process is executed, that is, the object object i When executing the color matching process, i=1, that is, executing the first color matching process, then the processed object will not be detected. In this case, step S2020103 is executed to determine the object object according to the overall background of the slide obtained in step S2020101. i Corresponding background information background i .
[0168] In step S2020102, if the i-th color matching process is executed, that is, the object object i When executing the color matching process, i>1, that is, executing the color matching process after the first time, at least one processed object will be detected. In this case, step S2020104 is executed to superimpose the overall background of the slide obtained in step S2020101 on the object. i-2 、object i-1 etc. processed objects to form the object object i Corresponding background information background i .
[0169] In this embodiment, the principle of executing steps S2020101-S2020104 is: when the processed object is not detected, it indicates that the object to be processed is the object at the lowest level (that is, the object closest to the overall background of the slide), and the background information corresponding to the object to be processed is the overall background of the slide; when the processed object is detected, it indicates that the level of the object to be processed is not the lowest, and those objects at a level not lower than the lowest become the processed objects, and the processed objects and the overall background of the slide together constitute the background of the object to be processed, so the processed object and the overall background of the slide are superimposed to become the background information corresponding to the object to be processed.
[0170] In this embodiment, when executing step S20202, that is, determining at least one representative color information according to the background information, the following steps may be specifically performed:
[0171] S2020201. Get the color of the background information;
[0172] S2020202. Cluster the color of the background information to obtain at least one color cluster;
[0173] S2020203. Determine a corresponding representative color information according to each color cluster.
[0174] In step S2020201, for the object to be processed object i Corresponding background information background i , get background information background i Specifically, the color of each pixel of the background information can be obtained; i Basically occupies the entire page of the slide, and the object to be processed object i Occupies a certain position in the page, so the object to be processed object i Will cover the background information background i Part of the background information i Object not yet processed i The covered part is the uncovered part, and the background information can be obtained. i The color of the uncovered part is used as the color of the background information to be obtained in step S2020201.
[0175] In step S2020202, a clustering algorithm may be used to perform color clustering on the colors of the background information. The result of executing the clustering algorithm is to obtain at least one color cluster, which is obtained by clustering the colors of the background information.
[0176] In step S2020203, the color cluster obtained in step S2020202 is used as the object to be processed. i The representative color information of the corresponding background information. Specifically, each color cluster is a representative color information, so the object to be processed object i How many representative color information the corresponding background information has may depend on how many color clusters the colors of the background information are clustered into by the clustering algorithm.
[0177] In this embodiment, by executing steps S2020201-S2020203, the colors of the background information can be clustered using a clustering algorithm, thereby mining color information that can represent all colors of the background information, that is, representative color information.
[0178] In this embodiment, when executing step S2020202, the background information background i When color clustering is performed on the color, the k-means clustering algorithm can be used.
[0179] Specifically, when executing step S2020202 to cluster the colors of the background information, the following steps may be performed:
[0180] S202020201. Determine at least one working cluster according to the color of the background information;
[0181] S202020202. Determine at least one preprocessing cluster according to the color of the background information;
[0182] S202020203. Cluster each preprocessing cluster based on each working cluster to obtain at least one color cluster.
[0183] In step S202020201, for background information background i , the HSL model can be used to represent background information i Specifically, you can get the background information background i The hue value range (the range formed by the minimum and maximum hue values of all pixels, such as 0-360), saturation value range (the range formed by the minimum and maximum saturation values of all pixels, such as 0-255) and brightness value range (the range formed by the minimum and maximum brightness values of all pixels, such as 0-255) of each pixel in the cluster are determined; then the number of clusters m is determined, and according to the hue value range (such as 0-360) and the number of clusters m, multiple average hue values are determined, that is, etc.; according to the saturation value range (e.g. 0-255), determine the saturation median (e.g. ); According to the brightness value range (for example, 0-255), determine the brightness median (for example ); Then traverse each average hue value, that is, The equally divided hue values are paired with the median saturation and the median brightness to form a corresponding working cluster, thus forming From this, we can see that the work cluster can be represented by the coordinates of (H, S, L).
[0184] In this embodiment, the principle of executing step S202020201 is: background information background i The color distribution (usually expressed as RGB distribution) is not too complicated, and even the background information background in most scenes iEach pixel in is a single RGB value; in step S202020201, the working cluster is obtained by the average tone method, which can be used in the background information background i When the color distribution is single, the obtained working clusters make it easier for the k-means clustering algorithm to quickly reach a convergence state, thereby improving the execution efficiency of the algorithm.
[0185] In step S202020202, background information background i To extract pixels, you can get background information from the background i A plurality of sampling pixels are obtained; redundant merging and noise interference elimination are performed on these sampling pixels, thereby eliminating the sampling pixels with redundant pixel information and eliminating the sampling pixels interfered by noise, and the remaining sampling pixels are key pixels; the color of each key pixel can be represented by a coordinate in the form of (H, S, L) through the HSL model, or represented by a coordinate in the form of (R, G, B) through the RGB model, wherein the RGB model can use the RGB16 space, and the memory size can be controlled to less than 32KB, which can further reduce the amount of calculation and thus improve the efficiency of the algorithm; the color of each key pixel is a preprocessing cluster.
[0186] In this embodiment, the principle of executing step S202020202 is that in the actual scene, due to the background information background i There are too many pixels in the image. Even after scaling, the number of pixels can easily exceed the order of thousands, which will generate too much computation and lead to low algorithm efficiency. Therefore, by extracting pixels, only a small number of sampled pixels can be processed to reduce the amount of computation. Background information i The color distribution of each pixel in the image is close to continuous change. In fact, it does not need too high continuity to represent its change. Therefore, the amount of data to be processed can be reduced by merging the redundant sampled pixels, thereby improving the efficiency of the k-means clustering algorithm. For example, if the background information is i The content of Figure 3 As shown, we only need to select 3 sampling pixels, whose colors are blue, pink, and orange, to retain the background information. i The key color information in the image; and noise interference removal can reduce the impact of noise on the k-means clustering algorithm, for example Figure 4 In the picture shown, the light blue area in the upper right corner is noise interference. Figure 4The image shown can be subjected to noise interference removal to eliminate the light blue area in the upper right corner and reduce noise interference. Generally, the sampling pixels can be redundantly merged first and then subjected to noise interference removal to avoid sampling pixels with key color information being removed as noise.
[0187] After executing step S202020201 to obtain the working cluster and executing step S202020202 to obtain the pre-processing cluster, execute step S202020203 to cluster the pre-processing clusters based on the working clusters to obtain at least one color cluster. These color clusters can be used as background information. i The representative color, that is, the representative color information.
[0188] In this embodiment, step S202020203 is executed to cluster the preprocessing clusters based on the working clusters using the k-means clustering algorithm to obtain at least one color cluster, specifically including:
[0189] Perform at least one clustering round. In any clustering round:
[0190] K1. Determine a preprocessed cluster as the target to be clustered;
[0191] K2. Obtain the distance between the target to be clustered and each cluster center; where, if the current clustering process is the first clustering process, the cluster center is the working cluster, and if the current clustering process is not the first clustering process, the cluster center is obtained from the previous clustering process;
[0192] K3. After assigning the target to be clustered to the nearest cluster center, update the cluster center;
[0193] K4. Get the cluster moving distance;
[0194] K5. If the cluster movement distance is greater than the distance threshold and the cumulative number of rounds of the clustering process is less than the round number threshold, the next round of clustering process is executed;
[0195] K6. When the moving distances of all clusters are less than the distance threshold, or the cumulative number of rounds of the clustering process reaches the round number threshold, each cluster center is determined as a corresponding color cluster.
[0196] In step K1, a preprocessed cluster is selected as the target to be clustered.
[0197] In step K2, if this round of clustering process is the first round of clustering process, then there is no previous round of clustering process, and a working cluster can be selected as the clustering center; if this round of clustering process is not the first round of clustering process, then executing the previous round of clustering process will obtain at least one clustering center, and the clustering center obtained by the previous round of clustering process will be called.
[0198] In step K3, the Euclidean distance between the target to be clustered (i.e. the selected preprocessing cluster) and each cluster center is calculated, and the target to be clustered (i.e. the selected preprocessing cluster) is assigned to the cluster center with the nearest distance. The target to be clustered (i.e. the selected preprocessing cluster) and the assigned cluster center form a new cluster center, thereby updating the cluster center; if the next round of clustering process is to be performed, the updated cluster center will be called by the next round of clustering process.
[0199] In step K4, for a cluster center, the moving distance of the cluster center after the update in step K3 is calculated relative to the moving distance before the update in step K3, to obtain the cluster moving distance of the cluster center. Specifically, the cluster moving distance may be the Euclidean distance.
[0200] In step K5, if there is a cluster movement distance greater than the distance threshold, and the cumulative number of rounds of the clustering process (i.e., the number of rounds of the clustering process that have been executed) is less than the round number threshold (e.g., 100 rounds), it indicates that the clustering process has not converged, and the next round of clustering process is executed.
[0201] In step K6, if the moving distances of all clusters are less than the distance threshold, or the cumulative number of rounds of the clustering process reaches the round number threshold, it indicates that the clustering process has converged, and the next round of clustering process is no longer executed. This round of clustering process is the last round of clustering process, and each cluster center obtained by executing this round of clustering process, i.e., the last round of clustering process, is determined as a color cluster. Specifically, each cluster center is a color cluster, and thus serves as a representative color information determined in step S20202.
[0202] Steps K1-K6 are specific applications of executing the k-means clustering algorithm to cluster each pre-processing cluster based on each working cluster. By executing steps K1-K6, the k-means clustering algorithm can be applied to cluster the working cluster and the pre-processing cluster, thereby determining the object to be processed. i Corresponding background information background i at least one representative color information of.
[0203] For example, if the background information background i like Figure 5 As shown in the far right of part (a) in , then by executing steps K1-K6, we can obtain Figure 5 The two color blocks on the left in part (a) show the representative color information; if the background information i like Figure 5 As shown in the far right of part (b) in , then by executing steps K1-K6, we can obtain Figure 5 The four color blocks on the left in part (b) show representative color information.
[0204] In this embodiment, when executing step S20203, that is, performing color evaluation according to each representative color information to obtain the adapted color information, the following steps may be specifically performed:
[0205] S2020301. Get the color scheme;
[0206] S2020302. Select candidate color information from the color scheme;
[0207] S2020303. Compare the candidate color information with each representative color information;
[0208] S2020304. When the candidate color information and each representative color information meet the color specification standard, the candidate color information is determined as the adapted color information.
[0209] In step S2020301, a color scheme can be designed according to factors such as the preferences of the slide maker or the audience, art design standards or industry standards. The color scheme includes at least one candidate color information, and the color scheme limits the range of colors that can be selected when matching the color of the object to be processed, that is, when matching the color of the object to be processed, the color used can be selected from the color scheme.
[0210] In step S2020302, candidate color information may be selected from the color scheme in sequence, and then step S2020303 is executed to compare the candidate color information with each representative color information obtained in step S20202.
[0211] In step S2020302, the purpose of comparing the candidate color information with the representative color information is to determine whether the combination of the candidate color information and the representative color information meets the color specification standard. The color specification standard can be set according to factors such as the preferences of the slide maker or the audience, art design standards, or industry standards. For example, the Web Content Accessibility Guidelines can be selected as the color specification standard in step S2020302.
[0212] Specifically, the Web Content Accessibility Guidelines stipulate that in order to meet readability, the contrast between two colors presented on the same page should be greater than a contrast threshold. Therefore, when executing step S2020302, it can be determined whether the contrast between the candidate color information and each representative color information is greater than or equal to the contrast threshold; when there is at least one representative color information and the candidate color information, the contrast is less than the contrast threshold, then it is determined that it does not comply with the color specification standard of the Web Content Accessibility Guidelines, and the candidate color information is not determined as the adaptive color information, and the execution of S2020301 is jumped back to obtain new candidate color information for comparison; conversely, when the contrast between the candidate color information and each representative color information is greater than or equal to the contrast threshold, then it is determined that the candidate color information and each representative color information comply with the color specification standard of the Web Content Accessibility Guidelines, and the candidate color information is determined as the adaptive color information; after obtaining the object to be processed object i After the corresponding color information is adapted, the object object is processed using the adapted color information i Match the colors.
[0213] For example, in step S2020301, use Figure 1 The color scheme shown; then, execute step S2020302 to traverse Figure 1 The color scheme shown in the figure is different rows in the color matrix of 10×6 (i.e., different brightness values in HSL are selected) as candidate color information, and step S2020303 is executed to determine whether the contrast between the candidate color information and each representative color information meets the color specification standard of the Web Content Accessibility Guidelines; if Figure 1 The color scheme shown cannot find candidate color information that meets the color specification standard of the Web Content Accessibility Guidelines. Figure 1 The color scheme shown is converted to Figure 6 The gradient shown is for Figure 6 The color hue in the image is searched starting from 0.8 and incremented by 0.1 (the ideal brightness range is -0.8 to 0.8, which is a reference value for UI design) according to different brightness until the candidate color information that meets the specification is found as the adapted color information.
[0214] In this embodiment, the principle of executing steps S2020301-S2020304 is: by selecting candidate color information from the color scheme, the colors used for the color matching of the object to be processed can be limited to a specific range, thereby meeting the needs of aesthetics and other aspects; by using color specification standards to check whether the candidate color information matches the representative color information, the colors used for the color matching of the object to be processed can meet the requirements of the color specification standards, thereby achieving effects such as improving the readability of the slides.
[0215] In this embodiment, when executing step S20204, that is, matching the color of the object to be processed according to the matching color information, the following steps may be specifically performed:
[0216] S2020401. Obtain the object attributes and object color of the object to be processed;
[0217] S2020402. When the object attribute is not a preset attribute or the object color is a theme color, the original color of the object to be processed is maintained;
[0218] S2020403. When the object attribute is a preset attribute and the object color is not a theme color, set the color of the object to be processed according to the adapted color information.
[0219] In step S2020401, for the object to be processed object i , detect the object to be processed i In this embodiment, the object to be processed object i The object property represents the object to be processed object i Whether it is a fillable type or a non-fillable type, the object to be processed object i The object color indicates the object to be processed i Original color.
[0220] Specifically, the preset attribute may be set as a fillable type.
[0221] If the object to be processed is i The object property is not a preset property, that is, it cannot be filled, which means that the object cannot be processed. i Fill with new color or object to be processed i If the object color originally belongs to the theme color, then select to execute step S2020402 to maintain the original color of the object to be processed.
[0222] If the object to be processed iThe object property is a preset property, that is, a fillable type, which means that the object can be processed i Fill with new color, and the object to be processed object i The object color does not belong to the theme color, so select step S2020403 to process the object object i The color is set to the adapted color information obtained in steps S2020301-S2020304.
[0223] In this embodiment, the principle of executing steps S2020401-S2020403 is: by detecting the object to be processed object i Object attributes are only available in the object to be processed. i If the object attribute is a preset attribute (such as fillable type) and the object color does not originally belong to the theme color, the color of the object to be processed is set to the color corresponding to the adaptive color information. Otherwise, the original color of the object to be processed is maintained unchanged, which can avoid the object to be processed i The object properties do not support color modification, and executing color filling may cause consequences such as system crash. It can also avoid repeated modification of the object color that already belongs to the theme color, reducing unnecessary data processing.
[0224] Embodiment 2
[0225] In this embodiment, a slide color matching method is described by using a specific example.
[0226] Execute step S1 to obtain Figure 7 Specifically, steps S101-S102 are performed, and the result is as follows: Figure 7 on the right side or Figure 8 As shown, the hierarchical information of the slide is obtained. The slide includes objects such as ① lavender rounded rectangle, ② light blue rounded rectangle, ③ robot shadow, ④ robot picture and ⑤ text box (the content is "Artificial Intelligence and Education Innovation"). The entire slide page is divided into 5 levels, among which object ① lavender rounded rectangle is at the first level, which is the lowest level, object ② light blue rounded rectangle is at the second level, object ③ robot shadow is at the third level, object ④ robot picture is at the fourth level, and object ⑤ text box is at the fifth level, which is the highest level.
[0227] Execute step S103 to set each object to a hidden state. The effect is as follows: Fig. 9 As shown, object ① lavender rounded rectangle, object ② light blue rounded rectangle, object ③ robot shadow, object ④ robot picture and object ⑤ text box are all hidden. At this time, when the slide is displayed, only the background of the slide itself, that is, the overall background, can be seen.
[0228] Then, step S2 is performed to perform a color matching process on the object.
[0229] Specifically, execute step S201, and traverse each object in order from low to high levels, that is, the order of object ① lavender rounded rectangle, object ② light blue rounded rectangle, object ③ robot shadow, object ④ robot picture, object ⑤ text box.
[0230] 1. Perform color matching process on object ① lavender rounded rectangle
[0231] First, read object ① lavender rounded rectangle, and execute steps S20201-S20204 for object ① lavender rounded rectangle.
[0232] In step S20201, object ① lavender rounded rectangle is the object to be processed. Set object ① lavender rounded rectangle to visible state. At this time, the display effect of the slide is as follows: Fig.10 As shown in the figure. Since there is no processed object at this time, the object to be processed, i.e., the background information corresponding to the object ①, the lavender rounded rectangle, is the background of the slide itself, i.e., the overall background, as shown in the figure. Fig.11 shown.
[0233] In step S20202, at least one representative color information is determined based on the background information corresponding to the object ① lavender rounded rectangle. Fig.11 Step S20202 can be executed to determine a representative color information, that is, Fig.12 Light blue #C8D5EF shown.
[0234] In step S20203, according to Fig.12 The representative color information shown in the figure is used for color evaluation, and the matching color information is obtained from the color matching scheme. In this embodiment, the matching color information is Fig.13 Shown in Steel Blue #4874CB.
[0235] In step S20204, Fig.13 The matching color information shown is the same as Fig.12 The contrast ratio of the representative color information shown is greater than 3.0, which meets the requirements of the "Web Accessibility Single Shared Standard", and the object property of the object ① lavender rounded rectangle is a fillable type, so according to Fig.13 The adaptation color information shown is used to match the color of the object to be processed, i.e., the lavender rounded rectangle of object ①.
[0236] After color matching is performed on object ① the lavender rounded rectangle, object ① the lavender rounded rectangle becomes a processed object in a visible state.
[0237] 2. Perform color matching process on object ② light blue rounded rectangle
[0238] Read object ②light blue rounded rectangle, and execute steps S20201-S20204 for object ②light blue rounded rectangle.
[0239] In step S20201, object ② light blue rounded rectangle is the object to be processed. Set object ② light blue rounded rectangle to visible state. The display effect of the slide is as follows: Fig.14 As shown in the figure. Since the object ①, the light purple rounded rectangle, is a processed object at this time, the background information corresponding to the object to be processed, i.e., the light blue rounded rectangle of the object ②, is the superposition of the overall background and the light purple rounded rectangle of the object ① after color matching, as shown in the figure. Fig.15 shown.
[0240] In step S20202, at least one representative color information is determined based on the background information corresponding to the light blue rounded rectangle of object ②. Fig.15 Step S20202 can be executed to determine a representative color information, that is, Fig.16 Shown in Steel Blue #4874CB.
[0241] In step S20203, according to Fig.16 The representative color information shown in the figure is used for color evaluation, and the matching color information is obtained from the color matching scheme. In this embodiment, the matching color information is Fig.17 Bright sky blue #DAE3F5 shown.
[0242] In step S20204, Fig.17 The matching color information shown is the same as Fig.16 The contrast ratio of the representative color information shown is greater than 3.0, which meets the requirements of the "Web Accessibility Single Shared Standard", and the object attribute of the light blue rounded rectangle of object ② is a fillable type, so according to Fig.17 The adaptation color information shown is used to match the color of the object to be processed, i.e., the light blue rounded rectangle of object ②.
[0243] 3. Perform color matching process on the object ③ robot shadow
[0244] In this embodiment, since the object attribute of object ③ robot shadow is of non-fillable type, steps S20201-S20204 may not be executed directly, object ③ robot shadow is not color matched, and the original color of object ③ robot shadow is maintained.
[0245] 4. Perform color matching process on the object ④ robot image
[0246] In this embodiment, since the object attribute of object ④ robot picture is a non-fillable type, steps S20201-S20204 can be directly skipped, and object ④ robot picture is not color-matched, maintaining the original color of object ④ robot picture.
[0247] By executing the above color matching processing processes 1-4, object ① lavender rounded rectangle, object ② light blue rounded rectangle, object ③ robot shadow and object ④ robot picture have all become processed objects and are set to be visible.
[0248] 5. Perform color matching process on object ⑤ text box
[0249] Read object ⑤ text box and execute steps S20201-S20204 on object ⑤ text box.
[0250] In step S20201, object ⑤ text box is the object to be processed. Set object ⑤ text box to visible state. At this time, the display effect of the slide is as follows: Fig.18 As shown in the figure. Since at this time, object ① lavender rounded rectangle, object ② light blue rounded rectangle, object ③ robot shadow and object ④ robot picture are processed objects, the background information corresponding to the object to be processed, i.e. object ⑤ text box, is the superposition of the overall background and object ① lavender rounded rectangle, object ② light blue rounded rectangle, object ③ robot shadow and object ④ robot picture after the color matching process, as shown in the figure. Fig.19 shown.
[0251] In step S20202, at least one representative color information is determined based on the background information corresponding to the text box of object ⑤. Fig.19 Step S20202 can be executed to determine a representative color information, that is, Fig. 20 Bright sky blue #DAE3F5 shown.
[0252] In step S20203, according to Fig. 20 The representative color information shown in the figure is used for color evaluation, and the matching color information is obtained from the color matching scheme. In this embodiment, the matching color information is Fig.21 Black #000000 shown.
[0253] In step S20204, Fig.21 The matching color information shown is the same as Fig. 20 The contrast ratio of the representative color information shown is greater than 4.5, which meets the requirements of the "Web Accessibility Single Shared Standard", and the object property of the object ⑤ text box is a fillable type, so according to Fig.21 The adaptive color information shown is used to match the color of the object to be processed, i.e., the object ⑤ text box.
[0254] By executing the above color matching process 1-5, object ① lavender rounded rectangle, object ② light blue rounded rectangle, object ③ robot shadow, object ④ robot picture and object ⑤ text box have all become processed objects and are set to visible state. All objects in the slide have become processed objects, and all color matching processes are completed. The final display effect of the slide is as follows: Fig. 22 shown.
[0255] In this embodiment, an example of color matching for other slides is also provided. Fig.23 As shown, the left side of parts (a), (b), (c), and (d) are the display effects of the slides before the slide color matching method is executed; Fig.23 The slide color matching method is performed on the left side of parts (a), (b), (c), and (d) of the embodiment, and the display effects of the slides after color matching are as follows: Fig.23 The right side of parts (a), (b), (c), and (d) of Fig.23 By comparing the left and right sides of the image, it can be seen that the slide color matching method in this embodiment can improve the coordination of the color matching in the slide and improve the readability of the slide.
[0256] In this embodiment, a slide color matching device is provided. Fig.24 , the slide color matching device includes:
[0257] An object acquisition module, used to acquire at least one object in a slide;
[0258] The object processing module is used to traverse each object and perform a color matching process on the object; the color matching process includes:
[0259] Obtaining background information corresponding to the object to be processed; the object to be processed is the object to be processed in this color matching process;
[0260] Determine at least one representative color information according to the background information;
[0261] Perform color evaluation based on each representative color information to obtain matching color information;
[0262] According to the adapted color information, the object to be processed is matched in color.
[0263] By running the slide color matching device, the same technical effect as the text generation method with semantic image information in the embodiment can be achieved.
[0264] In this embodiment, the computer is programmed to execute Figure 1 and storing such a computer program in a Fig.25 The memory of the computer device shown, or Fig.26The computer program stored in the memory or computer-readable storage medium may be Fig.25 The processor in Fig.26 The processor in the processor reads it out and obtains the execution Figure 2 The processor executes the instructions of each step in the process, and can execute the slide color matching method or the text generation method with semantic image information.
[0265] because Fig.25 The computer device and Fig.26 The computer-readable storage media shown can enable the processor to execute the slide color matching method or the text generation method with semantic image information, so Fig.25 The computer device and Fig.26 The computer-readable storage media shown can achieve the same technical effects as the slide color matching method or the text generation method with semantic image information in the embodiment.
[0266] It should be noted that, unless otherwise specified, the singular forms of "a" and "the" used in this disclosure are also intended to include plural forms, unless the context clearly indicates other meanings. In addition, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as those generally understood by those skilled in the art. The terms used in the present embodiment specification are only for describing specific embodiments, not for limiting the present invention. The term "and / or" used in this embodiment includes any combination of one or more related listed items.
[0267] It should be understood that, although the term first, second, third etc. may be adopted to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish the same type of elements from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided by the present embodiment is only intended to better illustrate embodiments of the present invention, and unless otherwise required, the scope of the present invention will not be limited.
[0268] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed dedicated integrated circuit for this purpose.
[0269] In addition, the operations of the process described in this embodiment may be performed in any suitable order, unless otherwise indicated in this embodiment or otherwise clearly contradicted by the context. The process described in this embodiment (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as a code (e.g., executable instructions, one or more computer programs, or one or more applications) executed on one or more processors in common, by hardware or a combination thereof. A computer program includes a plurality of instructions that may be executed by one or more processors.
[0270] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the above steps in conjunction with a microprocessor or other data processor, the invention of this embodiment includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.
[0271] The above are only preferred embodiments of the present invention. The present invention is not limited to the above embodiments. As long as the technical effects of the present invention are achieved by the same means, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical solutions and / or implementation methods may have various modifications and changes.
Claims
1. A slide color matching method, It is characterized in that The slide color matching method comprises: Get the objects in the slide; Performing a color matching process on the object; the color matching process includes: Acquire background information of an object to be processed; the object to be processed is the object to be processed in the color matching process; Determine at least one representative color information according to the background information; Performing color evaluation according to each of the representative color information to obtain matching color information; The object to be processed is matched in color according to the matching color information.
2. The slide color matching method according to claim 1, It is characterized in that The obtaining of at least one object in the slide includes: Obtaining the level information of the slide; Determine each of the objects in the slide and the level at which the objects are located according to the level information; Each of the objects is set to a hidden state.
3. The slide color matching method according to claim 2, It is characterized in that The color matching process for the object includes: Traverse the objects in order from low to high levels; Mark the traversed object as an object to be processed, and execute the color matching process; Marking the object that has completed the color matching process as a processed object; Sets the processed object to the visible state.
4. The slide color matching method according to claim 1, It is characterized in that The obtaining of background information corresponding to the object to be processed includes: Get the overall background of the slide; Detecting a processed object; the processed object is the object on which the color matching process has been completed; determining the background information according to the overall background when the processed object is not detected; When the processed object is detected, the overall background is superimposed on the processed object to obtain the background information.
5. The slide color matching method according to claim 1, It is characterized in that The step of determining at least one representative color information according to the background information includes: Get the color of the background information; Performing color clustering on the background information to obtain at least one color cluster; A corresponding piece of representative color information is determined according to each of the color clusters.
6. The slide color matching method according to claim 5, It is characterized in that The step of clustering the colors of the background information to obtain at least one color cluster includes: Determine at least one working cluster according to the color of the background information; determining at least one preprocessing cluster according to the color of the background information; The pre-processing clusters are clustered based on the working clusters to obtain at least one color cluster.
7. The slide color matching method according to claim 1, It is characterized in that The performing color evaluation according to each representative color information to obtain the adapted color information includes: Get the color scheme; Select candidate color information from the color scheme; Comparing the candidate color information with each representative color information respectively; In a case where the candidate color information and each representative color information meet the color specification standard, the candidate color information is determined as the adapted color information.
8. The slide color matching method according to claim 1, It is characterized in that The color matching of the object to be processed according to the adapted color information includes: Obtaining object attributes and object color of the object to be processed; When the object attribute is not a preset attribute or the object color is a theme color, maintaining the original color of the object to be processed; In a case where the object attribute is a preset attribute and the object color is not a theme color, the color of the object to be processed is set according to the adapted color information.
9. A slide color matching device, It is characterized in that The slide color matching device comprises: An object acquisition module is used to acquire objects in a slide; The object processing module is used to traverse the object and perform a color matching process on the object; the color matching process includes: Acquire background information corresponding to the object to be processed; the object to be processed is the object to be processed in the current color matching process; Determine at least one representative color information according to the background information; Performing color evaluation according to each of the representative color information to obtain matching color information; The object to be processed is matched in color according to the matching color information.
10. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
