A method and device for determining image color matching relationship
By automatically determining the color characteristics and correlation degree parameters of multiple layers in the image, the problem of low efficiency and poor accuracy in manually determining image color matching relationships is solved, and efficient and accurate automated determination of color matching relationships is achieved.
Patent Information
- Application Number
- CN202010082626.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-07
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2040-02-07
AI Technical Summary
Manually determining the image color matching relationship is inefficient and susceptible to human experience, making it difficult to guarantee accuracy.
By obtaining multiple layers of images to be processed, the color characteristics of each layer are determined, and the color matching relationship of the image is automatically determined based on the correlation parameters between these characteristics.
It realizes the automatic determination of image color matching relationships, improves efficiency, ensures accuracy, and reduces the impact of human experience.
Smart Images

Figure CN111292394B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for determining image color matching relationships. Background Art
[0002] A large number of new images appear on the Internet every day, including many designed posters, banners, etc. For these images that need to be designed, each image needs to be manually designed and colored, and the production cost is very high.
[0003] In order to reduce production costs, some image producers manually change the colors in a designed image to generate multiple images with different color combinations, eliminating the need to manually design image content. Before manually changing the color of the original image, it is necessary to manually determine the color matching relationship used in the original image so that subsequent color changes can be performed based on the color matching relationship.
[0004] However, manually determining image color relationships is not only inefficient, but also very easily affected by human experience, and its accuracy is difficult to guarantee. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides an image color matching relationship method and device, which realizes the automatic determination of image color matching relationships and improves the determination efficiency.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for determining an image color matching relationship, the method comprising:
[0008] Obtaining an image to be processed including multiple layers;
[0009] Determine color features corresponding to the multiple layers respectively;
[0010] Determining a correlation degree parameter between the color features;
[0011] The color matching relationship corresponding to the image to be processed is determined according to the association degree parameter, and the color matching relationship is used to identify the layers and colors corresponding to the color matching relationship in the multiple layers.
[0012] In a second aspect, an embodiment of the present application provides a device for determining a color matching relationship of an image, the device comprising an acquisition unit, a first determination unit, a second determination unit, and a third determination unit:
[0013] The acquisition unit is used to acquire an image to be processed including multiple layers;
[0014] The first determining unit is used to determine the color features corresponding to the multiple layers respectively;
[0015] The second determining unit is used to determine the correlation degree parameter between the color features;
[0016] The third determination unit is used to determine the color matching relationship corresponding to the image to be processed according to the association degree parameter, and the color matching relationship is used to identify the layer and color corresponding to the color matching relationship in the multiple layers.
[0017] In a third aspect, an embodiment of the present application provides a device for determining a color matching relationship of an image, the device comprising a processor and a memory:
[0018] The memory is used to store program code and transmit the program code to the processor;
[0019] The processor is used to execute the image color matching relationship determination method described in the first aspect according to the instructions in the program code.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store program code, and the program code is used to execute the image color matching relationship determination method described in the first aspect.
[0021] It can be seen from the above technical solution that for an image to be processed with multiple layers, the color features corresponding to the multiple layers can be determined, and the correlation degree parameters between the color features can be determined. Through the color features, the characteristics of the colors in the layers can be quantitatively reflected. The correlation degree parameters determined based on the color features can reflect the color interdependence and coordination relationship between the colors of the layers in the image design from the dimension of color characteristics. When determining the color matching relationship, the color matching relationship that meets the correlation degree parameters can be determined as the color matching relationship corresponding to the image to be processed, and the correlation degree parameters are determined based on the colors of each layer, so the determined color matching relationship can identify the layers and colors corresponding to the color matching relationship in multiple layers. In this way, the automatic determination of the corresponding color matching relationship of the image based on the color features is realized, the determination efficiency is improved, the accuracy is guaranteed, and the influence of human experience is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0023] Figure 1 A schematic diagram of an application scenario of a method for determining image color matching relationships provided in an embodiment of the present application;
[0024] Figure 2 A flowchart of a method for determining image color matching relationships provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of a method for determining image color matching relationships provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of a method for determining image color matching relationships provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of a method for determining image color matching relationships provided in an embodiment of the present application;
[0028] Figure 6 A flowchart of a method for determining image color matching relationships in an actual application scenario provided by an embodiment of the present application;
[0029] Figure 7 A schematic diagram of a method for determining image color matching relationships provided in an embodiment of the present application;
[0030] Figure 8a A structural block diagram of a device for determining image color matching relationships provided in an embodiment of the present application;
[0031] Figure 8b A structural block diagram of a device for determining image color matching relationships provided in an embodiment of the present application;
[0032] Figure 8c A structural block diagram of a device for determining image color matching relationships provided in an embodiment of the present application;
[0033] Figure 8d A structural block diagram of a device for determining image color matching relationships provided in an embodiment of the present application;
[0034] Fig. 9 A structural diagram of a device for determining image color matching relationships provided in an embodiment of the present application;
[0035] Fig.10 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0037] In the related art, in order to reduce the production cost of design drawings, when new design drawings are needed, such as new posters and banner advertisements, the colors in the existing design drawings are often replaced manually, so as to form a design drawing with a new color scheme for use. For example, in most cases, designers will replace the colors according to the color matching relationship of each layer in the original design drawing. Among them, the color replacement process can be completed entirely by the designer, or the designer can first determine the color matching relationship between the layers of the design drawing, and add corresponding layer relationship tags to each layer, and then the processing device replaces the color according to the layer relationship tag. Regardless of which method is used to complete the color replacement, the color matching relationship between the layers of the original design drawing needs to be manually determined before the replacement, which is labor-intensive and inefficient. At the same time, due to the limited observation ability of the human eye, manual judgment of color is inevitable, and different people may have different understandings of color relationships. When determining the color matching relationship, it will be more or less affected by personal experience. Therefore, the accuracy of manual color replacement is low.
[0038] In order to solve the above technical problems, the present application provides a method for determining image color matching relationships. The method can be applied to scenarios where it is necessary to determine the color matching relationships of images with multiple layers. By determining the color features of the layers in the image and the correlation degree parameters between the color features, the image color matching relationships can be automatically determined, thereby improving the determination efficiency. At the same time, since the color characteristics are quantitatively analyzed, and color quantization often has a unified quantization standard, the accuracy of the color matching relationship is guaranteed to a certain extent, and the influence of human experience is reduced.
[0039] It is understandable that the method can be applied to a processing device, which is a processing device with an image processing function, such as a terminal device or a server. The method can be executed independently by a terminal device, or independently by a server, or can be applied to a network scenario in which a terminal device and a server communicate, and is executed by the cooperation of a terminal device and a server. Among them, the terminal device can be a computer, a personal digital assistant (PDA for short), a tablet computer and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server. At the same time, in terms of hardware environment, the environment in which this technology has been implemented includes: ARM architecture processors, X86 architecture processors; in terms of software environment, the environment in which this technology has been implemented includes: Android platform, Windows xp and above operating systems or Linux operating systems.
[0040] It should be emphasized that the image color matching relationship determination method provided in the embodiment of the present application can be implemented based on artificial intelligence. Artificial Intelligence (AI) is a 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 the machines have the functions of perception, reasoning and decision-making.
[0041] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0042] In the embodiments of the present application, the artificial intelligence software technologies mainly involved include intelligent matching and machine learning.
[0043] For example, it may involve machine learning (ML), which 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 usually includes technologies such as deep learning. Deep learning includes artificial neural networks, such as convolutional neural networks (CNN), recurrent neural networks (RNN), deep neural networks (DNN), etc.
[0044] In the present application, the processing device can determine the matching relationship based on the image with the identified color matching relationship, and the matching relationship is used to identify the corresponding relationship between the color matching relationship and the correlation degree parameter between the color features. When determining the matching relationship, a machine learning method can be used for determination.
[0045] In order to facilitate understanding of the technical solution of the present application, the image color matching relationship determination method provided in the embodiment of the present application is introduced below in combination with actual application scenarios.
[0046] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of the method for determining image color matching relationships provided in an embodiment of the present application. In this application scenario, the processing device is a terminal 101. The image to be processed acquired by the terminal 101 includes multiple layers. After acquiring the image to be processed, the terminal 101 can read the layer information in the image to be processed. For example, three layers A, B, and C can be extracted from the multiple layers, and the color features corresponding to the layers can be determined for the colors included in the three layers, that is, color features A, B, and C. The color features can be attribute features of the colors included in the corresponding layers, and can quantitatively reflect the color characteristics of the colors included in the three layers. In this application scenario, the color features can be the hue values of the colors included in the three layers.
[0047] After the terminal 101 obtains the color feature, it can determine the correlation degree parameter between the color features according to the color feature, and the correlation degree parameter can reflect the relationship between the layer colors. For example, in this application scenario, the terminal 101 can determine the correlation degree parameter a according to the color feature A and the color feature B, can determine the correlation degree parameter b according to the color features A and C, and can determine the correlation degree parameter c according to the color features B and C. Since the color feature can reflect the color characteristics of the colors included in the corresponding layer, the correlation degree parameter determined according to the color feature can reflect the color relationship of the layer colors in the image design, such as mutual dependence, coordination or opposition, from the dimension of color characteristics, so that the color matching relationship corresponding to the image to be processed can be determined according to the correlation degree parameter.
[0048] In this application scenario, since the color feature can adopt the hue values of the colors included in the three layers, the correlation degree parameter determined according to the color feature can be the hue difference between the corresponding two layers. The color relationship of the colors included in the two layers can be determined by the hue difference between the two layers. For example, when the hue difference is greater than a certain value, the colors included in the two layers may be in an opposing color relationship; when the hue difference is less than a certain value, the colors included in the two layers may be in a mutually dependent color relationship.
[0049] At the same time, since the correlation degree parameter is determined by the color characteristics of each layer, after determining the color matching relationship corresponding to the image to be processed, the terminal 101 can mark the layers A, B, and C according to the color matching relationship for subsequent further color replacement processing of the image to be processed.
[0050] It can be seen that the terminal 101 can automatically determine the color matching relationship of the image to be processed composed of each layer based on the color characteristics of each layer, without the need for manual analysis of each layer, thereby improving the determination efficiency. In addition, the terminal 101 uses a unified and fixed color quantization standard when determining the color of each layer. The color quantization standard will not change due to changes in the image to be processed or the number of processing times. For example, the hue value is only related to the properties of the color itself and will not change due to processing in different processing devices. It is relatively stable. Therefore, the accuracy of the correlation degree parameter determined between the various layers is high. The color matching relationship determined based on the correlation degree parameter guarantees accuracy to a certain extent and will not be affected by error factors and experience factors during manual processing.
[0051] Next, a method for determining an image color matching relationship provided in an embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0052] See also Figure 2 , Figure 2 A flowchart of a method for determining an image color matching relationship is shown. The method is applied to a process of color processing an image with multiple layers. The method includes:
[0053] S201: Acquire an image to be processed including multiple layers.
[0054] The image to be processed may be a design drawing with multiple layers such as a banner, poster, or promotional drawing. When obtaining the image to be processed, the processing device may directly obtain it from the design drawing library stored in itself; when connected to the Internet, the image to be processed may also be obtained from the network application interface through image recognition, web crawler, and other technologies. For example, a promotional drawing for which the image color relationship needs to be determined may be obtained from a Weibo webpage through crawler technology.
[0055] It should be noted that the image data involved in this application are all image data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data comply with relevant laws, regulations and standards of relevant countries and regions.
[0056] S202: Determine color features corresponding to the multiple layers.
[0057] In order to determine the color matching relationship of the image to be processed, the processing device needs to analyze the colors contained in the image to be processed. When performing the analysis, the processing device needs to first obtain the relevant file information of the image to be processed, such as the layer elements contained in the image source file. The layer elements may include the various layers included in the image to be processed, the color composition of each layer, etc. This information can be obtained by the processing device through the corresponding plug-in or by using a code-written program to read and parse the image to be processed. Figure 3 As shown, Figure 3 It is the actual interface diagram of the processing device parsing the image through a plug-in. The list on the right side of the picture contains multiple layers in the promotional image on the left and information such as the color composition of each layer.
[0058] In the embodiment of the present application, after obtaining each layer through image analysis, in order to analyze the color of the layer, the processing device can extract the color of the layer and determine the color contained in the layer based on the extracted color information. It can be understood that since only the color type needs to be determined, it is not affected by other factors such as the scaling ratio of the layer and the number of pixels in the layer as a whole. In order to speed up the color extraction, the processing device can first compress the image to a suitable size, such as 100x100 pixels, so as to reduce the workload of the processing device in color extraction.
[0059] In order to more clearly determine the color characteristics of each layer, in a possible implementation method, when determining the color characteristics corresponding to multiple layers, the representative color corresponding to each layer can be first determined according to the color of each layer in the multiple layers, and then the color characteristics corresponding to each layer can be determined according to the representative color corresponding to each layer.
[0060] It is understandable that when the layer to be analyzed contains only one color, the color extracted by the processing device can be directly used as the color contained in the layer, that is, the representative color of the layer; when the layer to be analyzed contains multiple colors, if all the contained colors are used as the representative colors of the layer, it may cause confusion in the color relationship between the layers, and it is difficult to determine the color relationship between the design drawings; at the same time, even if a color relationship can be determined, the color relationship may be determined based on the color that occupies a smaller pixel ratio in a certain layer, and the color that occupies a larger pixel ratio in the layer may not conform to the color relationship, which may result in the image's aesthetics being reduced when the color relationship is subsequently applied to process the image.
[0061] In order to prevent confusion in the color matching relationship and determine a color matching relationship that is more consistent with the overall color characteristics of the image, the processing device can use the color composition of each layer obtained by the above-mentioned image analysis to determine whether the layer is a monochrome layer or a layer with multiple colors. When the layer that needs to be color analyzed is a first layer including multiple colors, the processing device can determine the representative color of the layer based on multiple colors. For example, when the multiple colors contained in the first layer are relatively similar, the processing device can synthesize the multiple colors according to the size occupied by the multiple similar colors and the attributes such as the size occupied by the various colors obtained in the above-mentioned analysis process, and determine the representative color. It can be understood that the representative color can be a color other than the above-mentioned multiple colors, or it can be a color in the multiple colors, which can reflect the overall color characteristics of the layer; or, in another possible situation, the colors included in the first layer are quite different. At this time, by comparing the size occupied by the various colors in the first layer, the pixel ratio and other factors, the color with a larger proportion can be selected as the representative color of the first layer. In addition, a variety of main color extraction algorithms, such as clustering, octree and other algorithms, can be used to obtain representative representative colors from multiple colors.
[0062] After determining the representative color of the layer, in order to enable the processing device to automatically determine the color matching relationship of the image to be processed, a certain color feature can be determined from the representative color, and the color feature can quantitatively reflect the color characteristics of the representative color of the layer. The processing device can automatically judge the color relationship between the layers according to the quantified color features and certain judgment rules, and determine the color matching relationship of the image to be processed according to the judgment result. Among them, the color feature can be the hue, brightness, saturation, etc. of the representative color. In a possible implementation, the processing device can quantify the representative color into a numerical value in the color space model LCH established based on brightness L, saturation C and hue H. The numerical value can specifically and clearly show the color characteristics of the representative color from three dimensions, which is convenient for the processing device to analyze the representative color.
[0063] S203: Determine the correlation degree parameter between color features.
[0064] After obtaining the color features representing the colors, in order to determine the color matching relationship of the image to be processed, the processing device needs to first determine the color relationship between the color features corresponding to the multiple layers. In order for the processing device to make a more accurate judgment on the color relationship, it is necessary to select reasonable parameters as the judgment basis of the processing device. As mentioned above, in order to realize the automation of the processing device, the determined color features can quantitatively reflect the color characteristics of the layer representative colors. Therefore, the processing device can quantitatively reflect the color interdependence and coordination relationship of the multiple layers of representative colors in the image design from the dimension of color characteristics by determining the correlation degree parameters between the color features. At the same time, since the quantitative standard of the color features adopted by the processing device when processing the image to be processed can be consistent, it has nothing to do with the difference between the images to be processed and the difference between the number of processing times. Therefore, the obtained correlation degree parameter can more accurately reflect the difference between the colors, reducing the influence of external factors. For example, when the color feature is a numerical value in the above-mentioned color space model LCH, the correlation degree parameter can be the difference in hue H between different layers.
[0065] S204: Determine the color matching relationship corresponding to the image to be processed according to the correlation degree parameter.
[0066] As mentioned above, the correlation degree parameter determined according to the color feature can quantitatively reflect the color relationship between the representative colors of multiple layers. Therefore, the processing device can further determine the color relationship corresponding to the image to be processed based on the color relationship between the layers obtained. For example, when the correlation degree parameter is the hue difference, the processing device can determine the color relationship between the representative colors of the layers based on the hue difference of the representative colors of the layers obtained. When the hue difference is greater than a preset value, the processing device can determine that the relationship between the representative colors of the layers is an opposing relationship, that is, one of the corresponding representative colors of the layers may be a contrasting color of another representative color of the layers; when the hue difference is less than a preset value, the processing device can determine that the relationship between the representative colors of the layers is a dependent relationship, that is, the corresponding representative colors of the layers are a relationship between the primary color and the secondary color. Therefore, the color relationship corresponding to the image to be processed can be composed of the relationship between the primary color, the secondary color and the contrasting color.
[0067] It is understandable that, in addition to the three-color color matching relationship mentioned above, other color matching relationships may also be included, such as other three-color color matching relationships, multi-color color matching relationships, etc.
[0068] The implementation of this application does not limit how to determine what kind of correlation degree parameter can reflect what kind of color matching relationship. For example, the processing device can also add more color matching relationship judgment methods and more types of color matching relationship judgment results through methods such as manual setting or machine learning, so that the color matching relationship of the processed image can be judged more completely and appropriately. When determining the correlation degree parameter corresponding to the color matching relationship based on machine learning, it can be obtained by training a regression model based on the image with the identified color matching relationship.
[0069] It is understandable that among the many beautifully designed images that have been displayed, there may be some color matching relationships that are appreciated by the public. In order to make the color matching relationship determined based on the correlation degree parameter more accurate, more in line with the design color matching concept in many historical designs, reduce the chance of large deviations in a certain determination process, and make the determined color matching relationship more in line with the public's aesthetic taste, in a possible implementation method, the processing device can determine the matching relationship based on the image with the identified color matching relationship, and the matching relationship is used to identify the corresponding relationship between the correlation degree parameter between the color matching relationship and the color feature.
[0070] The processing device can determine the color matching relationship corresponding to the image to be processed based on the correlation degree parameter and the matching relationship. For example, when the correlation degree parameter is the hue difference, the processing device can use the color matching relationship determined in the historical image and the hue difference between the layers corresponding to the color matching relationship to perform regression analysis to find the matching rules between the color matching relationship in many historical images and the hue difference of the corresponding layers. For example, when the layers of the historical image contain representative colors that have a relationship between a primary color and a secondary color, the processing device can obtain multiple hue difference values between these layers, and determine a hue difference threshold based on the multiple hue difference values, so that when the image has a layer representative color that meets the hue difference threshold, the representative colors are in most cases in a color relationship between a primary color and a secondary color.
[0071] After obtaining the regression analysis results, the processing device can use the results of the regression analysis as a matching relationship to determine the color matching relationship. For example, the relationship between the above-mentioned hue difference threshold and the primary and secondary colors can be used as a matching relationship. When judging a new image to be processed, it can be judged based on the hue difference of the representative colors of the layers contained in the image to be processed to determine whether it has a layer representative color that satisfies the relationship between the primary color and the secondary color.
[0072] It is understandable that when the layer included in the image to be identified includes multiple representative colors, there may be multiple groups of representative colors among the multiple representative colors that satisfy multiple color matching relationships. In order to determine the color matching relationship that best meets the design characteristics of the image to be processed, in a possible implementation, the processing device can determine the possibility of each possible color matching relationship based on the above matching relationship, and use the color matching relationship with a higher possibility as the color matching relationship of the image to be processed.
[0073] It is understandable that, on the basis of judging the color relationship through the correlation degree parameter determined by the color feature, in some scenarios, in order to better fit the design characteristics of the image to be processed, the layer information corresponding to the multiple layers and the layer relationship between the multiple layers can also be determined, and the color matching relationship corresponding to the image to be processed can be determined according to the correlation degree parameter, the layer information and the layer relationship. Among them, the layer information can be the color area in the layer, the color distribution in the layer, etc., and the layer relationship can be the front and back position between the layers, etc. For example, when the color relationship is determined by the hue difference mentioned above, if the hue difference of the representative colors of the two layers is less than a certain preset value, then it is determined that the representative colors are the relationship between the primary color and the secondary color.
[0074] In order to more accurately determine which layer's representative color is used as the primary color and which is used as the secondary color, we can determine the color area of the two layers' representative colors. Since the layer with a larger color area may account for a larger proportion of the image to be processed, the representative color of the layer can be used as the primary color, and the representative color with a smaller color area can be used as the secondary color. Alternatively, we can determine the layer positions of the two layers, such as Figure 4 As shown, when multiple layers are superimposed to form the image to be processed, the colors in the front layer A can to a certain extent cover the colors in the back layer B. Therefore, more representative colors of layer A are displayed in the image to be processed. The representative colors of layer A can be used as the primary colors, and the representative colors of layer B can be used as the secondary colors.
[0075] In addition, it can be seen from the above example that since the processing device determines the color matching relationship through the correlation degree parameter between the color features of the layers, when determining the color matching relationship, the processing device can use the color matching relationship to identify the layers and colors of the corresponding color matching relationship in multiple layers. For example, when the representative color of layer A is determined as the primary color and the representative color of layer B is the secondary color, the processing device can identify layer A as the primary color layer, the representative color of layer A as the primary color, and layer B as the secondary color layer, and the representative color as the secondary color. Through the color and layer identification, the processing device can further process the image to be processed, such as color change processing, color deletion processing, etc., in some cases where it is necessary, so as to further improve the richness of image processing.
[0076] It can be seen from the above technical scheme that for an image to be processed with multiple layers, the color features corresponding to the multiple layers can be respectively determined, and the correlation degree parameters between the color features can be determined. Through the color features, the characteristics of the colors in the layers can be quantitatively reflected. The correlation degree parameters determined based on the color features can reflect the color interdependence and coordination relationship between the colors of the layers in the image design from the dimension of color characteristics. When determining the color matching relationship, the color matching relationship that meets the correlation degree parameters can be determined as the color matching relationship corresponding to the image to be processed, and the correlation degree parameters are determined based on the colors of each layer, so the determined color matching relationship can identify the layers and colors corresponding to the color matching relationship in the multiple layers. In this way, the automatic determination of the corresponding color matching relationship of the image based on the color features is realized, the determination efficiency is improved, the accuracy is guaranteed, and the influence of human experience is reduced.
[0077] It is understandable that in order to further improve the richness of the processing device's functions and improve the efficiency of image design, the processing device can use the determined color matching relationship to further process the image to be processed. In one possible implementation, the processing device can determine a color scheme corresponding to the color matching relationship, and perform color change processing on the layer corresponding to the color matching relationship in the image to be processed according to the color indicated by the color scheme. For example, when the color matching relationship of the image to be processed determined by the processing device is a primary color, secondary color, and contrasting color relationship, a color scheme that also includes the primary color, secondary color, and contrasting color relationship can be obtained. The color scheme is used to change the color of the image to be processed, which can ensure that the image to be processed after the color change can maintain the color design characteristics of the original image to be processed to a certain extent, thereby ensuring the aesthetics of the image after the color change to a certain extent and improving the color change quality.
[0078] The color scheme can be generated instantly from a plurality of colors by the processing device according to the matching relationship and other rules mentioned above, or a plurality of color scheme libraries with different color matching relationships and different color types and styles can be generated in advance to improve the color changing efficiency, such as Figure 5 As shown, Figure 5 It is a schematic diagram of a color library with multiple color schemes. The color library includes multiple color schemes such as 501 and 502. Taking color scheme 501 as an example, color A in the color scheme is the primary color, color B is the secondary color, and color C is the contrasting color, which are used to replace the representative colors of the layers with primary color, secondary color and contrasting color identification in the image to be processed.
[0079] In addition, when performing the above color change processing on a certain image to be processed, multiple pending color schemes that satisfy the color matching relationship of the image to be processed may be found. At this time, in order to achieve different color change purposes and different color change effects, in a possible implementation method, multiple pending color schemes corresponding to the color matching relationship can be obtained, and a color matching scheme can be determined from the multiple pending color matching schemes according to the correlation degree parameter between the target color feature and the color features of the multiple pending color matching schemes. Among them, the target color feature refers to the color feature of the layer corresponding to the color matching relationship among the multiple layers of the image to be processed. For example, when selecting hue value as the color feature, when the color style of the image to be processed after the color change is closer to that of the image to be processed before the color change, making it easier for the audience to accept, the hue difference can be determined based on the hue values of the colors contained in the layers of the corresponding color matching relationship in the image to be processed, and the hue values of the colors contained in multiple pending color schemes, and a pending color scheme with a smaller hue difference is selected as the color scheme; when the color style of the image to be processed after the color change is significantly different from that of the image to be processed before the color change, so that it can be applied to scenes with significantly different environments, for example, when it is necessary to display in a web page with two tones with significantly different tones, one with a larger hue difference can be selected from multiple pending color schemes as the color scheme.
[0080] It is understandable that the above color matching relationship identifies multiple component color types in the color matching relationship. Since the image to be identified may have some multi-color layers, such as a second layer including multiple colors, since most color matching schemes only include one set of colors, that is, corresponding to multiple component color types in the color matching relationship, such as contrasting color, primary color, secondary color, etc., there is only one unique color, it is impossible to directly change the colors of the multiple colors in the second layer using the corresponding colors, otherwise the second layer may lose the characteristic of having multiple colors.
[0081] In order to enhance the stability and rationality of color change to a certain extent, the color of the color type corresponding to the second layer in the color matching relationship can be used as the color to be changed. The processing device can determine the color difference parameter between the color to be changed and the representative color of the second layer, and perform color change processing on the second layer according to the color difference parameter. Among them, the representative color of the second layer has the same meaning as the representative color of the first layer described above, and the representative color can be obtained from the multiple colors included in the second layer using the same method as the first layer. The color difference parameter can be the difference in parameter values obtained after quantizing a pair of color attributes between the color to be changed and the representative color, for example, it can be a hue value, a brightness value, a saturation value, etc.
[0082] For example, when the color difference parameter between the representative color of the second layer and the color to be changed is a brightness difference, after determining the brightness difference, all the brightness difference can be added to the brightness difference of the multiple colors included in the second layer, thereby obtaining multiple colors after the color change, and completing the color change processing of the second layer. Since the update is performed based on the original multiple colors with the same color difference parameter instead of the same color, the multi-color feature of the second layer is retained, and the color change processing of the second layer is completed, which ensures to a certain extent that after the color matching of the image to be processed is updated, the image content will not be lost, and the design features of the original image are still retained.
[0083] Next, the method for determining the image color matching relationship provided by the embodiment of the present application will be introduced in conjunction with an actual application scenario. In this application scenario, the processing device needs to perform color change processing on the image to be processed after determining the color matching relationship of the image to be processed. The image to be processed is a poster including multiple layers in a certain web page, and the processing device has a color palette including multiple color schemes corresponding to multiple color matching relationships. In addition, the selected color features are parameters in the color space model LCH, the correlation degree parameters determined according to the color features are LCH parameter differences, and the color difference parameters used to change the color of the multi-color layers are hue difference, brightness difference, and saturation difference. Figure 6 As shown, Figure 6 The present invention is a flowchart of a method for determining image color matching relationship in an actual application scenario, the method comprising:
[0084] S601: Get a picture.
[0085] The processing device utilizes crawler technology to crawl posters with multiple layers from a specified web page.
[0086] S602: Obtain the layer element of the image.
[0087] In order to obtain the LCH parameters, the processing device needs to perform image analysis on the poster to obtain layer elements, which include each layer and the color composition of each layer.
[0088] S603: Extracting layer color composition.
[0089] After obtaining the layer elements, the processing device can extract the color composition of the layer.
[0090] S604: Extracting layer information and layer relationships.
[0091] The processing device can also extract the layer information and layer relationship of each layer, and use the layer information and layer relationship as part of the judgment basis for determining the representative colors of the multi-color layers and the color matching relationship of the poster.
[0092] S605: Determine whether it is a single color.
[0093] After obtaining the color composition of the layer, the processing device can determine whether the layer is a single-color layer according to the color composition.
[0094] S606: If yes, directly obtain the representative color.
[0095] When the layer is a single color layer, the processing device can directly use the color in the layer color composition as the representative color.
[0096] S607: If not, obtain the representative color according to the layer information.
[0097] When a layer has multiple colors, the processing device can determine the representative color of the multi-color layer according to methods such as the area occupied by each color or the average color.
[0098] S608: Determine a correlation degree parameter.
[0099] After determining the representative color of the layer, the processing device obtains the LCH color space model value of the representative color according to the representative color, that is, obtains the hue value H, brightness value L and saturation value C of each representative color.
[0100] In this actual application scenario, Figure 7 As shown, the poster is divided into three layers: bottom layer, text and bevel. The text layer is a monochrome layer, and the representative color of the extracted layer is dark blue. The bottom layer includes blue and other colors, but blue accounts for the largest proportion, and after being blocked by other layers, the exposed area is also very large, so blue can be used as the representative color of the bottom layer; the bevel layer includes light purple, lavender and dark purple, and these three colors are relatively close, so the colors are averaged to obtain purple as the representative color of the bevel layer. The LCH attribute values of these three representative colors are:
[0101] Bottom layer - blue LCH is 86.941,42.618,205.374
[0102] Text layer - dark blue LCH is 36.886, 28.441, 292.552
[0103] Bevel layer - purple LCH is 51.618, 67.227, 313.022
[0104] Based on the above LCH values, the difference is determined to be:
[0105] Blue-dark blue: Delta L 50; Delta C 14; Delta H 87
[0106] Blue-purple: Delta L 35; Delta C 24; Delta H 108
[0107] Dark blue-purple: Delta L 15; Delta C 39; Delta H 21
[0108] Among them, Delta L represents the brightness difference between the two, Delta C represents the saturation difference, and Delta H represents the hue difference.
[0109] S609: Determine the image color matching relationship according to the association degree parameter and the matching relationship, the layer information and the layer relationship, etc.
[0110] After obtaining the LCH attribute difference, the processing device can use the matching relationship between the hue difference value obtained through training and the color matching relationship to determine the color matching relationship of the poster according to the hue difference value in the LCH attribute difference. In this application scenario, it can be seen from the matching relationship obtained after training that in most cases, two colors with a hue difference value less than 30 are in a similar relationship, so dark blue and purple are in a similar relationship, one of which is the primary color and the other is the secondary color; colors with a hue difference value greater than 30 are in a contrasting color relationship, and the hue difference between blue and the other two colors is greater than 30, so blue is used as a contrasting color. From the layer information obtained above, it can be seen that purple has a larger area than the other two colors, so the processing device uses purple as the primary color, dark blue as the secondary color, and blue as the contrasting color. The color matching relationship of the poster is the relationship between the primary color, the secondary color, and the contrasting color.
[0111] S610: Determine a color scheme with the same color matching relationship in the color palette and change the color.
[0112] According to the color matching relationship determined above, the processing device obtains multiple color matching schemes with primary color, secondary color and contrasting color relationship from the color palette stored in itself as the pending color matching scheme. In order to make the color style of the poster after color change close to that of the original poster, the processing device can respectively obtain the LCH attribute difference between the representative color of the poster layer and the corresponding color in the pending color matching scheme, and select the pending color matching scheme with the smallest difference as the color matching scheme. It can be understood that according to the actual needs in different situations, the type of difference selected may also be different, such as using one or more of hue difference, brightness difference, and saturation difference to determine the color matching scheme. In this actual application embodiment, the selection basis used is the pending color matching scheme with the smallest hue difference as the color matching scheme.
[0113] For example, in Figure 5The color library shown contains a variety of color schemes, among which color scheme 501 and color scheme 502 are both pending color schemes that satisfy the relationship of primary color, secondary color and contrasting color. The specific LCH attribute differences between the two schemes and the corresponding colors in the poster layer representative colors are as follows:
[0114] Pending color scheme 501:
[0115] Contrast color difference: Delta L 21; Delta C 10; Delta H 15
[0116] Primary color difference: Delta L 17; Delta C 24; Delta H 19
[0117] Secondary color difference: Delta L 22; Delta C 11; Delta H 21
[0118] Pending color scheme 502:
[0119] Contrast color difference: Delta L 55; Delta C 37; Delta H 46
[0120] Primary color difference: Delta L48; Delta C 40; Delta H 57
[0121] Secondary color difference: Delta L 62; Delta C 35; Delta H 61
[0122] It can be seen that in terms of hue value difference Delta H, the difference of the pending color scheme 501 is the smallest. Therefore, in terms of hue, the colors in the pending color scheme 501 are closer to the representative colors in the poster layer, and the color styles are closer after the color change. The pending color scheme 501 can be selected as the color scheme.
[0123] It is understandable that when multiple differences are selected as the basis for determination, an undetermined color scheme with the smallest difference can also be determined by taking an average value.
[0124] Among them, for the text layer in the poster, since it only has one color, the purple color of the text layer is directly replaced with a color with a complementary color relationship in the color scheme. For the bottom layer and the bevel layer, which have multiple colors, the LCH attribute difference between the blue and the color with a contrasting color relationship in the color scheme can be obtained, and the attribute difference is added to the LCH attribute values of multiple colors in the bottom layer, thereby completing the update of multiple colors in the bottom layer; the same is true for the bevel layer.
[0125] S611: Output the color-changed image.
[0126] The processing device outputs the poster after the color is changed.
[0127] Based on the image color matching relationship determination method provided in the above embodiment, the present application embodiment provides an image color matching relationship determination device 800, see Figure 8a , the apparatus 800 includes an acquisition unit 801, a first determination unit 802, a second determination unit 803 and a third determination unit 804:
[0128] An acquisition unit 801 is used to acquire an image to be processed including multiple layers;
[0129] A first determining unit 802 is used to determine color features corresponding to the multiple layers respectively;
[0130] The second determining unit 803 is used to determine the correlation degree parameter between the color features;
[0131] The third determining unit 804 is used to determine the color matching relationship corresponding to the to-be-processed image according to the correlation degree parameter, where the color matching relationship is used to identify the layers and colors corresponding to the color matching relationship in the multiple layers.
[0132] In one possible implementation, see Figure 8b , the apparatus 800 further comprises a fourth determining unit 805:
[0133] A fourth determining unit 805, used to determine layer information corresponding to the multiple layers and the layer relationship between the multiple layers;
[0134] The third determining unit 804 is specifically configured to:
[0135] The color matching relationship corresponding to the image to be processed is determined according to the correlation degree parameter, layer information and layer relationship.
[0136] In a possible implementation manner, the first determining unit 802 is specifically configured to:
[0137] Determine a representative color corresponding to each layer according to the color of each layer in the multiple layers;
[0138] The color feature corresponding to each layer is determined according to the representative color corresponding to each layer.
[0139] In a possible implementation, the first layer is a layer having multiple colors among the multiple layers. For the first layer, the first determining unit 802 is specifically configured to:
[0140] Determine a representative color of the first layer according to the multiple colors;
[0141] The color feature corresponding to the first layer is determined according to the representative color.
[0142] In one possible implementation, see Figure 8c , the apparatus 800 further comprises a fifth determining unit 806:
[0143] A fifth determining unit 806, configured to determine a matching relationship based on the image with the identified color matching relationship, wherein the matching relationship is used to identify a corresponding relationship between the color matching relationship and a correlation degree parameter between the color features;
[0144] The third determining unit 804 is specifically configured to:
[0145] According to the correlation degree parameter and the matching relationship, the color matching relationship corresponding to the image to be processed is determined.
[0146] In one possible implementation, see Figure 8d , the device 800 further comprises a color changing unit 807:
[0147] A color changing unit 807, used to determine a color scheme corresponding to the color matching relationship;
[0148] According to the colors indicated by the color scheme, the layers with corresponding color relationships in the image to be processed are subjected to color change processing.
[0149] In a possible implementation, the color changing unit 807 is specifically used for:
[0150] Obtain multiple pending color schemes corresponding to the color matching relationship;
[0151] A color scheme is determined from the multiple color schemes to be determined according to a correlation degree parameter between a target color feature and color features of the multiple color schemes to be determined; the target color feature is a color feature of a layer of the multiple layers having a corresponding color matching relationship.
[0152] In a possible implementation, the color matching relationship identifies multiple component color types in the color matching relationship; the second layer in the layers corresponding to the color matching relationship includes multiple colors; for the second layer, the color changing unit 807 is specifically used to:
[0153] Determine the color difference parameter between the color to be changed and the representative color of the second layer; the color to be changed is the color of the corresponding component color type of the second layer in the color matching relationship;
[0154] The second layer is subjected to color change processing according to the color difference parameter and the multiple colors included in the second layer.
[0155] The present application also provides a device for determining image color matching relationships. The device for determining image color matching relationships is described below in conjunction with the accompanying drawings. Fig. 9As shown, the embodiment of the present application provides a device 900 for determining image color matching relationships. The device 900 may also be a terminal device. The terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a vehicle-mounted computer, etc., and the terminal device is taken as an example of a mobile phone:
[0156] Fig. 9 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig. 9 The mobile phone includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, a processor 980, and a power supply 990. Those skilled in the art can understand that Fig. 9 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0157] Combine the following Fig. 9 A detailed introduction to the various components of the mobile phone:
[0158] The RF circuit 910 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 980 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 910 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 910 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0159] The memory 920 can be used to store software programs and modules. The processor 980 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 920. The memory 920 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 920 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0160] The input unit 930 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 931 or near the touch panel 931 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 931 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch panel 931 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 931, the input unit 930 may further include other input devices 932. Specifically, the other input devices 932 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0161] The display unit 940 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941. Optionally, the display panel 941 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. Further, the touch panel 931 may cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, it is transmitted to the processor 980 to determine the type of touch event. Subsequently, the processor 980 provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in Fig. 9 In the embodiment, the touch panel 931 and the display panel 941 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 931 and the display panel 941 can be integrated to realize the input and output functions of the mobile phone.
[0162] The mobile phone may also include at least one sensor 950, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 941 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 941 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0163] The audio circuit 960, the speaker 961, and the microphone 962 can provide an audio interface between the user and the mobile phone. The audio circuit 960 can transmit the received audio data to the speaker 961 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 962 converts the collected sound signal into an electrical signal, which is received by the audio circuit 960 and converted into audio data, and then the audio data is output to the processor 980 for processing, and then sent to another mobile phone through the RF circuit 910, or the audio data is output to the memory 920 for further processing.
[0164] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 970. It provides users with wireless broadband Internet access. Fig. 9 A WiFi module 970 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0165] The processor 980 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 980.
[0166] The mobile phone also includes a power supply 990 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 980 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.
[0167] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0168] In this embodiment, the processor 980 included in the terminal device also has the following functions:
[0169] Obtaining an image to be processed including multiple layers;
[0170] Determine color features corresponding to the multiple layers respectively;
[0171] Determining a correlation degree parameter between the color features;
[0172] The color matching relationship corresponding to the image to be processed is determined according to the association degree parameter, and the color matching relationship is used to identify the layers and colors corresponding to the color matching relationship in the multiple layers.
[0173] The present application also provides a server. Fig.10 As shown, Fig.10 The structural diagram of the server 1000 provided in the embodiment of the present application, the server 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1022 (for example, one or more processors) and a memory 1032, and one or more storage media 1030 (for example, one or more mass storage devices) storing application programs 1042 or data 1044. Among them, the memory 1032 and the storage medium 1030 can be short-term storage or permanent storage. The program stored in the storage medium 1030 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1022 can be configured to communicate with the storage medium 1030 and execute a series of instruction operations in the storage medium 1030 on the server 1000.
[0174] The server 1000 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1058, and / or one or more operating systems 1041, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0175] The steps executed by the server in the above embodiment can be based on the embodiment of the present application. A computer-readable storage medium is also provided for storing program code, and the program code is used to execute any implementation of the method for determining an image color matching relationship described in the above embodiments.
[0176] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0177] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0178] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application 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 determining image color matching relationship, characterized in that: The method comprises: Obtaining an image to be processed including multiple layers; Determine color features corresponding to the multiple layers respectively; Determining a correlation degree parameter between the color features; Determine the color matching relationship corresponding to the image to be processed according to the association degree parameter, the color matching relationship is used to identify the corresponding layers and colors in the multiple layers, and the color matching relationship identifies multiple component color types in the color matching relationship; the second layer in the layers of the color matching relationship includes multiple colors; wherein, when the association degree parameter is a color difference value, determine the color relationship between the representative colors of the layers according to the obtained color difference values of the representative colors of the layers; Determine a color scheme corresponding to the color matching relationship; According to the color indicated by the color scheme, a color change process is performed on the layer corresponding to the color matching relationship in the image to be processed; Wherein, for the second layer, performing color change processing on the layer corresponding to the color matching relationship in the to-be-processed image according to the color indicated by the color matching scheme includes: Determine a color difference parameter between the color to be changed and the representative color of the second layer; the color to be changed is the color of the corresponding component color type of the second layer in the color matching relationship; The second layer is subjected to color change processing according to the color difference parameter and a plurality of colors included in the second layer.
2. The method according to claim 1, characterized in that The method further comprises: Determine layer information corresponding to the plurality of layers and layer relationships between the plurality of layers, wherein the layer information includes color areas and color distribution of the layers; The step of determining the color matching relationship corresponding to the image to be processed according to the association degree parameter includes: The color matching relationship corresponding to the image to be processed is determined according to the association degree parameter, the layer information and the layer relationship.
3. The method according to claim 1, characterized in that The determining of the color features respectively corresponding to the multiple layers includes: Determine a representative color corresponding to each layer according to the color of each layer in the multiple layers; The color feature corresponding to each layer is determined according to the representative color corresponding to each layer.
4. The method according to claim 3, characterized in that The first layer is a layer having multiple colors among the multiple layers. For the first layer, the color feature corresponding to the first layer is determined according to the following method: Determining a representative color of the first layer according to the multiple colors; A color feature corresponding to the first layer is determined according to the representative color.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine a matching relationship based on images with identified color matching relationships in historical images, wherein the matching relationship is used to identify a corresponding relationship between a color matching relationship and a correlation degree parameter between color features; The step of determining the color matching relationship corresponding to the image to be processed according to the association degree parameter includes: The color matching relationship corresponding to the image to be processed is determined according to the association degree parameter and the matching relationship.
6. The method according to claim 1, characterized in that The determining of a color matching scheme corresponding to the color matching relationship includes: Obtaining multiple pending color matching schemes corresponding to the color matching relationship; The color scheme is determined from the multiple color schemes to be determined according to a correlation degree parameter between a target color feature and color features of the multiple color schemes to be determined; the target color feature is a color feature of a layer in the multiple layers corresponding to the color matching relationship.
7. A device for determining image color matching relationship, characterized in that: The device comprises an acquisition unit, a first determination unit, a second determination unit, a third determination unit and a color changing unit: The acquisition unit is used to acquire an image to be processed including multiple layers; The first determining unit is used to determine the color features corresponding to the multiple layers respectively; The second determining unit is used to determine the correlation degree parameter between the color features; The third determining unit is used to determine the color matching relationship corresponding to the to-be-processed image according to the association degree parameter, the color matching relationship is used to identify the corresponding layers and colors in the multiple layers, and the color matching relationship identifies multiple component color types in the color matching relationship; The second layer in the layers of the color matching relationship includes a plurality of colors; wherein, when the association degree parameter is a color difference value, the color relationship between the representative colors of the layers is determined according to the obtained color difference values of the representative colors of the layers; The color changing unit is used to determine a color matching scheme corresponding to the color matching relationship; According to the color indicated by the color scheme, a color change process is performed on the layer corresponding to the color matching relationship in the image to be processed; Wherein, for the second layer, the color changing unit is specifically used for: Determine a color difference parameter between the color to be changed and the representative color of the second layer; the color to be changed is the color of the corresponding component color type of the second layer in the color matching relationship; The second layer is subjected to color change processing according to the color difference parameter and a plurality of colors included in the second layer.
8. The device according to claim 7, characterized in that The device further comprises a fourth determining unit: The fourth determining unit is used to determine the layer information corresponding to the multiple layers and the layer relationship between the multiple layers, wherein the layer information includes the color area and color distribution of the layers; The third determining unit is specifically configured to: The color matching relationship corresponding to the image to be processed is determined according to the association degree parameter, the layer information and the layer relationship.
9. The device according to claim 7, characterized in that The first layer is a layer having multiple colors among the multiple layers. For the first layer, the first determining unit is specifically used to: Determining a representative color of the first layer according to the multiple colors; A color feature corresponding to the first layer is determined according to the representative color.
10. The device according to any one of claims 7 to 9, characterized in that: The apparatus further comprises a fifth determining unit: The fifth determining unit is used to determine a matching relationship based on an image with a recognized color matching relationship in the historical image, wherein the matching relationship is used to identify a corresponding relationship between a color matching relationship and a correlation degree parameter between color features; The third determining unit is specifically configured to: The color matching relationship corresponding to the image to be processed is determined according to the association degree parameter and the matching relationship.
11. The device according to claim 7, characterized in that The color changing unit is specifically used for: Obtaining multiple pending color matching schemes corresponding to the color matching relationship; The color scheme is determined from the multiple color schemes to be determined according to a correlation degree parameter between a target color feature and color features of the multiple color schemes to be determined; the target color feature is a color feature of a layer in the multiple layers corresponding to the color matching relationship.
12. A device for determining image color matching relationships, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the image color matching relationship determination method according to any one of claims 1 to 6 according to the instructions in the program code.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the method for determining the image color matching relationship according to any one of claims 1 to 6.
Citation Information
Patent Citations
Device and method for image processing
CN105430295A
Image processing method and device, storage medium and electronic device
CN110198437A