CN111107336B - Image processing method, image processing device, electronic equipment and storage medium - Google Patents

Image processing method, image processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111107336B
CN111107336B CN201911241574.7A CN201911241574A CN111107336B CN 111107336 B CN111107336 B CN 111107336B CN 201911241574 A CN201911241574 A CN 201911241574A CN 111107336 B CN111107336 B CN 111107336B
Authority
CN
China
Prior art keywords
color
color space
target
parameter value
space
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.)
Active
Application number
CN201911241574.7A
Other languages
Chinese (zh)
Other versions
CN111107336A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911241574.7A priority Critical patent/CN111107336B/en
Publication of CN111107336A publication Critical patent/CN111107336A/en
Application granted granted Critical
Publication of CN111107336B publication Critical patent/CN111107336B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • 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

Abstract

The embodiment of the application discloses an image processing method, which comprises the following steps: obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space; obtaining a color mapping table of a target color space; and performing color mapping on the first color parameter value of each pixel based on a color mapping table of the target color space to obtain a second color parameter value of each pixel. The embodiment of the application also discloses an image processing device, electronic equipment and a storage medium.

Description

Image processing method, image processing device, electronic equipment and storage medium
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a storage medium.
Background
With the continuous development of information technology, color parameters of an image for a target color space different from an RGB color space can be converted using an image processing technology. However, in the process of conversion, the color parameter value of each pixel of the image is first converted from the initial color parameter value of the target color space to the initial color parameter value of the RGB color space, then the final color parameter value of the RGB color space is obtained based on the RGB color mapping table, and finally the final color parameter value of the RGB color space is converted to the final color parameter value of the target color space.
It can be seen that, in the related art, the processing manner of converting the initial color parameter value of the target color space into the final color parameter value of the target color space has the problems of large operation amount, long processing time, and waste of system power consumption.
Disclosure of Invention
Embodiments of the present application are intended to provide an image processing method, an image processing apparatus, an electronic device, and a storage medium, which solve the problems of a large amount of computation, a long processing time, and a waste of system power consumption in a processing manner of converting an initial color parameter value of a target color space into a final color parameter value of the target color space in the related art.
The technical scheme of the application is realized as follows:
a method of image processing, the method comprising:
obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space;
obtaining a color mapping table of the target color space;
and performing color mapping on the first color parameter value of each pixel based on the color mapping table of the target color space to obtain a second color parameter value of each pixel.
Optionally, each pixel of the obtained target image is before the first color parameter value of the target color space, and the method further includes:
obtaining a video stream; the format of the video stream is a color coding format corresponding to the target color space;
extracting a plurality of frames of the target image from the video stream.
Optionally, the obtaining a color mapping table of the target color space includes:
obtaining a color mapping table of the RGB color space;
and generating a color mapping table of the target color space based on the color mapping table of the RGB color space.
Optionally, the generating a color mapping table of the target color space based on the color mapping table of the RGB color space includes:
obtaining a preset color parameter value of the target color space; the preset color parameter values of the target color space comprise first color parameter values of the pixels;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the color mapping table of the RGB color space.
Optionally, the generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the color mapping table of the RGB color space includes:
inputting the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of the RGB color space;
based on the RGB color mapping table, performing color mapping on a third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space;
inputting the fourth color parameter value of the RGB color space into a second parameter conversion model to obtain a target color parameter value of a target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
An image processing apparatus, the apparatus comprising:
the device comprises an obtaining unit, a processing unit and a processing unit, wherein the obtaining unit is used for obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space;
a processing unit for obtaining a color mapping table of the target color space;
and the determining unit is used for performing color mapping on the first color parameter value of each pixel based on the color mapping table of the target color space to obtain a second color parameter value of each pixel.
An electronic device, the electronic device comprising: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is used for executing the image processing program stored in the memory so as to realize the following steps:
obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space;
obtaining a color mapping table of the target color space;
and performing color mapping on the first color parameter value of each pixel based on the color mapping table of the target color space to obtain a second color parameter value of each pixel.
Optionally, the processor is configured to execute an image processing program stored in the memory, so as to implement the following steps:
obtaining a video stream; the format of the video stream is a color coding format corresponding to the target color space;
extracting a plurality of frames of the target image from the video stream.
Optionally, the processor is configured to execute an image processing program stored in the memory, so as to implement the following steps:
inputting the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of the RGB color space;
based on the RGB color mapping table, carrying out color mapping on the third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space;
inputting the fourth color parameter value of the RGB color space into a second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
A storage medium, characterized in that the storage medium stores one or more programs executable by one or more processors to implement the image processing method described above.
According to the image processing method, the image processing device, the electronic equipment and the storage medium, a first color parameter value of each pixel of a target image in a target color space is obtained; the target color space is different from the RGB color space; obtaining a color mapping table of a target color space; obviously, the electronic device obtains a color mapping table of the same color space; then, based on the color mapping table of the target color space, performing color mapping on the first color parameter value of each pixel to obtain a second color parameter value of each pixel, that is, the embodiment of the application is based on the color mapping table of the same target color space, and the first color parameter value of each pixel is used as input, so that the second color parameter value of each pixel of the target color space can be output; therefore, the problems of large operation amount, long processing time and system power consumption waste in a processing mode of converting the initial color parameter value of the target color space into the final color parameter value of the target color space are solved, the image processing efficiency is improved, and the intelligent degree of the electronic equipment is further improved.
Drawings
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another image processing method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another image processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
It should be appreciated that reference throughout this specification to "an embodiment of the present application" or "an embodiment of the foregoing" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in the embodiments of the present application" or "in the embodiments" in various places throughout this specification are not necessarily all referring to the same embodiments. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
In the related art, the overall color of an original image acquired by an image acquisition module is not bright enough, and meanwhile, when different scenes are desired to be shot, specific transformation is performed on the hue and the saturation of certain specific colors, for example: when the scene is green, it is desirable that the green color is more intense, while the other colors remain unchanged. The color mapping is performed on the original image or the video image according to the adjusted color mapping table, the color mapping table is a three-dimensional lookup table, three color components of IN _ RGB are input, and three corresponding color components of OUT _ RGB are searched OUT.
IN practical application, a video stream acquired by an image acquisition module is generally IN a YUV format, and when previewing or video color mapping is performed, each frame of image IN the video stream is converted into IN _ RGB from an IN _ YUV format, then the IN _ RGB is used for searching a color mapping table to obtain a mapped color value OUT _ RGB, and then the mapped color value OUT _ RGB is converted into OUT _ YUV to be output. Each frame of image in the video stream realizes one color mapping, and conversion operation of converting YUV to RGB and converting RGB to YUV is carried out once, so that the processing time and the power consumption are increased.
An embodiment of the present application provides an image processing method applied to an electronic device, and as shown in fig. 1, the method includes the following steps:
step 101, obtaining a first color parameter value of each pixel of the target image in the target color space.
Wherein the target color space is different from the RGB color space.
In the embodiment of the present application, the electronic device may include a mobile terminal device such as a mobile phone, a tablet computer, a notebook computer, a Personal Digital Assistant (PDA), a camera, a wearable device, and a fixed terminal device such as a desktop computer. Here, the electronic device may be provided with an image acquisition module such as a camera; of course, the electronic device may also be connected to the image capturing module in a communication manner, that is, the electronic device and the image capturing module may be physically combined or separately arranged.
In the embodiment of the application, the target image can be a single-frame image acquired by an image acquisition module, or can be any one of multiple-frame images in a video stream acquired by the image acquisition module; a pixel refers to a minimum unit in an image represented by a sequence of numbers, and a target image includes a plurality of pixels.
In the embodiment of the present application, the target color space includes a YUV (luminence) color space, a CMY (Cyan, magenta) color space, a CMYK (Cyan, magenta, black) color space, an HSV (Hue, value) color space, an HSI (Hue, saturation) color space, or a Lab (CIELab color model) color space.
The YUV color space is used for describing a color space of image colors and saturation; the first color parameter value of the YUV color space may be represented in YUV values; wherein, the color parameters in the YUV color space are brightness Y, hue U and V saturation respectively; here, the brightness Y has a value ranging from 0 to 255, the hue U has a value ranging from 0 to 255, and the saturation V has a value ranging from 0 to 255.
The HSV color space is a color space created according to the intuitive characteristics of colors, and is also called a hexagonal pyramid model. The parameters of the colors in the HSV color space are hue H, saturation S, and brightness V, respectively; wherein, the value range of the hue H is 0 to 180, the value range of the saturation S is 0 to 255, and the value range of the brightness V is 0 to 255.
The HSI color space is based on a color space created by a human visual system, wherein the HSI color space is also called a cone space model; the parameters of the colors in the HSI color space are hue H, saturation S and brightness I, respectively. Wherein, the value range of the hue H is 0 to 360, the value range of the saturation S is 0 to 1, and the value range of the brightness I is 0 to 255.
Wherein the parameters in the Lab color space are luminance L, color component a representing one color component from green to magenta, and color component b representing one color component from blue to yellow, respectively; wherein, the value range of the brightness L is 0 to 100, the value range of the color component a is-128 to 127, and the value range of the color component b is-128 to 127. In the Lab color space, the luminance L channel encodes only luminance and the color component a and b channels encode color information independently of color information.
In this embodiment, after the electronic device acquires the target image through the image acquisition module, the electronic device may determine, based on the target image, a first color parameter value of each pixel of the target image in a target color space different from an RGB color space. In practical applications, the RGB color space is an additive color space that obtains color through linear combination between R, G, B, and the three channels R, G, B correlate through the brightness of the impinging surface.
Step 102, obtaining a color mapping table of a target color space.
In the embodiment of the present application, the color mapping table is used to quickly obtain an output color parameter value corresponding to an input first color parameter value in a target color space.
In this embodiment, the color mapping table of the target color space may be a mapping table that is created in advance by the electronic device and stored in the electronic device, and the electronic device further invokes the color mapping table of the target color space after obtaining the first color parameter value of each pixel of the target image in the target color space.
In practical applications, the color mapping tables corresponding to different target color spaces are different. For example, a YUV color space is used as a target color space, each color parameter value in the YUV color space has a uniquely corresponding mapped color parameter value in a color mapping table of the YUV color space, for example, a YUV color parameter value (iY, iU, iV) is used as an input, and an output color parameter value (oY, oU, oV) uniquely corresponding to the input color parameter value is obtained after the color mapping table is searched. Here, by searching the color mapping table of the target color space, the output color parameter value corresponding to the input color parameter value can be quickly determined.
And 103, performing color mapping on the first color parameter value of each pixel based on a color mapping table of the target color space to obtain a second color parameter value of each pixel.
In the embodiment of the application, after the electronic device obtains the color mapping table of the target color space, the electronic device searches the color mapping table for the second color parameter value of each pixel corresponding to the first color parameter value of each pixel of the target image, so as to quickly realize the conversion between the initial color parameter value of the target color space and the final color parameter value of the target color space.
In the embodiment of the application, in different application scenarios, for a target image, first color parameter values of all pixels of the target image before color mapping are at least partially different from second color parameter values of all pixels of the target image after color mapping; that is, as an example, before and after the color mapping, the color parameter values of the first part of pixels of the target image are changed, and the color parameter values of the second part of pixels of the target image except the first part of pixels are not changed; as another example, the color parameter values for all pixels of the target image have changed before and after the color mapping.
According to the image processing method provided by the embodiment of the application, a first color parameter value of each pixel of a target image in a target color space is obtained; the target color space is different from the RGB color space; obtaining a color mapping table of a target color space; obviously, the electronic device obtains a color mapping table of the same color space; then, based on the color mapping table of the target color space, performing color mapping on the first color parameter value of each pixel to obtain a second color parameter value of each pixel, that is, based on the color mapping table of the same target color space, the first color parameter value of each pixel is taken as input, and the second color parameter value of each pixel in the target color space can be output; therefore, the problems of large operation amount, long processing time and system power consumption waste in a processing mode of converting the initial color parameter value of the target color space into the final color parameter value of the target color space are solved, the image processing efficiency is improved, and the intelligent degree of the electronic equipment is further improved.
An embodiment of the present application provides an image processing method, which is applied to an electronic device, and as shown in fig. 2, the method includes the following steps:
step 201, obtaining a video stream.
The format of the video stream is a color coding format corresponding to the target color space.
Here, the video stream includes multimedia data that is continuously transmitted, such as a video stream including a plurality of frames of target images.
In this embodiment, the electronic device may acquire the video stream through the image acquisition module, where a format of the video stream is a color coding format corresponding to the target color space. Exemplarily, the video stream acquired by the electronic device through the image acquisition device is in a YUV format, and when a multi-frame image in the video stream is processed in real time, the YUV color coding format of each pixel in the multi-frame image is converted to obtain the processed YUV color coding format.
Step 202, extracting multiple frames of target images from the video stream.
In the embodiment of the application, after the electronic equipment acquires the video stream through the image acquisition device, the electronic equipment can extract multi-frame images in the video stream, wherein the multi-frame images comprise multi-frame target images to be processed. It is to be understood that the multi-frame target image may be a partial image or an entire image of the multi-frame image. It should be noted that, the more the number of the multi-frame target images extracted from the video stream by the electronic device, the more the image processing method provided by the embodiment of the present application converts the initial color parameter value of the target color space into the final color parameter value of the target color space, and compared with the related art that converts the initial color parameter value of the target color space into the final color parameter value of the target color space, the higher the conversion effect is improved, the less the power consumption loss is, the smoother the user viewing experience is, and the better the viewing effect is.
Step 203, obtaining a first color parameter value of each pixel of the target image in the target color space.
Wherein the target color space is different from the RGB color space.
Step 204, obtaining a color mapping table of the target color space.
In this embodiment, the obtaining the color mapping table of the target color space in step 204 may include the following steps:
step 204a, obtaining a color mapping table of the RGB color space.
In the embodiment of the application, the color mapping table of the RGB color space may be pre-stored in the electronic device, and then the electronic device may directly call the color mapping table of the RGB color space. Of course, the electronic device may also obtain a color map of the RGB color space from other devices.
In practical applications, the RGB color space includes all colors that can be perceived by human vision, and is a color space describing standard colors in the industry; the parameters in the RGB color space are red R, green G and blue B, respectively; wherein, the value range of red R is 0-255, the value range of green G is 0-255 and the value range of blue B is 0-255.
In practical applications, in the color mapping table of the RGB color space, each color parameter value in the RGB color space has a uniquely corresponding mapped color parameter value in the color mapping table, for example, the RGB color parameter value (iR, iG, iB) is used as an input, and an output color parameter value (oR, oG, oB) uniquely corresponding to the input color parameter value is obtained after the color mapping table is searched. Here, by looking up the color mapping table of the RGB color space, the output color parameter value corresponding to the input color parameter value can be quickly determined.
And step 204b, obtaining a preset color parameter value of the target color space.
The preset color parameter value of the target color space comprises a first color parameter value of each pixel.
In the embodiment of the present application, the preset color parameter values cover all color parameter values in the target color space.
In practical applications, for example, the YUV color space is used as the target color space, the preset color parameter values in the YUV color space are (iY, iU, iV), and the values range from (0 to 255 ), i.e., (0, 0), (0, 1), (0, 2) \ 8230 \ 8230: (255, 255, 254), (255, 255, 255), and 256 × 256=16777216 combinations are used in total.
And 204c, inputting the preset color parameter value into the first parameter conversion model to obtain a third color parameter value of the RGB color space.
In the embodiment of the present application, for the first parametric conversion model, the color parameter values in the target color space are input, and the color parameter values in the RGB color space are output.
In the embodiment of the application, the electronic device inputs the preset color parameter value of the target color space into the first parameter conversion model to obtain the third color parameter value of the RGB color space having an association relationship with the target color space.
And 204d, performing color mapping on the third color parameter value of the RGB color space based on the RGB color mapping table to obtain a fourth color parameter value of the RGB color space.
Here, the fourth color parameter value represents a value associated with the third color parameter value.
In the embodiment of the application, the electronic device inputs the preset color parameter value into the first parameter conversion model to obtain a third color parameter value of the RGB color space, and then searches a fourth color parameter value having a color mapping relationship with the third color parameter in a color mapping table of the RGB color space.
And step 204e, inputting the fourth color parameter value of the RGB color space into the second parameter conversion model to obtain the target color parameter value of the target color space.
Wherein the target color parameter value of the target color space comprises a second color parameter value of each pixel.
In the embodiment of the present application, for the second parametric conversion model, the input is a color parameter value in an RGB color space, and the output is a color parameter value in a target color space.
In the embodiment of the application, the electronic device inputs the fourth color parameter value of the RGB color space into the second parameter conversion model to obtain the target color parameter value of the target color space.
And step 204f, generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
In the embodiment of the application, the electronic device generates a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space. Here, since the preset color parameter values cover all color parameter values in the target color space, the color mapping table of the target color space covers the target color parameter values corresponding to all the preset color parameter values.
Step 205, performing color mapping on the first color parameter value of each pixel based on the color mapping table of the target color space to obtain a second color parameter value of each pixel.
It should be noted that, in the image processing method provided in the embodiment of the present application, in the process of converting the initial color parameter value of the target color space into the final color parameter value of the target color space, only one conversion is performed based on the color mapping table of the target color space, and this kind of technical means of fast conversion improves the conversion efficiency especially obviously in the process of processing a plurality of pixels of a multi-frame image of a video stream, and compared with the scheme of multiple conversions in the related art, the image processing efficiency is obviously improved, the consumption of power consumption of an electronic device is reduced, the display effect of the electronic device is improved, and the viewing experience of a user is improved.
It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the description in the other embodiments, which is not repeated herein.
An embodiment of the present application provides an image processing method, which is shown in fig. 3 and includes the following steps:
step 301, the electronic device establishes a color mapping table YUV _ LUT in which the target color space is a YUV color space.
In this embodiment of the present application, step 301 establishes a color mapping table YUV _ LUT with a YUV color space as a target color space, and the specific implementation steps are as follows:
step 301a, the electronic device obtains a preset color parameter value IN _ YUV of the YUV color space.
Wherein the predetermined color parameter value IN _ YUV of the YUV color space comprises a first color parameter value (iY, iU, iV) of each pixel.
Here, the parameters in the YUV color space are brightness Y, hue U, and saturation V, respectively; wherein the brightness Y is in the range of 0-255, the hue U is in the range of 0-255, and the saturation V is in the range of 0-255. All combinations of YUV components in YUV color space share 256 × 256=16777216 ways.
Step 301b, the electronic device inputs the preset color parameter value IN _ YUV into the first parameter conversion model to obtain a third color parameter value IN _ RGB of the RGB color space.
The first parameter conversion model is a formula for converting a color coding format corresponding to a YUV color space into a color coding format corresponding to an RGB color space, and each combination (iR, iG, iB) of RGB components in the RGB color space is obtained.
Wherein, the color coding format corresponding to the YUV color space is converted into the color coding format corresponding to the RGB color space, and the corresponding formula is as follows:
R=Y+1.370705×(U-128)
G=Y-0.337633×(U-128)-0.698001×(V-128)
B=Y+1.732446×(U-128)
step 301c, the electronic device performs color mapping on the third color parameter value IN _ RGB of the RGB color space based on the RGB color mapping table RGB _ LUT to obtain a fourth color parameter value OUT _ RGB of the RGB color space.
Step 301d, the electronic device inputs the fourth color parameter value OUT _ RGB in the RGB color space into the second parameter conversion model to obtain a target color parameter value OUT _ YUV in the YUV color space; the target color parameter value OUT YUV of the YUV color space comprises the second color parameter value (oY, oU, oV) of each pixel.
The second parameter conversion model is a formula for converting a color coding format corresponding to the RGB color space into a color coding format corresponding to the YUV color space, and a target color parameter value OUT _ YUV in the YUV color space is obtained.
Wherein, the color coding format corresponding to the RGB color space is converted into the color coding format corresponding to the YUV color space, and the corresponding formula is as follows:
Y=0.298822R+0.586815G+0.114363B
U=0.298822R+0.586815G+0.511206B+128
V=0.511545R-0.428112G-0.083434B+128
step 301e, the electronic device generates a color mapping table YUV _ LUT IN the YUV color space based on a preset color parameter value IN _ YUV IN the YUV color space and a target color parameter value OUT _ YUV IN the YUV color space.
Step 302, the electronic device obtains a video stream, extracts a plurality of frames of target images from the video stream, and further obtains first color parameter values (iY, iU, iV) of each pixel of the target images in the YUV color space.
Here, the first color parameter value (iY, iU, iV) represents a color parameter value of any one of the pixels of the target image in the YUV color space.
The format of the video stream is a color coding format corresponding to the YUV color space of the target color space.
Step 303, the electronic device performs color mapping on the first color parameter value (iY, iU, iV) of each pixel based on a color mapping table YUV _ LUT in the YUV color space to obtain a second color parameter value (oY, oU, oV) of each pixel.
Therefore, the image processing method provided by the embodiment of the application generates the color mapping table YUV _ LUT converted from the YUV color coding format to the YUV color coding format in the YUV color space by taking the RGB color mapping table RGB _ LUT as an intermediary in advance, directly searches the YUV color mapping table YUV _ LUT during color mapping, omits two times of color space conversion in the middle of real-time color mapping of an image, and particularly has an obvious advantage when processing video stream data, solves the problems of large operation amount, long processing time and system power consumption waste of a processing mode of converting an initial color parameter value of a target color space into a final color parameter value of the target color space, improves the image processing efficiency, and further improves the intelligent degree of electronic equipment.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
An embodiment of the present application provides an image processing apparatus, which can be applied to an image processing method provided in an embodiment corresponding to fig. 1 to 2, and as shown in fig. 4, the image processing apparatus 4 includes:
an obtaining unit 41, configured to obtain a first color parameter value of each pixel of the target image in the target color space; the target color space is different from the RGB color space;
a processing unit 42 for obtaining a color mapping table of a target color space;
the determining unit 43 is configured to perform color mapping on the first color parameter value of each pixel based on the color mapping table of the target color space, so as to obtain a second color parameter value of each pixel.
In other embodiments of the present application, the obtaining unit 41 is further configured to obtain a video stream; the format of the video stream is a color coding format corresponding to the target color space; extracting a plurality of frames of target images from the video stream.
In other embodiments of the present application, the obtaining unit 41 is further configured to obtain a color mapping table of an RGB color space; the processing unit 42 is further configured to generate a color mapping table of the target color space based on the color mapping table of the RGB color space.
In other embodiments of the present application, the obtaining unit 41 is further configured to obtain a preset color parameter value of the target color space; the processing unit 42 is further configured to determine a preset color parameter value of the target color space includes a first color parameter value of each pixel; and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the color mapping table of the RGB color space.
In other embodiments of the present application, the processing unit 42 is further configured to input a preset color parameter value into the first parameter conversion model to obtain a third color parameter value of the RGB color space; based on the RGB color mapping table, performing color mapping on the third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space; inputting the fourth color parameter value of the RGB color space into the second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel; and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the description in the other embodiments, which is not repeated herein.
Based on the foregoing embodiments, an embodiment of the present application provides an electronic device, which can be applied to an image processing method provided in the embodiment corresponding to fig. 1-2, and as shown in fig. 5, the electronic device 5 (the electronic device 5 in fig. 5 corresponds to the image processing apparatus 4 in fig. 4) includes: a processor 51, a memory 52, and a communication bus 53, wherein:
the communication bus 53 is used for realizing communication connection between the processor 51 and the memory 52;
the processor 51 is configured to execute an image processing program stored in the memory 52 to implement the steps of:
obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space;
obtaining a color mapping table of a target color space;
and performing color mapping on the first color parameter value of each pixel based on a color mapping table of the target color space to obtain a second color parameter value of each pixel.
In other embodiments of the present application, the processor 51 is configured to execute an image processing program stored in the memory 52 to implement the following steps:
obtaining a video stream; the format of the video stream is a color coding format corresponding to the target color space;
extracting a plurality of frames of target images from the video stream.
In other embodiments of the present application, the processor 51 is configured to execute an image processing program stored in the memory 52 to implement the following steps:
obtaining a color mapping table of an RGB color space;
based on the color mapping table for the RGB color space, a color mapping table for the target color space is generated.
In other embodiments of the present application, the processor 51 is configured to execute an image processing program stored in the memory 52 to implement the following steps:
obtaining a preset color parameter value of a target color space; the preset color parameter values of the target color space comprise first color parameter values of all pixels;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the color mapping table of the RGB color space.
In other embodiments of the present application, the processor 51 is configured to execute an image processing program stored in the memory 52 to implement the following steps:
inputting the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of an RGB color space;
based on the RGB color mapping table, performing color mapping on the third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space;
inputting a fourth color parameter value of the RGB color space into the second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter values of the target color space include second color parameter values of the pixels;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the description in the other embodiments, which is not repeated herein.
Based on the foregoing embodiments, embodiments of the present application provide a computer storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space;
obtaining a color mapping table of a target color space;
and performing color mapping on the first color parameter value of each pixel based on a color mapping table of the target color space to obtain a second color parameter value of each pixel.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
obtaining a video stream; the format of the video stream is a color coding format corresponding to the target color space;
extracting a plurality of frames of target images from the video stream.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
obtaining a color mapping table of an RGB color space;
based on the color mapping table for the RGB color space, a color mapping table for the target color space is generated.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
obtaining a preset color parameter value of a target color space; the preset color parameter values of the target color space comprise first color parameter values of all pixels;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the color mapping table of the RGB color space.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
inputting the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of an RGB color space;
based on the RGB color mapping table, performing color mapping on the third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space;
inputting the fourth color parameter value of the RGB color space into the second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the description in the other embodiments, which is not repeated herein.
The computer storage medium/Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM), and the like; but may also be various terminals such as mobile phones, computers, tablet devices, personal digital assistants, etc., that include one or any combination of the above-mentioned memories.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing module, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit. Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as a removable Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to arrive at new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. An image processing method, characterized in that the method comprises:
obtaining first color parameter values of partial pixels in a target color space in all pixels of a target image; the target color space is different from the RGB color space, and the partial pixels are associated with a corresponding scene when the target image is shot;
obtaining a color mapping table of the target color space;
performing color mapping on the first color parameter values of the partial pixels based on a color mapping table of the target color space to obtain second color parameter values of the partial pixels;
wherein the obtaining the color mapping table of the target color space comprises:
obtaining a color mapping table of the RGB color space;
obtaining a preset color parameter value of the target color space; the preset color parameter values of the target color space comprise first color parameter values of the pixels;
inputting the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of the RGB color space;
based on the color mapping table of the RGB color space, performing color mapping on a third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space;
inputting a fourth color parameter value of the RGB color space into a second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
2. The method of claim 1, wherein each pixel of the obtained target image precedes the first color parameter value of the target color space, the method further comprising:
obtaining a video stream; the format of the video stream is a color coding format corresponding to the target color space;
extracting a plurality of frames of the target image from the video stream.
3. An image processing apparatus, characterized in that the apparatus comprises:
the device comprises an obtaining unit, a calculating unit and a processing unit, wherein the obtaining unit is used for obtaining first color parameter values of partial pixels in a target color space in all pixels of a target image; the target color space is different from the RGB color space, and the partial pixels are associated with corresponding scenes when the target image is shot;
a processing unit for obtaining a color mapping table of the target color space;
a determining unit, configured to perform color mapping on the first color parameter values of the partial pixels based on a color mapping table of the target color space to obtain second color parameter values of the partial pixels;
the obtaining unit is further configured to obtain a color mapping table of the RGB color space; obtaining a preset color parameter value of the target color space; the preset color parameter values of the target color space comprise first color parameter values of the pixels;
the processing unit is further configured to input the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of the RGB color space; based on the color mapping table of the RGB color space, performing color mapping on a third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space; inputting a fourth color parameter value of the RGB color space into a second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel; and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
4. An electronic device, characterized in that the electronic device comprises: a processor, a memory, and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute an image processing program stored in the memory to implement the steps of:
obtaining a first color parameter value of each pixel of a target image in a target color space; the target color space is different from the RGB color space;
obtaining a color mapping table of the target color space;
performing color mapping on the first color parameter value of each pixel based on a color mapping table of the target color space to obtain a second color parameter value of each pixel;
wherein the obtaining a color mapping table of the target color space comprises:
obtaining a color mapping table of the RGB color space;
obtaining a preset color parameter value of the target color space; the preset color parameter values of the target color space comprise first color parameter values of the pixels;
inputting the preset color parameter value into a first parameter conversion model to obtain a third color parameter value of the RGB color space;
based on the color mapping table of the RGB color space, performing color mapping on the third color parameter value of the RGB color space to obtain a fourth color parameter value of the RGB color space;
inputting the fourth color parameter value of the RGB color space into a second parameter conversion model to obtain a target color parameter value of the target color space; the target color parameter value of the target color space comprises a second color parameter value of each pixel;
and generating a color mapping table of the target color space based on the preset color parameter value of the target color space and the target color parameter value of the target color space.
5. The electronic device of claim 4, wherein the processor is configured to execute an image processing program stored in the memory to perform the steps of:
obtaining a video stream; the format of the video stream is a color coding format corresponding to the target color space;
extracting a plurality of frames of the target image from the video stream.
6. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the image processing method according to any one of claims 1 to 2.
CN201911241574.7A 2019-12-06 2019-12-06 Image processing method, image processing device, electronic equipment and storage medium Active CN111107336B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911241574.7A CN111107336B (en) 2019-12-06 2019-12-06 Image processing method, image processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911241574.7A CN111107336B (en) 2019-12-06 2019-12-06 Image processing method, image processing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111107336A CN111107336A (en) 2020-05-05
CN111107336B true CN111107336B (en) 2023-04-07

