CN112907459B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN112907459B
CN112907459B CN202110099368.8A CN202110099368A CN112907459B CN 112907459 B CN112907459 B CN 112907459B CN 202110099368 A CN202110099368 A CN 202110099368A CN 112907459 B CN112907459 B CN 112907459B
Authority
CN
China
Prior art keywords
tone
data
image
mapping table
offset
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
CN202110099368.8A
Other languages
Chinese (zh)
Other versions
CN112907459A (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110099368.8A priority Critical patent/CN112907459B/en
Publication of CN112907459A publication Critical patent/CN112907459A/en
Application granted granted Critical
Publication of CN112907459B publication Critical patent/CN112907459B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

An image processing method and apparatus are provided. The image processing method comprises the following steps: in response to receiving the hue offset value, obtaining an initial hue mapping table of the image in a hue saturation value, HSV, color space, wherein the initial hue mapping table reflects hue data of the image when the image is not hue-offset; establishing a tone offset mapping table based on the tone offset value and an initial tone mapping table, wherein the tone offset mapping table reflects tone data of an image subjected to tone offset; mapping tone data of the image based on a tone offset mapping table in an HSV color space to obtain an HSV image with tone offset; the hue-shifted HSV image is converted to an RGB color space to obtain a hue-shifted image. According to the image processing method and device, the whole tone shifting function of the single-frame picture can be efficiently completed.

Description

Image processing method and device
Technical Field
The present disclosure relates to the field of video technology. More particularly, the present disclosure relates to an image processing method and apparatus.
Background
In the related art, color gradation is performed on all areas in a picture or video, and the colors are cyclically reciprocated and monotonously cyclically different. In addition, when the picture is occupied, only all human body areas in the image can be protected, so that the color of the whole human body area is kept unchanged, and only other scenes in the picture are subjected to the color change, so that the special effect of the image or the video is poor.
Disclosure of Invention
An exemplary embodiment of the present disclosure is directed to an image processing method and apparatus, which at least solve the problems of image processing in the related art, but may not solve any of the above problems.
According to an exemplary embodiment of the present disclosure, there is provided an image processing method including: in response to receiving the hue offset value, obtaining an initial hue mapping table of the image in a hue saturation value, HSV, color space, wherein the initial hue mapping table reflects hue data of the image when the image is not hue-offset; establishing a tone offset mapping table based on the tone offset value and an initial tone mapping table, wherein the tone offset mapping table reflects tone data of an image subjected to tone offset; mapping tone data of the image based on a tone offset mapping table in an HSV color space to obtain an HSV image with tone offset; the hue-shifted HSV image is converted to an RGB color space to obtain a hue-shifted image.
Optionally, before receiving the tone offset value, the image processing method may further include: acquiring HSV color space data of an image, wherein the HSV color space data comprises tone data; an initial tone mapping table is established for tone data in the HSV color space data of the image.
Optionally, the step of creating the tone offset map based on the tone offset value and the initial tone map may include: dividing the initial tone mapping table into a first part and a second part based on the position of the tone offset value in the initial tone mapping table, and respectively offsetting the data of the first part and the data of the second part to obtain a tone offset mapping table.
Optionally, the step of shifting the data of the first portion and the data of the second portion, respectively, may include: and exchanging the data of the first part and the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
Optionally, the step of mapping the tone data of the image based on the tone offset mapping table may include: the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
Optionally, after converting the hue-shifted HSV image into the RGB color space, the image processing method may further include: detecting a preset part in the image; the color of the image before the image processing is maintained unchanged by a preset part in the image converted into the RGB color space, and the color of the image before the image processing is maintained unchanged by the preset part is taken as a tone offset image.
Optionally, the step of creating the tone offset map based on the tone offset value and the initial tone map may include: detecting a preset part in the image; dividing an initial tone map into a first portion and a second portion based on the position of the tone offset value in the initial tone map; and under the condition that the part corresponding to the preset part in the initial tone mapping table is kept unchanged, respectively shifting the data of the first part and the data of the second part to obtain a tone shift mapping table.
Optionally, in the case that a portion corresponding to the preset portion in the initial tone mapping table is maintained unchanged, the step of shifting the data of the first portion and the data of the second portion respectively may include: and exchanging the data which do not belong to the preset part in the data of the first part and the data which do not belong to the preset part in the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
Alternatively, the preset portion may comprise a skin portion.
According to an exemplary embodiment of the present disclosure, there is provided an image processing apparatus including: an initial mapping table acquisition unit configured to acquire an initial tone mapping table of an image in a tone saturation value HSV color space in response to receiving a tone offset value, wherein the initial tone mapping table reflects tone data when the image is not tone-offset; a data shift unit configured to establish a tone shift map based on a tone shift value and an initial tone map, wherein the tone shift map reflects tone data of an image subjected to tone shift; a tone mapping unit configured to map tone data of an image based on a tone shift mapping table in an HSV color space, obtaining a tone shifted HSV image; and a space conversion unit configured to convert the hue-shifted HSV image into an RGB color space to obtain a hue-shifted image.
Optionally, the image processing apparatus may further include an initial mapping table establishing unit configured to: acquiring HSV color space data of an image, wherein the HSV color space data comprises tone data; an initial tone mapping table is established for tone data in the HSV color space data of the image.
Alternatively, the data offset unit may be configured to: dividing the initial tone mapping table into a first part and a second part based on the position of the tone offset value in the initial tone mapping table, and respectively offsetting the data of the first part and the data of the second part to obtain a tone offset mapping table.
Alternatively, the data offset unit may be configured to: and exchanging the data of the first part and the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
Alternatively, the tone mapping unit may be configured to: the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
Optionally, the image processing apparatus may further include: a region detection unit configured to detect a preset portion in an image; and a color maintaining unit configured to maintain a preset portion of the image converted into the RGB color space as a color-shift image, the color of the image being unchanged before the image processing.
Alternatively, the data offset unit may include: a region detection unit configured to detect a preset portion in an image; a mapping table dividing unit configured to divide the initial tone mapping table into a first part and a second part based on a position of the tone offset value in the initial tone mapping table; and the data part shifting unit is configured to shift the data of the first part and the data of the second part respectively under the condition of maintaining the part corresponding to the preset part in the initial tone mapping table unchanged, so as to obtain a tone shift mapping table.
Optionally, the data portion offset unit may be configured to: and exchanging the data which do not belong to the preset part in the data of the first part and the data which do not belong to the preset part in the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
Alternatively, the preset portion may comprise a skin portion.
According to an exemplary embodiment of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement an image processing method according to an exemplary embodiment of the present disclosure.
According to an exemplary embodiment of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of an electronic device, causes the electronic device to perform an image processing method according to an exemplary embodiment of the present disclosure.
According to an exemplary embodiment of the present disclosure, a computer program product is provided, comprising a computer program/instruction which, when executed by a processor, implements an image processing method according to an exemplary embodiment of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the efficiency of the whole tone offset of the single frame picture is improved;
the flexible variability of hue shift is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 illustrates a flowchart of an image processing method according to an exemplary embodiment of the present disclosure.
Fig. 2 shows a schematic diagram of exchanging data of a first portion and data of a second portion according to an exemplary embodiment of the present disclosure.
Fig. 3 illustrates a flowchart of an image processing method according to another exemplary embodiment of the present disclosure.
Fig. 4 illustrates a flowchart of an image processing method according to another exemplary embodiment of the present disclosure.
Fig. 5 illustrates a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure.
Fig. 6 illustrates a block diagram of an image processing apparatus according to another exemplary embodiment of the present disclosure.
Fig. 7 illustrates a block diagram of an image processing apparatus according to another exemplary embodiment of the present disclosure.
Fig. 8 is a block diagram of an electronic device 800 according to an exemplary embodiment of the present disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The embodiments described in the examples below are not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, in this disclosure, "at least one of the items" refers to a case where three types of juxtaposition including "any one of the items", "a combination of any of the items", "an entirety of the items" are included. For example, "including at least one of a and B" includes three cases side by side as follows: (1) comprises A; (2) comprising B; (3) includes A and B. For example, "at least one of the first and second steps is executed", that is, three cases are juxtaposed as follows: (1) performing step one; (2) executing the second step; (3) executing the first step and the second step.
Hereinafter, an image processing method and apparatus according to an exemplary embodiment of the present disclosure will be described in detail with reference to fig. 1 to 8.
Fig. 1 illustrates a flowchart of an image processing method according to an exemplary embodiment of the present disclosure. Here, the image may be, for example, but not limited to, a picture and a video. And if the processing object is the video, extracting a single frame picture in the video, and processing the video frame by frame.
Referring to fig. 1, in step S101, an initial tone mapping table of an image in a tone saturation value HSV color space is acquired in response to receiving a tone offset value. Here, the initial tone map table reflects tone data when the image is not tone-shifted. The hue-shift value may be entered by a user, representing the hue value to be shifted.
In exemplary embodiments of the present disclosure, prior to receiving the hue offset value, the HSV color space data of the image may also be first acquired, and then an initial hue mapping table is established for the hue data in the HSV color space data of the image, thereby optimizing the calculation of the hue data. Here, the HSV color space data may include tone data. Further, the HSV color space data may also include saturation data and brightness data of the image.
Specifically, for a frame of picture I in the processing object, the picture may first be turned into the HSV color space, denoted as i= { p ij } i=1...h,j=1...w Here, the number of the first and second electrodes, here,p ij recording a pixel point in the HSV space picture, wherein h represents a Hue (Hue) value, and 0<=h<=180; s represents a Saturation (Saturation) value, 0<=s<=255, v represents a Value of 0<=v<=255。
The initial tone mapping table is only for Hue space (i.e., tone space) in the picture, i.e., H in HSV. In one example, when establishing the initial tone mapping table, a one-dimensional array of length 181 may be first established, noted asThen initializing the initial values of the array in turnIndex for its own index value, i.e. m index]=index, and the initial tone mapping table is formed by the array and the index value. Here, index represents the h value in the original picture, m [ index ]]Represented by m index]The value replaces the h value; therefore, the initial tone mapping table does not make any offset to the H space. Table 1 shows an example of an initial tone mapping table.
TABLE 1
In step S102, a tone offset map is created based on the tone offset value and the initial tone map. Here, the tone shift map reflects tone data after the image is tone shifted.
In an exemplary embodiment of the present disclosure, when the tone offset mapping table is established, the initial tone mapping table may be divided into a first portion and a second portion based on a position of a tone offset value in the initial tone mapping table, and data of the first portion and data of the second portion are respectively offset, thereby obtaining the tone offset mapping table.
In the exemplary embodiment of the disclosure, when the data of the first portion and the data of the second portion are respectively shifted, the data of the first portion and the data of the second portion may be exchanged, and the exchanged tone mapping table is used as a tone shift mapping table, so that the efficiency and the effect of tone shift are improved.
Fig. 2 shows a schematic diagram of exchanging data of a first portion and data of a second portion according to an exemplary embodiment of the present disclosure. In FIG. 2, the hue shift value is H,0<=H<=181。Representing a tone offset map.
As shown in FIG. 2, values indexed H through 181 in m are swapped toIn fragments with indices 0 to 181-H-1, then the values of indices 0 to H-1 in m are adjusted to +.>In segments indexed 181-H through 181.
In step S103, tone data of the image is mapped in the HSV color space based on the tone offset mapping table, and an HSV image of tone offset is obtained.
In the exemplary embodiments of the present disclosure, when mapping the tone data of an image based on a tone offset mapping table, the tone data of the image may be modified to tone data after tone offset based on an index value in the tone offset mapping table, thereby improving efficiency and effect of tone offset.
For example, according to a tone-shift mapping tableMapping Hue space (i.e. tone space) of original image I to obtain tone shifted HSV image +.>Namely: />p ij [1],p ij ,/>
In step S104, the hue-shifted HSV image is converted into an RGB color space, obtaining a hue-shifted image.
In an exemplary embodiment of the present disclosure, for one picture, different hue shift results may be provided given different hue shift values H.
Fig. 3 illustrates a flowchart of an image processing method according to another exemplary embodiment of the present disclosure. Here, the image may be, for example, but not limited to, a picture and a video. And if the processing object is the video, extracting a single frame picture in the video, and processing the video frame by frame.
Referring to fig. 3, in step S301, an initial tone mapping table of an image in a tone saturation value HSV color space is acquired in response to receiving a tone offset value. Here, the initial tone map table reflects tone data when the image is not tone-shifted. The hue-shift value may be entered by a user, representing the hue value to be shifted.
In exemplary embodiments of the present disclosure, prior to receiving the hue offset value, the HSV color space data of the image may also be first acquired, and then an initial hue mapping table is established for the hue data in the HSV color space data of the image, thereby optimizing the calculation of the hue data. Here, the HSV color space data may include tone data. Further, the HSV color space data may also include saturation data and brightness data of the image.
In step S302, a tone offset map is created based on the tone offset value and the initial tone map. Here, the tone shift map reflects tone data after the image is tone shifted.
In an exemplary embodiment of the present disclosure, when the tone offset mapping table is established, the initial tone mapping table may be divided into a first portion and a second portion based on a position of a tone offset value in the initial tone mapping table, and data of the first portion and data of the second portion are respectively offset, thereby obtaining the tone offset mapping table.
In the exemplary embodiment of the disclosure, when the data of the first portion and the data of the second portion are respectively shifted, the data of the first portion and the data of the second portion may be exchanged, and the exchanged tone mapping table is used as a tone shift mapping table, so that the efficiency and the effect of tone shift are improved.
In step S303, tone data of the image is mapped in the HSV color space based on the tone offset mapping table, and an HSV image of tone offset is obtained.
In the exemplary embodiments of the present disclosure, when mapping the tone data of an image based on a tone offset mapping table, the tone data of the image may be modified to tone data after tone offset based on an index value in the tone offset mapping table, thereby improving efficiency and effect of tone offset.
In step S304, the hue-shifted HSV image is converted into an RGB color space.
In step S305, a preset portion in the image is detected.
In step S306, a preset portion of the image converted into the RGB color space is left unchanged in color before image processing, and an image in which the preset portion is left unchanged in color before image processing is taken as a tone shifted image.
In exemplary embodiments of the present disclosure, the preset portion may include, for example, but is not limited to, a skin portion.
Specifically, after obtaining the hue-shifted HSV image, the HSV image may be first of allConverting to RGB color space, and then performing post-processing; the post-processing is mainly aimed at protecting some special areas, and retaining original pixel values, such as skin color parts of human body, etc. To increase playability, only the skin tone portion may be protected in the presence of a person. As an example, the skin tone portion may be determined by a skin tone detection method. The skin color detection method may be, for example, but not limited to, a skin segmentation method using an elliptical color space, or a skin segmentation algorithm based on deep learning, or the like.
The specific manner in which the steps of the method of the above embodiment are described in detail in relation to the embodiment of fig. 1 will not be explained in detail here.
Fig. 4 illustrates a flowchart of an image processing method according to another exemplary embodiment of the present disclosure. Here, the image may be, for example, but not limited to, a picture and a video. And if the processing object is the video, extracting a single frame picture in the video, and processing the video frame by frame.
Referring to fig. 4, in step S401, an initial tone mapping table of an image in a tone saturation value HSV color space is acquired in response to receiving a tone offset value. Here, the initial tone map table reflects tone data when the image is not tone-shifted. The hue-shift value may be entered by a user, representing the hue value to be shifted.
In exemplary embodiments of the present disclosure, prior to receiving the hue offset value, the HSV color space data of the image may also be first acquired, and then an initial hue mapping table is established for the hue data in the HSV color space data of the image, thereby optimizing the calculation of the hue data. Here, the HSV color space data may include tone data. Further, the HSV color space data may also include saturation data and brightness data of the image.
In step S402, a preset portion in an image is detected.
In exemplary embodiments of the present disclosure, the preset portion may include, for example, but is not limited to, a skin portion.
In step S403, the initial tone mapping table is divided into a first part and a second part based on the position of the tone offset value in the initial tone mapping table.
In step S404, under the condition that the portion corresponding to the preset portion in the initial tone mapping table is maintained unchanged, the data of the first portion and the data of the second portion are respectively shifted, so as to obtain a tone shift mapping table. Here, the tone shift map reflects tone data after the image is tone shifted.
In an exemplary embodiment of the present disclosure, when the data of the first portion and the data of the second portion are respectively shifted while maintaining the portion corresponding to the preset portion in the initial tone mapping table unchanged, the data of the first portion, which does not belong to the preset portion, and the data of the second portion, which does not belong to the preset portion, may be exchanged, and the exchanged tone mapping table is used as a tone shift mapping table, so that efficiency and effect of tone shift are improved.
In step S405, tone data of an image is mapped based on a tone shift mapping table in the HSV color space, and a tone shifted HSV image is obtained.
In the exemplary embodiments of the present disclosure, when mapping the tone data of an image based on a tone offset mapping table, the tone data of the image may be modified to tone data after tone offset based on an index value in the tone offset mapping table, thereby improving efficiency and effect of tone offset.
In step S406, the hue-shifted HSV image is converted into an RGB color space, obtaining a hue-shifted image.
The specific manner in which the steps of the method of the above embodiment are described in detail in relation to the embodiment of fig. 1 will not be explained in detail here.
The image processing method according to the exemplary embodiment of the present disclosure has been described above with reference to fig. 1 to 4. Hereinafter, an image processing apparatus according to an exemplary embodiment of the present disclosure and units thereof will be described with reference to fig. 5 to 7.
Fig. 5 illustrates a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure.
Referring to fig. 5, the image processing apparatus includes an initial map acquisition unit 51, a data shift unit 52, a tone mapping unit 53, and a spatial conversion unit 54.
The initial mapping table obtaining unit 51 is configured to obtain an initial tone mapping table of an image in a tone saturation value HSV color space in response to receiving a tone offset value. Here, the initial tone map table reflects tone data when the image is not tone-shifted.
In an exemplary embodiment of the present disclosure, the image processing apparatus may further include an initial mapping table establishing unit (not shown) configured to: acquiring HSV color space data of an image; an initial tone mapping table is established for tone data in the HSV color space data of the image. Here, the HSV color space data includes tone data.
The data offset unit 52 is configured to build a tone offset map based on the tone offset value and the initial tone map. Here, the tone shift map reflects tone data after the image is tone shifted.
In an exemplary embodiment of the present disclosure, the data offset unit 52 may be configured to: dividing the initial tone mapping table into a first part and a second part based on the position of the tone offset value in the initial tone mapping table, and respectively offsetting the data of the first part and the data of the second part to obtain a tone offset mapping table.
In an exemplary embodiment of the present disclosure, the data offset unit 52 may be configured to: and exchanging the data of the first part and the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
The tone mapping unit 53 is configured to map tone data of an image based on a tone offset mapping table in the HSV color space, obtaining a tone-offset HSV image.
In an exemplary embodiment of the present disclosure, the tone mapping unit 53 may be configured to: the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
The space conversion unit 54 is configured to convert the hue-shifted HSV image into an RGB color space to obtain a hue-shifted image.
Fig. 6 illustrates a block diagram of an image processing apparatus according to another exemplary embodiment of the present disclosure.
Referring to fig. 6, the image processing apparatus includes an initial mapping table acquisition unit 61, a data shift unit 62, a tone mapping unit 63, a spatial conversion unit 64, a region detection unit 65, and a color maintenance unit 66.
The initial mapping table obtaining unit 61 is configured to obtain an initial tone mapping table of an image in a tone saturation value HSV color space in response to receiving a tone offset value. Here, the initial tone map table reflects tone data when the image is not tone-shifted.
In an exemplary embodiment of the present disclosure, the image processing apparatus may further include an initial mapping table establishing unit (not shown) configured to: acquiring HSV color space data of an image; an initial tone mapping table is established for tone data in the HSV color space data of the image. Here, the HSV color space data includes tone data.
The data offset unit 62 is configured to build a tone offset map based on the tone offset value and the initial tone map. Here, the tone shift map reflects tone data after the image is tone shifted.
In an exemplary embodiment of the present disclosure, the data offset unit 62 may be configured to: dividing the initial tone mapping table into a first part and a second part based on the position of the tone offset value in the initial tone mapping table, and respectively offsetting the data of the first part and the data of the second part to obtain a tone offset mapping table.
In an exemplary embodiment of the present disclosure, the data offset unit 62 may be configured to: and exchanging the data of the first part and the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
The tone mapping unit 63 is configured to map tone data of an image based on a tone offset mapping table in the HSV color space, obtaining a tone-offset HSV image.
In an exemplary embodiment of the present disclosure, the tone mapping unit 63 may be configured to: the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
The space conversion unit 64 is configured to convert the hue-shifted HSV image into an RGB color space to obtain a hue-shifted image.
The area detection unit 65 is configured to detect a preset portion in an image.
The color maintaining unit 66 is configured to maintain a preset portion of the image converted into the RGB color space, which is unchanged in color before image processing, as a tone shifted image.
In exemplary embodiments of the present disclosure, the preset portion may include, for example, but is not limited to, a skin portion.
Fig. 7 illustrates a block diagram of an image processing apparatus according to another exemplary embodiment of the present disclosure.
Referring to fig. 7, the image processing apparatus includes an initial map acquisition unit 71, a region detection unit 72, a map dividing unit 73, a data portion offset unit 74, a tone mapping unit 75, and a spatial conversion unit 76.
The initial mapping table obtaining unit 71 is configured to obtain an initial tone mapping table of an image in a tone saturation value HSV color space in response to receiving a tone offset value. Here, the initial tone map table reflects tone data when the image is not tone-shifted.
In an exemplary embodiment of the present disclosure, the image processing apparatus may further include an initial mapping table establishing unit (not shown) configured to: acquiring HSV color space data of an image; an initial tone mapping table is established for tone data in the HSV color space data of the image. Here, the HSV color space data includes tone data
The area detection unit 72 is configured to detect a preset portion in an image.
In exemplary embodiments of the present disclosure, the preset portion may include, for example, but is not limited to, a skin portion.
The mapping table splitting unit 73 is configured to split the initial tone mapping table into a first part and a second part based on the position of the tone offset value in the initial tone mapping table.
The data portion shifting unit 74 is configured to shift the data of the first portion and the data of the second portion, respectively, to obtain a tone shift mapping table while maintaining a portion corresponding to the preset portion in the initial tone mapping table unchanged.
In an exemplary embodiment of the present disclosure, the data portion offset unit 74 may be configured to: and exchanging the data which do not belong to the preset part in the data of the first part and the data which do not belong to the preset part in the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
In the exemplary embodiment of the present disclosure, the region detection unit 72, the mapping table dividing unit 73, and the data portion shifting unit 74 may or may not be included in one unit or module (e.g., data shifting unit).
The tone mapping unit 75 is configured to map tone data of an image based on a tone offset mapping table in the HSV color space, obtaining a tone-offset HSV image.
In an exemplary embodiment of the present disclosure, the tone mapping unit 75 may be configured to: the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
The space conversion unit 76 is configured to convert the hue-shifted HSV image into an RGB color space, obtaining a hue-shifted image.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
An image processing apparatus according to an exemplary embodiment of the present disclosure has been described above with reference to fig. 5 to 7. Next, an electronic device according to an exemplary embodiment of the present disclosure is described with reference to fig. 8.
Fig. 8 is a block diagram of an electronic device 800 according to an exemplary embodiment of the present disclosure.
Referring to fig. 8, an electronic device 800 includes at least one memory 801 and at least one processor 802, the at least one memory 801 having stored therein a set of computer-executable instructions that, when executed by the at least one processor 802, perform a method of image processing according to an exemplary embodiment of the present disclosure.
By way of example, electronic device 800 may be a PC computer, tablet device, personal digital assistant, smart phone, or other device capable of executing the above-described set of instructions. Here, the electronic device 800 is not necessarily a single electronic device, but may be any apparatus or a collection of circuits capable of executing the above-described instructions (or instruction set) individually or in combination. The electronic device 800 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces with either locally or remotely (e.g., via wireless transmission).
In electronic device 800, processor 802 may include a Central Processing Unit (CPU), a Graphics Processor (GPU), a programmable logic device, a special purpose processor system, a microcontroller, or a microprocessor. By way of example, and not limitation, processors may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like.
The processor 802 may execute instructions or code stored in the memory 801, wherein the memory 801 may also store data. The instructions and data may also be transmitted and received over a network via a network interface device, which may employ any known transmission protocol.
The memory 801 may be integrated with the processor 802, for example, RAM or flash memory disposed within an integrated circuit microprocessor or the like. In addition, the memory 801 may include a stand-alone device, such as an external disk drive, storage array, or other storage device usable by any database system. The memory 801 and the processor 802 may be operatively coupled or may communicate with each other, for example, through an I/O port, network connection, etc., such that the processor 802 is able to read files stored in the memory.
In addition, the electronic device 800 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device 800 may be connected to each other via a bus and/or a network.
According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein the instructions, when executed by at least one processor, cause the at least one processor to perform a method of image processing according to the present disclosure. Examples of the computer readable storage medium herein include: read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, nonvolatile memory, CD-ROM, CD-R, CD + R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD + R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, blu-ray or optical disk storage, hard Disk Drives (HDD), solid State Disks (SSD), card memory (such as multimedia cards, secure Digital (SD) cards or ultra-fast digital (XD) cards), magnetic tape, floppy disks, magneto-optical data storage, hard disks, solid state disks, and any other means configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and to provide the computer programs and any associated data, data files and data structures to a processor or computer to enable the processor or computer to execute the programs. The computer programs in the computer readable storage media described above can be run in an environment deployed in a computer device, such as a client, host, proxy device, server, etc., and further, in one example, the computer programs and any associated data, data files, and data structures are distributed across networked computer systems such that the computer programs and any associated data, data files, and data structures are stored, accessed, and executed in a distributed fashion by one or more processors or computers.
There is also provided, in accordance with an exemplary embodiment of the present disclosure, a computer-readable storage medium including instructions, such as memory 801 including instructions, executable by processor 802 of apparatus 800 to perform the above-described method. Alternatively, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
According to an exemplary embodiment of the present disclosure, a computer program product may also be provided, comprising a computer program/instruction which, when executed by a processor, implements a method of image processing according to an exemplary embodiment of the present disclosure.
An image processing method and apparatus according to exemplary embodiments of the present disclosure have been described above with reference to fig. 1 to 8. However, it should be understood that: the image processing apparatuses shown in fig. 5 to 7 and units thereof may be configured as software, hardware, firmware, or any combination of the above to perform specific functions, respectively, and the electronic device shown in fig. 8 is not limited to include the components shown above, but some components may be added or deleted as needed, and the above components may also be combined.
According to the image processing method and device, an initial tone mapping table of an image in a tone saturation brightness HSV color space is obtained by responding to the received tone offset value, wherein the initial tone mapping table reflects tone data when the image is not subjected to tone offset; establishing a tone offset mapping table based on the tone offset value and an initial tone mapping table, wherein the tone offset mapping table reflects tone data of an image subjected to tone offset; mapping tone data of the image based on a tone offset mapping table in an HSV color space to obtain an HSV image with tone offset; the hue-shifted HSV image is converted into an RGB color space to obtain a hue-shifted image, thereby efficiently completing the overall hue-shift function of a single-frame picture.
In addition, according to the image processing method and the image processing device, different playing methods of pictures or videos can be supported, the method and the device are flexible and changeable, and meanwhile, the algorithm only protects the skin of a human body (only the skin part keeps the original image effect), so that the color tone of clothes, backpacks and the like can be changed.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (19)

