CN108200420B - Image adjusting method and device, readable storage medium and terminal - Google Patents
Image adjusting method and device, readable storage medium and terminal Download PDFInfo
- Publication number
- CN108200420B CN108200420B CN201810040637.1A CN201810040637A CN108200420B CN 108200420 B CN108200420 B CN 108200420B CN 201810040637 A CN201810040637 A CN 201810040637A CN 108200420 B CN108200420 B CN 108200420B
- Authority
- CN
- China
- Prior art keywords
- color
- current
- adjusted
- image
- mode
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/667—Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/643—Hue control means, e.g. flesh tone control
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
- Color Image Communication Systems (AREA)
Abstract
An image adjusting method, an image adjusting device, a readable storage medium and a terminal are provided, wherein the method comprises the following steps: acquiring a current image in a YUV format shot by a camera in real time, and acquiring a color mode selected by a user as a current color mode, wherein the color mode comprises a corresponding relation between at least one color to be adjusted and a target color, and the color to be adjusted and the value of the Y component of the target color are the same; and determining the current color to be adjusted in the current image according to the current color mode, and adjusting the current color to be adjusted to be the target color in the current color mode so as to adjust the current image to be the image matched with the current color mode. The embodiment of the invention can change the color in the image shot by the camera, so that the changed image is only the change in color and the brightness is unchanged, and the adjusted image is natural and real in image, thereby meeting the requirements of users.
Description
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to an image adjusting method, an image adjusting device, a readable storage medium, and a terminal.
Background
With the continuous development of electronic technology, intelligent terminal devices, such as mobile phones and tablet computers, gradually become important tools for people to communicate with the outside and for personal resource management, and bring convenience to the life of people.
Along with the function diversification of the intelligent terminal, more and more application installation is applied to the intelligent terminal. The camera is an important application on the intelligent terminal, most of the intelligent terminals have a photographing function, and great convenience and fun are brought to life of people.
In order to enhance the fun of photographing, the functions of the camera are increasing, and the functions are commonly used, such as beauty, filter, etc. When the camera in the prior art performs image transformation, the whole photo is adjusted, for example, contrast, brightness, sharpening, feathering, etc. of the image are adjusted. When the color in the image is adjusted, other parameters such as brightness and the like are correspondingly changed, and the user experience is poor.
Disclosure of Invention
In view of the above situation, it is necessary to provide an image adjusting method, an image adjusting apparatus, a readable storage medium, and a terminal, for solving the problem that image adjustment in the prior art is to adjust the overall effect of an image.
An image adjustment method, comprising:
acquiring a current image in a YUV format shot by a camera in real time, and acquiring a color mode selected by a user as a current color mode, wherein the color mode comprises a corresponding relation between at least one color to be adjusted and a target color, and the color to be adjusted and the value of the Y component of the target color are the same;
and determining the current color to be adjusted in the current image according to the current color mode, and adjusting the current color to be adjusted to be the target color in the current color mode so as to adjust the current image to be the image matched with the current color mode.
Further, in the image adjusting method, the step of obtaining the current color mode selected by the user includes:
acquiring an RGB value of at least one color to be adjusted selected by a user in the current image and an RGB increment aiming at the color to be adjusted selected by the user;
summing the RGB value and the RGB increment to obtain an RGB value of a new color, and converting the RGB value of the new color into a YUV format;
and extracting the value of the Y component of the current color to be adjusted and the values of the U component and the V component of the new color, taking the extracted values of the Y component, the U component and the V component as the component values of the target color, and establishing a corresponding relation with the color to be adjusted selected by the user to obtain the current color mode.
Further, in the image adjusting method, the step of determining the current color to be adjusted in the current image according to the current color mode includes:
and determining the color of the current image, which has the same YUV component value as the color to be adjusted in the current color mode, to obtain the current color to be adjusted.
Further, in the image adjusting method, the step of adjusting the current color to be adjusted to be the target color in the current color mode includes:
and modifying the value of Y, U, V component of each pixel point corresponding to the current color to be adjusted to be the same as the value of YUV component of the target color in the current color mode.
Further, the image adjusting method further includes the steps of:
acquiring at least one color to be adjusted selected by a user in a color setting mode of the camera, and acquiring a target color corresponding to the color to be adjusted selected by the user;
and storing the color to be adjusted selected by the user and the corresponding target color as a color mode.
Further, in the image adjusting method, the step of acquiring at least one color to be adjusted selected by a user in a color setting mode of the camera, and the step of acquiring a target color corresponding to the color to be adjusted selected by the user includes:
displaying a color list to be adjusted in a color setting mode of the camera, and acquiring a current first color selected by a user in the color list to be adjusted, wherein the color list to be adjusted comprises a graphic representation of at least one first color;
displaying a target color list, acquiring a current second color selected by a user in the target color list, wherein the target color list comprises a graphic representation of at least one second color, and taking the current first color and the current second color as a color to be adjusted and a target color respectively.
An embodiment of the present invention further provides an image adjusting apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a current image in a YUV format shot by a camera in real time and acquiring a color mode selected by a user as a current color mode, the color mode comprises a corresponding relation between at least one color to be adjusted and a target color, and the values of Y components of the color to be adjusted and the target color are the same;
a determining module for determining a current color to be adjusted in the current image according to the current color mode,
and the adjusting module is used for adjusting the current color to be adjusted to be the target color in the current color mode so as to adjust the current image to be the image matched with the current color mode.
Further, in the image adjusting apparatus, the first obtaining module includes:
the acquisition submodule is used for acquiring the RGB value of at least one color to be adjusted selected by a user in the current image and acquiring the RGB increment aiming at the color to be adjusted selected by the user;
the computing module is used for summing the RGB value and the RGB increment to obtain an RGB value of a new color and converting the RGB value of the new color into a YUV format;
and the establishing module is used for extracting the value of the Y component of the current color to be adjusted and the values of the U component and the V component of the new color, taking the extracted values of the Y component, the U component and the V component as the component values of the target color, and establishing a corresponding relation with the color to be adjusted selected by the user to obtain the current color mode.
Further, in the image adjusting apparatus, the determining module is specifically configured to:
and determining the color of the current image, which has the same YUV component value as the color to be adjusted in the current color mode, to obtain the current color to be adjusted.
Further, in the image adjusting apparatus, the adjusting module is specifically configured to:
and modifying the value of Y, U, V component of each pixel point corresponding to the current color to be adjusted to be the same as the value of YUV component of the target color in the current color mode.
Further, the image adjusting apparatus further includes:
the second acquisition module is used for acquiring at least one color to be adjusted selected by a user in a color setting mode of the camera and acquiring a target color corresponding to the color to be adjusted selected by the user;
and the storage module is used for storing the color to be adjusted selected by the user and the corresponding target color as a color mode.
Further, in the image adjusting apparatus, the second obtaining module includes:
the camera comprises a first color acquisition module, a second color acquisition module and a color setting module, wherein the first color acquisition module is used for displaying a to-be-adjusted color list in a color setting mode of the camera and acquiring a current first color selected by a user in the to-be-adjusted color list, and the adjusted color list comprises a graphic representation of at least one first color;
and the second color obtaining module is used for displaying a target color list and obtaining a current second color selected by a user in the target color list, wherein the target color list comprises a graphic representation of at least one second color, and the current first color and the current second color are respectively used as a color to be adjusted and a target color.
An embodiment of the present invention further provides a readable storage medium, on which a program is stored, where the program, when executed by a processor, implements the steps of any one of the above-mentioned methods.
The embodiment of the present invention further provides a terminal, which includes a memory, a processor, and a program stored in the memory and capable of being executed on the processor, and the processor implements any one of the steps of the method when executing the program.
In the embodiment of the invention, the color in the image shot by the camera can be changed according to the color mode selected by the user, so that the changed image is only changed in color and is unchanged in brightness, the image of the adjusted image is natural and real, and the requirements of the user are met.
Drawings
FIG. 1 is a flow chart of an image adjustment method in a first embodiment of the present invention;
FIG. 2 is a flow chart of an image adjustment method in a second embodiment of the present invention;
FIG. 3 is a flow chart of an image adjustment method in a third embodiment of the present invention;
FIG. 4 is a block diagram showing the structure of an image adjusting apparatus according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of a first obtaining module in a fourth embodiment of the present invention;
fig. 6 is a block diagram of a second obtaining module in a fourth embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
These and other aspects of embodiments of the invention will be apparent with reference to the following description and attached drawings. In the description and drawings, particular embodiments of the invention have been disclosed in detail as being indicative of some of the ways in which the principles of the embodiments of the invention may be practiced, but it is understood that the scope of the embodiments of the invention is not limited correspondingly. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Referring to fig. 1, the image adjustment method according to the first embodiment of the present invention includes steps S11-S12.
Step S11, acquiring a current image in YUV format captured by the camera in real time, and acquiring a color mode selected by the user as a current color mode, where the color mode includes a corresponding relationship between at least a color to be adjusted and a target color, and the value of the Y component of the color to be adjusted is the same as the value of the target color.
The image adjusting method in the embodiment is applied to a terminal, and the terminal has a photographing function and is provided with a camera. The terminal is, for example, a mobile phone, a tablet computer, a wearable device, and the like, and is used for performing real-time image processing on an image captured by a camera.
In the prior art, colors are represented by various modes such as an RGB mode, an HSV mode, a YUV mode, and the like, and the color mode of an image shot by a camera is determined by the color coding mode of the camera. Different color modes correspond to different color components, such as RGB components or YUV components. In this embodiment, the format of an image taken by a camera is a YUV format, the YUV mode is divided into three components, "Y" represents brightness (Luma or Luma), that is, a gray value; "U" and "V" represent Chrominance (or Chroma) that is used to describe the color and saturation of an image for specifying the color of a pixel.
When a user takes a picture, the color in the picture can be changed according to the preference of the user, for example, the red color in the picture can be changed into pink, and the green color can be changed into yellow and blue, and the like. In specific implementation, a plurality of color modes can be prestored in the terminal, and each color mode comprises at least one corresponding relation between the color to be adjusted and the target color. The color to be adjusted is different from the target color only in the UV component, the Y component is the same, when the color is to be modified, the brightness value is unchanged, the finally presented image effect is changed from the color of the original image, and the image adjusting effect is natural and real. In each color mode, each color to be adjusted may correspond to a different target color, or a plurality of colors to be adjusted may correspond to the same target color, which is set according to actual conditions.
The plurality of color modes pre-stored in the terminal can present different effects, such as autumn mode, summer mode, color mode, etc. The autumn style is, for example, adjusting green in the image to yellow, and adjusting blue to gray; summer mode is to adjust yellow to green, gray to blue, etc., and may exhibit an out-of-season effect. The color mode, for example, is to adjust the gray, black and white colors to be bright colors, such as red, blue and green, respectively, so as to form a colorful effect. Images presented in the various color modes can be previewed on a display interface of the camera, and a user can select a favorite color mode according to the previewed effect.
It can be understood that the color mode in the terminal can be preset by the camera system, and can also be set and added by the user according to the user preference as a custom color mode.
It is understood that the step of obtaining the current color mode selected by the user may further include the following steps:
and acquiring the color mode with the maximum use frequency, and sending out a reminding message to prompt a user whether to take the color mode with the maximum use frequency as the current color mode.
And in the terminal, recording and storing the use frequency of each color mode in real time, and determining the color mode with the maximum use frequency. And when the confirmation information based on the prompt information is received, acquiring the color mode with the maximum use frequency as the current color mode. And then, a prompt can be sent according to the use habit of the user to suggest a proper color mode, so that the user experience is enhanced.
Step S12, determining a current color to be adjusted in the current image according to the current color mode, and adjusting the current color to be adjusted to a target color in the current color mode, so that the current image is adjusted to an image matching the current color mode.
And when a color mode selected by the user is acquired, taking the color mode as the current color mode, and adjusting the current image. In the above step, according to the color to be adjusted in the current color mode, the color same as the color to be adjusted is inquired in the current image as the current color to be adjusted. And replacing the current color to be adjusted with the target color in the current color mode.
In specific implementation, the color of each pixel point in the current image is obtained, and the color component of the pixel point with the same color to be adjusted in the current mode is correspondingly changed, so that the change of the image color can be realized, and the image matched with the current color mode can be obtained.
In the embodiment, the color in the image shot by the camera can be changed according to the color mode selected by the user, so that the changed image is only changed in color and is unchanged in brightness, the image after adjustment is natural and real, and the requirements of the user are met.
FIG. 2 shows an image adjustment method according to a second embodiment of the present invention, which includes steps S21-S26.
In step S21, the current image captured by the camera is acquired in real time.
Step S22, obtaining RGB values of at least one color to be adjusted selected by the user in the current image, and obtaining RGB increments for the color to be adjusted selected by the user.
In practical applications, the color mode pre-stored in the terminal may not be suitable for the current photo, or the user wants to modify the color of the photo according to his/her preference. In view of this, in this embodiment, the user may select one or more colors in the current image to modify.
Since the format of the current image is YUV format, the adjustment of color is performed by adjusting the U component and the V component of each pixel. For the user, it is not intuitive to adjust the color by adjusting the U component and the V component, and therefore, in this embodiment, the YUV format of the color to be adjusted selected by the user is converted into the RGB format.
The image in YUV format is converted into the image in RBG format, and the conversion can be performed according to the YUV and RGB conversion formula in the prior art. For example, by the following conversion formula:
Y=0.257R+0.504G+0.098B+16;
V=0.439R-0.368G-0.071B+128;
U=-0.148R-0.291G+0.439B+128;
where RGB ranges from [0, 255], Y ranges from [16, 235], and UV ranges from [16, 239 ].
In specific implementation, a user opens a current image on a display interface of a camera application, selects a color of a position on the image, and a terminal acquires an RGB value of the color of the position through a color extraction tool, displays the RGB value and simultaneously displays a color value-added setting option. The color increment setting option is used for the user to modify the RGB values of the selected color, and the user can adjust the value of each color component up or down, that is, the color increment can be a positive value or a negative value. In the prior art, there are many tools for color extraction or color capture, and in this embodiment, colors can be extracted from the current image by any color extraction method.
And step S23, summing the RGB value and the RGB increment to obtain an RGB value of a new color, and converting the RGB value of the new color into a YUV format.
And summing the RGB value of the color to be adjusted selected by the user and the RGB added value of the color to be adjusted to obtain the RGB value of the new color. For example, the RGB value of red when the user selects in the current image is (255, 0, 0), the color increment set by the user is that the R and G increments are both 0, and the B increment is 255. The RGB value of the new color obtained after the summation calculation is (255, 0, 255), i.e. purple.
The adjustment of the color through the RGB value is more accurate and wider, and the current color to be adjusted can be adjusted to be any color.
As an example, in a specific implementation, the color to be adjusted selected by the user may also be displayed on a display interface in a color block, and a target color list is displayed on the display interface, where the target color list includes a plurality of preset target colors, and the user can more intuitively see the presentation effect of the color to be adjusted and the adjusted color selected by the user. For example, the color to be adjusted selected by the user is red, and one target color, such as purple, is selected from a preset target color list. The terminal acquires RGB values (255, 0, 255) of the target color selected by the user.
The color change in the RGB mode is very convenient, but the brightness of the adjusted image needs to be kept unchanged in the YUV mode. The color conversion from the RGB format to the YUV format can be performed by adopting a conversion formula of RGB and YUV in the prior art. For example, by the following conversion formula:
B=1.164(Y-16)+2.018(U-128);
G=1.164(Y-16)-0.813(V-128)-0.391(U-128);
R=1.164(Y-16)+1.596(V-128);
where RGB ranges from [0, 255], Y ranges from [16, 235], and UV ranges from [16, 239 ].
It is understood that the above mentioned conversion formula between RGB and YUV is only a formula used in a domain and threshold, and any conversion formula in the prior art can be used in practical application, and is not limited herein.
Step S24, extracting the value of the Y component in the current color to be adjusted and the values of the U component and the V component of the new color, taking the extracted values of the Y component, the U component and the V component as the component values of the target color and establishing a corresponding relationship with the color to be adjusted selected by the user to obtain the current color mode.
The YUV components of the color to be adjusted selected by the user have values of (y1, u1, v1), and the YUV components of the new color have values of (y2, u2, v 2). The UV component is used to distinguish colors, Y represents brightness, and the brightness is maintained unchanged after the color to be adjusted is color-adjusted, the Y component of the new color needs to be consistent with the Y component of the color to be adjusted selected by the user. Therefore, the (y1, u2, v2) value is used as the component value of the target color to establish the corresponding relation with the color to be adjusted selected by the user, and the current color mode can be obtained.
Further, the obtained current color mode can be stored in the terminal so as to be directly called when used next time.
Step S25, determining a color in the current image that is the same as the YUV component value of the color to be adjusted in the current color mode, to obtain the current color to be adjusted.
Step S26, modifying the value of Y, U, V component of each pixel point corresponding to the current color to be adjusted to be the same as the value of YUV component of the target color in the current color mode.
In the step S21, the user selects a color to be adjusted from the current image, determines a corresponding target color according to the steps S22 to S24, and associates the color to be adjusted selected by the user with the determined target color to serve as the current color mode. Specifically, when image adjustment is performed, each pixel point in the current image is traversed, a color which is the same as the YUV component value (y1, u1, v1) of the color to be adjusted selected by the user is determined, and the color to be adjusted is taken as the current color to be adjusted. And re-coloring the pixel point corresponding to the current color to be adjusted in the current image to make the pixel point same as the YUV component values (y1, u2 and v2) of the target color in the current color mode, thereby realizing the adjustment of the current image.
Compared with the first embodiment, in the present embodiment, the user can obtain the current color mode based on the current captured image, and adjust one or more colors of the captured image in a targeted manner.
Further, the user may add a color mode to the terminal, please refer to fig. 3, which is an image adjusting method according to a third embodiment of the present invention, and based on the first embodiment or the second embodiment, the method further includes steps S31 to S32:
step S31, acquiring at least one color to be adjusted selected by a user in a color setting mode of the camera, and acquiring a target color corresponding to the color to be adjusted selected by the user;
and step S32, storing the color to be adjusted selected by the user and the corresponding target color as a color mode.
In specific implementation, a color list to be debugged is presented in a color setting mode of the camera, a plurality of first color graphs are displayed in the color list to be debugged, a user can select at least one first color in the color list as a color to be adjusted, and a corresponding target color is added to the selected color.
In particular, after the user selects the first color icon in the color list, a target color list is popped up, and the target color list is in the form of a plurality of second color icons. At this time, the color list to be debugged may be in a hidden state or may be displayed in a reduced manner on the display interface. The user makes a selection of the second color in the list of target colors. And respectively taking the current first color selected by the user and the current second color selected by the user as the color to be adjusted and the target color, and establishing a corresponding relation. After a corresponding relation is established, the display interface hides the target color list, a user can continuously select a first color from the color list to be adjusted as a color to be adjusted, after one first color is selected, the target color list is displayed, and the user can continuously select a second color as a target color. And analogizing in sequence, establishing corresponding relations between all first colors selected by the user in the color list to be debugged and second colors selected in the target color list, and storing the first colors as a color mode. The user can use the custom color mode when taking a picture.
In this embodiment, the color to be debugged and the target color can be selected from the color list to be debugged and the target color list, the corresponding target colors can be set for a plurality of colors to be debugged, and the colors can be stored as a color mode, which is very intuitive and convenient. The user can set the color mode according to own hobby, and is convenient and practical.
Referring to fig. 4, an image adjusting apparatus according to a fourth embodiment of the present invention includes:
a first obtaining module 10, configured to obtain, in real time, a current image in a YUV format captured by a camera, and obtain, as a current color mode, a color mode selected by a user, where the color mode includes a correspondence between at least a color to be adjusted and a target color, and the color to be adjusted and the target color have the same value of a Y component;
a determining module 200, configured to determine a current color to be adjusted in the current image according to the current color mode,
an adjusting module 300, configured to adjust the current color to be adjusted to a target color in the current color mode, so that the current image is adjusted to an image matching the current color mode.
As shown in fig. 5, the first obtaining module 100 includes:
an obtaining sub-module 110, configured to obtain RGB values of at least one color to be adjusted selected by a user in the current image, and obtain RGB increments of the color to be adjusted selected by the user;
a calculating module 120, configured to sum the RGB value and the RGB increment to obtain an RGB value of a new color, and convert the RGB value of the new color into a YUV format;
the establishing module 130 extracts the value of the Y component of the current color to be adjusted and the values of the U component and the V component of the new color, takes the extracted values of the Y component, the U component and the V component as the component values of the target color, and establishes a corresponding relationship with the color to be adjusted selected by the user to obtain the current color mode.
The image adjusting apparatus, wherein the determining module 200 is specifically configured to:
and determining the color of the current image, which has the same YUV component value as the color to be adjusted in the current color mode, to obtain the current color to be adjusted.
The image adjusting apparatus is described above, wherein the adjusting module 300 is specifically configured to:
and modifying the value of Y, U, V component of each pixel point corresponding to the current color to be adjusted to be the same as the value of YUV component of the target color in the current color mode.
The image adjusting apparatus further includes:
a second obtaining module 400, configured to obtain at least one color to be adjusted selected by a user in a color setting mode of the camera, and obtain a target color corresponding to the color to be adjusted selected by the user;
a storage module 500, configured to store the color to be adjusted selected by the user and the corresponding target color as a color mode.
As shown in fig. 6, the second obtaining module 400 includes:
a first color obtaining module 410, configured to display a list of colors to be adjusted in a color setting mode of the camera, and obtain a current first color selected by a user in the list of colors to be adjusted, where the list of colors to be adjusted includes a graphic representation of at least one first color;
the second color obtaining module 420 is configured to display a target color list, and obtain a current second color selected by a user in the target color list, where the target color list includes an illustration of at least one second color, and the current first color and the current second color are respectively used as a color to be adjusted and a target color.
The image adjusting apparatus provided in the embodiment of the present invention has the same implementation principle and technical effect as the foregoing method embodiments, and for brief description, reference may be made to corresponding contents in the foregoing method embodiments for the parts of the embodiment that are not mentioned in the apparatus embodiments.
The invention also proposes a readable storage medium on which a computer program is stored which, when being executed by a processor, implements the image method described above.
The embodiment of the present invention further provides a terminal, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the method when executing the program.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (8)
1. An image adjustment method, comprising:
acquiring a current image in a YUV format shot by a camera in real time, and acquiring a color mode selected by a user as a current color mode, wherein the color mode comprises a corresponding relation between at least one color to be adjusted and a target color, and the color to be adjusted and the value of the Y component of the target color are the same;
determining a current color to be adjusted in the current image according to the current color mode, and adjusting the current color to be adjusted to a target color in the current color mode so as to adjust the current image to be an image matched with the current color mode;
wherein the step of obtaining the current color mode selected by the user comprises:
acquiring an RGB value of at least one color to be adjusted selected by a user in the current image, and acquiring an RGB increment aiming at the color to be adjusted selected by the user;
summing the RGB value and the RGB increment to obtain an RGB value of a new color, and converting the RGB value of the new color into a YUV format;
and extracting the value of the Y component of the current color to be adjusted and the values of the U component and the V component of the new color, taking the extracted values of the Y component, the U component and the V component as the component values of the target color, and establishing a corresponding relation with the color to be adjusted selected by the user to obtain the current color mode.
2. The image adjustment method of claim 1, wherein the step of determining the current color to be adjusted in the current image according to the current color mode comprises:
and determining the color of the current image, which has the same YUV component value as the color to be adjusted in the current color mode, to obtain the current color to be adjusted.
3. The image adjusting method according to claim 1, wherein the step of adjusting the current color to be adjusted to the target color in the current color mode comprises:
modifying the value of Y, U, V component of each pixel point corresponding to the current color to be adjusted to be the same as the value of YUV component of the target color in the current color mode.
4. The image adjusting method according to claim 1, further comprising the steps of:
acquiring at least one color to be adjusted selected by a user in a color setting mode of the camera, and acquiring a target color corresponding to the color to be adjusted selected by the user;
and storing the color to be adjusted selected by the user and the corresponding target color as a color mode.
5. The image adjusting method according to claim 4, wherein at least one color to be adjusted selected by a user is acquired in a color setting mode of the camera, and the step of acquiring the target color corresponding to the color to be adjusted selected by the user includes:
displaying a color list to be adjusted in a color setting mode of the camera, and acquiring a current first color selected by a user in the color list to be adjusted, wherein the color list to be adjusted comprises a graphic representation of at least one first color;
displaying a target color list, acquiring a current second color selected by a user in the target color list, wherein the target color list comprises a graphic representation of at least one second color, and taking the current first color and the current second color as a color to be adjusted and a target color respectively.
6. An image adjusting apparatus, characterized by comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a current image in a YUV format shot by a camera in real time and acquiring a color mode selected by a user as a current color mode, the color mode comprises a corresponding relation between at least one color to be adjusted and a target color, and the values of Y components of the color to be adjusted and the target color are the same;
a determining module for determining a current color to be adjusted in the current image according to the current color mode,
the adjusting module is used for adjusting the current color to be adjusted to be a target color in the current color mode so as to adjust the current image to be an image matched with the current color mode;
wherein the first obtaining module comprises:
the obtaining submodule is used for obtaining the RGB value of at least one color to be adjusted selected by the user in the current image and obtaining the RGB increment aiming at the color to be adjusted selected by the user;
the computing module is used for summing the RGB value and the RGB increment to obtain an RGB value of a new color and converting the RGB value of the new color into a YUV format;
and the establishing module is used for extracting the value of the Y component of the current color to be adjusted and the values of the U component and the V component of the new color, taking the extracted values of the Y component, the U component and the V component as the component values of the target color, and establishing a corresponding relation with the color to be adjusted selected by the user to obtain the current color mode.
7. A readable storage medium on which a program is stored, which program, when executed by a processor, carries out the method according to any one of claims 1-5.
8. A terminal comprising a memory, a processor and a program stored on the memory and executable on the processor, wherein the processor when executing the program implements the method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810040637.1A CN108200420B (en) | 2018-01-16 | 2018-01-16 | Image adjusting method and device, readable storage medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810040637.1A CN108200420B (en) | 2018-01-16 | 2018-01-16 | Image adjusting method and device, readable storage medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108200420A CN108200420A (en) | 2018-06-22 |
CN108200420B true CN108200420B (en) | 2020-05-19 |
Family
ID=62589352
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810040637.1A Active CN108200420B (en) | 2018-01-16 | 2018-01-16 | Image adjusting method and device, readable storage medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108200420B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109660725A (en) * | 2018-12-24 | 2019-04-19 | 惠州Tcl移动通信有限公司 | Image capturing method, computer storage medium and mobile terminal |
CN109949377B (en) * | 2019-03-08 | 2021-10-01 | 北京旷视科技有限公司 | Image processing method and device and electronic equipment |
CN112133260B (en) * | 2019-06-24 | 2022-06-07 | 腾讯科技(深圳)有限公司 | Image adjusting method and device |
CN111107336B (en) * | 2019-12-06 | 2023-04-07 | Oppo广东移动通信有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
CN112750171B (en) * | 2021-04-02 | 2021-08-31 | 深圳市火乐科技发展有限公司 | Color adjustment method, device, medium and electronic equipment |
CN113286136B (en) * | 2021-07-23 | 2021-12-17 | 卡莱特云科技股份有限公司 | Picture color adjusting method and device, computer equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101873503B (en) * | 2009-12-09 | 2013-02-13 | 杭州海康威视数字技术股份有限公司 | Method and device for adjusting image property |
TWI629892B (en) * | 2016-05-09 | 2018-07-11 | 國立成功大學 | Rgb to yuv format conversion and inverse conversion method and circuit for depth packing and depacking |
CN107438178B (en) * | 2016-05-25 | 2019-02-22 | 掌赢信息科技(上海)有限公司 | A kind of image color antidote and electronic equipment |
CN107068042B (en) * | 2017-01-18 | 2019-10-18 | 西安诺瓦星云科技股份有限公司 | Image processing method |
-
2018
- 2018-01-16 CN CN201810040637.1A patent/CN108200420B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108200420A (en) | 2018-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108200420B (en) | Image adjusting method and device, readable storage medium and terminal | |
CN109584180A (en) | Face image processing process, device, electronic equipment and computer storage medium | |
US9997133B2 (en) | Image processing apparatus, image processing method, and computer-readable recording medium | |
CN113810602A (en) | Shooting method and electronic equipment | |
JP2020504831A (en) | Interface image display method, apparatus and program | |
CN111935418B (en) | Video processing method and device, electronic equipment and storage medium | |
CN113132696A (en) | Image tone mapping method, device, electronic equipment and storage medium | |
CN111627076A (en) | Face changing method and device and electronic equipment | |
CN113014803A (en) | Filter adding method and device and electronic equipment | |
CN113450431B (en) | Virtual hair dyeing method, device, electronic equipment and storage medium | |
CN106251369A (en) | Image processing method and device | |
US8290262B2 (en) | Color processing apparatus and method thereof | |
CN113570581A (en) | Image processing method and device, electronic equipment and storage medium | |
CN108198123A (en) | Watermark embedding method and terminal | |
US8687091B2 (en) | Image capturing systems and methods utilizing customizable look management | |
US20090285477A1 (en) | Method and communication terminal for searching phone book for desired contacts | |
CN111462158B (en) | Image processing method and device, intelligent equipment and storage medium | |
WO2023005853A1 (en) | Image processing method and apparatus, electronic device, storage medium, and computer program product | |
CN111107336A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN107578753B (en) | Mobile terminal, display screen brightness adjusting method and storage medium | |
CN113207023B (en) | Method, device, equipment and medium for processing background color change of television detail page | |
CN115294945A (en) | Object display method and device, and color lookup table generation method and device | |
JP2004194303A (en) | Imaging apparatus, imaging method, computer readable recording medium, and program | |
CN111613168A (en) | Image display processing method and device and computer readable storage medium | |
KR100824794B1 (en) | Method and apparatus for changing color of a pixel signal |
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 |