Family

ID=70421757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911241574.7A Active CN111107336B (en) 2019-12-06 2019-12-06 Image processing method, image processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111107336B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114067739B (en) * 2020-07-31 2024-02-06 北京小米移动软件有限公司 Color gamut mapping method and device, electronic equipment and storage medium
CN115063325A (en) * 2022-08-17 2022-09-16 中央广播电视总台 Video signal processing method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046670A (en) * 2015-08-28 2015-11-11 中国科学院深圳先进技术研究院 Image rain removal method and system
WO2018175337A1 (en) * 2017-03-20 2018-09-27 Dolby Laboratories Licensing Corporation Perceptually preserving scene-referred contrasts and chromaticities

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001036762A (en) * 1999-07-22 2001-02-09 Fuji Photo Film Co Ltd Device and method for preparing color correction definition
US20050123193A1 (en) * 2003-12-05 2005-06-09 Nokia Corporation Image adjustment with tone rendering curve
CN1704891A (en) * 2004-05-31 2005-12-07 蒋国华 Computer color handling method and use thereof
US8860745B2 (en) * 2009-06-01 2014-10-14 Stmicroelectronics, Inc. System and method for color gamut mapping
CN109416830A (en) * 2016-07-08 2019-03-01 深圳市大疆创新科技有限公司 System and method for image procossing
CN108200420B (en) * 2018-01-16 2020-05-19 奇酷互联网络科技(深圳)有限公司 Image adjusting method and device, readable storage medium and terminal
CN108401147A (en) * 2018-03-21 2018-08-14 焦作大学 A kind of image color antidote and electronic equipment
CN109474809B (en) * 2018-11-07 2021-06-11 深圳六滴科技有限公司 Chromatic aberration correction method, device and system, panoramic camera and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046670A (en) * 2015-08-28 2015-11-11 中国科学院深圳先进技术研究院 Image rain removal method and system
WO2018175337A1 (en) * 2017-03-20 2018-09-27 Dolby Laboratories Licensing Corporation Perceptually preserving scene-referred contrasts and chromaticities