1. An image processing method, comprising:
in response to receiving the hue offset value, obtaining an initial hue mapping table of the image in a hue saturation value, HSV, color space, wherein the initial hue mapping table reflects hue data of the image when the image is not hue-offset;
dividing an initial tone mapping table into a first part and a second part based on the position of a tone offset value in the initial tone mapping table, and respectively offsetting the data of the first part and the data of the second part to obtain a tone offset mapping table, wherein the tone offset mapping table reflects tone data after the image is subjected to tone offset;
mapping tone data of the image based on a tone offset mapping table in an HSV color space to obtain an HSV image with tone offset;
the hue-shifted HSV image is converted to an RGB color space to obtain a hue-shifted image.
2. The image processing method according to claim 1, characterized in that before receiving the tone offset value, the image processing method further comprises:
acquiring HSV color space data of an image, wherein the HSV color space data comprises tone data;
an initial tone mapping table is established for tone data in the HSV color space data of the image.
3. The image processing method according to claim 1, wherein the step of shifting the data of the first portion and the data of the second portion, respectively, includes:
and exchanging the data of the first part and the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
4. The image processing method according to claim 1, wherein the step of mapping tone data of the image based on the tone offset mapping table includes:
the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
5. The image processing method according to claim 1, wherein after converting the hue-shifted HSV image into the RGB color space, the image processing method further comprises:
detecting a preset part in the image;
the color of the image before the image processing is maintained unchanged by a preset part in the image converted into the RGB color space, and the color of the image before the image processing is maintained unchanged by the preset part is taken as a tone offset image.
6. The image processing method according to claim 1, wherein the step of shifting the data of the first portion and the data of the second portion, respectively, to obtain the tone shift map includes:
detecting a preset part in the image;
and under the condition that the part corresponding to the preset part in the initial tone mapping table is kept unchanged, respectively shifting the data of the first part and the data of the second part of the initial tone mapping table to obtain a tone shift mapping table.
7. The image processing method according to claim 6, wherein the step of shifting the data of the first portion and the data of the second portion of the initial tone map respectively while maintaining the portions of the initial tone map corresponding to the preset portions unchanged includes:
and exchanging the data which do not belong to the preset part in the data of the first part and the data which do not belong to the preset part in the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
8. The image processing method according to claim 5 or 6, wherein the preset portion includes a skin portion.
9. An image processing apparatus, comprising:
an initial mapping table acquisition unit configured to acquire an initial tone mapping table of an image in a tone saturation value HSV color space in response to receiving a tone offset value, wherein the initial tone mapping table reflects tone data when the image is not tone-offset;
a data offset unit configured to divide the initial tone mapping table into a first part and a second part based on the position of the tone offset value in the initial tone mapping table, and offset the data of the first part and the data of the second part, respectively, to obtain a tone offset mapping table, wherein the tone offset mapping table reflects tone data after the image is tone-offset;
a tone mapping unit configured to map tone data of an image based on a tone shift mapping table in an HSV color space, obtaining a tone shifted HSV image; and
and a space conversion unit configured to convert the hue-shifted HSV image into an RGB color space to obtain a hue-shifted image.
10. The image processing apparatus according to claim 9, further comprising an initial map creation unit configured to:
acquiring HSV color space data of an image, wherein the HSV color space data comprises tone data;
an initial tone mapping table is established for tone data in the HSV color space data of the image.
11. The image processing apparatus according to claim 9, wherein the data offset unit is configured to:
and exchanging the data of the first part and the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
12. The image processing apparatus according to claim 9, wherein the tone mapping unit is configured to:
the tone data of the image is modified to tone data after tone shift based on the index value in the tone shift map.
13. The image processing apparatus according to claim 9, wherein the image processing apparatus further comprises:
a region detection unit configured to detect a preset portion in an image; and
and a color maintaining unit configured to maintain a preset portion of the image converted into the RGB color space, as an image of a tone shift, a color before image processing, and an image of the preset portion, as a color before image processing.
14. The image processing apparatus according to claim 9, wherein the data shift unit includes:
a region detection unit configured to detect a preset portion in an image;
and the data part offset unit is configured to offset the data of the first part and the data of the second part of the initial tone mapping table respectively under the condition that the part corresponding to the preset part in the initial tone mapping table is kept unchanged, so as to obtain a tone offset mapping table.
15. The image processing apparatus according to claim 14, wherein the data portion offset unit is configured to:
and exchanging the data which do not belong to the preset part in the data of the first part and the data which do not belong to the preset part in the data of the second part, and taking the exchanged tone mapping table as a tone offset mapping table.
16. The image processing apparatus according to claim 13 or 14, wherein the preset portion includes a skin portion.
17. An electronic device/server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the image processing method of any one of claims 1 to 8.
18. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor of an electronic device, causes the electronic device to perform the image processing method according to any one of claims 1 to 8.
19. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the image processing method of any of claims 1 to 8.
CN202110099368.8A 2021-01-25 2021-01-25 Image processing method and device Active CN112907459B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110099368.8A CN112907459B (en) 2021-01-25 2021-01-25 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110099368.8A CN112907459B (en) 2021-01-25 2021-01-25 Image processing method and device

