CN113870099A - Picture color conversion method, device and equipment and readable storage medium - Google Patents

Picture color conversion method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN113870099A
CN113870099A CN202111143452.1A CN202111143452A CN113870099A CN 113870099 A CN113870099 A CN 113870099A CN 202111143452 A CN202111143452 A CN 202111143452A CN 113870099 A CN113870099 A CN 113870099A
Authority
CN
China
Prior art keywords
original
rgb channel
color conversion
pixel point
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111143452.1A
Other languages
Chinese (zh)
Other versions
CN113870099B (en
Inventor
余康正
肖力成
冯政
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taishan Information Technology Co ltd
Original Assignee
Taishan Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taishan Information Technology Co ltd filed Critical Taishan Information Technology Co ltd
Priority to CN202111143452.1A priority Critical patent/CN113870099B/en
Publication of CN113870099A publication Critical patent/CN113870099A/en
Application granted granted Critical
Publication of CN113870099B publication Critical patent/CN113870099B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention discloses a picture color conversion method, which comprises the following steps: acquiring an original picture to be subjected to color conversion and a color conversion type; acquiring original RGB channel components corresponding to original pixel points in an original picture respectively; when the color conversion type is black-and-white effect processing, performing weighting calculation on each original RGB channel component aiming at each original pixel point; determining each black-white pixel point according to each first weighted calculation result to obtain a black-white effect image; when the color conversion type is the coloring effect processing, the concentration and the saturation of each target color pixel point in the target coloring effect graph are adjusted to obtain adjusted RGB channel components, and the target coloring effect graph is generated by combining each original RGB channel component and each adjusted RGB channel component. The invention greatly improves the color conversion efficiency and ensures the space consistency of the color in the transfer process. The invention also discloses a device, equipment and a storage medium, which have corresponding technical effects.

Description

Picture color conversion method, device and equipment and readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for converting a picture color.
Background
In information transfer and exchange, images are important propagation media. In the human visual system, color is one of the important factors that embody visual cognition. The original picture sample cannot display various requirements of the user sometimes, and the picture needs to be processed at this time, for example, pictures of scenes with different styles are switched.
Most of the existing picture color conversion methods are color conversion methods based on color transfer. At present, in the aspect of research on a coloring method based on color transfer, because the coloring process at each pixel point in a target gray-scale image is independent, the conventional color conversion method generally has the problems of inconsistent colors in the transfer process, complex picture color conversion process and low conversion efficiency.
In summary, how to effectively solve the problems that the color of the existing color conversion method is easily inconsistent in the transfer process, the color conversion process of the picture is complex, the conversion efficiency is low, and the like, is a problem that needs to be solved by those skilled in the art at present.
Disclosure of Invention
The invention aims to provide a picture color conversion method, which greatly reduces the color conversion complexity, improves the color conversion efficiency and ensures the space consistency of colors in the transfer process; another object of the present invention is to provide a picture color conversion apparatus, a device and a computer readable storage medium.
In order to solve the technical problems, the invention provides the following technical scheme:
a picture color conversion method, comprising:
analyzing the received picture color conversion request to obtain an original picture to be color-converted and a color conversion type;
acquiring original RGB channel components corresponding to original pixel points in the original picture respectively;
when the color conversion type is black and white effect processing, performing weighting calculation on the original RGB channel components aiming at each original pixel point;
determining black-and-white pixel points respectively corresponding to the original pixel points according to the obtained first weighted calculation result, and returning the black-and-white pixel points to the positions of the corresponding original pixel points in the original picture to obtain a black-and-white effect picture;
when the color conversion type is coloring effect processing, acquiring each target color pixel point in a target coloring effect graph, and adjusting the concentration and the saturation of each target color pixel point to obtain each adjusted pixel point;
acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components;
and returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
In one embodiment of the present invention, the performing the weighted calculation on the raw RGB channel components for each raw pixel point includes:
acquiring an RGB channel weight coefficient obtained by pre-training;
and carrying out weighted calculation on the original RGB channel components according to the RGB channel weight coefficients aiming at each original pixel point.
In a specific embodiment of the present invention, determining black and white pixels corresponding to the original pixels according to the obtained first weighted calculation results includes:
comparing each first weighted calculation result with a preset pixel threshold value respectively, and determining each target black-and-white pixel value according to each obtained comparison result;
and generating black-white pixel points corresponding to the original pixel points according to the target black-white pixel values.
In an embodiment of the present invention, the adjusting the concentration and the saturation of each target color pixel includes:
acquiring first RGB channel components corresponding to the target color pixel points respectively;
carrying out concentration adjustment on each first RGB channel component by using a pixel concentration adjustment model obtained by pre-training to obtain each second RGB channel component;
and performing saturation adjustment operation on each second RGB channel component by using a saturation adjustment model obtained by pre-training.
In a specific embodiment of the present invention, generating each pixel point to be added by combining each of the original RGB channel components and each of the adjusted RGB channel components includes:
carrying out weighted calculation on the adjusted RGB channel components aiming at each adjusted pixel point to obtain a second weighted calculation result;
calculating target RGB channel components by combining the original RGB channel components and the second weighting calculation results;
and generating each pixel point to be added according to each target RGB channel component.
A picture color conversion device comprising:
the request analysis module is used for analyzing the received image color conversion request to obtain an original image to be color-converted and a color conversion type;
the original component acquisition module is used for acquiring original RGB channel components corresponding to original pixel points in the original picture respectively;
the weighting calculation module is used for carrying out weighting calculation on the original RGB channel components aiming at each original pixel point when the color conversion type is black and white effect processing;
the black-and-white effect image obtaining module is used for determining black-and-white pixel points respectively corresponding to the original pixel points according to the obtained first weighted calculation results, and returning the black-and-white pixel points to the positions of the corresponding original pixel points in the original image to obtain a black-and-white effect image;
the concentration and saturation adjusting module is used for acquiring each target color pixel point in a target coloring effect graph when the color conversion type is coloring effect processing, and adjusting the concentration and saturation of each target color pixel point to obtain each adjusted pixel point;
the pixel point generating module is used for acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components;
and the coloring effect graph obtaining module is used for returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect graph.
In an embodiment of the present invention, the weighting calculation module includes:
the weight coefficient acquisition submodule is used for acquiring the RGB channel weight coefficient obtained by pre-training;
and the weighting calculation submodule is used for carrying out weighting calculation on each original RGB channel component according to the RGB channel weighting coefficient aiming at each original pixel point.
In an embodiment of the present invention, the black-and-white effect map obtaining module includes:
the black-and-white pixel value determining submodule is used for respectively comparing each first weighted calculation result with a preset pixel threshold value and determining each target black-and-white pixel value according to each obtained comparison result;
and the black-and-white pixel point generation submodule is used for generating black-and-white pixel points corresponding to the original pixel points according to the target black-and-white pixel values.
A picture color conversion apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the picture color conversion method as described above when executing the computer program.
A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the picture color conversion method as set forth above.
The picture color conversion method provided by the invention analyzes the received picture color conversion request to obtain an original picture to be color-converted and a color conversion type; acquiring original RGB channel components corresponding to original pixel points in an original picture respectively; when the color conversion type is black and white effect processing, performing weighting calculation on the original RGB channel components aiming at each original pixel point; determining black-white pixel points corresponding to the original pixel points according to the obtained first weighted calculation results, and returning the black-white pixel points to the corresponding original pixel point positions in the original picture to obtain a black-white effect picture; when the color conversion type is the coloring effect processing, acquiring each target color pixel point in the target coloring effect graph, and adjusting the concentration and the saturation of each target color pixel point to obtain each adjusted pixel point; acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components; and returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
According to the technical scheme, the fast conversion from the original picture to the corresponding effect picture is realized by calculating the RGB channel components, the switching speed under different scenes can be met, the conversion complexity is greatly reduced, the color conversion efficiency is improved, and the space consistency of the color in the transfer process is ensured.
Correspondingly, the invention also provides a picture color conversion device, equipment and a computer readable storage medium corresponding to the picture color conversion method, which have the technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating an implementation of a method for converting a color of a picture according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another implementation of a method for converting a picture color according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a setting interface of a picture color conversion type according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a picture color setting interface according to an embodiment of the invention;
FIG. 5 is a block diagram of a color conversion apparatus according to an embodiment of the present invention;
FIG. 6 is a block diagram of a picture color conversion apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a picture color conversion device provided in this embodiment.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a picture color conversion method according to an embodiment of the present invention, where the method may include the following steps:
s101: and analyzing the received picture color conversion request to obtain an original picture to be color-converted and a color conversion type.
When the color of the picture needs to be converted, sending a picture color conversion request to a picture color conversion center, wherein the picture color conversion request comprises an original picture to be subjected to color conversion and a color conversion type. And the picture color conversion center receives the picture color conversion request and analyzes the received picture color conversion request to obtain an original picture to be subjected to color conversion and a color conversion type. The color conversion type may include a black and white effect process and a coloring effect process.
S102: and acquiring original RGB channel components corresponding to the original pixel points in the original picture.
After the original picture to be color-converted and the color conversion type are obtained through analysis, original RGB channel components corresponding to the original pixel points in the original picture are obtained, that is, R, G, B three-channel numerical values of the original pixel points are obtained respectively.
RGB is a color standard in the industry, which obtains various colors by changing three color channels of red (R), green (G) and blue (B) and superimposing them on each other, and this standard includes almost all colors that can be perceived by human vision, and is one of the most widely used color systems.
S103: when the color conversion type is the black-and-white effect process, the weighting calculation is performed for the original RGB channel components for each original pixel point.
After the original RGB channel components corresponding to the original pixel points in the original image are obtained, when the color conversion type is black and white effect processing, weighting calculation is carried out on the original RGB channel components aiming at each original pixel point. Setting a weight coefficient for R, G, B channels of the pixel point, multiplying the R, G, B channel values of the original pixel point by the corresponding weight coefficients, and adding the three product values obtained by calculation.
S104: and determining black-white pixel points corresponding to the original pixel points according to the obtained first weighted calculation results, and returning the black-white pixel points to the corresponding original pixel point positions in the original picture to obtain a black-white effect picture.
Each first weighting calculation result is obtained by performing weighting calculation on the original RGB channel components for each original pixel point. After each first weighted calculation result is obtained, determining black and white pixel points corresponding to each original pixel point according to each obtained first weighted calculation result, if a pixel determination critical value is preset, determining black and white pixel points corresponding to each original pixel point according to the magnitude relation between the first weighted calculation result obtained by calculation of each original pixel point and the pixel determination critical value. After determining the black and white pixel points corresponding to the original pixel points respectively, returning the black and white pixel points to the original pixel point positions corresponding to the original picture to obtain a black and white effect picture, namely finally obtaining the picture which is either black or white, and completely removing the original color chroma.
S105: and when the color conversion type is the coloring effect processing, acquiring each target color pixel point in the target coloring effect graph, and adjusting the concentration and the saturation of each target color pixel point to obtain each adjusted pixel point.
After the original RGB channel components corresponding to the original pixel points in the original picture are obtained, when the color conversion type is coloring effect processing, the target is to make all colors of the original picture approach to the target color as much as possible, to obtain target color pixel points in a target coloring effect picture, and to adjust the concentration and the saturation of the target color pixel points, so as to obtain the adjusted pixel points. By adjusting the concentration and the saturation of the target color pixel point, the image looks more natural.
S106: and acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components.
After each adjusted pixel point is obtained by adjusting the concentration and the saturation of each target color pixel point, adjusted RGB channel components corresponding to each adjusted pixel point are obtained. Because the pixels are added on the basis of each original pixel point of the original image, new pixel points cannot be generated directly according to the adjusted RGB channel components, and each pixel point to be added needs to be generated by combining each original RGB channel component and each adjusted RGB channel component.
S107: and returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
And after each pixel point to be added is generated by combining each original RGB channel component and each adjusted RGB channel component, returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture. And overlapping the pixel points to be added with the corresponding original pixel points to obtain target color pixel points.
According to the technical scheme, the fast conversion from the original picture to the corresponding effect picture is realized by calculating the RGB channel components, the switching speed under different scenes can be met, the color conversion complexity is greatly reduced, the color conversion efficiency is improved, and the space consistency of the color in the transfer process is ensured.
It should be noted that, based on the above embodiments, the embodiments of the present invention also provide corresponding improvements. In the following embodiments, steps that are the same as or correspond to those in the above embodiments may be referred to one another, and corresponding advantageous effects may also be referred to one another, which is not described in detail in the following modified embodiments.
Referring to fig. 2, fig. 2 is a flowchart of another implementation of a picture color conversion method according to an embodiment of the present invention, where the method may include the following steps:
s201: and analyzing the received picture color conversion request to obtain an original picture to be color-converted and a color conversion type.
S202: and acquiring original RGB channel components corresponding to the original pixel points in the original picture.
S203: and when the color conversion type is black-and-white effect processing, acquiring the RGB channel weight coefficient obtained by pre-training.
The RGB channel weighting coefficients are trained in advance, for example, the R channel is trained to have a coefficient of 0.2125, the G channel is trained to have a coefficient of 0.7154, and the B channel is trained to have a coefficient of 0.0721. And acquiring the RGB channel weight coefficient obtained by pre-training.
S204: and carrying out weighting calculation on the original RGB channel components according to the RGB channel weight coefficients aiming at each original pixel point.
After the RGB channel weight coefficients obtained through pre-training are obtained, weighting calculation is carried out on the original RGB channel components for each original pixel point according to the RGB channel weight coefficients, the values of R, G, B three channels of the original pixel points are respectively multiplied by the corresponding weight coefficients obtained through training, and then the three product values obtained through calculation are added.
S205: and respectively comparing each first weighted calculation result with a preset pixel threshold value, and determining each target black-and-white pixel value according to each obtained comparison result.
The preset pixel threshold, such as a certain percentage of 255, may be 25%, 50%, 75%, etc. After each original pixel point performs weighted calculation on the original RGB channel component according to the RGB channel weight coefficient to obtain each first weighted calculation result, each first weighted calculation result is compared with a preset pixel threshold value respectively, each target black-and-white pixel value is determined according to each obtained comparison result, if the first weighted calculation result is larger than the preset pixel threshold value, the pixel value of the pixel point is set to be (255, 255, 255), namely, the pixel point is set to be a white pixel point, and if the first weighted calculation result is smaller than or equal to the preset pixel threshold value, the pixel point is set to be (0, 0, 0), namely, the pixel point is set to be a black pixel point.
S206: and generating black-white pixel points corresponding to the original pixel points according to the target black-white pixel values.
After each target black-white pixel value is determined, black-white pixel points corresponding to each original pixel point are generated according to each target black-white pixel value, namely when the target black-white pixel value is the pixel value corresponding to the black pixel point, the black pixel point is generated, and when the target black-white pixel value is the pixel value corresponding to the white pixel point, the white pixel point is generated.
S207: and returning each black-and-white pixel point to the corresponding original pixel point position in the original picture to obtain a black-and-white effect picture.
S208: and when the color conversion type is the coloring effect processing, acquiring each target color pixel point in the target coloring effect graph.
S209: and acquiring first RGB channel components corresponding to the target color pixel points respectively.
After each target color pixel point in the target coloring effect graph is obtained, first RGB channel components corresponding to each target color pixel point are obtained, and the first RGB channel components are composed of first R channel components R1First G channel component G1First B channel component B1Forming to obtain R, G, B three-channel number of target color pixel pointThe value is obtained.
S210: and performing concentration adjustment on each first RGB channel component by using a pixel concentration adjustment model obtained by pre-training to obtain each second RGB channel component.
And pre-training a pixel concentration adjustment model, and after first RGB channel components corresponding to the target color pixels are obtained, performing concentration adjustment on the first RGB channel components by using the pixel concentration adjustment model obtained through pre-training to obtain second RGB channel components. The second RGB channel component is composed of a second R channel component R2A second G channel component G2A second B channel component B2The coloring effect treatment can be classified into a deep coloring effect treatment and a light coloring effect treatment.
When the pixel density adjustment model belongs to the deep coloring effect processing category, the trained pixel density adjustment model may include the following density adjustment formula:
Figure BDA0003284530430000091
Figure BDA0003284530430000092
Figure BDA0003284530430000093
when the pixel density adjustment model belongs to the category of light coloring effect processing, the trained pixel density adjustment model may include the following density adjustment formula:
R2=R1×0.450.44999998
G2=G1×0.450.44999998
B2=B1×0.450.44999998
thereby obtaining each second RGB channel component after density adjustment.
S211: and performing saturation adjustment operation on each second RGB channel component by using a saturation adjustment model obtained by pre-training to obtain each adjusted pixel point.
And pre-training a saturation adjustment model, performing concentration adjustment on each first RGB channel component by using the pixel concentration adjustment model obtained through pre-training to obtain each second RGB channel component, and performing saturation adjustment operation on each second RGB channel component by using the saturation adjustment model obtained through pre-training to obtain each adjusted pixel point. Setting the adjusted RGB channel component corresponding to each adjusted pixel point as the third R channel component R3A third G channel component G3A third B channel component B3And (4) forming.
When the saturation adjustment model belongs to the deep coloring effect processing category, the trained saturation adjustment model may include the following saturation adjustment formula:
Figure BDA0003284530430000101
Figure BDA0003284530430000102
Figure BDA0003284530430000103
when the saturation adjustment model belongs to the category of light coloring effect processing, the trained saturation adjustment model may include the following saturation adjustment formula:
Figure BDA0003284530430000104
Figure BDA0003284530430000105
Figure BDA0003284530430000106
thereby obtaining each adjusted pixel point after passing through concentration adjustment and saturation adjustment.
S212: and acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively.
S213: and performing weighted calculation on the adjusted RGB channel components aiming at each adjusted pixel point to obtain a second weighted calculation result.
After the adjusted RGB channel components corresponding to the adjusted pixel points are obtained, weighting calculation is carried out on the adjusted RGB channel components according to each adjusted pixel point, and a second weighting calculation result is obtained. The third R channel component R in the adjusted RGB channel component3A third G channel component G3A third B channel component B3The respective corresponding weight coefficients may be kept identical to the weight coefficients at the time of calculation of the first weighting calculation result.
S214: and calculating each target RGB channel component by combining each original RGB channel component and each second weighting calculation result.
After the second weighting calculation results are obtained through calculation, each target RGB channel component is calculated by combining each original RGB channel component and each second weighting calculation result. The target RGB channel component is composed of a fourth R channel component R4Fourth G channel component G4Fourth B channel component B4And (4) forming.
When belonging to the deep shading effect processing category, each target RGB channel component can be calculated by the following formula:
Figure BDA0003284530430000111
Figure BDA0003284530430000112
Figure BDA0003284530430000113
wherein R is0For the B channel component, G, of the original RGB channel components0For the G channel component, B, of the original RGB channel components0Is the B channel component in the original RGB channel component.
When belonging to the light coloring effect processing category, each target RGB channel component can be calculated by the following formula:
Figure BDA0003284530430000114
Figure BDA0003284530430000115
Figure BDA0003284530430000116
thereby calculating to obtain each target RGB channel component.
S215: and generating each pixel point to be added according to each target RGB channel component.
And after the target RGB channel components are obtained, generating each pixel point to be added according to each target RGB channel component.
S216: and returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
And after generating each pixel point to be added according to each target RGB channel component, returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain a target coloring effect picture.
The present embodiment is different from the first embodiment corresponding to the technical solution claimed in independent claim 1, and the technical solutions claimed in dependent claims 2 to 5 are added, and of course, according to different practical situations and requirements, the technical solutions claimed in the dependent claims can be flexibly combined on the basis of not affecting the completeness of the solutions, so as to better meet the requirements of different use scenarios.
Corresponding to the above method embodiments, the present invention further provides a picture color conversion apparatus, and the picture color conversion apparatus described below and the picture color conversion method described above may be referred to in correspondence with each other.
Referring to fig. 5, fig. 5 is a block diagram of a picture color conversion apparatus according to an embodiment of the present invention, where the apparatus may include:
a request analysis module 51, configured to analyze the received image color conversion request to obtain an original image to be color-converted and a color conversion type;
an original component obtaining module 52, configured to obtain original RGB channel components corresponding to original pixel points in an original picture respectively;
a weighting calculation module 53, configured to perform weighting calculation on the original RGB channel components for each original pixel point when the color conversion type is black-and-white effect processing;
a black-and-white effect map obtaining module 54, configured to determine, according to the obtained first weighted calculation result, a black-and-white pixel point corresponding to each original pixel point, and return each black-and-white pixel point to a corresponding original pixel point position in the original picture to obtain a black-and-white effect map;
a density and saturation adjusting module 55, configured to, when the color conversion type is the coloring effect processing, obtain each target color pixel point in the target coloring effect graph, and perform density and saturation adjustment on each target color pixel point to obtain each adjusted pixel point;
a pixel point generating module 56, configured to obtain adjusted RGB channel components corresponding to each adjusted pixel point, and generate each pixel point to be added by combining each original RGB channel component and each adjusted RGB channel component;
and a coloring effect map obtaining module 57, configured to return each pixel to be added to a corresponding original pixel position in the original picture, so as to obtain a target coloring effect map.
According to the technical scheme, the fast conversion from the original picture to the corresponding effect picture is realized by calculating the RGB channel components, the switching speed under different scenes can be met, the color conversion complexity is greatly reduced, the color conversion efficiency is improved, and the space consistency of the color in the transfer process is ensured.
In one embodiment of the present invention, the weight calculating module 53 includes:
the weight coefficient acquisition submodule is used for acquiring the RGB channel weight coefficient obtained by pre-training;
and the weighting calculation submodule is used for carrying out weighting calculation on the original RGB channel components according to the RGB channel weighting coefficient aiming at each original pixel point.
In an embodiment of the present invention, the black-and-white effect map obtaining module 54 includes:
the black-and-white pixel value determining submodule is used for respectively comparing each first weighted calculation result with a preset pixel threshold value and determining each target black-and-white pixel value according to each obtained comparison result;
and the black-and-white pixel point generation submodule is used for generating black-and-white pixel points corresponding to the original pixel points according to the target black-and-white pixel values.
In one embodiment of the present invention, the concentration and saturation adjusting module 55 includes:
the first component obtaining submodule is used for obtaining first RGB channel components corresponding to the target color pixel points respectively;
the concentration adjustment submodule is used for adjusting the concentration of each first RGB channel component by using a pixel concentration adjustment model obtained by pre-training to obtain each second RGB channel component;
and the saturation adjusting submodule is used for performing saturation adjusting operation on each second RGB channel component by using the saturation adjusting model obtained by pre-training.
In a specific embodiment of the present invention, the pixel point generating module 56 includes:
the weighting calculation submodule is used for carrying out weighting calculation on the adjusted RGB channel components aiming at each adjusted pixel point to obtain a second weighting calculation result;
the component calculation submodule is used for calculating each target RGB channel component by combining each original RGB channel component and each second weighting calculation result;
and the pixel point generation submodule is used for generating each pixel point to be added according to each target RGB channel component.
Corresponding to the above method embodiment, referring to fig. 6, fig. 6 is a schematic diagram of a picture color conversion device provided by the present invention, and the device may include:
a memory 332 for storing a computer program;
a processor 322, configured to implement the steps of the picture color conversion method of the above-mentioned method embodiment when executing the computer program.
Specifically, referring to fig. 7, fig. 7 is a schematic diagram illustrating a specific structure of a picture color conversion device provided in this embodiment, which may generate relatively large differences due to different configurations or performances, and may include a processor (CPU) 322 (e.g., one or more processors) and a memory 332, where the memory 332 stores one or more computer applications 342 or data 344. Memory 332 may be, among other things, transient or persistent storage. The program stored in memory 332 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a data processing device. Still further, the processor 322 may be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the picture color conversion device 301.
The picture color conversion apparatus 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341.
The steps in the picture color conversion method described above may be implemented by the structure of the picture color conversion apparatus.
Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
analyzing the received picture color conversion request to obtain an original picture to be color-converted and a color conversion type; acquiring original RGB channel components corresponding to original pixel points in an original picture respectively; when the color conversion type is black and white effect processing, performing weighting calculation on the original RGB channel components aiming at each original pixel point; determining black-white pixel points corresponding to the original pixel points according to the obtained first weighted calculation results, and returning the black-white pixel points to the corresponding original pixel point positions in the original picture to obtain a black-white effect picture; when the color conversion type is the coloring effect processing, acquiring each target color pixel point in the target coloring effect graph, and adjusting the concentration and the saturation of each target color pixel point to obtain each adjusted pixel point; acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components; and returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A picture color conversion method, comprising:
analyzing the received picture color conversion request to obtain an original picture to be color-converted and a color conversion type;
acquiring original RGB channel components corresponding to original pixel points in the original picture respectively;
when the color conversion type is black and white effect processing, performing weighting calculation on the original RGB channel components aiming at each original pixel point;
determining black-and-white pixel points respectively corresponding to the original pixel points according to the obtained first weighted calculation result, and returning the black-and-white pixel points to the positions of the corresponding original pixel points in the original picture to obtain a black-and-white effect picture;
when the color conversion type is coloring effect processing, acquiring each target color pixel point in a target coloring effect graph, and adjusting the concentration and the saturation of each target color pixel point to obtain each adjusted pixel point;
acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components;
and returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
2. The picture color conversion method according to claim 1, wherein performing a weighted calculation of the raw RGB channel components for each raw pixel point comprises:
acquiring an RGB channel weight coefficient obtained by pre-training;
and carrying out weighted calculation on the original RGB channel components according to the RGB channel weight coefficients aiming at each original pixel point.
3. The method of converting a color of an image according to claim 1 or 2, wherein determining the black-and-white pixel point corresponding to each original pixel point according to the obtained first weighted calculation result comprises:
comparing each first weighted calculation result with a preset pixel threshold value respectively, and determining each target black-and-white pixel value according to each obtained comparison result;
and generating black-white pixel points corresponding to the original pixel points according to the target black-white pixel values.
4. The method of claim 1, wherein the adjusting the density and saturation of each target color pixel comprises:
acquiring first RGB channel components corresponding to the target color pixel points respectively;
carrying out concentration adjustment on each first RGB channel component by using a pixel concentration adjustment model obtained by pre-training to obtain each second RGB channel component;
and performing saturation adjustment operation on each second RGB channel component by using a saturation adjustment model obtained by pre-training.
5. The method of claim 4, wherein the step of combining each of the original RGB channel components and each of the adjusted RGB channel components to generate each pixel point to be added comprises:
carrying out weighted calculation on the adjusted RGB channel components aiming at each adjusted pixel point to obtain a second weighted calculation result;
calculating target RGB channel components by combining the original RGB channel components and the second weighting calculation results;
and generating each pixel point to be added according to each target RGB channel component.
6. A picture color conversion apparatus, comprising:
the request analysis module is used for analyzing the received image color conversion request to obtain an original image to be color-converted and a color conversion type;
the original component acquisition module is used for acquiring original RGB channel components corresponding to original pixel points in the original picture respectively;
the weighting calculation module is used for carrying out weighting calculation on the original RGB channel components aiming at each original pixel point when the color conversion type is black and white effect processing;
the black-and-white effect image obtaining module is used for determining black-and-white pixel points respectively corresponding to the original pixel points according to the obtained first weighted calculation results, and returning the black-and-white pixel points to the positions of the corresponding original pixel points in the original image to obtain a black-and-white effect image;
the concentration and saturation adjusting module is used for acquiring each target color pixel point in a target coloring effect graph when the color conversion type is coloring effect processing, and adjusting the concentration and saturation of each target color pixel point to obtain each adjusted pixel point;
the pixel point generating module is used for acquiring adjusted RGB channel components corresponding to the adjusted pixel points respectively, and generating pixel points to be added by combining the original RGB channel components and the adjusted RGB channel components;
and the effect picture obtaining module is used for returning each pixel point to be added to the corresponding original pixel point position in the original picture to obtain the target coloring effect picture.
7. The picture color conversion device according to claim 6, wherein the weighting calculation module includes:
the weight coefficient acquisition submodule is used for acquiring the RGB channel weight coefficient obtained by pre-training;
and the weighting calculation submodule is used for carrying out weighting calculation on the original RGB channel components according to the RGB channel weight coefficients aiming at each original pixel point.
8. The picture color conversion device according to claim 6 or 7, wherein the black-and-white effect map obtaining module comprises:
the black-and-white pixel value determining submodule is used for respectively comparing each first weighted calculation result with a preset pixel threshold value and determining each target black-and-white pixel value according to each obtained comparison result;
and the black-and-white pixel point generation submodule is used for generating black-and-white pixel points corresponding to the original pixel points according to the target black-and-white pixel values.
9. A picture color conversion apparatus, characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the picture color conversion method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the picture color conversion method according to any one of claims 1 to 5.
CN202111143452.1A 2021-09-28 2021-09-28 Picture color conversion method, device, equipment and readable storage medium Active CN113870099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111143452.1A CN113870099B (en) 2021-09-28 2021-09-28 Picture color conversion method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111143452.1A CN113870099B (en) 2021-09-28 2021-09-28 Picture color conversion method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113870099A true CN113870099A (en) 2021-12-31
CN113870099B CN113870099B (en) 2023-06-27

Family

ID=78991763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111143452.1A Active CN113870099B (en) 2021-09-28 2021-09-28 Picture color conversion method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113870099B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115797494A (en) * 2023-02-06 2023-03-14 武汉精臣智慧标识科技有限公司 Picture binarization processing method and device, electronic equipment and storage medium
CN117435156A (en) * 2023-12-20 2024-01-23 汉朔科技股份有限公司 Display information generation method, device, equipment and medium of electronic price tag

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017045218A1 (en) * 2015-09-14 2017-03-23 深圳市华星光电技术有限公司 Adaptive conversion method for image
CN109741279A (en) * 2019-01-04 2019-05-10 Oppo广东移动通信有限公司 Image saturation method of adjustment, device, storage medium and terminal
CN110335195A (en) * 2019-07-09 2019-10-15 北京字节跳动网络技术有限公司 Body color method of adjustment, device, electronic equipment and storage medium
CN112788321A (en) * 2021-01-05 2021-05-11 锐芯微电子股份有限公司 Image color recovery method and apparatus, image pickup apparatus, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017045218A1 (en) * 2015-09-14 2017-03-23 深圳市华星光电技术有限公司 Adaptive conversion method for image
CN109741279A (en) * 2019-01-04 2019-05-10 Oppo广东移动通信有限公司 Image saturation method of adjustment, device, storage medium and terminal
CN110335195A (en) * 2019-07-09 2019-10-15 北京字节跳动网络技术有限公司 Body color method of adjustment, device, electronic equipment and storage medium
CN112788321A (en) * 2021-01-05 2021-05-11 锐芯微电子股份有限公司 Image color recovery method and apparatus, image pickup apparatus, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张芸 等: "几种基于颜色模型的彩色图像黑白化算法", 《南昌工程学院学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115797494A (en) * 2023-02-06 2023-03-14 武汉精臣智慧标识科技有限公司 Picture binarization processing method and device, electronic equipment and storage medium
CN117435156A (en) * 2023-12-20 2024-01-23 汉朔科技股份有限公司 Display information generation method, device, equipment and medium of electronic price tag

Also Published As

Publication number Publication date
CN113870099B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
CN109934776B (en) Model generation method, video enhancement method, device and computer-readable storage medium
US6807300B1 (en) Noise reduction method utilizing color information, apparatus, and program for digital image processing
US8244056B2 (en) Image contrast enhancement apparatus and method thereof
CN113870099B (en) Picture color conversion method, device, equipment and readable storage medium
KR101384627B1 (en) Method for the automatic segmentation of object area in video
CN111489322B (en) Method and device for adding sky filter to static picture
CN106780417A (en) A kind of Enhancement Method and system of uneven illumination image
CN110335330B (en) Image simulation generation method and system, deep learning algorithm training method and electronic equipment
CN113658085B (en) Image processing method and device
CN111353955A (en) Image processing method, device, equipment and storage medium
Wang et al. Color contrast-preserving decolorization
KR101437626B1 (en) System and method for region-of-interest-based artifact reduction in image sequences
CN109272526B (en) Image processing method and system and electronic equipment
CN114596259A (en) Method, device, equipment and storage medium for determining reference-free video quality
EP3429197B1 (en) Image processing apparatus, imaging apparatus, image processing method, and program
CN114862725A (en) Method and device for realizing motion perception fuzzy special effect based on optical flow method
CN113781321B (en) Information compensation method, device and equipment for image highlight region and storage medium
CN113112422A (en) Image processing method, image processing device, electronic equipment and computer readable medium
CN113066020A (en) Image processing method and device, computer readable medium and electronic device
CN107945139A (en) A kind of image processing method, storage medium and intelligent terminal
CN113591838B (en) Target detection method, device, electronic equipment and storage medium
CN112215237B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN114266803A (en) Image processing method, image processing device, electronic equipment and storage medium
CN109242750B (en) Picture signature method, picture matching method, device, equipment and storage medium
CN113610720A (en) Video denoising method and device, computer readable medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method, device, device, and readable storage medium for image color conversion

Effective date of registration: 20231009

Granted publication date: 20230627

Pledgee: Tai'an Taiyue Tourism Technology Co.,Ltd.

Pledgor: Taishan Information Technology Co.,Ltd.

Registration number: Y2023980060332

PE01 Entry into force of the registration of the contract for pledge of patent right