CN109447927B - Image processing method and device, electronic equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN109447927B
CN109447927B CN201811197964.4A CN201811197964A CN109447927B CN 109447927 B CN109447927 B CN 109447927B CN 201811197964 A CN201811197964 A CN 201811197964A CN 109447927 B CN109447927 B CN 109447927B
Authority
CN
China
Prior art keywords
image
light effect
effect template
target
processed
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
CN201811197964.4A
Other languages
Chinese (zh)
Other versions
CN109447927A (en
Inventor
罗玲玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811197964.4A priority Critical patent/CN109447927B/en
Publication of CN109447927A publication Critical patent/CN109447927A/en
Application granted granted Critical
Publication of CN109447927B publication Critical patent/CN109447927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The application relates to an image processing method and device, an electronic device and a computer readable storage medium. The method comprises the following steps: the method comprises the steps of obtaining an image to be processed, carrying out fusion processing on a first light effect template and the image to be processed to obtain an intermediate image, and carrying out fusion processing on a second light effect template and the intermediate image to obtain a target image, wherein the first light effect template and the second light effect template are used for simulating different light source effects. The electronic equipment processes the image by using the first light effect template and the second light effect template, and the first light effect template and the second light effect template are used for simulating different light source effects, so that the light effect of the image can be increased by processing the image, the personalized requirements are met, and the user viscosity is improved.

Description

Image processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The electronic device may acquire images in various ways, for example, the electronic device may acquire images in real time through a camera, download images through a network, or import images through an external device. If the acquired image can not meet the personalized requirements, the user can also perform post-processing on the acquired image according to the preference of the user. For example, the overall brightness of the image may be adjusted, noise in the image may be weakened, or a portrait in the image may be beautified.
Disclosure of Invention
The embodiment of the application provides an image processing method and device, an electronic device and a computer readable storage medium, which can increase the light effect of an image, thereby meeting the personalized requirements and improving the user viscosity.
An image processing method comprising:
acquiring an image to be processed;
fusing the first light effect template and the image to be processed to obtain an intermediate image;
fusing the second light effect template and the intermediate image to obtain a target image; the first light effect template and the second light effect template are used for simulating different light source effects.
An image processing apparatus comprising:
the image acquisition module is used for acquiring an image to be processed;
the intermediate image acquisition module is used for carrying out fusion processing on the first light effect template and the image to be processed to obtain an intermediate image;
the target image acquisition module is used for fusing the second light effect template and the intermediate image to obtain a target image; the first light effect template and the second light effect template are used for simulating different light source effects.
An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring an image to be processed;
fusing the first light effect template and the image to be processed to obtain an intermediate image;
fusing the second light effect template and the intermediate image to obtain a target image; the first light effect template and the second light effect template are used for simulating different light source effects.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring an image to be processed;
fusing the first light effect template and the image to be processed to obtain an intermediate image;
fusing the second light effect template and the intermediate image to obtain a target image; the first light effect template and the second light effect template are used for simulating different light source effects.
According to the image processing method and device, the electronic equipment and the computer readable storage medium, the image to be processed is obtained, the first light effect template and the image to be processed are subjected to fusion processing to obtain the intermediate image, the second light effect template and the intermediate image are subjected to fusion processing to obtain the target image, and the first light effect template and the second light effect template are used for simulating different light source effects. The electronic equipment processes the image by using the first light effect template and the second light effect template, and the first light effect template and the second light effect template are used for simulating different light source effects, so that the light effect of the image can be increased by processing the image, the personalized requirements are met, and the user viscosity is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an exemplary embodiment of an image processing method;
FIG. 2 is a flow diagram of a method of image processing in one embodiment;
FIG. 3 is a flow diagram of a method for obtaining an intermediate image in one embodiment;
FIG. 4 is a flow diagram of a method for obtaining a first light effect template and a second light effect template in one embodiment;
FIG. 5 is a diagram illustrating resizing of a light effect template in one embodiment;
FIG. 6 is a flow diagram of a method for obtaining a target image in one embodiment;
FIG. 7 is a block diagram showing the configuration of an image processing apparatus according to an embodiment;
FIG. 8 is a schematic diagram showing an internal configuration of an electronic apparatus according to an embodiment;
FIG. 9 is a schematic diagram of an image processing circuit in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first light effect template may be referred to as a second light effect template, and similarly, a second light effect template may be referred to as a first light effect template, without departing from the scope of the present application. Both the first and second light effect templates are light effect templates, but they are not the same light effect template.
Fig. 1 is a schematic diagram of an application environment of an image processing method in an embodiment. As shown in fig. 1, the application environment includes an electronic device 110. The electronic device 110 may capture an ambient environment through the camera, and the electronic device 110 may acquire the image to be processed and perform fusion processing on the first light effect template and the image to be processed to obtain an intermediate image. The electronic device 110 may perform a fusion process on the second light effect template and the intermediate image to obtain a target image. The first light effect template and the second light effect template are used for simulating different light source effects. It is understood that the electronic device may be a mobile phone, a computer, a tablet computer, a wearable device, and the like, which is not limited herein.
In one embodiment, an image processing method is provided for the electronic device, as shown in fig. 2, and includes steps 202 to 206. Wherein:
step 202, acquiring an image to be processed.
The image to be processed may be an image stored in the electronic device, an image acquired by a camera of the electronic device in real time, a preview image acquired by the camera of the electronic device, an image downloaded by the electronic device through a network, or the like, which is not limited herein.
When the electronic device receives the image acquisition instruction, the electronic device may acquire the image to be processed according to the image acquisition instruction. The image acquisition instruction can be generated by the user through operation of an application program on the electronic device. For example, when a user clicks a capture button after launching a camera application on the electronic device, the electronic device may generate an image acquisition instruction. The image acquisition instruction may also be generated when the electronic device is connected to a network and the user downloads the image through the electronic device.
And 204, carrying out fusion processing on the first light effect template and the image to be processed to obtain an intermediate image.
The first light effect template may be used to simulate a light source effect, wherein the light source effect may be the effect that light emitted by the light source exhibits in the image. The fusion processing is to fuse image information in a plurality of images so that the fused image contains more image information. For example, the electronic device may fuse image information in 2 images into image information in 1 image, and the electronic device may fuse image information in 3 images into image information in 2 images, which is not limited herein. The electronic device can adopt an image fusion algorithm to perform fusion processing on the image, and can also combine the average value, entropy value, standard deviation, average gradient and the like of pixels in the image to perform fusion on the image.
After the electronic device acquires the image to be processed, the first light effect template and the image to be processed can be fused. After the electronic equipment fuses the first light effect template and the image to be processed, a fused intermediate image can be obtained.
And step 206, fusing the second light effect template and the intermediate image to obtain a target image, wherein the first light effect template and the second light effect template are used for simulating different light source effects.
The second light effect template can be used for simulating light source effects, and the light source effects simulated by the first light effect template and the light source effects simulated by the second light effect template can be different. For example, the first light effect template may be a template simulating natural light, and the second light effect template may be a template simulating light reflected by the glass. .
After the electronic device obtains the intermediate image, the second light effect template and the intermediate image can be subjected to fusion processing to obtain a target image.
In this embodiment, an intermediate image is obtained by acquiring an image to be processed and fusing the first light effect template and the image to be processed, and a target image is obtained by fusing the second light effect template and the intermediate image, wherein the first light effect template and the second light effect template are used for simulating different light source effects. The electronic equipment processes the image by using the first light effect template and the second light effect template, and the first light effect template and the second light effect template are used for simulating different light source effects, so that the light effect of the image can be increased by processing the image, the personalized requirements are met, and the user viscosity is improved.
As shown in fig. 3, in an embodiment, the provided image processing method may further include a process of obtaining an intermediate image, specifically including:
step 302, identify an image scene type of an image to be processed.
The image scene type is used to indicate the type of a shooting scene of an image. For example, the image scene type may be an indoor, outdoor, beach, snow, etc. scene type.
The electronic device may identify an image scene type of the image to be processed. Specifically, the electronic device may identify a scene type of the image to be processed according to an image scene identification algorithm, so as to obtain an image scene type of the image to be processed.
And step 304, when the image scene type is the target image scene type, removing the illumination information in the image to be processed.
The target image scene type may be set in advance, for example, the target image scene type may be set outdoors. The illumination information refers to information generated in an image when light in a shooting scene irradiates an object.
After the electronic device identifies the image scene type of the image to be processed, the identified image scene type can be compared with the target image scene type, and a comparison result is obtained. For example, the electronic device may identify that the image scene type of the image to be processed is outdoor, and the target image scene type is outdoor, and compare the image scene type of the image to be processed with the target image scene type, so as to obtain a comparison result that the image scene type is the same as the target image scene type.
When the comparison result obtained by the electronic equipment is that the image scene type is the same as the target image scene type, the electronic equipment can remove the illumination information in the image to be processed. . The electronic equipment can establish an illumination model for the detected illumination information in the image to be processed and remove the illumination information in the image to be processed according to the established illumination model. For example, when a street lamp irradiates a face, the face is photographed to obtain an image to be processed, and then illumination information of the street lamp is generated in the image to be processed. Before the light effect template is fused with the image to be processed, the illumination information generated during the street lamp illumination in the image to be processed can be removed, so that the effect after the light effect is finally added is better.
And step 306, fusing the first light effect template and the image to be processed after the illumination information is removed to obtain an intermediate image.
After the illumination information of the image to be processed is removed, the electronic device can obtain the image to be processed from which the illumination information is removed. The electronic device can perform fusion processing on the first light effect template and the image to be processed after the illumination information is removed, and obtain an intermediate image.
In this embodiment, the electronic device identifies an image scene type of the image to be processed, and when the image scene type is the target image scene type, the electronic device obtains an intermediate image by removing illumination information from the image to be processed and performing fusion processing on the image to be processed from which the illumination information is removed by using the first light effect template. The electronic equipment determines whether to remove illumination information in the image to be processed according to the identified image scene type of the image to be processed, and performs fusion processing on the image to be processed after the illumination information is removed and the first light effect template, so that the efficiency and the accuracy of image processing can be improved.
In an embodiment, as shown in fig. 4, the provided image processing method may further include a process of obtaining a first light effect template and a second light effect template, specifically including:
step 402, a first preset light effect template is obtained.
The first preset light effect template may be stored in the electronic device, and may also be stored in the server, which is not limited herein. The electronic device may obtain the first preset light effect template locally or from a server.
And step 404, adjusting the size of the first preset light effect template according to the size of the image to be processed to obtain a first light effect template.
After the electronic device acquires the image to be processed, the size of the image to be processed can be acquired. The size of the image to be processed is used to represent the image length and width of the image to be processed, and the size of the image to be processed may be in units of pixels or centimeters, which is not limited herein. For example, when the size is in units of pixels, the size of the image to be processed may be 300 × 300, which means that the length of the image to be processed is 300pt and the width is 300 pt; when the size is in units of centimeters, the size of the image to be processed may be 2.5 × 3, meaning that the length of the image to be processed is 2.5cm and the width is 3 cm.
After the electronic equipment acquires the size of the image to be processed, the size of the first preset light effect template can be adjusted according to the size of the image to be processed. For example, the size of the image to be processed acquired by the electronic device is 2.5 × 3, that is, the length of the image to be processed is 2.5cm, and the width of the image to be processed is 3cm, and the electronic device may adjust the size of the first preset light effect template to be 2.5 × 3, that is, the length of the first preset light effect template is 2.5cm, and the width of the first preset light effect template is 3 cm. After the electronic equipment finishes size adjustment, a first light effect template can be obtained.
And 406, acquiring a second preset light effect template.
The second preset light effect template may be stored in the electronic device, and may also be stored in the server, which is not limited herein. The electronic device may retrieve the second preset light effect template locally or from a server.
And step 408, adjusting the size of the second preset light effect template according to the size of the intermediate image to obtain a second light effect template.
After the electronic equipment obtains the intermediate image, the size of the intermediate image can be obtained, and the size of the second preset light effect template is adjusted according to the size of the intermediate image. For example, the electronic device may adjust the size of the second preset light effect template to be 3.5 × 2.5, that is, the length of the second preset light effect template is 3.5cm and the width of the second preset light effect template is 2.5cm, where the size of the intermediate image acquired by the electronic device is 3.5 × 2.5. And after the electronic equipment finishes size adjustment, a second light effect template can be obtained.
In this embodiment, the electronic device obtains the first light efficiency template by acquiring the first preset light efficiency template and adjusting the size of the first preset light efficiency template according to the size of the image to be processed, and obtains the second light efficiency template by acquiring the second preset light efficiency template and adjusting the size of the second preset light efficiency template according to the size of the intermediate image. The electronic equipment respectively adjusts the first preset light effect template and the second preset light effect template according to the size of the image to be processed and the size of the intermediate image, and respectively obtains the first light effect template and the second light effect template.
In another embodiment, the provided image processing method may further include a process of obtaining a second light effect template, specifically including: and adjusting the size of the second preset light effect template according to the size of the intermediate image, and adjusting the transparency of the second preset light effect template after size adjustment to obtain a second light effect template.
Transparency is used to indicate the degree to which an image is transparent. The transparency may be represented by a specific numerical value, for example, the transparency may be 20%, 35%, 70%, 92%, etc. After the electronic equipment acquires the intermediate image, the size of the intermediate image can be acquired, and the size of the second preset light effect template is adjusted according to the size of the intermediate image. The electronic equipment can adjust the transparency of the second preset light effect template after the size is adjusted, and a second light effect template is obtained. The transparency of the second preset light effect template can be adjusted according to an adjusting instruction input by a user, and the transparency of the second preset light effect template can be automatically adjusted by the electronic equipment.
In this embodiment, the electronic device adjusts the size of the second preset light effect template according to the size of the intermediate image, and adjusts the transparency of the second preset light effect template after the size adjustment, so as to obtain the second light effect template. Electronic equipment is through predetermineeing the light efficiency template size and transparency to the second and adjusting, and the second light efficiency template size and transparency that obtain can with the more convenient integration of intermediate image, have improved image processing's convenience.
In one embodiment, as shown in fig. 5, a schematic view of adjusting the size of a light effect template is provided. As shown in fig. 5, taking the adjustment of the size of the first preset light effect template 520 as an example, after the electronic device obtains the first preset light effect template 520, the size of the first preset light effect template 520 may be adjusted according to the size of the image to be processed 510, so as to obtain a first light effect template 530 that is consistent with the size of the image to be processed 510.
In an embodiment, as shown in fig. 6, the provided image processing method may further include a process of obtaining a target image, specifically including:
step 602, when a portrait exists in the intermediate image, portrait depth information of the portrait is obtained.
The portrait depth information is used to represent the distance between the portrait in the intermediate image and the camera. The electronic equipment can detect whether the portrait exists in the intermediate image, and when the portrait exists in the intermediate image as a result of the detection of the electronic equipment, the electronic equipment can acquire portrait depth information of the portrait. For example, the electronic device may acquire a portrait at a distance of 2m from the camera.
And step 604, acquiring object depth information of other objects except for the portrait in the intermediate image.
The object depth information is used for representing the distance between other objects except the portrait in the intermediate image and the camera. The other objects except for the portrait refer to non-portrait objects existing in the intermediate image, and the electronic device may respectively obtain object depth information of the other objects except for the portrait in the intermediate image. For example, the other objects except for the portrait may be trees, books, toys, and other objects, the electronic device may obtain a distance between the trees and the camera of 3m, the distance between the books and the camera is 1.5m, and the distance between the toys and the camera is 3.5 m.
And 606, acquiring an object with object depth information smaller than the portrait depth information as a target object.
After the electronic device acquires the portrait depth information and the object depth information, the acquired object depth information and the portrait depth information can be respectively compared, and a comparison result is obtained. For example, the portrait depth information acquired by the electronic device is 2m, the depth information of a tree acquired by the electronic device is 3m, the depth information of a book is 1.5m, and the depth information of a toy is 3.5m, the electronic device may compare the depth information of the tree with the portrait depth information, compare the depth information of the book with the portrait depth information, compare the depth information of the toy with the portrait depth information, and obtain a comparison result that the depth information of the tree and the toy is greater than the portrait depth information, and the depth information of the book is less than the portrait depth information.
The electronic device may take an object whose object depth information is smaller than the portrait depth information as the target object. For example, the electronic device may use the book as the target object if the comparison result obtained by the electronic device is that the depth information of the book is smaller than the portrait depth information.
And 608, fusing the second light effect template and the region except the target object in the intermediate image to obtain a target image.
After the electronic device acquires the target object in the intermediate image, the second light effect template and the region of the intermediate image except the target object may be fused. For example, the target object in the intermediate image acquired by the electronic device is a book, and the electronic device may perform fusion processing on the second light effect template and the region of the intermediate image except for the book, so as to obtain the target image.
In this embodiment, when a portrait exists in the intermediate image, portrait depth information of the portrait is obtained, object depth information of other objects except the portrait in the intermediate image is obtained, an object whose object depth information is smaller than the portrait depth information is obtained as a target object, and the second light effect template and an area except the target object in the intermediate image are subjected to fusion processing to obtain the target image. The electronic equipment selectively fuses the second light effect template with the region in the intermediate image according to the depth information of the portrait and the object in the intermediate image, so that the image processing efficiency can be improved, and the individual requirements can be met.
In one embodiment, when the electronic device detects that a plurality of human figures exist in the intermediate image, the electronic device may respectively obtain human figure depth information of the human figures, and the electronic device may compare the human figure depth information corresponding to the obtained plurality of human figures, and select a target human figure from the human figures according to a comparison result of the human figure depth information. Specifically, the electronic device may select a portrait corresponding to the maximum portrait depth information as a target portrait, may select a portrait corresponding to the minimum portrait depth information as a target portrait, and may also select a portrait selected by the user as a target portrait, which is not limited herein. The electronic equipment can acquire an object with object depth information smaller than the portrait depth information of the target portrait as a target object, and the second light effect template and the region of the intermediate image except the target object are subjected to fusion processing to obtain the target image.
In another embodiment, the provided image processing method may further include a process of obtaining a target image, specifically including: and generating a second target light effect template according to the second light effect template and the target object, and fusing the second target light effect template and the region except the target object in the intermediate image to obtain the target image.
The electronic device may generate a second target light effect template from the second light effect template and the target object. For example, the target object acquired by the electronic device is a tree, and the second target light effect template generated by the electronic device may be a light effect template containing a tree silhouette.
In this embodiment, the electronic device generates a second target light effect template according to the second light effect template and the target object, and performs fusion processing on the second target light effect template and a region in the intermediate image except for the target object to obtain a target image, so that personalized requirements can be met.
In an embodiment, the provided image processing method may further include a process of adjusting a color of the target image, specifically including: the method includes acquiring sensitivity of a target image, and adjusting colors of the target image according to the sensitivity.
The sensitivity iso (photosensibility) is used for indicating the sensitivity degree of a photosensitive device of the camera to light, and the higher the sensitivity is, the more sensitive the photosensitive device is to light, and the brighter an image collected by the camera is. The sensitivity may be expressed by a specific numerical value, and for example, the sensitivity may be 100, 200, 1600, 4500, or the like.
After the electronic device obtains the target image, the sensitivity of the target image can be acquired. Specifically, the electronic device may acquire the sensitivity of the target image according to the brightness, saturation, and the like of the target image. The electronic device may adjust a color of the target image according to the acquired sensitivity. Specifically, the higher the sensitivity acquired by the electronic device is, the darker the color of the target image can be adjusted by the electronic device; the lower the sensitivity acquired by the electronic device, the brighter the electronic device can adjust the color of the target image. For example, the electronic device acquires a sensitivity of 4500, and the electronic device can adjust the color of the target image to black and white; the electronic device acquires a sensitivity of 100, and the electronic device can adjust the color of the target image to a chromatic color.
In this embodiment, the electronic apparatus adjusts the color of the target image according to the sensitivity by acquiring the sensitivity of the target image. The electronic equipment can adjust the color of the target image according to the light sensitivity of the target image, so that the individual requirements can be met, and the user viscosity is improved.
In one embodiment, an image processing method is provided, and the specific steps for implementing the method are as follows:
(1) and acquiring an image to be processed.
(2) And acquiring a first preset light effect template.
(3) And adjusting the size of the first preset light effect template according to the size of the image to be processed to obtain a first light effect template.
(4) An image scene type of an image to be processed is identified.
(5) And when the image scene type is the target image scene type, removing the illumination information in the image to be processed.
(6) And fusing the first light effect template and the image to be processed after the illumination information is removed to obtain an intermediate image.
(7) And acquiring a second preset light effect template.
(8) And adjusting the size of the second preset light effect template according to the size of the intermediate image.
(9) And adjusting the transparency of the second preset light effect template after the size is adjusted to obtain a second light effect template.
(10) And when the portrait exists in the intermediate image, acquiring portrait depth information of the portrait.
(11) And acquiring object depth information of other objects except for the portrait in the intermediate image.
(12) And acquiring an object with object depth information smaller than the portrait depth information as a target object.
(13) And generating a second target light effect template according to the second light effect template and the target object.
(14) And carrying out fusion processing on the second target light effect template and the region except the target object in the intermediate image to obtain a target image.
(15) The method includes acquiring sensitivity of a target image, and adjusting colors of the target image according to the sensitivity.
It should be understood that, although the steps in the respective flowcharts described above are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in each of the flowcharts described above may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or the stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 7, there is provided an image processing apparatus including: an image acquisition module 710, an intermediate image acquisition module 720, and a target image acquisition module 730, wherein:
an image obtaining module 710, configured to obtain an image to be processed.
And the intermediate image obtaining module 720 is configured to perform fusion processing on the first light effect template and the image to be processed to obtain an intermediate image.
And the target image obtaining module 730 is configured to perform fusion processing on the second light effect template and the intermediate image to obtain a target image. The first light effect template and the second light effect template are used for simulating different light source effects.
In this embodiment, an intermediate image is obtained by acquiring an image to be processed and fusing the first light effect template and the image to be processed, and a target image is obtained by fusing the second light effect template and the intermediate image, wherein the first light effect template and the second light effect template are used for simulating different light source effects. The electronic equipment processes the image by using the first light effect template and the second light effect template, and the first light effect template and the second light effect template are used for simulating different light source effects, so that the light effect of the image can be increased by processing the image, the personalized requirements are met, and the user viscosity is improved.
In one embodiment, an image processing apparatus is provided, which may further include a scene type identification module, and a lighting information removal module, wherein:
and the scene type identification module is used for identifying the image scene type of the image to be processed.
And the illumination information removing module is used for removing the illumination information in the image to be processed when the image scene type is the target image scene type.
The intermediate image obtaining module 720 is further configured to perform fusion processing on the first light effect template and the image to be processed from which the illumination information is removed, so as to obtain an intermediate image.
In one embodiment, an image processing apparatus is provided, which may further include a first light effect template acquisition module and a second light effect template acquisition module, wherein:
the first light effect template acquisition module is used for acquiring a first preset light effect template, and the size of the first preset light effect template is adjusted according to the size of the image to be processed to obtain the first light effect template.
And the second light effect template acquisition module is used for acquiring a second preset light effect template, and adjusting the size of the second preset light effect template according to the size of the intermediate image to obtain the second light effect template.
In an embodiment, the second light effect template obtaining module is further configured to adjust a size of a second preset light effect template according to the size of the intermediate image, and adjust a transparency of the second preset light effect template after the size adjustment, so as to obtain the second light effect template.
In one embodiment, the target image obtaining module 730 may include a portrait depth information obtaining module, an object depth information obtaining module, a target object obtaining module, and a fusion module, wherein:
and the portrait depth information acquisition module is used for acquiring the portrait depth information of the portrait when the portrait exists in the intermediate image.
And the object depth information acquisition module is used for acquiring the object depth information of other objects except the portrait in the intermediate image.
And the target object acquisition module is used for acquiring an object of which the object depth information is less than the portrait depth information as a target object.
And the fusion module is used for fusing the second light effect template and the region except the target object in the intermediate image to obtain a target image.
In an embodiment, the fusion module is further configured to generate a second target light effect template according to the second light effect template and the target object, and perform fusion processing on the second target light effect template and a region in the intermediate image except for the target object to obtain the target image.
In one embodiment, an image processing apparatus may further include a color adjustment module configured to acquire a sensitivity of a target image and adjust a color of the target image according to the sensitivity.
The division of the modules in the image processing apparatus is only for illustration, and in other embodiments, the image processing apparatus may be divided into different modules as needed to complete all or part of the functions of the image processing apparatus.
For specific limitations of the image processing apparatus, reference may be made to the above limitations of the image processing method, which are not described herein again. The respective modules in the image processing apparatus described above may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The implementation of each module in the image processing apparatus provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program modules constituted by the computer program may be stored on the memory of the terminal or the server. Which when executed by a processor, performs the steps of the method described in the embodiments of the present application.
In one embodiment, as shown in fig. 8, a schematic diagram of an internal structure of an electronic device is provided. The electronic device includes a processor, a memory, a display, and a network interface connected by a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. The memory is used for storing data, programs, instruction codes and/or the like, and at least one computer program is stored on the memory, and the computer program can be executed by the processor to realize the image processing method suitable for the electronic device provided in the embodiment of the application. The Memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random-Access-Memory (RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a database, and a computer program. The computer program can be executed by a processor for implementing an image processing method provided by various embodiments of the present application. The internal memory provides a cached operating environment for the operating system, databases, and computer programs in the non-volatile storage medium. The display can be used for displaying an uploading interface and the like, and can also be used for displaying the light effect model. The network interface may be an ethernet card or a wireless network card, etc. for communicating with an external electronic device, such as a server or other electronic devices.
Those skilled in the art will appreciate that the structure shown in fig. 8 is a block diagram of only a portion of the structure relevant to the present disclosure, and does not constitute a limitation on the electronic device to which the present disclosure may be applied, and that a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
The embodiment of the application also provides the electronic equipment. Included in the electronic device is an Image Processing circuit, which may be implemented using hardware and/or software components, and may include various Processing units that define an ISP (Image Signal Processing) pipeline. FIG. 9 is a schematic diagram of an image processing circuit in one embodiment. As shown in fig. 9, for convenience of explanation, only aspects of the image processing technique related to the embodiments of the present application are shown.
As shown in fig. 9, the image processing circuit includes an ISP processor 940 and a control logic 950. The image data captured by the imaging device 910 is first processed by the ISP processor 940, and the ISP processor 940 analyzes the image data to capture image statistics that may be used to determine and/or control one or more parameters of the imaging device 910. The imaging device 910 may include a camera having one or more lenses 912 and an image sensor 914. Image sensor 914 may include an array of color filters (e.g., Bayer filters), and image sensor 914 may acquire light intensity and wavelength information captured with each imaging pixel of image sensor 914 and provide a set of raw image data that may be processed by ISP processor 940. The sensor 920 (e.g., a gyroscope) may provide parameters of the acquired image processing (e.g., anti-shake parameters) to the ISP processor 940 based on the type of interface of the sensor 920. The sensor 920 interface may utilize an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above.
In addition, image sensor 914 may also send raw image data to sensor 920, sensor 920 may provide raw image data to ISP processor 940 based on the type of interface of sensor 920, or sensor 920 may store raw image data in image memory 930.
The ISP processor 940 processes the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the ISP processor 940 may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
ISP processor 940 may also receive image data from image memory 930. For example, the sensor 920 interface sends raw image data to the image memory 930, and the raw image data in the image memory 930 is then provided to the ISP processor 940 for processing. The image Memory 930 may be a part of a Memory device, a storage device, or a separate dedicated Memory within an electronic device, and may include a DMA (Direct Memory Access) feature.
Upon receiving raw image data from image sensor 914 interface or from sensor 920 interface or from image memory 930, ISP processor 940 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 930 for additional processing before being displayed. ISP processor 940 receives processed data from image memory 930 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The image data processed by ISP processor 940 may be output to display 970 for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). Further, the output of ISP processor 940 may also be sent to image memory 930 and display 970 may read image data from image memory 930. In one embodiment, image memory 930 may be configured to implement one or more frame buffers. In addition, the output of the ISP processor 940 may be transmitted to an encoder/decoder 960 for encoding/decoding the image data. The encoded image data may be saved and decompressed before being displayed on a display 970 device. The encoder/decoder 960 may be implemented by a CPU or GPU or coprocessor.
The statistical data determined by the ISP processor 940 may be transmitted to the control logic 950 unit. For example, the statistical data may include image sensor 914 statistics such as auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 912 shading correction, and the like. The control logic 950 may include a processor and/or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters of the imaging device 910 and control parameters of the ISP processor 940 based on the received statistical data. For example, the control parameters of imaging device 910 may include sensor 920 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, lens 912 control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), as well as lens 912 shading correction parameters.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the image processing method.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform an image processing method.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. An image processing method, comprising:
acquiring an image to be processed;
identifying an image scene type of the image to be processed;
when the image scene type is a target image scene type, removing illumination information in the image to be processed;
fusing the first light effect template and the image to be processed after the illumination information is removed to obtain an intermediate image;
when a portrait exists in the intermediate image, acquiring portrait depth information of the portrait;
acquiring object depth information of other objects except the portrait in the intermediate image;
acquiring an object with the object depth information smaller than the portrait depth information as a target object;
generating a second target light effect template according to the second light effect template and a target object, wherein the first light effect template and the second light effect template are used for simulating different light source effects;
and carrying out fusion processing on the second target light effect template and the region except the target object in the intermediate image to obtain a target image.
2. The method of claim 1, further comprising:
acquiring a first preset light effect template;
adjusting the size of the first preset light effect template according to the size of the image to be processed to obtain a first light effect template;
acquiring a second preset light effect template;
and adjusting the size of the second preset light effect template according to the size of the intermediate image to obtain a second light effect template.
3. The method according to claim 2, wherein said adjusting the size of the second preset light effect template according to the size of the intermediate image, resulting in a second light effect template, comprises:
adjusting the size of the second preset light effect template according to the size of the intermediate image;
and adjusting the transparency of the second preset light effect template after the size is adjusted to obtain a second light effect template.
4. The method according to any one of claims 1 to 3, further comprising:
and acquiring the sensitivity of the target image, and adjusting the color of the target image according to the sensitivity.
5. An image processing apparatus characterized by comprising:
the image acquisition module is used for acquiring an image to be processed;
the scene type identification module is used for identifying the image scene type of the image to be processed;
the illumination information removing module is used for removing the illumination information in the image to be processed when the image scene type is a target image scene type;
the intermediate image acquisition module is used for fusing the first light effect template and the image to be processed after the illumination information is removed to obtain an intermediate image;
the target image acquisition module comprises a portrait depth information acquisition module, an object depth information acquisition module, a target object acquisition module and a fusion module, wherein:
the portrait depth information acquisition module is used for acquiring the portrait depth information of the portrait when the portrait exists in the intermediate image;
the object depth information acquisition module is used for acquiring object depth information of other objects except the portrait in the intermediate image;
the target object acquisition module is used for acquiring an object of which the object depth information is smaller than the portrait depth information as a target object;
the fusion module is used for generating a second target light effect template according to the second light effect template and a target object, wherein the first light effect template and the second light effect template are used for simulating different light source effects; and carrying out fusion processing on the second target light effect template and the region except the target object in the intermediate image to obtain a target image.
6. The apparatus of claim 5, further comprising:
the first light effect template acquisition module is used for acquiring a first preset light effect template, and adjusting the size of the first preset light effect template according to the size of the image to be processed to obtain a first light effect template;
and the second light effect template acquisition module is used for acquiring a second preset light effect template, and adjusting the size of the second preset light effect template according to the size of the intermediate image to obtain the second light effect template.
7. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the image processing method according to any one of claims 1 to 4.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201811197964.4A 2018-10-15 2018-10-15 Image processing method and device, electronic equipment and computer readable storage medium Active CN109447927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811197964.4A CN109447927B (en) 2018-10-15 2018-10-15 Image processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811197964.4A CN109447927B (en) 2018-10-15 2018-10-15 Image processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109447927A CN109447927A (en) 2019-03-08
CN109447927B true CN109447927B (en) 2021-01-22