Publications (2)

Publication Number Publication Date
CN112907459A CN112907459A (en) 2021-06-04
CN112907459B true CN112907459B (en) 2024-04-09

Family

ID=76120257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110099368.8A Active CN112907459B (en) 2021-01-25 2021-01-25 Image processing method and device

Country Status (1)

Country Link
CN (1) CN112907459B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106981277A (en) * 2016-01-19 2017-07-25 上海和辉光电有限公司 Method of adjustment, apparatus and system for the tone of display
CN107657594A (en) * 2017-09-22 2018-02-02 武汉大学 The quick tone mapping method and system of a kind of high quality
CN108171648A (en) * 2017-11-27 2018-06-15 北京美摄网络科技有限公司 A kind of method and apparatus of U.S.'s face skin color transition
CN108198152A (en) * 2018-02-07 2018-06-22 广东欧珀移动通信有限公司 Image processing method and device, electronic equipment, computer readable storage medium
CN108198250A (en) * 2018-01-23 2018-06-22 网易(杭州)网络有限公司 Virtual objects model colouring method and device, storage medium, electronic equipment
CN109299299A (en) * 2018-07-18 2019-02-01 奇酷互联网络科技(深圳)有限公司 Adjust the method, apparatus and mobile terminal of color
CN109754375A (en) * 2018-12-25 2019-05-14 广州华多网络科技有限公司 Image processing method, system, computer equipment, storage medium and terminal
CN110009588A (en) * 2019-04-09 2019-07-12 成都品果科技有限公司 A kind of portrait image color enhancement method and device
CN110211030A (en) * 2019-06-04 2019-09-06 北京字节跳动网络技术有限公司 Image generating method and device
CN110830778A (en) * 2018-08-14 2020-02-21 杭州海康威视数字技术股份有限公司 Imaging device color correction method, imaging device color correction device, electronic device and storage medium
CN111080725A (en) * 2019-12-19 2020-04-28 新立讯科技股份有限公司 Image processing method, system and equipment based on color space conversion
CN112215760A (en) * 2019-07-11 2021-01-12 华为技术有限公司 Image processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI333383B (en) * 2006-09-25 2010-11-11 Ind Tech Res Inst Color adjustment circuit, digital color adjustment device and a multimedia apparatus using the same

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106981277A (en) * 2016-01-19 2017-07-25 上海和辉光电有限公司 Method of adjustment, apparatus and system for the tone of display
CN107657594A (en) * 2017-09-22 2018-02-02 武汉大学 The quick tone mapping method and system of a kind of high quality
CN108171648A (en) * 2017-11-27 2018-06-15 北京美摄网络科技有限公司 A kind of method and apparatus of U.S.'s face skin color transition
CN108198250A (en) * 2018-01-23 2018-06-22 网易(杭州)网络有限公司 Virtual objects model colouring method and device, storage medium, electronic equipment
CN108198152A (en) * 2018-02-07 2018-06-22 广东欧珀移动通信有限公司 Image processing method and device, electronic equipment, computer readable storage medium
CN109299299A (en) * 2018-07-18 2019-02-01 奇酷互联网络科技(深圳)有限公司 Adjust the method, apparatus and mobile terminal of color
CN110830778A (en) * 2018-08-14 2020-02-21 杭州海康威视数字技术股份有限公司 Imaging device color correction method, imaging device color correction device, electronic device and storage medium
CN109754375A (en) * 2018-12-25 2019-05-14 广州华多网络科技有限公司 Image processing method, system, computer equipment, storage medium and terminal
CN110009588A (en) * 2019-04-09 2019-07-12 成都品果科技有限公司 A kind of portrait image color enhancement method and device
CN110211030A (en) * 2019-06-04 2019-09-06 北京字节跳动网络技术有限公司 Image generating method and device
CN112215760A (en) * 2019-07-11 2021-01-12 华为技术有限公司 Image processing method and device
CN111080725A (en) * 2019-12-19 2020-04-28 新立讯科技股份有限公司 Image processing method, system and equipment based on color space conversion

