Image color matching method, device and equipment
By acquiring and analyzing image data, and using the trained color matching model to realize automatic color matching of poster design, solving the problems of artificial dependence and strong subjectivity, improving efficiency and applicability, and being suitable for large-scale industrialized scenarios.
Patent Information
- Application Number
- CN202111271903.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In the prior art, the layer coloring process in poster design relies on manual experience, has low versatility and cannot achieve batch automation production. Although the design website annotation method can generate a color palette, the color scheme is subjective and cannot adapt to large-scale. Industrialization scenario.
By obtaining the color data of the original image, determining the background color and text color of the target area, and automatically matching the image with the trained color matching model to achieve batch automatic production without manual judgment.
It improves the efficiency of image color matching, realizes automated production, adapts to the use of large-scale industrial scenarios, and can automatically match color matching based on image content, suitable for advertising delivery and other projects.
Smart Images

Figure CN114332301B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image color matching method, device and equipment. Background Art
[0002] With the development of the Internet and the popularization of the network, people's demand for image design is becoming more and more extensive.
[0003] In the current poster design process, coloring the layers is one of the main processes. In this process, the designer needs to replace the colors of each layer one by one and find new layer colors to match, so as to select the most suitable color for color matching. This process mainly relies on manual experience.
[0004] There are many related design websites such as Drbble. For each uploaded work, the system will automatically extract the color of the work and mark the color, and then generate a color palette. The color palette generated by the design website annotation will be used in the designer's poster color matching process.
[0005] However, the methods of color matching based on manual experience and design website annotation have low versatility for image color matching and cannot be mass-produced automatically. Summary of the invention
[0006] The embodiments of the present application provide an image color matching method, device and equipment, which can automatically match the color of an image without manual determination of the color matching effect, thereby improving the efficiency of image color matching.
[0007] On the one hand, a method for image color matching is provided, the method comprising: acquiring color data of an original image; determining a background color of a target area in the original image based on the color data; determining a position of text in the target area; determining a color of the text in the target area based on the position of the text and the color data of the original image, the color of the text being different from the background color; and matching the original image to obtain a first color matching image based on the determined background color of the target area and the color of the text in the target area.
[0008] Optionally, the method also includes: acquiring sample data, each training sample in the sample data including color data and color matching annotation information of the training sample; training the color matching model according to the color data and color matching annotation information of the training sample to obtain a trained color matching model, and the trained color matching model is used to process the original image to match the background color of the target area in the original image with the color of the text in the target area to obtain a second color matching image.
[0009] In another aspect, an image color matching device is provided, the device comprising:
[0010] An acquisition unit, used for acquiring color data of an original image;
[0011] A first determining unit, configured to determine a background color of a target area in the original image according to the color data;
[0012] A second determining unit, used to determine the position of the text in the target area;
[0013] A third determining unit, configured to determine the color of the text in the target area based on the position of the text and the color data of the original image, wherein the color of the text is different from the background color;
[0014] The first color matching unit is used to match the color of the original image according to the determined background color of the target area and the color of the text in the target area to obtain a first color matching image.
[0015] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program is suitable for being loaded by a processor to execute the steps in the image color matching method as described in any of the above embodiments.
[0016] On the other hand, a computer device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the processor executes the steps in the image color matching method described in any of the above embodiments by calling the computer program stored in the memory.
[0017] On the other hand, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps in the image color matching method described in any of the above embodiments.
[0018] The embodiment of the present application obtains the color data of the original image; determines the background color of the target area in the original image according to the color data; determines the position of the text in the target area; determines the color of the text in the target area based on the position of the text and the color data of the original image, and the color of the text is different from the background color; and matches the original image according to the determined background color of the target area and the color of the text in the target area to obtain a first color matching image. The embodiment of the present application automatically matches the color of the original image by extracting colors from the original image, without manually determining the color matching effect, thereby improving the efficiency of image color matching and realizing batch automated production.
[0019] Optionally, the embodiments of the present application can also automatically match the color of the original image through a color matching model trained based on sample data with color matching annotation information, without the need for manual judgment of the color matching effect, thereby improving the efficiency of image color matching and realizing batch automated production. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A schematic diagram of the structure of the image color matching system provided in an embodiment of the present application.
[0022] Figure 2 A first flow chart of the image color matching method provided in an embodiment of the present application.
[0023] Figure 3 A schematic diagram of an application scenario of the image color matching method provided in an embodiment of the present application.
[0024] Figure 4 A second flow chart of the image color matching method provided in an embodiment of the present application.
[0025] Figure 5 A third flow chart of the image color matching method provided in an embodiment of the present application.
[0026] Figure 6 A fourth flow chart of the image color matching method provided in an embodiment of the present application.
[0027] Figure 7 A schematic diagram of another application scenario of the image color matching method provided in an embodiment of the present application.
[0028] Figure 8 This is a fifth flow chart of the image color matching method provided in an embodiment of the present application.
[0029] Fig. 9 This is a sixth flow chart of the image color matching method provided in an embodiment of the present application.
[0030] Fig.10 This is a first structural schematic diagram of the image color matching device provided in an embodiment of the present application.
[0031] Fig.11 This is a second structural schematic diagram of the image color matching device provided in an embodiment of the present application.
[0032] Fig.12A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0034] The embodiments of the present application provide an image color matching method, apparatus, computer device, and storage medium. Specifically, the image color matching method of the embodiments of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The embodiments of the present application can be applied to various scenarios such as video processing, image processing, data security, cloud technology, artificial intelligence, and smart transportation.
[0035] First, some nouns or terms that appear in the description of the embodiments of the present application are explained as follows:
[0036] Artificial Intelligence (AI): It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0037] Machine Learning (ML): It is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0038] Deep Learning (DL): It is a branch of machine learning and an algorithm that attempts to use multiple processing layers containing complex structures or composed of multiple nonlinear transformations to perform high-level abstraction of data. Deep learning is to learn the inherent laws and representation levels of training sample data. The information obtained in the learning process is of great help in interpreting data such as text, images, and sounds. The ultimate goal of deep learning is to enable machines to have analytical learning capabilities like humans and to be able to recognize data such as text, images, and sounds. Deep learning is a complex machine learning algorithm that has achieved results in speech and image recognition that far exceed previous related technologies.
[0039] Neural Network (NN): A deep learning model in the field of machine learning and cognitive science that imitates the structure and function of biological neural networks.
[0040] k-means: k-means clustering algorithm is an iterative clustering analysis algorithm. Its steps are: divide the data into K groups in advance, randomly select K objects as the initial cluster centers, and then calculate the distance between each object and each seed cluster center, and assign each object to the cluster center closest to it. The cluster centers and the objects assigned to them represent a cluster. Every time a sample is assigned, the cluster center of the cluster will be recalculated based on the existing objects in the cluster. This process will be repeated until a certain termination condition is met. The termination condition can be that no (or a minimum number) of objects are reassigned to different clusters, no (or a minimum number) of cluster centers change again, and the sum of squared errors is locally minimized.
[0041] Median cut method: It is an image quantization algorithm, which aims to extract the theme color in the image. The principle of median cut method is to regard the image color as a cuboid (VBox) in the color space. Starting from the initial whole image as a cuboid, the longest side of RGB is cut in half from the median of color statistics, so that the number of pixels contained in the two cuboids is the same, and the above steps are repeated until the number of cuboids obtained by the final cut is equal to the number of theme colors. For example, the three coordinate axes in the RGB color space are uniformly quantized, and each coordinate axis is divided into 256 levels, 0 is the darkest, and 255 is the brightest, so that the various colors of the true color image can be represented by various quantization points in the coordinate space. Then, the color cube is divided into 256 small cubes, so that each cube contains the same number of colors. Finally, the color of the center point of these 256 small cubes is calculated.
[0042] Support vector machines (SVM): is a binary classification model. Its basic model is a linear classifier with the largest margin defined in the feature space. The largest margin makes it different from the perceptron. SVM also includes kernel techniques, which makes it a substantially nonlinear classifier. The learning strategy of SVM is to maximize the margin, which can be formalized as a problem of solving a convex quadratic programming, which is equivalent to the problem of minimizing the regularized hinge loss function. The learning algorithm of SVM is the optimization algorithm for solving convex quadratic programming. The basic idea of SVM learning is to solve the separating hyperplane that can correctly divide the training data set and has the largest geometric margin.
[0043] Logistic Regression (LR): Also known as logistic regression analysis, it is a classification and prediction algorithm. It predicts the probability of future results based on the performance of historical data. It determines the conditional probability between {0,1} through linear mapping and sigmoid transformation. Logistic regression assumes that the data label follows the Bernoulli distribution, and uses the maximum likelihood function and gradient descent to solve the parameters, thereby classifying the data into two categories.
[0044] Decision tree algorithm: It is a method of approximating the value of a discrete function. It is a typical classification method. First, the data is processed, and readable rules and decision trees are generated using an induction algorithm. Then, the decision is used to analyze new data. In essence, the decision tree is the process of classifying data through a series of rules. Decision tree is a basic classification and regression method. The decision tree model has a tree structure. In classification problems, it represents the process of classifying instances based on features. It can be considered as a collection of if-then rules, or as a conditional probability distribution defined in feature space and class space. The goal of decision tree learning is to build a decision tree model based on a given training data set so that it can correctly classify instances. Decision tree learning is essentially to summarize a set of classification rules from the training data set. There may be multiple decision trees that can correctly classify the training data, or there may be no decision trees. When choosing a decision tree, you should choose a decision tree that has less contradiction with the training data and has good generalization ability; and the selected conditional probability model should not only have a good fit for the training data, but also have a good prediction for unknown data.
[0045] Cloud technology: refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0046] Blockchain system: It can be a distributed system formed by connecting clients and multiple nodes (any form of computing devices connected to the network, such as servers and user terminals) through network communication. The nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP). In a distributed system, any machine such as a server or terminal can join and become a node. The node includes the hardware layer, the middle layer, the operating system layer and the application layer.
[0047] In the current poster design process, coloring the layers is one of the main processes. In this process, the designer needs to replace the colors of each layer one by one, and find new layer colors to match, so as to select the most suitable color for color matching. This process mainly relies on manual experience color matching.
[0048] There are many related design websites such as Drbble. For each uploaded work, the system will automatically extract the color of the work and mark the color, and then generate a color palette. The color palette generated by the design website annotation will be used in the designer's poster color matching process. For example, the colors wheat color (#F5DEB3) and dark red (#DC143C) often appear together. In the future, when making posters, if some layers in the graphics have wheat color (#F5DEB3), you can choose dark red (#DC143C) for color matching.
[0049] However, the methods of manual experience color matching and design website annotation have low universality for image color matching and cannot be mass-produced automatically. For the method of manual experience color matching, the whole process is too complicated and time-consuming. For ordinary users who have not received professional design training, it is difficult to select the color matching of each layer from a large number of colors and then generate a beautiful poster color scheme. The whole process is too dependent on manual participation, so it is difficult to mass-produce automatically and cannot achieve the purpose of mass production. For the method of design website annotation, each sample image has a color scheme. When there are many sample images, there are many color schemes. First, these color schemes need to be collected and tried one by one. This process is too complicated. Secondly, the color matching effect needs to be manually determined. This process is highly subjective. In addition, the color scheme is mainly determined by the color area of the color block in the image. The internal relationship between the colors on the color palette is not sorted out. The color scheme is generated only by area sorting. The color scheme is too simple and crude. For example, in a certain picture, the colors arranged from large to small in terms of area are A, B, and C. Even if A and C look more coordinated, A and B will be prioritized in terms of area from large to small. In fact, the color matching image obtained in this way is not ideal.
[0050] The embodiment of the present application proposes an image color matching method, which can automatically match the color of the layer according to the original image content, or match the color according to the color matching model obtained by machine learning certain color matching rules or training results. Compared with pure manual judgment, it can realize batch automated production and is more adaptable to the use environment of large-scale industrial scenarios.
[0051] The method provided in the embodiment of the present application can be applied to advertising, automatically matching colors for the produced materials, automatically adding layers (such as design elements), etc., to complete the production of poster images for advertising and user acquisition and other projects. The embodiment of the present application can automatically match colors for layers according to image content, or match colors according to certain color matching rules or color matching models obtained from training results. Compared with pure manual judgment, it is more adaptable to the use environment of large-scale industrial scenes.
[0052] The embodiments of the present application can be implemented in combination with cloud technology or blockchain network technology. For example, the image color matching method disclosed in the embodiments of the present application, wherein these data can be stored on the blockchain.
[0053] For example, the color data of the original image, the determined background color of the target area and the color of the text in the target area, and the color matching result of the original image can all be saved on the blockchain. In order to facilitate the storage and query of the color data of the original image, the determined background color of the target area and the color of the text in the target area, and the color matching result of the original image, optionally, the image color matching method also includes: sending the color data of the original image, the determined background color of the target area and the color of the text in the target area, and the color matching result of the original image to the blockchain network, so that the nodes of the blockchain network fill the color data of the original image, the determined background color of the target area and the color of the text in the target area, and the color matching result of the original image into the new block, and when a consensus is reached on the new block, the new block is appended to the end of the blockchain. The embodiment of the present application can store the color data of the original image, the determined background color of the target area and the color of the text in the target area, and the color matching result of the original image on the chain to realize record backup. When the original image needs to be color matched, the color data of the corresponding original image, the determined background color of the target area and the color of the text in the target area, and the color matching result of the original image can be directly and quickly obtained from the blockchain, without the need to perform a series of processing through the image color matching system to obtain the color matching result of the original image, thereby improving the efficiency of data processing and data acquisition.
[0054] For example, the original image, the trained color matching model, and the color matching result of the original image can all be saved on the blockchain. In order to facilitate the storage and query of the original image, the trained color matching model, and the color matching result of the original image, optionally, the image color matching method also includes: sending the original image, the trained color matching model, and the color matching result of the original image to the blockchain network, so that the nodes of the blockchain network fill the original image, the trained color matching model, and the color matching result of the original image into a new block, and when a consensus is reached on the new block, the new block is appended to the end of the blockchain. The embodiments of the present application can store the original image, the trained color matching model, and the color matching result of the original image on the chain to realize the backup of the records. When the original image needs to be color matched, the corresponding original image, the trained color matching model, and the color matching result of the original image can be directly and quickly obtained from the blockchain, without the need to perform a series of processing through the image color matching system to obtain the color matching result of the original image, thereby improving the efficiency of data processing and data acquisition.
[0055] Please refer to Figure 1 , Figure 1 A schematic diagram of the structure of the image color matching system provided in the embodiment of the present application. The image color matching system includes a terminal 10 and a server 20, etc.; the terminal 10 and the server 20 are connected via a network, for example, via a wired or wireless network connection, etc. The terminal 10 can be a smart phone, a tablet computer, a laptop computer, a smart TV, a smart speaker, a wearable smart device, a smart car terminal, etc. The terminal 10 can also include a client, which can be a video client, a browser client, or an instant messaging client, etc. The server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0056] Among them, the terminal 10 can be used to display a graphical user interface. Among them, the terminal is used to interact with the user through a graphical user interface, for example, by downloading and installing the corresponding client through the terminal and running it, for example, by calling the corresponding applet and running it, for example, by logging into the website to present the corresponding graphical user interface, etc. In an embodiment of the present application, the terminal 10 can be a terminal device for the user to upload the original image and display the color matching result. Among them, when performing image color matching, the original image is uploaded through the terminal device used by the user, and the original image is sent to the server 20 for color matching. The server 20 will send the color matching result of the original image to the terminal 10 for display.
[0057] Among them, in an embodiment of the present application, when performing image color matching, the server 20 can be specifically used to: obtain color data of the original image; determine the background color of the target area in the original image based on the color data; determine the position of the text in the target area; based on the position of the text and the color data of the original image, determine the color of the text in the target area, the color of the text is different from the background color; match the original image according to the determined background color of the target area and the color of the text in the target area; and send the color matching result of the original image to the terminal 10 for display.
[0058] Optionally, in an embodiment of the present application, when performing image color matching, the server 20 can also be specifically used to: obtain an original image; process the original image according to a trained color matching model to match the background color of a target area in the original image and the color of text in the target area, wherein the trained color matching model is trained based on sample data with color matching annotation information; and send the color matching result of the original image to the terminal 10 for display.
[0059] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0060] Each embodiment of the present application provides an image color matching method, which can be executed by a terminal or a server, or by a terminal and a server together; the embodiments of the present application are described by taking the image color matching method executed by a server as an example.
[0061] See also Figures 2 to 9 , Figure 2 , Figures 4 to 6 , Figure 8 , Fig. 9 All of them are flowchart diagrams of the image color matching method provided in the embodiments of the present application. Figure 3 and Figure 7 These are schematic diagrams of application scenarios of the image color matching method provided in the embodiments of the present application. The method includes:
[0062] Step 210: Acquire color data of the original image.
[0063] First, an original image is input, and appropriate colors are selected for color matching in some layers of the original image in the subsequent color matching process. Figure 3 As shown, the target area 310 in the original image 300 needs to be color matched. The target area can be the subtitle of the poster image generated based on the original image. In the subsequent color matching process, the background color of the target area 310 is matched, and the color of the text 311 in the target area 310 is matched. Figure 3 For example, the background color of the target area 310 and the color of the text 311 are matched. The color matching requirement is to highlight the text content of the target area (subtitle) so that the user can notice the text of the target area (subtitle) when seeing the original image. For example, the text content of the target area is "XXX joins hands with XXX to pursue the dream of the entertainment industry".
[0064] Optionally, obtaining the color data of the original image includes: extracting multiple image color blocks from the original image; sorting the multiple image color blocks by color, and selecting colors corresponding to image color blocks whose sorting order belongs to a preset ranking as candidate colors, and determining the candidate colors as the color data of the original image.
[0065] For example, before matching the background color, the color data of the original image needs to be obtained first. When obtaining the color data of the original image, multiple image color blocks are usually extracted from the main body of the original image, and the extracted multiple image color blocks are sorted, and the colors in the image color blocks whose sorting order belongs to a preset ranking (such as top20) are pre-selected, and the selected colors are used as candidate colors, and then the candidate colors are determined as the color data of the original image. By sorting the colors of the image color blocks and selecting the colors ranked in the top N positions as candidate colors, colors with little impact on the color effect can be excluded, reducing the amount of calculation, and ensuring that the selected colors can maintain the color effect of the color data of the original image.
[0066] Optionally, the color sorting of the multiple image color blocks includes: sorting the image color blocks in order of area from large to small; or sorting the multiple image color blocks in order of color brightness from high to low; or sorting the multiple image color blocks in order of color vividness from high to low.
[0067] For example, the brightness of a color can also be expressed as the lightness of the color. Lightness refers to the brightness of the color. The highest lightness is white, and the lowest lightness is black. For example, the brightness of a color can also be expressed as saturation. Saturation refers to the vividness of the color. The color with the highest saturation is the pure color. The colors on the far right of the color picker are all the most saturated, and the colors on the far left are the least saturated.
[0068] Step 220: Determine the background color of the target area in the original image according to the color data.
[0069] Optional, such as Figure 4 As shown, step 220 may be implemented through steps 401 to 404, specifically:
[0070] Step 401: Acquire RGB color information of candidate colors in the color data of the original image, and convert the RGB color information of the candidate colors in the color data of the original image into YUV color information.
[0071] For example, the selection of background color usually adopts the following specifications: the selected color has high saturation; the selected color has high brightness; the selected color has large R channel value. Therefore, the candidate colors selected in the above sorting order that belong to the preset ranking (such as top20) need to be analyzed according to the above three specifications. For example, the RGB color information of the candidate color in the color data of the original image is obtained and converted into YUV color information.
[0072] Among them, RGB (red, green, and blue) is a space defined based on the colors recognized by the human eye, which can represent most colors. In order to use the human visual angle characteristics to reduce the amount of data, the color image represented by the RGB space is usually transformed into other color spaces. There are three color space transformations currently used: YIQ, YUV, and YCrCb. Each color space produces a brightness component signal and two chrominance component signals, and the parameters used in each transformation are to adapt to a certain type of display device. Among them, YIQ is suitable for NTSC color television system, YUV is suitable for PAL and SECAM color television systems, and YCrCb is suitable for computer monitors. In the YUV color space, Y represents brightness, UV is used to represent color difference, and U and V are two components that constitute color. In the YCbCr color space, Y refers to the brightness component, Cb refers to the blue chrominance component, and Cr refers to the red chrominance component. YUV uses RGB information, but it produces a black and white image from a full-color image, and then extracts the three main colors into two additional signals to describe the color. Combining these three signals can produce a full-color image. The YCbCr color space is an internationally standardized variant of YUV and is used in digital television and image compression (such as JPEG).
[0073] For example, in the digital domain rather than in the analog domain, when YUV color information is represented by the YCbCr color space, the calculation formula for converting YUV color information from RGB color information to YUV color information can be expressed as follows:
[0074] Y=0.299*R+0.587*G+0.114*B;
[0075] Cb=U=-0.1687*R-0.3313*G+0.5*B+128;
[0076] Cr=V=0.5*R-0.4187*G-0.0813*B+128.
[0077] Among them, the Y channel represents brightness, the V channel represents saturation, the U channel represents hue, the R channel represents red, the G channel represents green, and the B channel represents blue.
[0078] Step 402: normalize the R channel value in the RGB color information, and the V channel value and the Y channel value in the YUV color information.
[0079] For example, since the value ranges of the R channel, V channel, and Y channel are all [0, 255], the values of the three channels are normalized to [0, 1] respectively.
[0080] Step 403: Calculate the score of each candidate color according to the normalized R channel value, V channel value and Y channel value.
[0081] Optionally, calculating the score of each candidate color based on the normalized R channel value, V channel value and Y channel value includes: calculating the score of each candidate color based on the normalized R channel value, V channel value and Y channel value, and the weight of the R channel, the weight of the V channel and the weight of the Y channel, wherein the sum of the weight of the R channel, the weight of the V channel and the weight of the Y channel is equal to 1.
[0082] Optionally, the weight of the R channel, the weight of the V channel, and the weight of the Y channel are all equal.
[0083] For example, after normalization, the score of each candidate color in the candidate colors whose sorting order belongs to the preset ranking (such as top20) is calculated by fusion, and the calculation method is as follows:
[0084] Score = K1*R+K2*V+K3*Y;
[0085] Among them, Score represents the score, R represents the R channel value, Y represents the Y channel value, V represents the V channel value, K1 represents the weight of the R channel, K2 represents the weight of the V channel, and K3 represents the weight of the Y channel.
[0086] Generally, K1+K2+K3=1. Optionally, for the convenience of calculation, K1=K2=K3=1 / 3 may be assumed.
[0087] For example, Figure 3 Through the above method, the background color of the target area can be obtained as red.
[0088] Step 404: Determine the background color of the target area in the original image according to the score of each candidate color in the color data of the original image.
[0089] Optionally, determining the background color of the target area in the original image based on the score of each candidate color in the color data of the original image includes: determining the candidate color with the highest score in the color data of the original image as the background color of the target area in the original image.
[0090] For example, the candidate color with the highest score among the candidate colors whose sorting order belongs to a preset ranking (such as top 20) can be used as the background color of the target area in the original image.
[0091] Optional, such as Figure 5 As shown, step 220 may be implemented through steps 501 to 506, specifically:
[0092] Step 501, obtain RGB color information of the candidate color in the color data of the original image, and convert the RGB color information of the candidate color in the color data of the original image into YUV color information. The specific description of step 501 can refer to the above step 401, which will not be repeated here.
[0093] Step 502, normalize the R channel value in the RGB color information, and the V channel value and the Y channel value in the YUV color information. The specific description of step 502 can refer to the above step 402, which will not be repeated here.
[0094] Step 503, calculating the score of each candidate color according to the normalized R channel value, V channel value and Y channel value. The specific description of step 503 can refer to the above step 403, which will not be repeated here.
[0095] Step 504 , classifying the candidate colors in the color data of the original image according to the emotional color scenes, to obtain different color groups corresponding to different emotional color scenes.
[0096] For example, color itself has no emotion, but people who live in a colorful environment for a long time will accumulate certain visual scenes of different color environments. When certain visual scenes resonate with the stimulation of certain colors, people will have certain emotions. Therefore, colors can be classified based on preset emotional color scenes.
[0097] For example, emotional color scenes may include warm scenes, cold scenes, solemn scenes, etc. For example, warm scenes may correspond to warm colors, such as red, orange, yellow, pink and other colors; for example, cold scenes may correspond to cool colors, such as blue, green, purple and other colors; for example, solemn scenes may include white, black, gray and other colors.
[0098] For example, the associated objects of red may include: fire, blood, flowers, red flags, Spring Festival couplets, happy events, etc.; red may symbolize: enthusiasm, jubilation, warmth, vitality, prohibition, warning, passion, danger, etc.
[0099] For example, the associative objects corresponding to the color orange may include: citrus, autumn leaves, sunset, lights, persimmons, juice, bread, etc.; orange can symbolize: happiness, health, self-confidence, unrestrainedness, magnificence, maturity, sweetness, warmth, etc.
[0100] For example, the associated objects of yellow may include: lemon, chrysanthemum, banana, sunflower, corn, moon, gold, etc.; yellow may symbolize: light, hope, authority, harvest, nobility, cheerfulness, etc.
[0101] For example, the associated objects of blue can include: sea, sky, water, universe, etc. Blue can symbolize: tranquility, indifference, calmness, reason, heaviness, distance, sadness, melancholy, boredom, etc.
[0102] For example, the associated objects of green may include: grass, leaves, plants, green traffic lights, parks, military uniforms, seedlings, etc.; green may symbolize: life, peace, youth, safety, calmness, growth, vitality, etc.
[0103] For example, the associated objects of purple may include: grapes, eggplants, lilacs, violets, etc.; purple can symbolize: superiority, nobility, luxury, sorrow, selfishness, jealousy, etc.
[0104] For example, the associative objects corresponding to white can include: white clouds, white sugar, flour, snow, white walls, nurses, wedding dresses, white rabbits, etc.; white can symbolize: innocence, purity, brightness, holiness, sincerity, innocence, nobility, light, etc.
[0105] For example, the associative objects corresponding to gray may include: tree bark, dark clouds, cement, etc.; gray may symbolize: ordinariness, frustration, humility, maturity, stability, negativity, etc.
[0106] For example, the associated objects of black may include: night, ink, charcoal, coal. Black may symbolize: terror, death, seriousness, strength, weight, guilt, solidity, etc.
[0107] Among them, when classifying colors based on preset emotional color scenes, colors belonging to the same color system or similar colors can be classified into the same category.
[0108] Step 505: sort the candidate colors in each of the color groups according to the score of each of the candidate colors.
[0109] For example, after classifying candidate colors in the color data of the original image according to emotional color scenes to obtain different color groups corresponding to different emotional color scenes, the candidate colors in each color group are reordered within the color group based on the score of each candidate color.
[0110] Step 506, acquiring the emotional information of the text, and determining the candidate color with the highest score in the color group whose emotional color scene in the different color groups matches the emotional information of the text as the background color of the target area in the original image.
[0111] For example, text content may be obtained and semantic analysis may be performed on the text content to obtain emotional information of the text. The emotional information of the text is then matched with color symbolic information in an emotional color scene to select a color group whose emotional color scene matches the emotional information of the text from multiple color groups, and then a candidate color with the highest score is selected from the matched color group as the background color of the target area in the original image.
[0112] Optional, such as Figure 6 As shown, step 220 may be implemented through steps 601 to 606, specifically:
[0113] Step 601, obtain RGB color information of the candidate color in the color data of the original image, and convert the RGB color information of the candidate color in the color data of the original image into YUV color information. The specific description of step 601 can refer to the above step 401, which will not be repeated here.
[0114] Step 602, normalize the R channel value in the RGB color information, and the V channel value and the Y channel value in the YUV color information. The specific description of step 602 can refer to the above step 402, which will not be repeated here.
[0115] Step 603, calculating the score of each candidate color according to the normalized R channel value, V channel value and Y channel value. The specific description of step 603 can refer to the above step 402, which will not be repeated here.
[0116] Step 604: classify the candidate colors in the color data of the original image according to the emotional color scene to obtain different color groups corresponding to different emotional color scenes. The specific description of step 604 can refer to the above step 504, which will not be repeated here.
[0117] Step 605: Sort the candidate colors in each color group according to the score of each candidate color. The specific description of step 605 can refer to the above step 505, which will not be repeated here.
[0118] Step 606, obtaining the presentation object in the original image, and determining the candidate color with the highest score in the color group whose emotional color scene in the different color groups matches the presentation object as the background color of the target area in the original image.
[0119] For example, object extraction may be performed on the original image to extract the presentation object in the original image. Optionally, a subject object may be determined from multiple presentation objects according to the area size and / or display position of the presentation object. The presentation object (or subject object) is then matched with the color association object information in the emotional color scene to select a color group whose emotional color scene matches the presentation object (or subject object) from multiple color groups, and then a candidate color with the highest score is selected from the matched color group as the background color of the target area in the original image.
[0120] It is understandable that the background color of the target area in the original image may be matched in combination with the color data of the original image, the text content in the target area, and / or the presentation object of the original image.
[0121] Step 230: determine the position of the text in the target area.
[0122] Optionally, determining the position of the text in the target area includes: determining the position of the text in the target area according to the content of the text and the pixels of each text, and the size of the original image.
[0123] Optionally, determining the position of the text in the target area based on the content of the text, the pixels of each character, and the size of the original image includes: determining the size of the text box of the text based on the content of the text and the pixels of each character; determining the position of the text box based on the size of the text box and the size of the original image.
[0124] Optionally, the method further includes: determining a position of the target area in the original image according to a position of the text box.
[0125] For example, in the case where the text box is the target area, or the target area is an area slightly larger than the text box, the position of the target area in the original image can be determined based on the position of the text box. As long as the position of the text box is determined, the position of the target area can be determined.
[0126] For example, you can get the position of the text area that needs to be covered. Figure 3For example, the text content 311 of the target area 310 (subtitle) contains 13 characters in total. For example, if each character is required to be p pixels, the size of the text box 312 can be a matrix of 13p times p. If the width of the original image 300 is W, for example, the height from the upper left corner of the text box 312 to the upper left vertex is limited to h, and the text box 312 is centered, the width from the upper left corner of the original image 300 to the upper left vertex is (W-13P) / 2, that is, the coordinates of the upper left corner of the text box 312 are ((W-13P) / 2, h), and the coordinates of the lower right corner are ((W+13P) / 2, h+p).
[0127] Optionally, the target area is a specified position, and determining the position of the text box according to the size of the text box and the size of the original image includes: determining the position of the text in the target area according to the size of the text box, the size of the original image, and the specified position of the target area in the original image.
[0128] For example, the target area may be a designated position in a designated original image, and the designated position of the target area needs to be considered when determining the position of the text box. For example, if the text box is centered in the target area, the position of the text in the target area can be determined based on the size of the text box, the width of the original image, and the designated position of the target area in the original image.
[0129] Optionally, before determining the position of the text box according to the size of the text box and the size of the original image, the method further includes: acquiring a presentation object in the original image, and when the presentation object is a person object, identifying the head position of the person object;
[0130] Determining the position of the text box according to the size of the text box and the size of the original image includes: determining the position of the text in the target area according to the head position of the character object, the size of the text box and the size of the original image, wherein the position of the text in the target area does not overlap with the head position of the character object.
[0131] For example, the position of the text box needs to avoid the key position of the object presented in the original image. For example, the key position may be the head position of a person object, the head position of an animal object, a key scene area, etc. For example, the position of the text box needs to avoid the head position of the person object in the original image.
[0132] Step 240, based on the location of the text and the color data of the original image, determine the color of the text in the target area, the color of the text is different from the background color.
[0133] Optionally, determining the color of the text in the target area based on the position of the text and the color data of the original image includes: determining the color of the text according to brightness information converted from the color data at the position of the text.
[0134] Optionally, determining the color of the text based on brightness information converted from color data at the location where the text is located includes: obtaining brightness information converted from color data at the location where the text is located; judging whether the proportion of the value of the brightness information at the location where the text is located that is greater than a first threshold exceeds the first proportion; if the proportion of the value of the brightness information at the location where the text is located that is greater than the first threshold exceeds the first proportion, determining the color of the text as black; or if the proportion of the value of the brightness information at the location where the text is located that is greater than the first threshold does not exceed the first proportion, determining the color of the text as white.
[0135] For example, when matching the color of the subtitle text, for convenience, only two colors can be considered, namely white and black. For example, after obtaining the position of the text box, the color data corresponding to the position of the text box is taken out from the original image, and the color data corresponding to the position of the text box is converted into YUV color information containing brightness information, and the value of the Y channel representing the brightness information is calculated. When the value of the Y channel is greater than the first threshold (such as 100) and the proportion exceeds the first proportion (such as 99%), black text is selected, and when the value of the Y channel is greater than the first threshold (such as 100) and the proportion is less than the first proportion (such as 99%), white text is selected.
[0136] like Figure 7 As shown, for the left image, the text-covered area has a higher brightness. If white text is used, the text will be difficult to see clearly. In this case, black text will have a better visual effect. For the right image, the text-covered area has a lower brightness. Using white text can intuitively improve the visual effect of users reading the text content.
[0137] Step 250 , matching colors of the original image according to the determined background color of the target area and the color of the text in the target area to obtain a first color matching image.
[0138] For example, the original image is color matched according to the determined background color of the target area and the color of the text in the target area to generate a first color matched image with a color matched result, and the first color matched image can be sent to the display interface of the terminal for display.
[0139] The embodiment of the present application can automatically match the colors of the layers according to the content of the original image, which can achieve batch automated production compared to pure manual judgment, and is more adaptable to the use environment of large-scale industrial scenes. The embodiment of the present application can be applied to advertising, automatically matching the colors of the produced materials, automatically adding layers (such as design elements), etc., to complete the production of poster images for advertising and user acquisition and other projects. The embodiment of the present application can automatically match the colors of the layers according to the image content, which is more adaptable to the use environment of large-scale industrial scenes compared to pure manual judgment. The embodiment of the present application can be used to layout pages such as websites and clients, and different color matching images are selected for different activities in different scenes.
[0140] Among them, the image color matching method for extracting colors from the original image for color matching provided in the embodiment of the present application provides a color matching method that is only applicable to some cases, and the operation is relatively simple. The selected colors are divided into two cases: one is the color in the original image, and the other is a common color, such as black / white.
[0141] Optionally, in order to increase the diversity of solutions, the method also includes: acquiring sample data, each training sample in the sample data including color data and color matching annotation information of the training sample; training the color matching model according to the color data and color matching annotation information of the training sample to obtain a trained color matching model, and the trained color matching model is used to process the original image to match the background color of the target area in the original image and the color of the text in the target area to obtain a second color matching image.
[0142] For example, when the user is not satisfied with the first color matching image, it may be necessary to trigger the operation of regenerating the color matching image. For example, when the first color matching image is rated as unattractive, or when a color matching request based on a color matching model is received, the step of processing the original image according to the trained color matching model is triggered to match the background color of the target area in the original image and the color of the text in the target area to obtain a second color matching image.
[0143] In order to better illustrate the step of color matching the original image based on the trained color matching model to obtain the second color matching image in the embodiment of the present application, please refer to Figures 8 to 9 The flowchart of the image color matching method shown is as follows:
[0144] Step 810: Acquire sample data, where each training sample in the sample data includes color data and color matching annotation information of the training sample.
[0145] For example, a training sample with an initial color matching rule can be obtained. The initial color matching rule can be created by an expert, or more rules can be mined from the initial color matching rule to achieve data augmentation of the color matching rule. The same color matching rule can be applicable to multiple business scenarios or more patterns, that is, fewer color matching rules can be used to support most color matching processes. For example, each training sample includes the color data and color matching annotation information of the training sample, and each color matching rule corresponds to a training sample, that is, each color matching rule corresponds to the color data and color matching annotation information of a training sample. The training sample can be a sample image with a specific color matching rule that has been completed.
[0146] In the example of the embodiment of the present application, the color data of a training sample is equivalent to the background color of the target area of the training sample and the color of the text in the target area. The color matching annotation information is equivalent to the annotation corresponding to the manual scoring, which can include 0 and 1, where 0 means unsightly or unusable, and 1 means beautiful or usable.
[0147] Optional, such as Fig. 9 As shown, step 810 may be implemented through steps 811 to 815, specifically:
[0148] In step 811, an image obtained by crawling data from a design website page is used as a sample image, or an obtained historical color matching image is used as a sample image.
[0149] For example, you can first crawl the images in the design website (such as Drbble) to obtain sample images. Crawling is a means of obtaining relevant World Wide Web resources based on World Wide Web web links. Data crawling is to obtain the content information on the required website, such as text, video, pictures and other data, through a web crawler program. A web crawler is a program or script that automatically grabs World Wide Web information according to certain rules. It downloads web pages from the World Wide Web for search engines and is an important component of search engines.
[0150] For example, the acquired historical color matching image may also be used as a sample image.
[0151] Step 812: Perform color extraction on the sample image to extract a preset number of candidate colors from the sample image as color data of the sample image.
[0152] For example, after a sufficient number of sample images are obtained, color extraction is performed on the sample images to extract a preset number of candidate colors from the sample images as color data of the sample images.
[0153] For example, there are many ways to extract the theme color of the sample image, such as the median segmentation method. For example, this project uses the kmeans algorithm based on clustering. For example, the preset number k is set to 5, and the center point of each cluster is extracted as the color of the cluster. That is, in this step, 5 colors in the sample image can be extracted as the color data (theme color) of the sample image.
[0154] Step 813, selecting two colors from a preset number of candidate colors in the sample image, and determining training samples according to the two selected colors, wherein the color data of each training sample includes the two selected colors.
[0155] For example, if the preset number of candidate colors is 5 colors, two colors are selected from the 5 colors of each sample image, a total of 10 groups of colors, and the color matching rules composed of each group of colors constitute a training sample. For example, when 10,000 sample images are obtained, 100,000 (10000*10) training samples can be formed.
[0156] Optionally, determining the training sample according to the two selected colors includes: performing data expansion processing on color data of the sample image according to the two selected colors, and determining the training sample by reselecting two colors from the color data after the data expansion processing.
[0157] Optionally, performing data expansion processing on the color data of the sample image according to the two selected colors includes: performing data expansion processing on the color data of the sample image according to a color in the color wheel that is at a preset angle to each of the two selected colors.
[0158] Step 814, obtaining color matching annotation information of the training sample, wherein the color matching annotation information is used to indicate whether the combination of the two selected colors is aesthetically pleasing, and the color matching annotation information includes aesthetically pleasing and unpleasing.
[0159] Step 815: determine the training samples with the color matching annotation information being aesthetically pleasing as positive samples, and determine the training samples with the color matching annotation information being unpleasing as negative samples.
[0160] For example, taking the preset number of candidate colors as 5 colors, two colors are selected from the 5 colors of each sample image, a total of 10 groups of colors, and the color matching rules composed of each group of colors constitute a training sample. The training samples corresponding to these 10 groups of colors are sent to the terminal corresponding to the scoring expert, so that the scoring expert (such as a designer) can manually score the above training samples. The scoring content mainly determines whether the training samples composed of the two selected colors are beautiful. Then, the terminal corresponding to the scoring expert sends the color matching annotation information obtained by the scoring expert after scoring whether the matching of the two colors in the new training sample is beautiful to the server. For example, 100,000 training sample data composed of 10,000 sample images are annotated, and a total of M groups of training samples with appropriate beauty are selected.
[0161] For example, the two selected colors can be two colors selected arbitrarily from a preset number of candidate colors. For example, two colors whose color block size difference satisfies a first preset condition can be selected from a preset number of candidate colors according to the color image block size, such as the first preset condition that the color block size difference is the largest, or the color block size difference exceeds a certain value. For example, two colors whose color brightness difference satisfies a second preset condition can be selected from a preset number of candidate colors according to the color brightness, such as the second preset condition that the color vividness difference is the largest, or the color vividness difference exceeds a certain value. For example, two colors whose color vividness difference satisfies a third preset condition can be selected from a preset number of candidate colors according to the color vividness, such as the third preset condition that the color vividness difference is the largest, or the color vividness difference exceeds a certain value.
[0162] For example, since the number of M is small and does not meet the requirements of large-scale training, some commonly used color matching methods in the design field can be considered to expand the data set. For example, the two colors selected above are represented as C and CC respectively. According to the colors in the color wheel that are at a preset angle to each of the two selected colors, the color data of the sample image is expanded. For example, the data set can be expanded in the following way:
[0163] (1) Data expansion processing is performed on the color data of the sample image according to similar colors. Similar colors are all colors within 90° in the hue wheel, that is, colors that are close to each other on the hue wheel. For example, within the range of similar colors, they can also be divided into adjacent colors and same colors according to different angles. Adjacent colors are colors that are adjacent to each other on the hue wheel. Colors within 60° can be called adjacent colors; same colors are colors within 15° in the hue wheel. For example, the preset angle can be set to 30 degrees, and data expansion processing is performed based on the colors in the hue wheel that are 30 degrees away from each of the two selected colors. For example, through similar color expansion, the colors of C+30 and CC+30 can be obtained.
[0164] (2) Performing data expansion processing on the color data of the sample image according to contrasting colors. Contrasting colors are also called complementary colors. Contrasting colors can be colors opposite (180°) to a single color in the hue wheel, that is, colors that are 180 degrees apart on the hue wheel. Contrasting colors have strong contrast, such as red and green, yellow and purple, etc. For example, the preset angle can be set to 180 degrees, and data expansion processing is performed according to the colors in the hue wheel that are 180 degrees apart from each of the two selected colors. For example, by contrasting color expansion, the colors of C+180 and CC+180 can be obtained.
[0165] (3) Data expansion processing is performed on the color data of the sample image according to the three-color color matching, such as the colors that are 120 degrees apart from each other on the hue wheel. For example, the preset angle can be set to 120 degrees, and data expansion processing is performed according to the colors that are 120 degrees apart from each of the two selected colors in the hue wheel. For example, through the three-color color matching expansion method, the colors of C+120 and CC+120 can be obtained.
[0166] For example, the above 10,000 data can be expanded to 30,000 data after data expansion. Then, two colors different from the colors selected for the first time are randomly selected from the color data after data expansion to form a new training sample, and the new training sample is sent to the terminal corresponding to the scoring expert, so that the scoring expert (such as a designer) can manually score the new training sample, and then the terminal corresponding to the scoring expert sends the color matching annotation information obtained after the scoring expert scores whether the matching of the two colors in the new training sample is beautiful to the server, so that the server selects a total of N groups of beautiful and appropriate training samples from the new training samples according to the color matching annotation information. At this time, M+N training samples (positive samples) with beautiful color matching annotation information can be obtained. The M+N training samples with beautiful color matching annotation information can be used as valid color matching rules, and other training samples (negative samples) with unsightly color matching annotation information can be used as invalid color matching rules.
[0167] Step 820: training the color matching model according to the color data and color matching annotation information of the training sample to obtain a trained color matching model.
[0168] Optionally, training the color matching model according to the color data and color matching annotation information of the training samples to obtain a trained color matching model includes: training the color matching model according to RGB data of two colors corresponding to the positive sample and the negative sample, respectively, and the color matching annotation information corresponding to the positive sample and the negative sample, respectively, to obtain a trained color matching model.
[0169] For example, a model is trained for M+N valid rules, and the input is RGB data of two colors, that is, the input is six-dimensional; the output is whether it can be used, 1 means it can be used, and 0 means it cannot be used. A binary classification network can be used for training, for example, the number of positive samples selected is M+N, and M+N negative samples are randomly selected from the labeled data for training.
[0170] For example, after the designers score, M+N valid color matching rules are obtained, and the remaining 10w-M+3w-N rules are invalid color matching rules. When training the model, the positive samples input are the samples corresponding to the M+N valid color matching rules, and the negative samples are the M+N samples randomly selected from the 10w-M+3w-N rules.
[0171] Optionally, before training the color matching model, the positive samples and the negative samples are deduplicated. By deduplicating the positive samples and the negative samples, it is possible to prevent the data from being too concentrated in a certain area as much as possible. For example, each color matching rule has two colors, and each color has three groups of color variables, RGB, that is, each color matching rule has 3*2=6 color variables. The deduplication method can be to traverse the color matching rules corresponding to all positive samples, and compare the color variables RGB and color variables R'G'B' of each two color matching rules. If the size difference of these six variables is within 3, it means that the two color matching rules are repeated, and the data related to the repeated color matching rules needs to be deleted. Assume that after deduplication from M+N positive sample data, K positive sample data remain; deduplication is removed from the negative samples and K negative sample data are randomly selected, so that the K positive sample data and K negative sample data construct a training sample data set. For example, the training plan has K positive and negative samples, a total of 2K training sample data sets, each training sample has 6 parameters, which are the GRB values of two colors; the model output is a variable of 0 or 1, 0 means that the positive sample is usable (or beautiful), and 1 means that the negative sample is not usable (or not beautiful). The machine learning algorithm is trained on these 2K training sample data to finally optimize the model parameters of the color matching model to obtain a trained color matching model.
[0172] For example, you can try to use a variety of machine learning algorithms for training, including support vector machine SVM, logistic regression LR algorithm, decision tree algorithm and other algorithm models for model training.
[0173] For example, support vector machine (SVM) is a binary classification model. SVM can map the feature vector of an instance to some points in space. The purpose of SVM is to draw a line to "best" distinguish the two types of points, so that if there are new points in the future, this line can also make a good classification. SVM is suitable for small and medium-sized data samples, nonlinear, and high-dimensional classification problems.
[0174] For example, different machine learning models can be used for model training and testing. Through online verification, two color schemes are randomly displayed, and the proportion of the algorithm and the designer considering them usable reaches 80%, that is, the algorithm availability rate reaches 80%. For example, through experiments, it can be seen that the use of SVM has the best effect, and the precision recall rate of the color matching model can reach 90%.
[0175] For example, the input data of machine learning training can add more dimensions. For example, the proportion information of the colored target area and / or text in the sample image in the training sample, or the position information of the colored target area and / or text in the sample image can be input as one of the input data in the training sample.
[0176] For example, data enhancement strategies can also be implemented in other ways. For example, if the three colors A, B, and C meet the color matching requirements, a more complex graph network can be used to replace the existing machine learning network. That is, ABC is regarded as a node in the graph, and the lines between the nodes represent the strength. The strength of the existing process is the same, and the score can be used to replace the existing sample suitability (whether it is usable / beautiful) process.
[0177] Step 830 , processing the original image according to the trained color matching model to match the background color of the target area in the original image with the color of the text in the target area to obtain a second color matching image.
[0178] For example, the second color matching image generated by the color matching model may replace the first color matching image originally obtained by matching colors according to the color data of the original image.
[0179] For example, the second color matching image generated by the color matching model and the first color matching image originally obtained by matching the color data of the original image can be sent to the terminal for display at the same time, so that the user can select the most satisfactory image from the first color matching image and the second color matching image.
[0180] For example, when a first color matching image and a second color matching image are provided to the user for selection, if the image finally selected by the user is the first color matching image, the selected first color matching image is used as a sample image of the color matching model, so that the shooting model can be retrained when a preset number of sample images are subsequently obtained.
[0181] The embodiments of the present application can match colors according to the color matching model obtained by machine learning certain color matching rules or training results. Compared with pure manual judgment, batch automated production can be achieved, and it is more adaptable to the use environment of large-scale industrial scenes. The embodiments of the present application can be applied to advertising, automatically matching the produced materials, automatically adding layers (such as design elements), etc., to complete the production of poster images for advertising and user acquisition and other projects. The embodiments of the present application can match colors according to the color matching model obtained by machine learning certain color matching rules or training results. Compared with pure manual judgment, it is more adaptable to the use environment of large-scale industrial scenes. The embodiments of the present application can be used to layout pages such as websites and clients, and different color matching images are selected for different activities in different scenes.
[0182] All of the above technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described in detail here.
[0183] The embodiment of the present application obtains the color data of the original image; determines the background color of the target area in the original image according to the color data; determines the position of the text in the target area; determines the color of the text in the target area based on the position of the text and the color data of the original image, and the color of the text is different from the background color; and matches the original image according to the determined background color of the target area and the color of the text in the target area to obtain a first color matching image. The embodiment of the present application automatically matches the color of the original image by extracting colors from the original image, without manually determining the color matching effect, thereby improving the efficiency of image color matching and realizing batch automated production.
[0184] In addition, the embodiment of the present application can also automatically match the color of the original image through a color matching model trained based on sample data with color matching annotation information, without the need for manual judgment of the color matching effect, thereby improving the efficiency of image color matching and realizing batch automated production.
[0185] In order to better implement the image color matching method of the embodiment of the present application, the embodiment of the present application also provides an image color matching device. Fig.10 , Fig.10 The first structural diagram of the image color matching device provided in the embodiment of the present application. The image color matching device 1000 may include:
[0186] An acquisition unit 1010 is used to acquire color data of an original image;
[0187] A first determining unit 1020, configured to determine a background color of a target area in the original image according to the color data;
[0188] A second determining unit 1030 is used to determine the position of the text in the target area;
[0189] A third determining unit 1040 is used to determine the color of the text in the target area based on the position of the text and the color data of the original image, wherein the color of the text is different from the background color;
[0190] The first color matching unit 1050 is used to match the color of the original image according to the determined background color of the target area and the color of the text in the target area to obtain a first color matching image.
[0191] Optionally, the acquisition unit 1010 can be used to: extract multiple image color blocks from the original image; sort the multiple image color blocks by color, and select the colors corresponding to the image color blocks whose sorting order belongs to a preset ranking as candidate colors, and determine the candidate colors as the color data of the original image.
[0192] Optionally, when the acquisition unit 1010 performs color sorting on the multiple image color blocks, it can be used to: sort the image color blocks in order of their areas from large to small; or sort the multiple image color blocks in order of their color brightness from high to low; or sort the multiple image color blocks in order of their color vividness from high to low.
[0193] Optionally, the first determination unit 1020 can be used to: obtain RGB color information of the candidate color in the color data of the original image, and convert the RGB color information of the candidate color in the color data of the original image into YUV color information; normalize the R channel value in the RGB color information, and the V channel value and the Y channel value in the YUV color information; calculate the score of each of the candidate colors based on the normalized R channel value, V channel value and Y channel value; determine the background color of the target area in the original image based on the score of each of the candidate colors in the color data of the original image.
[0194] Optionally, when determining the background color of the target area in the original image based on the score of each candidate color in the color data of the original image, the first determination unit 1020 can be used to: determine the candidate color with the highest score in the color data of the original image as the background color of the target area in the original image.
[0195] Optionally, after calculating the score of each candidate color based on the normalized R channel value, V channel value and Y channel value, the first determination unit 1020 can also be used to: classify the candidate colors in the color data of the original image according to the emotional color scene to obtain different color groups corresponding to different emotional color scenes; and sort the candidate colors in each color group according to the score of each candidate color.
[0196] Optionally, when determining the background color of the target area in the original image based on the score of each candidate color in the color data of the original image, the first determination unit 1020 can be used to: obtain the emotional information of the text, and determine the candidate color with the highest score in the color group whose emotional color scene in the different color groups matches the emotional information of the text as the background color of the target area in the original image.
[0197] Optionally, when determining the background color of the target area in the original image based on the score of each candidate color in the color data of the original image, the first determination unit 1020 can be used to: obtain the presentation object in the original image, and determine the candidate color with the highest score in the color group that matches the emotional color scene in the different color groups with the presentation object as the background color of the target area in the original image.
[0198] Optionally, when calculating the score of each candidate color based on the normalized R channel value, V channel value and Y channel value, the first determination unit 1020 can be used to: calculate the score of each candidate color based on the normalized R channel value, V channel value and Y channel value, and the weight of the R channel, the weight of the V channel and the weight of the Y channel, wherein the sum of the weight of the R channel, the weight of the V channel and the weight of the Y channel is equal to 1.
[0199] Optionally, the second determining unit 1030 may be configured to determine the position of the text in the target area according to the content of the text and the pixels of each text, and the size of the original image.
[0200] Optionally, when determining the position of the text in the target area based on the content of the text, the pixels of each character, and the size of the original image, the second determination unit 1030 can be used to: determine the size of the text box of the text based on the content of the text and the pixels of each character; determine the position of the text box based on the size of the text box and the size of the original image.
[0201] Optionally, before determining the position of the text box according to the size of the text box and the size of the original image, the second determination unit 1030 can also be used to: obtain the presentation object in the original image, and when the presentation object is a person object, identify the head position of the person object; determine the position of the text in the target area according to the head position of the person object, the size of the text box and the size of the original image, wherein the position of the text in the target area does not overlap with the head position of the person object.
[0202] Optionally, the second determining unit 1030 may also be configured to: determine the position of the target area in the original image according to the position of the text box.
[0203] Optionally, the target area is a specified position, and when the second determination unit 1030 determines the position of the text box according to the size of the text box and the size of the original image, it can also be used to: determine the position of the text in the target area according to the size of the text box, the size of the original image, and the specified position of the target area in the original image.
[0204] Optionally, the third determination unit 1040 may be configured to determine the color of the text according to brightness information converted from color data at the location where the text is located.
[0205] Optionally, when determining the color of the text based on the brightness information converted from the color data at the location where the text is located, the third determination unit 1040 can also be used to: obtain the brightness information after the color data at the location where the text is located is converted; determine whether the proportion of the value of the brightness information at the location where the text is located that is greater than a first threshold exceeds the first proportion; if the proportion of the value of the brightness information at the location where the text is located that is greater than the first threshold exceeds the first proportion, determine the color of the text as black; or if the proportion of the value of the brightness information at the location where the text is located that is greater than the first threshold does not exceed the first proportion, determine the color of the text as white.
[0206] It should be noted that the functions of each module in the image color matching device 1000 in the embodiment of the present application may correspond to the specific implementation methods of any of the above-mentioned method embodiments, and will not be repeated here.
[0207] See also Fig.11 , Fig.11 This is a second structural diagram of the image color matching device provided in an embodiment of the present application. The image color matching device 1000 also includes:
[0208] The training unit 1060 is used to obtain sample data, each training sample in the sample data includes color data and color matching annotation information of the training sample, and train the color matching model according to the color data and color matching annotation information of the training sample to obtain a trained color matching model, and the trained color matching model is used to process the original image to match the background color of the target area in the original image and the color of the text in the target area to obtain a second color matching image.
[0209] The second color matching unit 1070 is used to process the original image according to the trained color matching model to match the background color of the target area in the original image with the color of the text in the target area to obtain a second color matching image.
[0210] Optionally, when acquiring sample data, the training unit 1060 can be used to: use an image obtained by data crawling from a design website page as a sample image, or use an acquired historical color matching image as a sample image; perform color extraction on the sample image to extract a preset number of candidate colors in the sample image as color data of the sample image; select two colors from a preset number of candidate colors in the sample image, and determine a training sample based on the two selected colors, the color data of each training sample including the two selected colors; obtain color matching annotation information of the training sample, the color matching annotation information is used to characterize whether the combination of the two selected colors is beautiful, and the color matching annotation information includes beautiful and unaesthetic; determine the training sample whose color matching annotation information is beautiful as a positive sample, and determine the training sample whose color matching annotation information is unaesthetic as a negative sample.
[0211] Optionally, when determining the training sample according to the two selected colors, the training unit 1060 can be used to: perform data expansion processing on the color data of the sample image according to the two selected colors, and determine the training sample by reselecting two colors from the color data after the data expansion processing.
[0212] Optionally, when the training unit 1060 performs data expansion processing on the color data of the sample image according to the two selected colors, it can be used to: perform data expansion processing on the color data of the sample image according to the colors in the color wheel that are at a preset angle to each of the two selected colors.
[0213] Optionally, the training unit 1060 can be used to train the color matching model according to the RGB data of the two colors corresponding to the positive sample and the negative sample, respectively, and the color matching annotation information corresponding to the positive sample and the negative sample, respectively, to obtain the trained color matching model.
[0214] Each unit in the above-mentioned image color matching device can be implemented in whole or in part by software, hardware or a combination thereof. Each unit can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the corresponding operations of each unit.
[0215] The image color matching device 1000 may be integrated in a terminal or a server that has a storage device and a processor and has computing capabilities, or the image color matching device 1000 is the terminal or the server.
[0216] Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application, which computer device may be Figure 1 The terminal or server shown. Fig.12 As shown, the computer device 1200 may include: a communication interface 1201, a memory 1202, a processor 1203 and a communication bus 1204. The communication interface 1201, the memory 1202, and the processor 1203 communicate with each other through the communication bus 1204. The communication interface 1201 is used for the device 700 to communicate data with external devices. The memory 1202 can be used to store software programs and modules, and the processor 1203 runs the software programs and modules stored in the memory 1202, such as the software programs of the corresponding operations in the aforementioned method embodiments.
[0217] Optionally, the processor 1203 can call the software program and module stored in the memory 1202 to perform the following operations: obtain the color data of the original image; determine the background color of the target area in the original image based on the color data; determine the position of the text in the target area; based on the position of the text and the color data of the original image, determine the color of the text in the target area, the color of the text is different from the background color; according to the determined background color of the target area and the color of the text in the target area, match the color of the original image to obtain a first color-matched image.
[0218] Optionally, the present application further provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0219] The present application also provides a computer-readable storage medium for storing a computer program. The computer-readable storage medium can be applied to a computer device, and the computer program enables the computer device to execute the corresponding process in the image color matching method in the embodiment of the present application, which will not be described in detail for the sake of brevity.
[0220] The present application also provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the corresponding process in the image color matching method in the embodiment of the present application, which will not be described here for the sake of brevity.
[0221] The present application also provides a computer program, which includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the corresponding process in the image color matching method in the embodiment of the present application, which will not be described in detail for the sake of brevity.
[0222] It should be understood that the processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and performed. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, and other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0223] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0224] It should be understood that the above-mentioned memory is exemplary but not restrictive. For example, the memory in the embodiments of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM), etc. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
[0225] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0226] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0227] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0228] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0229] In addition, each functional unit in the embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0230] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer or a server) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0231] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for color matching an image, It is characterized in that The method comprises: Acquiring color data of an original image, including: extracting a plurality of image color blocks from the original image; sorting the plurality of image color blocks by color, and selecting colors corresponding to image color blocks whose sorting order belongs to a preset ranking as candidate colors, and determining the candidate colors as color data of the original image; Determining the background color of the target area in the original image according to the color data, including: obtaining RGB color information of the candidate color in the color data of the original image, and converting the RGB color information of the candidate color in the color data of the original image into YUV color information; normalizing the R channel value in the RGB color information, and the V channel value and the Y channel value in the YUV color information; calculating the score of each of the candidate colors according to the normalized R channel value, V channel value and Y channel value; determining the background color of the target area in the original image according to the score of each of the candidate colors in the color data of the original image; Determine the position of the text in the target area; Determining the color of the text in the target area based on the location of the text and the color data of the original image, wherein the color of the text is different from the background color; According to the determined background color of the target area and the color of the text in the target area, the original image is color matched to obtain a first color matched image.
2. The image color matching method according to claim 1, It is characterized in that The color sorting of the plurality of image color blocks comprises: sorting the image color blocks in descending order of their area; or sorting the plurality of image color blocks according to the order of color brightness of the image color blocks from high to low; or The multiple image color blocks are sorted by color according to the order of color vividness from high to low.
3. The image color matching method according to claim 1, It is characterized in that The step of determining the background color of the target area in the original image according to the score of each candidate color in the color data of the original image comprises: The candidate color with the highest score in the color data of the original image is determined as the background color of the target area in the original image.
4. The image color matching method according to claim 1, It is characterized in that After calculating the score of each candidate color according to the normalized R channel value, V channel value and Y channel value, the method further includes: Classifying candidate colors in the color data of the original image according to emotional color scenes to obtain different color groups corresponding to different emotional color scenes; The candidate colors in each of the color groups are sorted according to the score of each of the candidate colors.
5. The image color matching method according to claim 4, It is characterized in that The step of determining the background color of the target area in the original image according to the score of each candidate color in the color data of the original image comprises: Acquire the emotional information of the text, and determine the candidate color with the highest score in the color group whose emotional color scene in the different color groups matches the emotional information of the text as the background color of the target area in the original image; or The presented object in the original image is obtained, and the candidate color with the highest score in the color group whose emotional color scene in the different color groups matches the presented object is determined as the background color of the target area in the original image.
6. The image color matching method according to claim 1, It is characterized in that The step of calculating the score of each candidate color according to the normalized R channel value, V channel value, and Y channel value comprises: The score of each candidate color is calculated according to the normalized R channel value, V channel value and Y channel value, as well as the weight of the R channel, the weight of the V channel and the weight of the Y channel, wherein the sum of the weight of the R channel, the weight of the V channel and the weight of the Y channel is equal to 1.
7. The image color matching method according to claim 1, It is characterized in that The determining the position of the text in the target area includes: The position of the characters in the target area is determined according to the content of the characters, the pixels of each character, and the size of the original image.
8. The image color matching method according to claim 7, It is characterized in that The determining the position of the text in the target area according to the content of the text, the pixel of each text, and the size of the original image includes: Determine the size of the text box of the text according to the content of the text and the pixels of each text; The position of the text box is determined according to the size of the text box and the size of the original image.
9. The image color matching method according to claim 8, It is characterized in that Before determining the position of the text box according to the size of the text box and the size of the original image, the method further includes: Acquire a presentation object in the original image, and when the presentation object is a person object, identify the head position of the person object; The determining the position of the text box according to the size of the text box and the size of the original image includes: The position of the text in the target area is determined according to the head position of the character object, the size of the text box and the size of the original image, wherein the position of the text in the target area does not overlap with the head position of the character object.
10. The image color matching method according to claim 1, It is characterized in that The determining the color of the text in the target area based on the position of the text and the color data of the original image includes: The color of the text is determined according to brightness information after the color data at the position where the text is located is converted.
11. The image color matching method according to claim 10, It is characterized in that The step of determining the color of the text according to brightness information converted from color data at the position where the text is located includes: Obtain brightness information after color data conversion at the position where the text is located; Determine whether the proportion of the brightness information at the position where the text is located that is greater than the first threshold exceeds a first proportion; If the proportion of the value of the brightness information at the position where the text is located that is greater than the first threshold exceeds the first proportion, the color of the text is determined to be black; or If the proportion of the value of the brightness information at the position where the text is located that is greater than the first threshold does not exceed the first proportion, the color of the text is determined to be white.
12. The image color matching method according to claim 1, It is characterized in that The method further comprises: Acquire sample data, wherein each training sample in the sample data includes color data and color matching annotation information of the training sample; train a color matching model according to the color data and color matching annotation information of the training sample to obtain a trained color matching model, and use the trained color matching model to process the original image to match the background color of a target area in the original image with the color of text in the target area to obtain a second color matching image.
13. The image color matching method according to claim 12, It is characterized in that The obtaining of sample data comprises: Use images obtained by data crawling from the design website page as sample images, or use historical color matching images obtained as sample images; Performing color extraction on the sample image to extract a preset number of candidate colors from the sample image as color data of the sample image; Selecting two colors from a preset number of candidate colors in the sample image, and determining training samples according to the two selected colors, wherein the color data of each training sample includes the two selected colors; Acquire color matching annotation information of the training sample, where the color matching annotation information is used to indicate whether the combination of the two selected colors is aesthetically pleasing, and the color matching annotation information includes aesthetically pleasing and unpleasing; The training samples with the color matching annotation information being aesthetically pleasing are determined as positive samples, and the training samples with the color matching annotation information being unpleasing are determined as negative samples.
14. The image color matching method according to claim 13, It is characterized in that The step of determining a training sample according to the two selected colors comprises: Data expansion processing is performed on the color data of the sample image according to the two selected colors, and the training sample is determined by reselecting two colors from the color data after the data expansion processing.
15. The image color matching method according to claim 14, It is characterized in that The step of performing data expansion processing on the color data of the sample image according to the two selected colors comprises: Data expansion processing is performed on the color data of the sample image according to the color in the color wheel that is at a preset angle to each of the two selected colors.
16. The image color matching method according to claim 15, It is characterized in that The step of training the color matching model according to the color data and color matching annotation information of the training sample to obtain a trained color matching model includes: The color matching model is trained according to the RGB data of the two colors corresponding to the positive sample and the negative sample, respectively, and the color matching annotation information corresponding to the positive sample and the negative sample, so as to obtain the trained color matching model.
17. An image color matching device, It is characterized in that The device comprises: An acquisition unit is used to acquire color data of an original image, including: extracting a plurality of image color blocks from the original image; sorting the plurality of image color blocks by color, and selecting colors corresponding to image color blocks whose sorting order belongs to a preset ranking as candidate colors, and determining the candidate colors as color data of the original image; A first determination unit is used to determine the background color of the target area in the original image according to the color data, including: obtaining RGB color information of the candidate color in the color data of the original image, and converting the RGB color information of the candidate color in the color data of the original image into YUV color information; normalizing the R channel value in the RGB color information, and the V channel value and the Y channel value in the YUV color information; calculating the score of each of the candidate colors according to the normalized R channel value, V channel value and Y channel value; determining the background color of the target area in the original image according to the score of each of the candidate colors in the color data of the original image; A second determining unit, used to determine the position of the text in the target area; A third determining unit, configured to determine the color of the text in the target area based on the position of the text and the color data of the original image, wherein the color of the text is different from the background color; The first color matching unit is used to match the color of the original image according to the determined background color of the target area and the color of the text in the target area to obtain a first color matching image.
18. A computer device, It is characterized in that The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the steps in the image color matching method according to any one of claims 1 to 16 by calling the computer program stored in the memory.
19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the image color matching method according to any one of claims 1 to 16.
20. A computer program product comprising computer instructions, It is characterized in that When the computer instructions are executed by a processor, the steps in the image color matching method according to any one of claims 1 to 16 are implemented.
Citation Information
Cited By
Color sorting method and related computer system
TWI916155B
Main color extracting method
TWI936059B