Family

ID=65545121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811197964.4A Active CN109447927B (en) 2018-10-15 2018-10-15 Image processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109447927B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796630B (en) * 2019-10-29 2022-08-30 上海商汤智能科技有限公司 Image processing method and device, electronic device and storage medium
CN112995539B (en) * 2019-12-16 2022-07-01 青岛海信移动通信技术股份有限公司 Mobile terminal and image processing method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608664A (en) * 2014-11-19 2016-05-25 深圳市腾讯计算机***有限公司 Photo processing method and terminal
CN107613208A (en) * 2017-09-29 2018-01-19 努比亚技术有限公司 Adjusting method and terminal, the computer-readable storage medium of a kind of focusing area
CN108616700A (en) * 2018-05-21 2018-10-02 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment, computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101783963B (en) * 2010-02-10 2012-07-18 西安理工大学 Nighttime image enhancing method with highlight inhibition
CN102385753B (en) * 2011-11-17 2013-10-23 江苏大学 Illumination-classification-based adaptive image segmentation method
CN103049930B (en) * 2012-12-06 2016-07-06 南方医科大学 The dynamic Gauss body Model method for drafting of 3 d medical images
CN105611182B (en) * 2014-11-25 2020-05-22 中兴通讯股份有限公司 Brightness compensation method and device
CN107734264B (en) * 2017-09-11 2020-12-22 Oppo广东移动通信有限公司 Image processing method and device
CN108419028B (en) * 2018-03-20 2020-07-17 Oppo广东移动通信有限公司 Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108648251B (en) * 2018-05-15 2022-05-24 奥比中光科技集团股份有限公司 3D expression making method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608664A (en) * 2014-11-19 2016-05-25 深圳市腾讯计算机***有限公司 Photo processing method and terminal
CN107613208A (en) * 2017-09-29 2018-01-19 努比亚技术有限公司 Adjusting method and terminal, the computer-readable storage medium of a kind of focusing area
CN108616700A (en) * 2018-05-21 2018-10-02 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment, computer readable storage medium

Also Published As

Publication number Publication date
CN109447927A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
CN108805103B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108764370B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN108810413B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108764208B (en) Image processing method and device, storage medium and electronic equipment
CN110572573B (en) Focusing method and device, electronic equipment and computer readable storage medium
CN108777815B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN108810418B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN108734676B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109246354B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107886484B (en) Beautifying method, beautifying device, computer-readable storage medium and electronic equipment
CN109360254B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108419028B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108198152B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN110956679B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108805198B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108961302B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN108717530B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108848306B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109712177B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107862658B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108616700B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
CN107948617B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN109242794B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107424117B (en) Image beautifying method and device, computer readable storage medium and computer equipment

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