Also Published As

Publication number Publication date
CN112907459A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
JP7181437B2 (en) A technique for identifying skin tones in images under uncontrolled lighting conditions
CN110458918B (en) Method and device for outputting information
WO2018028583A1 (en) Subtitle extraction method and device, and storage medium
GB2572029A (en) Detecting objects using a weakly supervised model
US11151780B2 (en) Lighting estimation using an input image and depth map
US11080553B2 (en) Image search method and apparatus
EP4085369A1 (en) Forgery detection of face image
CN112950738B (en) Rendering engine processing method and device, storage medium and electronic equipment
US8824778B2 (en) Systems and methods for depth map generation
US20210073949A1 (en) Method and system to enhance quality of digital images
US9143754B2 (en) Systems and methods for modifying stereoscopic images
US11216961B2 (en) Aligning digital images by selectively applying pixel-adjusted-gyroscope alignment and feature-based alignment models
CN112907459B (en) Image processing method and device
JP6785181B2 (en) Object recognition device, object recognition system, and object recognition method
US8761543B2 (en) Image processing using bounds adjustment
CN115330803B (en) Surface defect data enhancement method and device, electronic equipment and storage medium
CN114937072A (en) Image processing method and device, electronic equipment and computer readable storage medium
CN113470124A (en) Training method and device of special effect model and special effect generation method and device
CN113537403A (en) Training method and device and prediction method and device of image processing model
JP6168872B2 (en) Image processing apparatus, image processing method, and program
CN113610713B (en) Training method of video super-resolution model, video super-resolution method and device
CN114827473B (en) Video processing method and device
CN113487552B (en) Video detection method and video detection device
CN114222118B (en) Encoding method and device, decoding method and device
CN114332308A (en) Image processing method, image processing device, electronic 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