WO2019120025A1 - 照片的调整方法、装置、存储介质及电子设备 - Google Patents
照片的调整方法、装置、存储介质及电子设备 Download PDFInfo
- Publication number
- WO2019120025A1 WO2019120025A1 PCT/CN2018/116746 CN2018116746W WO2019120025A1 WO 2019120025 A1 WO2019120025 A1 WO 2019120025A1 CN 2018116746 W CN2018116746 W CN 2018116746W WO 2019120025 A1 WO2019120025 A1 WO 2019120025A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- photo
- preset
- local object
- adjusted
- adjusting
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000011218 segmentation Effects 0.000 claims abstract description 155
- 230000008921 facial expression Effects 0.000 claims description 29
- 230000014509 gene expression Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 11
- 230000003247 decreasing effect Effects 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 9
- 230000001960 triggered effect Effects 0.000 description 5
- 230000007423 decrease Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000003709 image segmentation Methods 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/174—Facial expression recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/70—Labelling scene content, e.g. deriving syntactic or semantic representations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
Definitions
- the present application belongs to the field of image processing technologies, and in particular, to a method, an apparatus, a storage medium, and an electronic device for adjusting a photo.
- Cameras are installed on many smart terminals, including front and rear cameras, and the pixels of these cameras can reach 10 million pixels. Users often use the terminal to take photos. In addition to the photos that are required to be photographed are sufficiently clear, the user's requirements for the beautification of the photos are getting higher and higher.
- the terminal can perform adjustment based on the color histogram and the color space conversion method on the photos taken by the user.
- the embodiment of the present application provides a method, an apparatus, a storage medium, and an electronic device for adjusting a photo, which can improve flexibility in adjusting a photo.
- An embodiment of the present application provides a method for adjusting a photo, including:
- An embodiment of the present application provides a photo adjustment apparatus, including:
- a photo segmentation module configured to perform semantic segmentation on the photo to be adjusted by using a preset image semantic segmentation model to obtain a photo segmentation result
- a determining module configured to determine, according to the photo segmentation result, a local object category included in the photo to be adjusted
- the adjustment module is configured to acquire a target adjustment parameter corresponding to each of the local object categories, and adjust the corresponding local object category by using each of the target adjustment parameters.
- the embodiment of the present application provides a storage medium on which a computer program is stored.
- the computer program is executed on a computer, the computer is caused to execute the flow in the method for adjusting the photo provided by the embodiment of the present application.
- the embodiment of the present application further provides an electronic device, including a memory, a processor, by using a computer program stored in the memory, to execute:
- FIG. 1 is a schematic flow chart of a method for adjusting a photo provided by an embodiment of the present application.
- FIG. 2 is another schematic flowchart of a method for adjusting a photo provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of a scenario of a method for adjusting a photo according to an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of a photo adjusting device according to an embodiment of the present application.
- FIG. 6 is another schematic structural diagram of a photo adjusting apparatus according to an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- FIG. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
- An embodiment of the present application provides a method for adjusting a photo, including:
- the embodiment may further include: counting the number of the local object categories.
- the obtaining the target adjustment parameter corresponding to each of the local object categories, and adjusting the corresponding local object category by using each of the target adjustment parameters may include: if the quantity is detected to reach a preset first
- the threshold is obtained by acquiring a target adjustment parameter corresponding to each of the local object categories, and adjusting the corresponding local object category by using each of the target adjustment parameters.
- the embodiment may further include: if it is detected that the photo is deleted within the preset preset duration, Then, it is determined that there is an error in the photo segmentation result, and the number of times the photo segmentation result is erroneous is counted; when the number of times the detection reaches the preset second threshold, the preset image semantic segmentation model is replaced.
- the method may further include: when it is detected that the user browses and adjusts, before detecting that the photo is deleted within the preset preset duration, and determining that the photo segmentation result has an error.
- the photo is taken, the facial expression feature of the user is acquired; if it is determined that the user is in the preset negative expression state according to the facial expression feature, it is detected whether the photo is deleted within the preset preset duration.
- the method for adjusting a photo may further include: acquiring a quantity of local object categories included in each photo that needs to be adjusted in a preset time range; The number of object categories is calculated, and a corresponding average value is calculated; according to the average value, the preset first threshold value is updated.
- the updating the preset first threshold according to the average value may include: setting a value of the average value to a new preset first threshold.
- the updating the preset first threshold according to the average value may include: increasing or decreasing a preset amplitude based on the average value to obtain a target value; The value is set to the new preset first threshold.
- the executive body of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
- FIG. 1 is a schematic flowchart of a method for adjusting a photo according to an embodiment of the present disclosure.
- the process may include:
- a predetermined image semantic segmentation model is used, and the photo to be adjusted is semantically segmented to obtain a photo segmentation result.
- Cameras are installed on many electronic devices, including front and rear cameras, and the pixels of these cameras are already up to 10 million pixels. Users often use electronic devices to take pictures. In addition to the photos that are required to be photographed are sufficiently clear, the user's requirements for the beautification of the photos are getting higher and higher.
- the electronic device can perform a beautification adjustment based on a color histogram and a color space conversion method on a photograph taken by a user.
- these photo adjustment methods can only be used to globalize the photos, which is less flexible.
- the electronic device may first obtain a photo that needs to be beautified, that is, a photo to be adjusted.
- the electronic device may use a preset image semantic segmentation model, semantically segment the photo to be adjusted, and obtain a semantic segmentation result of the photo.
- semantic segmentation of a photo means that the electronic device can automatically segment and recognize the content in the photo. For example, if a photo of a user riding a motorcycle is input into a preset image semantic segmentation model, the output of the preset image semantic segmentation model should be able to mark the characters, the motorcycle, and the region where the background is located. For example, the electronic device can use the preset image semantic segmentation model to mark the area where the character is located in red, mark the area where the motorcycle is located in green, and mark the background in black.
- the preset image semantic segmentation model may employ, for example, Fully Convolutional Networks (FCN), DeepLab, and the like.
- FCN Fully Convolutional Networks
- DeepLab DeepLab
- the local object category included in the photo to be adjusted is determined.
- the electronic device may determine the local object category included in the photo to be adjusted according to the semantic segmentation result. That is, the electronic device can determine the partial object category included in the semantically segmented photo.
- the local object category refers to objects belonging to different categories existing in the photo.
- the photo to be adjusted is a scene in which the user rides a motorcycle. Then, the photo to be adjusted includes at least the following three partial object categories: a character, a motorcycle, and a background.
- a target adjustment parameter corresponding to each of the local object categories is acquired, and the corresponding local object category is adjusted by using each of the target adjustment parameters.
- the electronic device may acquire an adjustment parameter corresponding to each local object category, that is, a target adjustment parameter. Then, the electronic device can adjust the corresponding local object category by using each target adjustment parameter, thereby obtaining the adjusted photo.
- the electronic device may sequentially acquire a first target adjustment parameter corresponding to the character, a second target adjustment parameter corresponding to the motorcycle, and a background. Corresponding third target adjustment parameters. Then, the electronic device can respectively adjust the area where the person (user) in the photo is located by using the first target adjustment parameter, adjust the area where the motorcycle is located in the photo using the second target adjustment parameter, and adjust the parameter by using the third target. Tune the area in the photo where the background is located.
- the electronic device may first perform semantic segmentation on the photo to be adjusted, and then determine a local object category included in the photo to be adjusted according to the semantic segmentation result. Then, the electronic device may acquire target adjustment parameters corresponding to each local object category, and separately adjust corresponding local object categories by using each target adjustment parameter. Therefore, the embodiment can specifically adjust each local object in the photo that needs to be adjusted, thereby improving the flexibility of adjusting the photo.
- FIG. 2 is another schematic flowchart of a method for adjusting a photo according to an embodiment of the present disclosure, where the process may include:
- the electronic device acquires a photo to be adjusted.
- the preset image semantic segmentation model is used, and the electronic device performs semantic segmentation on the photo to be adjusted to obtain a photo segmentation result.
- 201 and 202 can include:
- the electronic device can first obtain a photo that needs to be beautified, that is, the photo to be adjusted.
- the electronic device may use a preset image semantic segmentation model, semantically segment the photo to be adjusted, and obtain a semantic segmentation result of the photo.
- semantic segmentation of a photo means that the electronic device can automatically segment and recognize the content in the photo. For example, if a photo of a user riding a motorcycle is input into a preset image semantic segmentation model, then the output of the preset image semantic segmentation model should be able to mark the characters, the motorcycle, and the region in which the background is located. For example, the electronic device can use the preset image semantic segmentation model to mark the area where the character is located in red, mark the area where the motorcycle is located in green, and mark the background in black.
- the preset image semantic segmentation model may employ, for example, Fully Convolutional Networks (FCN), DeepLab, and the like.
- FCN Fully Convolutional Networks
- DeepLab DeepLab
- the electronic device determines a local object category included in the photo to be adjusted.
- the electronic device may determine the local object category included in the photo to be adjusted according to the semantic segmentation result. That is, the electronic device can determine the partial object category included in the semantically segmented photo.
- the local object category refers to objects belonging to different categories existing in the photo.
- the photo to be adjusted is a scene in which the user rides a motorcycle. Then, the photo to be adjusted includes at least the following three partial object categories: a character, a motorcycle, and a background.
- the electronic device counts the number of local object categories.
- the electronic device may count the number of the local object categories.
- the electronic device can detect whether the number of the local object categories reaches a preset first threshold.
- the photo to be adjusted may be regarded as a photo taken in a simple scene, and the electronic device may not perform additional adjustment on the photo, etc. .
- the electronic device acquires a target adjustment parameter corresponding to each of the local object categories, and adjusts the corresponding local object category by using each of the target adjustment parameters.
- the electronic device counts that the number of local object categories included in the photo to be adjusted reaches a preset first threshold, and the photo to be adjusted may be considered as a photo taken in a complicated scene.
- the complex scene refers to a plurality of partial object categories included in the shooting scene of the photo.
- a photograph of a person photographed in an outdoor environment in addition to a character, including a building, a plant, a car, a road, a bicycle, and the like, can be considered as a photograph in a complicated scene. Get the photo.
- the electronic device may be triggered to acquire an adjustment parameter corresponding to each local object category, that is, a target adjustment parameter. Then, the electronic device can adjust the corresponding local object category by using each target adjustment parameter, thereby obtaining the adjusted photo.
- the photo to be adjusted includes three local object categories of a person, a motorcycle, and a background
- the preset first threshold has a value of 3, that is, the number of local object categories reaches a preset first threshold.
- the electronic device may sequentially acquire a first target adjustment parameter corresponding to the character, a second target adjustment parameter corresponding to the motorcycle, and a third target adjustment parameter corresponding to the background.
- the electronic device can respectively adjust the area where the person (user) in the photo is located by using the first target adjustment parameter, adjust the area where the motorcycle is located in the photo, and adjust the parameter using the third target by using the second target adjustment parameter. Tune the area in the photo where the background is located.
- each target adjustment parameter may be a parameter for tuning the color. Understandably, the color of this photo can be more natural and full after adjusting the photo using the tuning parameters for color.
- the electronic device when detecting that the user browses the adjusted photo, acquires the facial expression feature of the user.
- the electronic device detects that the user browses the adjusted photo. For example, the electronic device detects that the user enters the album from the camera's shooting preview interface to view the photo just taken. At this time, the electronic device may be triggered to acquire a face image of the user, and the facial expression feature of the user is acquired according to the face image.
- the electronic device may turn on the front camera to acquire the face image of the user, and acquire the facial expression feature of the user according to the face image.
- the electronic device may analyze the facial expression features to determine whether the user is in a preset negative expression state.
- the preset negative expression state may be a relatively negative expression state such as a grin, a grin, a disappointment, and the like.
- smiles, smiles, pleasures, etc. are more positive expressions.
- the user can be considered to be satisfied with the adjusted photo currently being browsed, and the electronic device can perform other operations.
- the user If the user is in a state of expression indicating that the user is in a negative expression according to the facial expression feature of the user, then the user enters 207.
- the electronic device detects whether the photo is deleted within the preset preset duration.
- the electronic device determines that there is an error in the photo segmentation result, and counts the number of times the photo segmentation result has an error.
- the electronic device when detecting that the number reaches the preset second threshold, the electronic device replaces the preset image semantic segmentation model.
- 207, 208, 209 can include:
- the electronic device analyzes that the user is in a relatively negative expression when viewing the adjusted photo according to the obtained facial expression feature of the user, and then the user may feel that the user is dissatisfied with the adjusted photo, and the electronic device can detect the Whether the photo is deleted within the preset duration after being adjusted.
- the electronic device can perform other operations.
- the electronic device can determine that there is an error in the photo semantic segmentation result.
- the electronic device can count the number of times the segmentation result is wrong when the photo semantic segmentation is performed by using the preset image semantic segmentation model currently configured for the electronic device.
- the electronic device can detect whether the number of times reaches a preset second threshold.
- the preset image semantic segmentation model currently configured for the electronic device still has fewer errors when performing photo semantic segmentation, and the electronic device can perform other operations.
- the electronic device can replace the preset image semantic segmentation model.
- the image semantic segmentation model previously configured for electronic devices is a model A.
- the electronic device may acquire another image semantic segmentation model. For example, an electronic device can acquire a B model and replace the A model with a B model.
- the embodiment may further include the following processes:
- the electronic device acquires the number of local object categories included in each photo that needs to be adjusted during the preset time range;
- the electronic device calculates a corresponding average value according to the number of partial object categories included in each photo
- the electronic device updates the preset first threshold.
- the electronic device counts the number of local object categories included in the photo to be adjusted. Then, the electronic device can record the number of partial object categories included in each photo that needs to be adjusted within a preset time range, such as the most recent week.
- the electronic device may calculate an average value of the number of local object categories included in each of the recorded photos, and update a preset first threshold value according to the average value.
- the electronic device can set the value of the average to a new preset first threshold.
- the electronic device may also increase or decrease a certain preset amplitude based on the average value to obtain a target value, and set the target value as a new preset first threshold.
- updating the preset first threshold according to the average value may include:
- the electronic device sets the value of the average value to a new preset first threshold.
- updating the preset first threshold according to the average value may include:
- the electronic device increases or decreases the preset amplitude based on the average value to obtain a target value
- the electronic device sets the target value to a new preset first threshold.
- FIG. 3 to FIG. 4 are schematic diagrams of a method for adjusting a photo according to an embodiment of the present disclosure.
- the trained image semantic segmentation model can be ported to an electronic device.
- the preset image semantic segmentation model can be obtained by: firstly, the machine can obtain a large number of photos including various shooting scenes, including various types of objects, such as characters, buildings, and various types of vehicles. , all kinds of tables and chairs, and so on. The machine can then perform pixel-level object calibration of each photo with manual assistance. After that, the machine can obtain a pre-selected image semantic segmentation model, and input the photo that has been subjected to the pixel-level object calibration as a training sample to the image semantic segmentation model, and perform deep learning training to obtain the trained image. The semantic segmentation model is then ported to the electronic device.
- the electronic device can determine it as a preset image semantic segmentation model. It can be understood that, since the training process of the preset image semantic segmentation model uses the photo of the pixel-level object calibration as the training sample, the preset image semantic segmentation model has high segmentation precision for the image.
- the electronic device can obtain the photo A that needs to be beautified, and determine it as a photo to be adjusted, for example, the photo is shown in FIG.
- the electronic device can use the preset image semantic segmentation model, semantically segment the photo, and obtain the semantic segmentation result of the photo A.
- the preset image semantic segmentation model divides the photo A into a character 10, a building 20, a cloud 30, and a background 40.
- the electronic device may determine the local object category included in the photo A according to the semantic segmentation result, and count the number of the local object categories. For example, the electronic device determines that the photo A contains four partial object categories of a person, a building, a cloud, and a background.
- the electronic device can detect whether the number of local object categories included in the photo A reaches a preset first threshold.
- the preset first threshold is 3.
- the electronic device can detect that the number of partial object categories included in the photo A exceeds a preset first threshold. At this time, it can be considered that the photo A is a photograph taken in a complicated scene, and it is necessary to perform individual color adjustment for each of the partial object categories.
- the electronic device may be triggered to acquire an adjustment parameter corresponding to each local object category, that is, a target adjustment parameter. Then, the electronic device can adjust the corresponding local object category by using each target adjustment parameter, thereby obtaining the adjusted photo.
- the electronic device may sequentially acquire a first target adjustment parameter corresponding to the character, a second target adjustment parameter corresponding to the building, a third target adjustment parameter corresponding to the cloud, and a fourth target adjustment parameter corresponding to the background. Then, the electronic device can respectively adjust the area where the character is located in the photo by using the first target adjustment parameter, adjust the area where the building is located in the photo by using the second target adjustment parameter, and adjust the parameter to the cloud in the photo by using the third target adjustment parameter. The area is tuned, and the fourth target adjustment parameter is used to tune the area where the background is in the photo.
- the color of the photo A can be more natural and full after the parameter adjustment of each local object category in the photo A is performed by using each target adjustment parameter.
- the embodiment provides a photo adjustment device, including:
- the photo segmentation module is configured to perform semantic segmentation on the photo to be adjusted by using a preset image semantic segmentation model to obtain a photo segmentation result.
- a determining module configured to determine, according to the photo segmentation result, a local object category included in the photo to be adjusted.
- the adjustment module is configured to acquire a target adjustment parameter corresponding to each of the local object categories, and adjust the corresponding local object category by using each of the target adjustment parameters.
- the adjusting device of the photo may further include: a statistics module, configured to count the number of the local object categories.
- the adjusting module may be configured to: if it is detected that the quantity reaches a preset first threshold, acquire target adjustment parameters corresponding to each of the local object categories, and use each of the target adjustment parameter pairs to correspond The local object category is adjusted.
- the adjusting device of the photo may further include: a replacing module, if it is detected that the photo is deleted within the preset preset time after the adjustment, determining that the photo segmentation result has an error, and counting the photo segmentation As a result, there is a wrong number of times; when it is detected that the number of times reaches a preset second threshold, the preset image semantic segmentation model is replaced.
- the adjusting device of the photo may further include: a detecting module, configured to acquire a facial expression feature of the user when detecting that the user browses the adjusted photo; if according to the facial expression feature If it is determined that the user is in the preset negative expression state, it is detected whether the photo is deleted within the preset preset time period after being adjusted.
- a detecting module configured to acquire a facial expression feature of the user when detecting that the user browses the adjusted photo; if according to the facial expression feature If it is determined that the user is in the preset negative expression state, it is detected whether the photo is deleted within the preset preset time period after being adjusted.
- the adjusting device of the photo may further include: an updating module, configured to acquire, according to the preset time range, the number of partial object categories included in each photo that needs to be adjusted; The number of local object categories is calculated, and a corresponding average value is calculated; according to the average value, the preset first threshold value is updated.
- an updating module configured to acquire, according to the preset time range, the number of partial object categories included in each photo that needs to be adjusted. The number of local object categories is calculated, and a corresponding average value is calculated; according to the average value, the preset first threshold value is updated.
- the updating module may be configured to: set a value of the average value to a new preset first threshold.
- the updating module may be configured to: increase or decrease a preset amplitude based on the average value to obtain a target value; and set the target value as a new preset first threshold.
- FIG. 5 is a schematic structural diagram of a photo adjusting apparatus according to an embodiment of the present application.
- the photo adjustment device 300 may include an acquisition module 301, a photo segmentation module 302, a determination module 303, and an adjustment module 304.
- the obtaining module 301 is configured to obtain a photo to be adjusted.
- the photo segmentation module 302 is configured to perform semantic segmentation on the photo to be adjusted by using a preset image semantic segmentation model to obtain a photo segmentation result.
- the obtaining module 301 may first obtain a photo that needs to be beautified, that is, a photo to be adjusted.
- the photo segmentation module 302 can perform semantic segmentation on the photo to be adjusted by using a preset image semantic segmentation model, and obtain a semantic segmentation result of the photo.
- semantic segmentation of a photo means that the electronic device can automatically segment and recognize the content in the photo. For example, if a photo of a user riding a motorcycle is input into a preset image semantic segmentation model, then the output of the preset image semantic segmentation model should be able to mark the characters, the motorcycle, and the region in which the background is located. For example, the electronic device can use the preset image semantic segmentation model to mark the area where the character is located in red, mark the area where the motorcycle is located in green, and mark the background in black.
- the preset image semantic segmentation model may employ, for example, Fully Convolutional Networks (FCN), DeepLab, and the like.
- FCN Fully Convolutional Networks
- DeepLab DeepLab
- the determining module 303 is configured to determine, according to the photo segmentation result, a local object category included in the photo to be adjusted.
- the determining module 303 may determine the local object category included in the photo to be adjusted according to the semantic segmentation result. That is, the determination module 303 can determine the partial object categories included in the semantically segmented photo.
- the local object category refers to objects belonging to different categories existing in the photo.
- the photo to be adjusted is a scene in which the user rides a motorcycle. Then, the photo to be adjusted includes at least the following three partial object categories: a character, a motorcycle, and a background.
- the adjustment module 304 is configured to acquire a target adjustment parameter corresponding to each of the local object categories, and adjust the corresponding local object category by using each of the target adjustment parameters.
- the adjustment module 304 may acquire an adjustment parameter corresponding to each local object category, that is, a target adjustment parameter. Then, the adjustment module 304 can adjust the corresponding local object category by using each target adjustment parameter, thereby obtaining the adjusted photo.
- the adjustment module 304 may sequentially acquire a first target adjustment parameter corresponding to the character, a second target adjustment parameter corresponding to the motorcycle, and The third target adjustment parameter corresponding to the background. Then, the adjustment module 304 can respectively adjust the area where the person (user) in the photo is located by using the first target adjustment parameter, adjust the area where the motorcycle is located in the photo, and adjust the area using the third target by using the second target adjustment parameter.
- the parameter tuned the area in the photo where the background is located.
- FIG. 6 is another schematic structural diagram of a photo adjusting apparatus according to an embodiment of the present application.
- the photo adjustment device 300 may further include: a statistics module 305, a replacement module 306, a detection module 307, and an update module 308.
- the statistics module 305 is configured to count the number of the local object categories.
- the adjusting module 304 is configured to: if it is detected that the quantity reaches a preset first threshold, acquire target adjustment parameters corresponding to each of the local object categories, and use each of the target adjustment parameter pairs to correspond The local object category is adjusted.
- the statistics module 305 can count the number of the local object categories.
- the electronic device can detect whether the number of the local object categories reaches a preset first threshold.
- the photo to be adjusted may be regarded as a photo taken in a simple scene, and the electronic device may not perform additional adjustment on the photo, etc. .
- the electronic camera may consider that the photo to be adjusted is a photo taken in a complicated scene.
- the complex scene refers to a plurality of partial object categories included in the shooting scene of the photo.
- a photograph of a person photographed in an outdoor environment in addition to a character, including a building, a plant, a car, a road, a bicycle, and the like, can be considered as a photograph in a complicated scene. Get the photo.
- the adjustment module 304 can be triggered to acquire an adjustment parameter corresponding to each local object category, that is, a target adjustment parameter. Then, the adjustment module 304 can adjust the corresponding local object category by using each target adjustment parameter, thereby obtaining the adjusted photo.
- the photo to be adjusted includes three local object categories of a person, a motorcycle, and a background
- the preset first threshold has a value of 3, that is, the number of local object categories reaches a preset first threshold.
- the adjustment module 304 may sequentially acquire a first target adjustment parameter corresponding to the character, a second target adjustment parameter corresponding to the motorcycle, and a third target adjustment parameter corresponding to the background.
- the adjustment module 304 can respectively adjust the area where the person (user) in the photo is located by using the first target adjustment parameter, adjust the area where the motorcycle is located in the photo, and adjust the area using the third target by using the second target adjustment parameter.
- the parameter tuned the area in the photo where the background is located.
- the replacement module 306 is configured to: if it is detected that the photo is deleted within the preset preset time period, determine that there is an error in the photo segmentation result, and count the number of times the photo segmentation result has an error; and when the detected number reaches the preset number When the threshold is two, the preset image semantic segmentation model is replaced.
- the replacement module 306 can detect whether the adjusted photo is deleted within the preset preset time period.
- the electronic device can perform other operations.
- the replacement module 306 can determine that there is an error in the photo semantic segmentation result.
- the replacement module 306 can count the number of times the segmentation result is wrong when the photo semantic segmentation is performed by using the preset image semantic segmentation model currently configured for the electronic device.
- the replacement module 306 can detect whether the number of times reaches a preset second threshold.
- the preset image semantic segmentation model currently configured for the electronic device still has fewer errors when performing photo semantic segmentation, and the electronic device can perform other operations.
- the replacement module 306 can replace the preset image semantic segmentation model.
- the image semantic segmentation model previously configured for electronic devices is a model A.
- the replacement module 306 can acquire another image semantic segmentation model.
- the replacement module 306 can acquire the B model and replace the A model with the B model.
- the detecting module 307 is configured to: when detecting that the user browses the adjusted photo, acquiring a facial expression feature of the user; if it is determined that the user is in a preset negative expression state according to the facial expression feature, detecting the photo is Whether it has been deleted within the preset time period after being adjusted.
- the electronic device detects that the user browses the adjusted photo.
- the detection module 307 detects that the user has entered the album from the camera's shooting preview interface and has just taken the photo.
- the detection module 307 may be triggered to acquire a face image of the user, and the facial expression feature of the user is acquired according to the face image.
- the detecting module 307 can turn on the front camera to acquire the face image of the user, and acquire the facial expression feature of the user according to the face image.
- the detecting module 307 may analyze the facial expression features to determine whether the user is in the preset negative expression state.
- the preset negative expression state may be a relatively negative expression state such as a grin, a grin, a disappointment, and the like. In contrast, smiles, smiles, pleasures, etc. are more positive expressions.
- the user can be considered to be satisfied with the adjusted photo currently being browsed, and the electronic device can perform other operations.
- the detecting module 307 analyzes that the user is in a relatively negative expression when viewing the adjusted photo according to the obtained facial expression feature of the user, the user may feel that the user is dissatisfied with the adjusted photo, and the electronic device may It is detected whether the photo is deleted within the preset time period after being adjusted.
- the electronic device can perform other operations.
- the replacement module 306 can determine that there is an error in the photo semantic segmentation result.
- An update module 308 configured to acquire a quantity of local object categories included in each photo that needs to be adjusted in a preset time range; and calculate a corresponding average value according to the number of local object categories included in each photo; An average value that updates the preset first threshold.
- the statistics module 305 counts the number of local object categories included in the photo to be adjusted. Then, the update module 308 can record the number of partial object categories included in each photo that needs to be adjusted within a preset time range, such as the most recent week.
- the update module 308 can calculate an average value of the number of local object categories included in each of the recorded photos, and update the value of the preset first threshold according to the average value.
- the update module 308 can set the average to a preset first threshold.
- the update module 308 may also increase or decrease a certain amplitude based on the average value to obtain a target value, and set the target value to a preset first threshold.
- the embodiment of the present application provides a computer readable storage medium having stored thereon a computer program, when the computer program is executed on a computer, causing the computer to perform the steps in the method for adjusting the photo provided by the embodiment. .
- the embodiment of the present application further provides an electronic device, including a memory, and a processor, by using a computer program stored in the memory, to execute a process in a method for adjusting a photo provided by the embodiment.
- the above electronic device may be a mobile terminal such as a tablet or a smart phone.
- FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- the electronic device 400 can include components such as an imaging unit 401, a memory 402, a processor 403, and the like. It will be understood by those skilled in the art that the electronic device structure illustrated in FIG. 7 does not constitute a limitation on the electronic device, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements.
- the camera unit 401 may include a front camera, a rear camera, and the like.
- Memory 402 can be used to store applications and data.
- the application stored in the memory 402 contains executable code.
- Applications can form various functional modules.
- the processor 403 executes various functional applications and data processing by running an application stored in the memory 402.
- the processor 403 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, executes the electronic device by running or executing an application stored in the memory 402, and calling data stored in the memory 402. The various functions and processing of data to provide overall monitoring of the electronic device.
- the processor 403 in the electronic device loads the executable code corresponding to the process of one or more applications into the memory 402 according to the following instructions, and is executed by the processor 403 to be stored in the memory.
- the electronic device 500 may include components such as an imaging unit 501, a memory 502, a processor 503, an input unit 504, an output unit 505, and the like.
- the camera unit 501 may include a front camera, a rear camera, and the like.
- Memory 502 can be used to store applications and data.
- the application stored in the memory 502 contains executable code.
- Applications can form various functional modules.
- the processor 503 executes various functional applications and data processing by running an application stored in the memory 502.
- the processor 503 is a control center of the electronic device, and connects various parts of the entire electronic device using various interfaces and lines, executes the electronic device by running or executing an application stored in the memory 502, and calling data stored in the memory 502. The various functions and processing of data to provide overall monitoring of the electronic device.
- the input unit 504 can be configured to receive input digits, character information or user characteristic information (such as fingerprints), and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
- the output unit 505 can be used to display information input by the user or information provided to the user as well as various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, video, and any combination thereof.
- the output unit may include a display panel.
- the processor 503 in the electronic device loads the executable code corresponding to the process of one or more applications into the memory 502 according to the following instructions, and is stored in the memory by the processor 503.
- the processor 503 may further perform: counting the number of the local object categories.
- the processor 503 may perform: if detecting After the quantity reaches the preset first threshold, the target adjustment parameters corresponding to each of the local object categories are acquired, and the corresponding local object categories are adjusted by using the target adjustment parameters.
- the processor 503 may further perform: if it is detected that the photo is within the preset preset time period If it is deleted, it is determined that there is an error in the photo segmentation result, and the number of times the photo segmentation result is erroneous is counted; when it is detected that the number of times reaches the preset second threshold, the preset image semantic segmentation model is replaced.
- the processor 503 may further perform: after detecting that the photo is divided within the preset time period after the photo is determined to be correct, the processor 503 may perform: when detecting that the user browses and adjusts In the subsequent photo, the facial expression feature of the user is acquired; if it is determined that the user is in the preset negative expression state according to the facial expression feature, it is detected whether the photo is deleted within the preset preset duration.
- the processor 503 may further: obtain a quantity of local object categories included in each photo that needs to be adjusted in a preset time range; and calculate according to the number of local object categories included in each photo. Corresponding average values; updating the preset first threshold according to the average value.
- the processor 503 when the processor 503 performs the updating of the preset first threshold according to the average value, it may be performed to: set a value of the average value as a new preset first threshold.
- the processor 503 when the processor 503 performs the updating of the preset first threshold according to the average value, the processor 503 may perform: increasing or decreasing a preset amplitude based on the average value to obtain a target value. Setting the target value to a new preset first threshold.
- the adjusting device of the photo provided by the embodiment of the present application is the same as the method for adjusting the photo in the above embodiment, and any one of the embodiments provided in the adjusting method of the photo may be operated on the adjusting device of the photo
- the specific implementation process of the method is described in the embodiment of the method for adjusting the photo, and details are not described herein again.
- the computer program may be stored in a computer readable storage medium, such as in a memory, and executed by at least one processor, and may include an implementation of an adjustment method as the photo during execution The flow of the example.
- the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), a random access memory (RAM), or the like.
- each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module.
- the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
- the integrated module if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computational Linguistics (AREA)
- Image Analysis (AREA)
- Studio Devices (AREA)
Abstract
一种照片的调整方法,包括:获取待调整的照片(101);利用预设图像语义分割模型,对该待调整的照片进行语义分割,得到照片分割结果(102);根据该照片分割结果,确定该待调整的照片中包含的局部对象类别(103);获取与每一该局部对象类别对应的目标调整参数,并利用各该目标调整参数对对应的局部对象类别进行调整(104)。
Description
本申请要求于2017年12月22日提交中国专利局、申请号为201711407286.5、申请名称为“照片的调整方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请属于图片处理技术领域,尤其涉及一种照片的调整方法、装置、存储介质及电子设备。
许多智能终端上都安装有摄像头,包括前置摄像头和后置摄像头,并且这些摄像头的像素都已可以达到千万像素级别。用户经常会使用终端进行拍照。除了要求拍摄得到的照片足够清晰外,用户对照片的美化要求也越来越高。相关技术中,终端可以对用户拍摄得到的照片进行基于色彩直方图和色彩空间变换方法的调整。
发明内容
本申请实施例提供一种照片的调整方法、装置、存储介质及电子设备,可以提高对照片进行调整的灵活性。
本申请实施例提供一种照片的调整方法,包括:
获取待调整的照片;
利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;
根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;
获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
本申请实施例提供一种照片的调整装置,包括:
获取模块,用于获取待调整的照片;
照片分割模块,用于利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;
确定模块,用于根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;
调整模块,用于获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
本申请实施例提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行本申请实施例提供的照片的调整方法中的流程。
本申请实施例还提供一种电子设备,包括存储器,处理器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行:
获取待调整的照片;
利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;
根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;
获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其有益效果显而易见。
图1是本申请实施例提供的照片的调整方法的流程示意图。
图2是本申请实施例提供的照片的调整方法的另一流程示意图。
图3至图4是本申请实施例提供的照片的调整方法的场景示意图。
图5是本申请实施例提供的照片的调整装置的结构示意图。
图6是本申请实施例提供的照片的调整装置的另一结构示意图。
图7是本申请实施例提供的电子设备的结构示意图。
图8是本申请实施例提供的电子设备的另一结构示意图。
请参照图示,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。
本申请实施例提供一种照片的调整方法,包括:
获取待调整的照片;利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
在一种实施方式中,在所述确定所述待调整的照片中包含的局部对象类别之后,本实施例还可以包括:统计所述局部对象类别的数量。
那么,所述获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整,可以包括:若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
在一种实施方式中,在所述利用各所述目标调整参数对对应的局部对象类别进行调整之后,本实施例还可以包括:若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
在一种实施方式中,在所述若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误之前,本实施例还可以包括:当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
在一种实施方式中,本实施例提供的照片的调整方法还可以包括:获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
在一种实施方式中,所述根据所述平均值,更新所述预设第一阈值,可以包括:将所述平均值的数值设定为新的预设第一阈值。
在一种实施方式中,所述根据所述平均值,更新所述预设第一阈值,可以包括:在所述平均值的基础上增加或减少预设幅度,得到目标数值;将所述目标数值设定为新的预设第一阈值。
可以理解的是,本申请实施例的执行主体可以是诸如智能手机或平板电脑等的电子设备。
请参阅图1,图1是本申请实施例提供的照片的调整方法的流程示意图,流程可以包括:
在101中,获取待调整的照片。
在102中,利用预设图像语义分割模型,对该待调整的照片进行语义分割,得到照片分割结果。
许多电子设备上都安装有摄像头,包括前置摄像头和后置摄像头,并且这些摄像头的像素都已可以达到千万像素级别。用户经常会使用电子设备进行拍照。除了要求拍摄得到的照片足够清晰外,用户对照片的美化要求也越来越高。相关技术中,电子设备可以对用户拍摄得到的照片进行基于色彩直方图和色彩空间变换方法的美化调整。然而,这些照片调整方法只能对照片进行全局美化,其灵活性较差。
在本申请实施例的101中,比如,电子设备可以先获取需要进行美化的照片,即待调整的照片。
然后,电子设备可以利用预设图像语义分割模型,对该待调整的照片进行语义分割,并得到照片的语义分割结果。
需要说明的是,对照片进行语义分割指的是电子设备可以自动分割并识别出照片中的内容。比如,将一张用户骑摩托车的照片输入到预设图像语义分割模型中,那么该预设图像语义分割模型的输出应当能够将照片中的人物、摩托车、背景所在的区域分别标注出来。例如,电子设备利用预设图像语义分割模型可以将照片中人物所在的区域用红色标注出来,将摩托车所在的区域用绿色标注出来,将背景用黑色标注出来。
预设图像语义分割模型可以采用诸如全卷积神经网络(Fully Convolutional Networks, 简称FCN)、DeepLab等。
在103中,根据该照片分割结果,确定该待调整的照片中包含的局部对象类别。
比如,在得到待调整的照片的语义分割结果之后,电子设备可以根据该语义分割结果,确定出该待调整的照片中包含的局部对象类别。即,电子设备可以确定出经过语义分割后的照片中包含的局部对象类别。
需要说明的是,局部对象类别指的是照片中存在的属于不同类别的对象。例如,待调整的照片为用户骑摩托车的场景。那么,该待调整的照片中至少包括以下三个局部对象类别:人物、摩托车以及背景。
在104中,获取与每一该局部对象类别对应的目标调整参数,并利用各该目标调整参数对对应的局部对象类别进行调整。
比如,在确定出待调整的照片中包含的局部对象类别后,电子设备可以获取与每一局部对象类别对应的调整参数,即目标调整参数。然后,电子设备可以利用各目标调整参数对对应的局部对象类别进行调整,从而得到经过调整后的照片。
例如,待调整的照片中包含人物、摩托车以及背景这三个局部对象类别,那么电子设备可以依次获取与人物对应的第一目标调整参数、与摩托车对应的第二目标调整参数、与背景对应的第三目标调整参数。然后,电子设备可以分别使用第一目标调整参数对照片中人物(用户)所在的区域进行调优,使用第二目标调整参数对照片中摩托车所在的区域进行调优,使用第三目标调整参数对照片中背景所在的区域进行调优。
可以理解的是,本申请实施例中,电子设备可以先将待调整的照片进行语义分割,再根据语义分割结果,确定出该待调整的照片中包含的局部对象类别。然后,电子设备可以获取与各局部对象类别对应的目标调整参数,并利用各目标调整参数对对应的局部对象类别进行单独调整。因此,本实施例可以针对性地对需要调整的照片中的各局部对象进行单独调整,从而提高了对照片进行调整的灵活性。
请参阅图2,图2为本申请实施例提供的照片的调整方法的另一流程示意图,流程可以包括:
在201中,电子设备获取待调整的照片。
在202中,利用预设图像语义分割模型,电子设备对该待调整的照片进行语义分割,得到照片分割结果。
比如,201和202可以包括:
在相机拍摄得到照片后,电子设备可以先获取需要进行美化的照片,即待调整的照片。
然后,电子设备可以利用预设图像语义分割模型,对该待调整的照片进行语义分割,并得到照片的语义分割结果。
需要说明的是,对照片进行语义分割指的是电子设备可以自动分割并识别出照片中的内容。比如,将一张用户骑摩托车的照片输入到预设图像语义分割模型中,那么该预设图 像语义分割模型的输出应当能够将照片中的人物、摩托车、背景所在的区域分别标注出来。例如,电子设备利用预设图像语义分割模型可以将照片中人物所在的区域用红色标注出来,将摩托车所在的区域用绿色标注出来,将背景用黑色标注出来。
预设图像语义分割模型可以采用诸如全卷积神经网络(Fully Convolutional Networks,简称FCN)、DeepLab等。
在203中,根据该照片分割结果,电子设备确定该待调整的照片中包含的局部对象类别。
比如,在得到待调整的照片的语义分割结果之后,电子设备可以根据该语义分割结果,确定出该待调整的照片中包含的局部对象类别。即,电子设备可以确定出经过语义分割后的照片中包含的局部对象类别。
需要说明的是,局部对象类别指的是照片中存在的属于不同类别的对象。例如,待调整的照片为用户骑摩托车的场景。那么,该待调整的照片中至少包括以下三个局部对象类别:人物、摩托车以及背景。
在204中,电子设备统计该局部对象类别的数量。
比如,在根据该待调整的照片的语义分割结果,确定出其中包含的局部对象类别之后,电子设备可以统计该局部对象类别的数量。
然后,电子设备可以检测该局部对象类别的数量是否达到预设第一阈值。
若检测到该局部对象类别的数量未达到预设第一阈值,则可以认为该待调整的照片是在简单场景下拍摄得到的照片,此时电子设备可以不对该照片进行额外的调整,等等。
若检测到该局部对象类别的数量达到预设第一阈值,则进入205。
在205中,若检测到该数量达到预设第一阈值,则电子设备获取与每一该局部对象类别对应的目标调整参数,并利用各该目标调整参数对对应的局部对象类别进行调整。
比如,电子设备统计到该待调整的照片中包含的局部对象类别的数量达到预设第一阈值,此时可以认为该待调整的照片是在复杂场景下拍摄得到的照片。
需要说明的是,复杂场景指的是照片的拍摄场景中包含多个局部对象类别。例如,在室外环境下拍摄的包含人物的照片,除了人物之外,该场景中还包含建筑、植物、汽车、马路、自行车等等各种对象,则可以认为这张照片时在复杂场景下拍摄得到的照片。
在这种情况下,可以触发电子设备获取与每一局部对象类别对应的调整参数,即目标调整参数。然后,电子设备可以利用各目标调整参数对对应的局部对象类别进行调整,从而得到经过调整后的照片。
例如,待调整的照片中包含人物、摩托车以及背景这三个局部对象类别,而预设第一阈值的数值为3,即局部对象类别的数量达到了预设第一阈值。那么,电子设备可以依次获取与人物对应的第一目标调整参数、与摩托车对应的第二目标调整参数、与背景对应的第三目标调整参数。然后,电子设备可以分别使用第一目标调整参数对照片中人物(用户) 所在的区域进行调优,使用第二目标调整参数对照片中摩托车所在的区域进行调优,使用第三目标调整参数对照片中背景所在的区域进行调优。
在一种实施方式中,各目标调整参数可以是用于对色彩进行调优的参数。可以理解的是,在使用关于色彩的调优参数对照片进行调整后,这张照片的色彩可以变得更加自然、饱满。
在206中,当检测到用户浏览经过调整后的照片时,电子设备获取用户的人脸表情特征。
比如,在利用各目标调整参数,对待调整的照片进行调整之后,电子设备检测到用户浏览经过调整后的照片。例如,电子设备检测到用户从相机的拍摄预览界面进入相册浏览刚刚拍摄得到的照片。此时,可以触发电子设备获取用户的人脸图像,并根据该人脸图像获取用户的人脸表情特征。
例如,电子设备可以开启前置摄像头获取用户的人脸图像,并根据该人脸图像获取用户的人脸表情特征。
在获取到用户的人脸表情特征之后,电子设备可以对这些人脸表情特征进行分析,以判断用户是否处于预设消极表情状态。在一些实施方式中,预设消极表情状态可以是邹眉、噘嘴、失望等比较消极的表情状态。相对的,微笑、张嘴笑、愉悦等为比较积极的表情状态。
如果根据用户的人脸表情特征,分析出用户处于比较积极的表情状态,那么可以认为用户对当前正在浏览的、经过调整后的照片感到满意,此时电子设备可以执行其它操作。
如果根据用户的人脸表情特征,分析出用户处于邹眉、失望等表示消极的表情状态,那么进入207。
在207中,若根据该人脸表情特征确定出用户处于预设消极表情状态,则电子设备检测该照片在被调整后的预设时长内是否被删除。
在208中,若检测到照片在被调整后的预设时长内被删除,则电子设备确定照片分割结果存在错误,并统计照片分割结果存在错误的次数。
在209中,当检测到该次数达到预设第二阈值时,电子设备更换该预设图像语义分割模型。
比如,207、208、209可以包括:
电子设备根据获取到的用户人脸表情特征,分析出用户在浏览经过调整后的照片时处于比较消极的表情,那么可以认为用户对经过调整后的照片感到不满意,此时电子设备可以检测该照片在被调整后的预设时长内是否被删除。
如果检测到该照片在被调整后的预设时长内未被删除,那么电子设备可以执行其它操作。
如果检测到该照片在被调整后的预设时长内被删除,例如该照片在被调整后的3秒内 被用户删除,那么可以认为用户是因对调整后的照片不满意而将该照片删除的。在这种情况下,很有可能是因为在对待调整的照片进行语义分割时执行了错误地图像分割,导致后面使用目标调整参数对局部对象类别进行调整时效果不佳。此时,电子设备可以确定照片语义分割结果存在错误。同时,电子设备可以统计利用当前为电子设备配置的预设图像语义分割模型进行照片语义分割时分割结果存在错误的次数。
然后,电子设备可以检测该次数是否达到预设第二阈值。
如果检测到该次数未达到预设第二阈值,则可以认为当前为电子设备配置的预设图像语义分割模型在进行照片语义分割时发生的错误仍然较少,此时电子设备可以执行其它操作。
如果检测到该次数达到了预设第二阈值,则可以认为当前为电子设备配置的预设图像语义分割模型在进行照片语义分割时发生的错误较多。在这种情况下,电子设备可以更换预设图像语义分割模型。例如,之前为电子设备配置的图像语义分割模型是甲模型。那么,当检测到使用甲模型进行照片语义分割的结果存在错误的次数达到预设第二阈值时,电子设备可以获取另外一个图像语义分割模型。例如,电子设备可以获取乙模型,并使用乙模型替换掉甲模型。
在一种实施方式中,本实施例还可以包括如下流程:
电子设备获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;
根据各照片包含的局部对象类别的数量,电子设备计算对应的平均值;
根据该平均值,电子设备更新预设第一阈值。
比如,在204中电子设备会统计待调整的照片包含的局部对象类别的数量。那么,电子设备可以将预设时间范围内,如最近一星期范围内拍摄得到的需要进行调整的各张照片所包含的局部对象类别的数量记录下来。
然后,电子设备可以根据记录到的上述各张照片包含的局部对象类别的数量,计算这些数量的平均值,并根据该平均值,更新预设第一阈值的数值。
例如,电子设备可以将该平均值的数值设定为新的预设第一阈值。或者,电子设备也可以在该平均值的基础上,增加或减少一定的预设幅度,得到一个目标数值,并将该目标数值设定为新的预设第一阈值。
即,在一种实施方式中,根据平均值更新预设第一阈值,可以包括:
电子设备将平均值的数值设定为新的预设第一阈值。
在另一种实施方式中,根据平均值更新预设第一阈值,可以包括:
电子设备在平均值的基础上增加或减少预设幅度,得到目标数值;
电子设备将该目标数值设定为新的预设第一阈值。
请参阅图3至图4,图3至图4为本申请实施例提供的照片的调整方法的场景示意图。
在一种实施方式中,可以将训练好的图像语义分割模型移植到电子设备中。其中,该 预设图像语义分割模型可以是通过如下方式获得的:首先,机器可以获取大量包含各种拍摄场景的照片,这些照片中包含各类被拍摄对象,如人物、建筑物、各类车辆、各类桌椅等等。然后,机器可以在人工辅助下,对各照片进行像素级别的对象标定。之后,机器可以获取预先选定的图像语义分割模型,并将已经进行过像素级别的对象标定的照片作为训练样本输入到该图像语义分割模型,使之进行深度学习训练,从而得到训练好的图像语义分割模型,再将其移植到电子设备中。在获取到该图像语义分割模型后,电子设备可以将其确定为预设图像语义分割模型。可以理解的是,由于该预设图像语义分割模型的训练过程使用的是经过像素级别的对象标定的照片作为训练样本,因此该预设图像语义分割模型对图像的分割精度很高。
比如,用户拍摄了一张照片甲,电子设备可以获取该需要进行美化的照片甲,并将其确定为待调整的照片,例如该照片甲如图3所示。
然后,电子设备可以利用预设图像语义分割模型,对该照片甲进行语义分割,并得到照片甲的语义分割结果。
例如,如图4所示,预设图像语义分割模型将照片甲分割为人物10、建筑20、云朵30以及背景40。
在得到照片甲的语义分割结果之后,电子设备可以根据该语义分割结果,确定出该照片甲中包含的局部对象类别,并统计局部对象类别的数量。例如,电子设备确定出照片甲中包含人物、建筑、云朵以及背景这4个局部对象类别。
然后,电子设备可以检测照片甲包含的局部对象类别的数量是否达到预设第一阈值。例如,预设第一阈值为3。那么,电子设备可以检测到照片甲包含的局部对象类别的数量超过了预设第一阈值。此时,可以认为该照片甲是在复杂场景下拍摄得到的照片,需要对其中的各局部对象类别进行单独的色彩调优。
在这种情况下,可以触发电子设备获取与每一局部对象类别对应的调整参数,即目标调整参数。然后,电子设备可以利用各目标调整参数对对应的局部对象类别进行调整,从而得到经过调整后的照片。
例如,电子设备可以依次获取与人物对应的第一目标调整参数、与建筑对应的第二目标调整参数、与云朵对应的第三目标调整参数、与背景对应的第四目标调整参数。然后,电子设备可以分别使用第一目标调整参数对照片中人物所在的区域进行调优,使用第二目标调整参数对照片中建筑所在的区域进行调优,使用第三目标调整参数对照片中云朵所在的区域进行调优,使用第四目标调整参数对照片中背景所在的区域进行调优。
可以理解的是,在使用各目标调整参数分别对照片甲中的各局部对象类别进行参数调优后,照片甲的色彩可以变得更加自然、饱满。
本实施例提供一种照片的调整装置,包括:
获取模块,用于获取待调整的照片。
照片分割模块,用于利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果。
确定模块,用于根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别。
调整模块,用于获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
在一种实施方式中,所述照片的调整装置还可以包括:统计模块,用于统计所述局部对象类别的数量。
那么,所述调整模块可以用于:若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
在一种实施方式中,所述照片的调整装置还可以包括:更换模块,用于若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
在一种实施方式中,所述照片的调整装置还可以包括:检测模块,用于当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
在一种实施方式中,所述照片的调整装置还可以包括:更新模块,用于获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
在一种实施方式中,所述更新模块可以用于:将所述平均值的数值设定为新的预设第一阈值。
在一种实施方式中,所述更新模块可以用于:在所述平均值的基础上增加或减少预设幅度,得到目标数值;将所述目标数值设定为新的预设第一阈值。
请参阅图5,图5为本申请实施例提供的照片的调整装置的结构示意图。照片的调整装置300可以包括:获取模块301,照片分割模块302,确定模块303,以及调整模块304。
获取模块301,用于获取待调整的照片。
照片分割模块302,用于利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果。
比如,获取模块301可以先获取需要进行美化的照片,即待调整的照片。
然后,照片分割模块302可以利用预设图像语义分割模型,对该待调整的照片进行语义分割,并得到照片的语义分割结果。
需要说明的是,对照片进行语义分割指的是电子设备可以自动分割并识别出照片中的内容。比如,将一张用户骑摩托车的照片输入到预设图像语义分割模型中,那么该预设图 像语义分割模型的输出应当能够将照片中的人物、摩托车、背景所在的区域分别标注出来。例如,电子设备利用预设图像语义分割模型可以将照片中人物所在的区域用红色标注出来,将摩托车所在的区域用绿色标注出来,将背景用黑色标注出来。
预设图像语义分割模型可以采用诸如全卷积神经网络(Fully Convolutional Networks,简称FCN)、DeepLab等。
确定模块303,用于根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别。
比如,在得到待调整的照片的语义分割结果之后,确定模块303可以根据该语义分割结果,确定出该待调整的照片中包含的局部对象类别。即,确定模块303可以确定出经过语义分割后的照片中包含的局部对象类别。
需要说明的是,局部对象类别指的是照片中存在的属于不同类别的对象。例如,待调整的照片为用户骑摩托车的场景。那么,该待调整的照片中至少包括以下三个局部对象类别:人物、摩托车以及背景。
调整模块304,用于获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
比如,在确定模块303确定出待调整的照片中包含的局部对象类别后,调整模块304可以获取与每一局部对象类别对应的调整参数,即目标调整参数。然后,调整模块304可以利用各目标调整参数对对应的局部对象类别进行调整,从而得到经过调整后的照片。
例如,待调整的照片中包含人物、摩托车以及背景这三个局部对象类别,那么调整模块304可以依次获取与人物对应的第一目标调整参数、与摩托车对应的第二目标调整参数、与背景对应的第三目标调整参数。然后,调整模块304可以分别使用第一目标调整参数对照片中人物(用户)所在的区域进行调优,使用第二目标调整参数对照片中摩托车所在的区域进行调优,使用第三目标调整参数对照片中背景所在的区域进行调优。
请一并参阅图6,图6为本申请实施例提供的照片的调整装置的另一结构示意图。在一实施例中,照片的调整装置300还可以包括:统计模块305,更换模块306,检测模块307以及更新模块308。
统计模块305,用于统计所述局部对象类别的数量。
那么,所述调整模块304用于:若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
比如,在确定模块303根据该待调整的照片的语义分割结果,确定出其中包含的局部对象类别之后,统计模块305可以统计该局部对象类别的数量。
然后,电子设备可以检测该局部对象类别的数量是否达到预设第一阈值。
若检测到该局部对象类别的数量未达到预设第一阈值,则可以认为该待调整的照片是 在简单场景下拍摄得到的照片,此时电子设备可以不对该照片进行额外的调整,等等。
若电子设备统计到该待调整的照片中包含的局部对象类别的数量达到预设第一阈值,此时可以认为该待调整的照片是在复杂场景下拍摄得到的照片。
需要说明的是,复杂场景指的是照片的拍摄场景中包含多个局部对象类别。例如,在室外环境下拍摄的包含人物的照片,除了人物之外,该场景中还包含建筑、植物、汽车、马路、自行车等等各种对象,则可以认为这张照片时在复杂场景下拍摄得到的照片。
在这种情况下,可以触发调整模块304获取与每一局部对象类别对应的调整参数,即目标调整参数。然后,调整模块304可以利用各目标调整参数对对应的局部对象类别进行调整,从而得到经过调整后的照片。
例如,待调整的照片中包含人物、摩托车以及背景这三个局部对象类别,而预设第一阈值的数值为3,即局部对象类别的数量达到了预设第一阈值。那么,调整模块304可以依次获取与人物对应的第一目标调整参数、与摩托车对应的第二目标调整参数、与背景对应的第三目标调整参数。然后,调整模块304可以分别使用第一目标调整参数对照片中人物(用户)所在的区域进行调优,使用第二目标调整参数对照片中摩托车所在的区域进行调优,使用第三目标调整参数对照片中背景所在的区域进行调优。
更换模块306,用于若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
比如,在调整模块304对照片进行调整后,更换模块306可以检测经过调整的照片在被调整后的预设时长内是否被删除。
如果检测到该照片在被调整后的预设时长内未被删除,那么电子设备可以执行其它操作。
如果检测到该照片在被调整后的预设时长内被删除,例如该照片在被调整后的3秒内被用户删除,那么可以认为用户是因对调整后的照片不满意而将该照片删除的。在这种情况下,很有可能是因为在对待调整的照片进行语义分割时执行了错误地图像分割,导致后面使用目标调整参数对局部对象类别进行调整时效果不佳。此时,更换模块306可以确定照片语义分割结果存在错误。同时,更换模块306可以统计利用当前为电子设备配置的预设图像语义分割模型进行照片语义分割时分割结果存在错误的次数。
然后,更换模块306可以检测该次数是否达到预设第二阈值。
如果检测到该次数未达到预设第二阈值,则可以认为当前为电子设备配置的预设图像语义分割模型在进行照片语义分割时发生的错误仍然较少,此时电子设备可以执行其它操作。
如果检测到该次数达到了预设第二阈值,则可以认为当前为电子设备配置的预设图像语义分割模型在进行照片语义分割时发生的错误较多。在这种情况下,更换模块306可以 更换预设图像语义分割模型。例如,之前为电子设备配置的图像语义分割模型是甲模型。那么,当检测到使用甲模型进行照片语义分割的结果存在错误的次数达到预设第二阈值时,更换模块306可以获取另外一个图像语义分割模型。例如,更换模块306可以获取乙模型,并使用乙模型替换掉甲模型。
检测模块307,用于当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
比如,在调整模块304利用各目标调整参数,对待调整的照片进行调整之后,电子设备检测到用户浏览经过调整后的照片。例如,检测模块307检测到用户从相机的拍摄预览界面进入相册浏览刚刚拍摄得到的照片。此时,可以触发检测模块307获取用户的人脸图像,并根据该人脸图像获取用户的人脸表情特征。
例如,检测模块307可以开启前置摄像头获取用户的人脸图像,并根据该人脸图像获取用户的人脸表情特征。
在获取到用户的人脸表情特征之后,检测模块307可以对这些人脸表情特征进行分析,以判断用户是否处于预设消极表情状态。在一些实施方式中,预设消极表情状态可以是邹眉、噘嘴、失望等比较消极的表情状态。相对的,微笑、张嘴笑、愉悦等为比较积极的表情状态。
如果根据用户的人脸表情特征,分析出用户处于比较积极的表情状态,那么可以认为用户对当前正在浏览的、经过调整后的照片感到满意,此时电子设备可以执行其它操作。
如果检测模块307根据获取到的用户人脸表情特征,分析出用户在浏览经过调整后的照片时处于比较消极的表情,那么可以认为用户对经过调整后的照片感到不满意,此时电子设备可以检测该照片在被调整后的预设时长内是否被删除。
如果检测到该照片在被调整后的预设时长内未被删除,那么电子设备可以执行其它操作。
如果检测到该照片在被调整后的预设时长内被删除,那么更换模块306可以确定照片语义分割结果存在错误。
更新模块308,用于获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
比如,统计模块305会统计待调整的照片包含的局部对象类别的数量。那么,更新模块308可以将预设时间范围内,如最近一星期范围内拍摄得到的需要进行调整的各张照片所包含的局部对象类别的数量记录下来。
然后,更新模块308可以根据记录到的上述各张照片包含的局部对象类别的数量,计算这些数量的平均值,并根据该平均值,更新预设第一阈值的数值。
例如,更新模块308可以将该平均值设定为预设第一阈值。或者,更新模块308也可以在该平均值的基础上,增加或减少一定幅度,得到一个目标数值,并将该目标数值设定为预设第一阈值。
本申请实施例提供一种计算机可读的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上执行时,使得所述计算机执行如本实施例提供的照片的调整方法中的步骤。
本申请实施例还提供一种电子设备,包括存储器,处理器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行本实施例提供的照片的调整方法中的流程。
例如,上述电子设备可以是诸如平板电脑或者智能手机等移动终端。请参阅图7,图7为本申请实施例提供的电子设备的结构示意图。
该电子设备400可以包括摄像单元401、存储器402、处理器403等部件。本领域技术人员可以理解,图7中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
摄像单元401可以包括前置摄像头和后置摄像头等。
存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器403通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。
处理器403是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
在本实施例中,电子设备中的处理器403会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行代码加载到存储器402中,并由处理器403来运行存储在存储器402中的应用程序,从而执行:
获取待调整的照片;利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
请参阅图8,电子设备500可以包括摄像单元501、存储器502、处理器503、输入单元504、输出单元505等部件。
摄像单元501可以包括前置摄像头和后置摄像头等。
存储器502可用于存储应用程序和数据。存储器502存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器503通过运行存储在存储器502的应用程序,从而执行各种功能应用以及数据处理。
处理器503是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部 分,通过运行或执行存储在存储器502内的应用程序,以及调用存储在存储器502内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。
输入单元504可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。
输出单元505可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。输出单元可包括显示面板。
在本实施例中,电子设备中的处理器503会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行代码加载到存储器502中,并由处理器503来运行存储在存储器502中的应用程序,从而执行:
获取待调整的照片;利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
在一种实施方式中,处理器503在执行所述确定所述待调整的照片中包含的局部对象类别之后,还可以执行:统计所述局部对象类别的数量。
那么,处理器503在执行所述获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数分别对各所述局部对象类别进行调整时,可以执行:若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
在一种实施方式中,处理器503在执行所述利用各所述目标调整参数分别对各所述局部对象类别进行调整之后,还可以执行:若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
在一种实施方式中,处理器503在执行所述若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误之前,还可以执行:当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
在一种实施方式中,处理器503还可以执行:获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
在一种实施方式中,处理器503执行所述根据所述平均值,更新所述预设第一阈值时,可以执行:将所述平均值的数值设定为新的预设第一阈值。
在一种实施方式中,处理器503执行所述根据所述平均值,更新所述预设第一阈值时, 可以执行:在所述平均值的基础上增加或减少预设幅度,得到目标数值;将所述目标数值设定为新的预设第一阈值。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对照片的调整方法的详细描述,此处不再赘述。
本申请实施例提供的所述照片的调整装置与上文实施例中的照片的调整方法属于同一构思,在所述照片的调整装置上可以运行所述照片的调整方法实施例中提供的任一方法,其具体实现过程详见所述照片的调整方法实施例,此处不再赘述。
需要说明的是,对本申请实施例所述照片的调整方法而言,本领域普通技术人员可以理解实现本申请实施例所述照片的调整方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在存储器中,并被至少一个处理器执行,在执行过程中可包括如所述照片的调整方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)等。
对本申请实施例的所述照片的调整装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。
以上对本申请实施例所提供的一种照片的调整方法、装置、存储介质以及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (20)
- 一种照片的调整方法,其中,包括:获取待调整的照片;利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
- 根据权利要求1所述的照片的调整方法,其中,在所述确定所述待调整的照片中包含的局部对象类别之后,还包括:统计所述局部对象类别的数量;所述获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整,包括:若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
- 根据权利要求2所述的照片的调整方法,其中,在所述利用各所述目标调整参数对对应的局部对象类别进行调整之后,还包括:若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
- 根据权利要求3所述的照片的调整方法,其中,在所述若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误之前,还包括:当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
- 根据权利要求4所述的照片的调整方法,其中,所述方法还包括:获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
- 根据权利要求5所述的照片的调整方法,其中,所述根据所述平均值,更新所述预设第一阈值,包括:将所述平均值的数值设定为新的预设第一阈值。
- 根据权利要求5所述的照片的调整方法,其中,所述根据所述平均值,更新所述预设第一阈值,包括:在所述平均值的基础上增加或减少预设幅度,得到目标数值;将所述目标数值设定为新的预设第一阈值。
- 一种照片的调整装置,其中,包括:获取模块,用于获取待调整的照片;照片分割模块,用于利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;确定模块,用于根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;调整模块,用于获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
- 根据权利要求8所述的照片的调整装置,其中,所述装置还包括:统计模块,用于统计所述局部对象类别的数量;所述调整模块用于:若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
- 根据权利要求9所述的照片的调整装置,其中,所述装置还包括:更换模块,用于若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
- 根据权利要求10所述的照片的调整装置,其中,所述装置还包括:检测模块,用于:当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
- 根据权利要求11所述的照片的调整装置,其中,所述装置还包括:更新模块,用于获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
- 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行如权利要求1至7中任一项所述的方法。
- 一种电子设备,包括存储器,处理器,其中,所述处理器通过调用所述存储器中存储的计算机程序,用于执行:获取待调整的照片;利用预设图像语义分割模型,对所述待调整的照片进行语义分割,得到照片分割结果;根据所述照片分割结果,确定所述待调整的照片中包含的局部对象类别;获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
- 根据权利要求14所述的电子设备,其中,所述处理器用于执行:统计所述局部对象类别的数量;若检测到所述数量达到预设第一阈值,则获取与每一所述局部对象类别对应的目标调整参数,并利用各所述目标调整参数对对应的局部对象类别进行调整。
- 根据权利要求15所述的电子设备,其中,所述处理器用于执行:若检测到照片在被调整后的预设时长内被删除,则确定照片分割结果存在错误,并统计照片分割结果存在错误的次数;当检测到所述次数达到预设第二阈值时,更换所述预设图像语义分割模型。
- 根据权利要求16所述的电子设备,其中,所述处理器用于执行:当检测到用户浏览经过调整后的照片时,获取用户的人脸表情特征;若根据所述人脸表情特征确定出用户处于预设消极表情状态,则检测所述照片在被调整后的预设时长内是否被删除。
- 根据权利要求17所述的电子设备,其中,所述处理器用于执行:获取预设时间范围内拍摄的需要调整的各照片所包含的局部对象类别的数量;根据所述各照片包含的局部对象类别的数量,计算对应的平均值;根据所述平均值,更新所述预设第一阈值。
- 根据权利要求18所述的电子设备,其中,所述处理器用于执行:将所述平均值的数值设定为新的预设第一阈值。
- 根据权利要求18所述的电子设备,其中,所述处理器用于执行:在所述平均值的基础上增加或减少预设幅度,得到目标数值;将所述目标数值设定为新的预设第一阈值。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711407286.5A CN109961403B (zh) | 2017-12-22 | 2017-12-22 | 照片的调整方法、装置、存储介质及电子设备 |
CN201711407286.5 | 2017-12-22 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019120025A1 true WO2019120025A1 (zh) | 2019-06-27 |
Family
ID=66993033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/116746 WO2019120025A1 (zh) | 2017-12-22 | 2018-11-21 | 照片的调整方法、装置、存储介质及电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109961403B (zh) |
WO (1) | WO2019120025A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112040180A (zh) * | 2020-08-19 | 2020-12-04 | 浙江大华技术股份有限公司 | 一种图像采集设备的控制方法、设备及系统 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111583283B (zh) * | 2020-05-20 | 2023-06-20 | 抖音视界有限公司 | 图像分割方法、装置、电子设备及介质 |
CN113283538B (zh) * | 2021-06-11 | 2022-07-22 | 长江大学 | 一种基于卷积神经网络的昆虫分类及计数方法 |
CN114022496B (zh) * | 2021-09-26 | 2023-04-07 | 天翼爱音乐文化科技有限公司 | 图像处理方法、系统、装置及存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104063842A (zh) * | 2014-05-30 | 2014-09-24 | 小米科技有限责任公司 | 处理图像的方法、装置及终端 |
WO2015042891A1 (zh) * | 2013-09-27 | 2015-04-02 | 华为技术有限公司 | 图像语义分割的方法和装置 |
CN105744171A (zh) * | 2016-03-30 | 2016-07-06 | 联想(北京)有限公司 | 一种图像处理方法及电子设备 |
CN106534687A (zh) * | 2016-11-18 | 2017-03-22 | 广东欧珀移动通信有限公司 | 控制方法及控制装置 |
CN107358241A (zh) * | 2017-06-30 | 2017-11-17 | 广东欧珀移动通信有限公司 | 图像处理方法、装置、存储介质及电子设备 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010108475A (ja) * | 2008-10-03 | 2010-05-13 | Sony Corp | 画像処理装置および方法、プログラム、並びに記録媒体 |
CN101403949A (zh) * | 2008-11-11 | 2009-04-08 | 珠海金山软件股份有限公司 | 手写输入装置和手写输入方法 |
CN104935802B (zh) * | 2014-03-17 | 2018-02-27 | 联想(北京)有限公司 | 图像处理方法、电子设备和系统 |
CN104503749B (zh) * | 2014-12-12 | 2017-11-21 | 广东欧珀移动通信有限公司 | 照片处理方法和电子设备 |
CN105872350A (zh) * | 2015-12-08 | 2016-08-17 | 乐视移动智能信息技术(北京)有限公司 | 相机拍摄参数调整方法及装置 |
CN105354565A (zh) * | 2015-12-23 | 2016-02-24 | 北京市商汤科技开发有限公司 | 基于全卷积网络人脸五官定位与判别的方法及系统 |
CN106251369B (zh) * | 2016-07-22 | 2019-04-16 | 北京小米移动软件有限公司 | 图像处理方法及装置 |
-
2017
- 2017-12-22 CN CN201711407286.5A patent/CN109961403B/zh active Active
-
2018
- 2018-11-21 WO PCT/CN2018/116746 patent/WO2019120025A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015042891A1 (zh) * | 2013-09-27 | 2015-04-02 | 华为技术有限公司 | 图像语义分割的方法和装置 |
CN104063842A (zh) * | 2014-05-30 | 2014-09-24 | 小米科技有限责任公司 | 处理图像的方法、装置及终端 |
CN105744171A (zh) * | 2016-03-30 | 2016-07-06 | 联想(北京)有限公司 | 一种图像处理方法及电子设备 |
CN106534687A (zh) * | 2016-11-18 | 2017-03-22 | 广东欧珀移动通信有限公司 | 控制方法及控制装置 |
CN107358241A (zh) * | 2017-06-30 | 2017-11-17 | 广东欧珀移动通信有限公司 | 图像处理方法、装置、存储介质及电子设备 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112040180A (zh) * | 2020-08-19 | 2020-12-04 | 浙江大华技术股份有限公司 | 一种图像采集设备的控制方法、设备及系统 |
CN112040180B (zh) * | 2020-08-19 | 2022-06-07 | 浙江大华技术股份有限公司 | 一种图像采集设备的控制方法、设备及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN109961403A (zh) | 2019-07-02 |
CN109961403B (zh) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109461167B (zh) | 图像处理模型的训练方法、抠图方法、装置、介质及终端 | |
WO2019109801A1 (zh) | 拍摄参数的调整方法、装置、存储介质及移动终端 | |
WO2019120025A1 (zh) | 照片的调整方法、装置、存储介质及电子设备 | |
WO2019120029A1 (zh) | 智能调节屏幕亮度的方法、装置、存储介质及移动终端 | |
US8792722B2 (en) | Hand gesture detection | |
CN108701439B (zh) | 一种图像显示优化方法及装置 | |
US10586308B2 (en) | Digital media environment for removal of obstructions in a digital image scene | |
US20150116350A1 (en) | Combined composition and change-based models for image cropping | |
WO2019120016A1 (zh) | 图像处理方法、装置、存储介质及电子设备 | |
CN108234882B (zh) | 一种图像虚化方法及移动终端 | |
US20170053156A1 (en) | Human face recognition method, apparatus and terminal | |
CN107392933B (zh) | 一种图像分割的方法及移动终端 | |
CN110619350B (zh) | 图像检测方法、装置及存储介质 | |
CN108898082B (zh) | 图片处理方法、图片处理装置及终端设备 | |
CN111182212B (zh) | 图像处理方法、装置、存储介质以及电子设备 | |
CN107909569B (zh) | 一种花屏检测方法、花屏检测装置及电子设备 | |
CN111209970A (zh) | 视频分类方法、装置、存储介质及服务器 | |
WO2018233254A1 (zh) | 基于终端的物体识别方法、装置及电子设备 | |
CN108961267B (zh) | 图片处理方法、图片处理装置及终端设备 | |
CN110930329A (zh) | 星空图像处理方法及装置 | |
WO2018184260A1 (zh) | 文档图像的校正方法及装置 | |
CN109120854A (zh) | 图像处理方法、装置、电子设备及存储介质 | |
WO2019120018A1 (zh) | 照片的处理方法、装置、存储介质及电子设备 | |
CN109784327B (zh) | 边界框确定方法、装置、电子设备及存储介质 | |
CN104077597A (zh) | 图像分类方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18892726 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18892726 Country of ref document: EP Kind code of ref document: A1 |