Also Published As

Publication number Publication date
CN111107336A (en) 2020-05-05

Similar Documents

Publication Publication Date Title
US9472162B2 (en) Method of mapping source colors from a source color gamut into a target color gamut
CN111147857B (en) Image processing method, image processing device, electronic equipment and storage medium
WO2017008377A1 (en) Image processing method and terminal
EP3087725B1 (en) Method of mapping source colors of images of a video content into the target color gamut of a target color device
RU2012125614A (en) IMAGE PROCESSING DEVICE AND IMAGE PROCESSING METHOD
AU2016212243A1 (en) A method and apparatus of encoding and decoding a color picture
KR20170115500A (en) Method and device for decoding a color picture
CN111107336B (en) Image processing method, image processing device, electronic equipment and storage medium
CN107465939B (en) Method and device for processing video image data stream
CN113132696B (en) Image tone mapping method, image tone mapping device, electronic equipment and storage medium
KR20170115503A (en) Apparatus and method for reverse-ton mapping images
CN112200747B (en) Image processing method and device and computer readable storage medium
WO2024027287A1 (en) Image processing system and method, and computer-readable medium and electronic device
CN106408617B (en) Interactive single image material obtaining system and method based on YUV color space
KR20170124554A (en) Adaptive color grade interpolation method and device
CN112309312A (en) Image display method and device, receiving card, sending card and LED display system
WO2021179142A1 (en) Image processing method and related apparatus
CN105321153A (en) Video monitor low-illumination image color restoration method and device
US10341531B2 (en) Applying a perceptually uniform color space for image processing
JP2018507618A (en) Method and apparatus for encoding and decoding color pictures
US20230061966A1 (en) Image processing
CN117408872B (en) Color image data conversion method, device, equipment and storage medium
US10887567B2 (en) Camera color image processing
CN107197287A (en) A kind of video recorded broadcast method and apparatus based on arm processors
CN115063325A (en) Video signal processing method and device, computer equipment and storage medium

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