Image processing method and device and electronic equipment

By replacing the target object image in the first picture with reference pictures adjacent to time in the electronic device, the problem of insufficient picture quality in the prior art is solved, and a higher quality shooting effect is achieved.

CN119155558APending Publication Date: 2024-12-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411172619.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The quality of the pictures taken by existing electronic devices is insufficient, especially when multiple people are photographed or objects are reflected or blocked, which affects the quality of the pictures.

Method used

By acquiring a reference picture adjacent to the capture time and shooting time during the shooting operation, replacing the target object image in the first picture as an object image that meets the preset visual conditions, thereby improving the picture quality.

Benefits of technology

The quality of the shot is improved, so that the visual effect of the objects in the picture is more in line with user needs, such as smiling faces or opening eyes, improving the visual effect of the shot.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155558A_ABST
    Figure CN119155558A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method and device and electronic equipment. The method comprises the following steps: in response to a shooting operation, obtaining a first picture obtained by shooting; identifying the reference picture to obtain a first object image of an object in the reference picture, the reference picture being a picture whose acquisition time is adjacent to the shooting time of the first picture, and the first object image being an object image satisfying a preset visual condition; and replacing the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture. Therefore, after the first picture is shot, the first object image of the object is further obtained from the reference picture with the adjacent acquisition time, and under the condition that the first object image is obtained based on the preset visual condition, the object image of the first target object in the first picture is replaced with the first object image, so that the first object image is obtained. And the quality of the obtained second picture can be improved compared with the quality of the first picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to an image processing method, device and electronic device. Background Art

[0002] With the rapid development of science and technology, electronic devices (such as smart phones, tablet computers, etc.) are increasingly equipped with cameras, which greatly enriches users' daily experience and creative space. When an electronic device is equipped with a camera, the user of the electronic device can use the camera to take pictures according to their needs. However, the quality of pictures taken by related electronic devices needs to be improved. Summary of the invention

[0003] In view of the above problems, the present application proposes an image processing method, device and electronic device to improve the above problems.

[0004] In a first aspect, the present application provides an image processing method, comprising: in response to a shooting operation, acquiring a first picture obtained by shooting; replacing an object image of a first target object in the first picture with a first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture, the first object image of the first target object is obtained from a reference picture, the reference picture is a picture whose acquisition time is close to the shooting time of the first picture, and the first object image satisfies a preset visual condition.

[0005] In a second aspect, the present application provides an image processing device, comprising: an image acquisition unit, for acquiring a first image captured in response to a shooting operation; an image processing unit, for replacing an object image of a first target object in the first image with a first object image of the first target object to obtain a second image, wherein the first target object is at least one object in the first image, the first object image of the first target object is obtained from a reference image, the reference image is a image whose acquisition time is close to the shooting time of the first image, and the first object image satisfies a preset visual condition.

[0006] In a third aspect, the present application provides an electronic device, which includes at least a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.

[0007] In a fourth aspect, the present application provides a computer-readable storage medium having program code stored therein, wherein the above method is executed when the program code is executed by a processor.

[0008] The present application provides an image processing method, device and electronic device, in which a first image obtained by shooting can be obtained in response to a shooting operation, and a first object image of a first target object (the object to be replaced by the object image) can be obtained through a reference image whose acquisition time is close to the shooting time of the first image, and then the object image of the first target object in the first image is replaced based on the first object image of the first target object to obtain a second image. Thus, through the above method, in the case of the first image obtained by the shooting operation, a picture with a close acquisition time can be further combined as a reference picture, and then the first object image of the object is obtained from the reference picture. In the case where the first object image is obtained by screening based on preset visual conditions, by replacing the object image of the first target object in the first image with the first object image, the quality of the obtained second image can be improved compared with the quality of the first image, and in the case where the second image is used as the image finally obtained by the shooting operation, the quality of the captured image is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A schematic diagram showing an application scenario of the image processing method proposed in an embodiment of the present application;

[0011] Figure 2 A schematic diagram showing another application scenario of the image processing method proposed in an embodiment of the present application;

[0012] Figure 3 A flowchart of an image processing method proposed in an embodiment of the present application is shown;

[0013] Figure 4 A schematic diagram of determining a first picture in an embodiment of the present application is shown;

[0014] Figure 5 A schematic diagram of a first candidate image in an embodiment of the present application is shown;

[0015] Figure 6 A schematic diagram of a second candidate image in an embodiment of the present application is shown;

[0016] Figure 7 A schematic diagram showing switching of shooting modes in an embodiment of the present application is shown;

[0017] Figure 8 A flowchart of an image processing method proposed in another embodiment of the present application is shown;

[0018] Fig. 9 A schematic diagram showing pixels at the same position in the present application is shown;

[0019] Fig.10 A schematic diagram showing the calculation of pixel value difference in the present application is shown;

[0020] Fig.11 A flowchart of an image processing method proposed in another embodiment of the present application is shown;

[0021] Fig.12 A schematic diagram showing an image processing method provided by an embodiment of the present application applied to a character processing scene;

[0022] Fig.13 A flowchart of an image processing method proposed in another embodiment of the present application is shown;

[0023] Fig.14 A schematic diagram showing the display of the second picture in the present application is shown;

[0024] Fig.15 A schematic diagram showing displaying a set of object images of a second target object in the present application is shown;

[0025] Fig.16 A structural block diagram of an image processing device proposed in an embodiment of the present application is shown;

[0026] Fig.17 A structural block diagram of another electronic device for executing an image processing method according to an embodiment of the present application is shown;

[0027] Fig.18 It is a storage unit of an embodiment of the present application for storing or carrying a program code for implementing the image processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] With the rapid development of science and technology, electronic devices in modern life, such as smartphones, tablets and even wearable devices, are generally equipped with cameras. This trend has not only profoundly changed the way people communicate, but also greatly broadened the boundaries of users' daily experience and the infinite space for creative expression. Nowadays, users can capture every wonderful moment in life through these cameras with just a click.

[0030] However, despite the continuous innovation of camera technology in electronic devices, users' demands for image quality are also growing and becoming more diverse. For example, when taking photos of multiple people, some people's expressions may not be ideal in the photos, which may affect the quality of the photos. For another example, when taking photos of multiple objects, some objects may reflect light or be blocked, which may affect the quality of the photos.

[0031] Therefore, after the inventors discovered the above problems in the research, they proposed the image processing method, device and electronic device in the present application that can improve the above problems. In this method, in response to the shooting operation, the first picture obtained by shooting can be obtained, and the first object image of the first target object can be obtained through a reference picture whose acquisition time is close to the shooting time of the first picture, and then based on the first object image of the first target object, the object image of the first target object in the first picture is replaced to obtain the second picture. Therefore, through the above method, in the case of the first picture obtained by the shooting operation, it is possible to further combine the picture with the adjacent acquisition time as the reference picture, and then obtain the object image set from the reference picture, so as to replace the object image of the first target object in the first picture with the object image set of the first target object, so that the quality of the obtained second picture can be improved compared with the quality of the first picture, and in the case of taking the second picture as the picture finally obtained by the shooting operation, the quality of the picture obtained by shooting is improved.

[0032] It should be noted that, in the embodiments of the present application, the higher quality of the picture can be understood as the visual effect of the object in the picture is more in line with the needs or expectations of the user. For example, the user's demand is that the faces in the captured pictures are all smiling. In this case, if the faces that are not smiling in the first picture are replaced with smiling faces, then a quality improvement is achieved. For another example, if the user's demand is that the eyes are all open, then if the faces in the first picture with closed eyes are replaced with faces in the open eyes, then a quality improvement is also achieved.

[0033] Before further describing the embodiments of the present application in detail, an application environment involved in the embodiments of the present application is introduced.

[0034] The following first introduces the application scenarios involved in the embodiments of the present application.

[0035] In the embodiment of the present application, the image processing method provided can be executed by an electronic device. In this way, all steps in the image processing method provided by the embodiment of the present application can be executed by the electronic device. For example, Figure 1 As shown, all steps in the image processing method provided in the embodiment of the present application can be executed by the processor of the electronic device 100.

[0036] Alternatively, the image processing method provided in the embodiment of the present application may also be executed by a server. Correspondingly, in this mode of execution by the server, the server may start executing the steps in the image processing method provided in the embodiment of the present application in response to a trigger instruction. The trigger instruction may be sent by an electronic device used by a user, or may be triggered locally by the server in response to some automation events.

[0037] In addition, the image processing method provided in the embodiment of the present application can also be executed by the electronic device and the server in collaboration. In this way, some steps of the image processing method provided in the embodiment of the present application are executed by the electronic device, while other steps are executed by the server. For example, Figure 2 As shown, the electronic device 100 can execute the image processing method including: in response to a shooting operation, obtaining a first picture taken, the electronic device 100 transmits the first picture and a reference picture to the server 200, after receiving the first picture and the reference picture, the server 200 can execute subsequent steps to obtain a second picture, and then transmit the second picture to the electronic device 100, after receiving the second picture, the electronic device 100 can store, display and share the target image.

[0038] It should be noted that in this method of collaborative execution by the electronic device and the server, the steps respectively executed by the electronic device and the server are not limited to the methods introduced in the above examples. In actual applications, the steps respectively executed by the electronic device and the server can be dynamically adjusted according to actual conditions.

[0039] It should be noted that the electronic device 100 is Figure 1 and Figure 2In addition to the smartphone shown in , it can also be a device equipped with a camera such as a tablet computer, a smart watch, and an intelligent voice assistant. Server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud computing, cloud storage, network services, cloud communications, middleware services, and artificial intelligence platforms. Among them, in the case where the image processing method provided in the embodiment of the present application is executed by a server cluster or a distributed system composed of multiple physical servers, different steps in the image processing method can be executed by different physical servers respectively, or can be executed in a distributed manner by a server built based on a distributed system.

[0040] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0041] See also Figure 3 , an image processing method provided by an embodiment of the present application, the method comprising:

[0042] S110: In response to the shooting operation, a first shot picture is acquired.

[0043] In the embodiment of the present application, the shooting operation can be understood as an operation of touching a shooting button. The shooting button can be a physical button or a virtual button. It should be noted that when the electronic device starts the camera, the electronic device can display the image (real-time preview image) captured by the camera in real time through the preview interface. When the electronic device detects the shooting operation, the image currently displayed in the preview interface is used as the first picture.

[0044] For example, Figure 4 As shown, after the camera of the electronic device is started, the images displayed in sequence on the preview interface include image 10, image 11, image 12 and image 13. If the user triggers a shooting operation when image 13 is displayed, image 13 can be used as the first picture.

[0045] S120: Replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture, the first object image of the first target object is obtained from a reference picture, the reference picture is a picture whose acquisition time is close to the shooting time of the first picture, and the first object image meets a preset visual condition.

[0046] In the embodiment of the present application, the reference picture is a picture whose acquisition time is close to the shooting time of the first picture. The shooting time of the first picture can be understood as the trigger time of the aforementioned shooting operation, and being close to the shooting time of the first picture can be understood as the shooting time of the first picture being close to the acquisition time of the reference picture. For example, the time interval between the acquisition time and the shooting time of the reference picture can be less than the preset duration. The preset duration is not specifically limited in the embodiment of the present application. For example, the preset duration can be 1 second, or 2 seconds, etc.

[0047] In the embodiments of the present application, there may be multiple ways to obtain reference images.

[0048] As a method, a reference image can be determined from the first candidate image. It should be noted that after the camera is started, even if the user does not trigger the shooting operation, the camera will still capture images (for example, the aforementioned real-time preview image) and can cache the captured images. In this case, the cached image can be used as the first candidate image. Then, after obtaining the first image, the reference image can be obtained from the first candidate image.

[0049] The first candidate image may be generated in the form of a video or a picture. In the case where the first candidate image is a video, the start acquisition time of the first candidate image is before the shooting time of the first picture, and the end acquisition time of the first candidate image is after the shooting time of the first picture. For example, the start acquisition time of the first candidate image is earlier than the shooting time of the first picture by a preset time length (for example, 1 second earlier), and the end acquisition time of the first candidate image is later than the shooting time of the first picture by a preset time length (for example, 1 second later). In the case where the first candidate image is in the form of a picture, the first candidate image may include multiple cached pictures, wherein the acquisition time of the first cached picture among the multiple cached pictures is before the shooting time of the first picture, and the acquisition time of the last cached picture among the multiple cached pictures is after the shooting time of the first picture.

[0050] For example, Figure 5 As shown, in the case where the first candidate content is a video, the shooting time of the first picture 13 is between the start acquisition time of the first candidate content and the end acquisition time of the first candidate content.

[0051] As another method, after obtaining the first image in response to the shooting operation, an image of a certain length can be collected immediately as the second candidate image. Then, a reference image is obtained from the second candidate image. For example, Figure 6 As shown, the start acquisition time of the second candidate image is the shooting time of the first image 13 .

[0052] It should be noted that, because the acquisition time of the reference picture is close to the shooting time of the first picture, it means that the objects appearing in the first picture will also appear in the reference picture. Alternatively, it can also be understood that the objects appearing in the reference picture will also include the objects in the first picture. For example, when the objects are people, when the user triggers the shooting operation to take pictures of people W1, W2 and W3, the first picture taken may include people W1, W2 and W3. Correspondingly, because the acquisition time of the reference picture is close to that of the first picture, the people included in the reference picture will also include people W1, W2 and W3.

[0053] Among them, although the reference picture also includes the objects that appear in the first picture, because the acquisition time of the reference picture is different from that of the first picture, the state of the same object in the first picture may be different from the state in the reference picture. For example, when the object is a person, and the first picture includes person W1, person W2, and person W3, person W1 may be in a closed-eye state in the first picture, but person W1 may be in an open-eye state in the reference picture. For another example, person W2 may not be smiling in the first picture, but person W2 may be smiling in the reference picture.

[0054] By identifying the reference image, the first object image corresponding to each object can be obtained from the reference image, and then the first object image can be used to replace the object image of the object in the first image, so as to replace the undesirable part of the first image (for example, a face with closed eyes) with an ideal part (for example, a face with open eyes). The first object image is an object image that meets preset visual conditions. The preset visual conditions can be understood as conditions that meet certain visual quality requirements. The visual quality requirements can include that the photographed person is in an open-eyed state, or that the photographed person is in a smiling state, and in the latter case, there is no obstructed part of the photographed object.

[0055] Optionally, the visual feature condition can be pre-configured by a developer. Alternatively, the visual feature condition can be configured by a user of the electronic device according to his or her own preferences.

[0056] The first target object may be understood as an object that needs to have its image replaced.

[0057] After obtaining the first target object determined from the first picture, the first object image of the first target object can be used to replace the object image of the first target object in the first picture, thereby obtaining the second picture. After obtaining the second picture, the second picture can be displayed, or the second picture can be directly stored. Alternatively, both the first picture and the second picture can be stored.

[0058] In the embodiment of the present application, there may be multiple ways to determine the first target object.

[0059] As one approach, the first target object may be an object that does not satisfy the preset visual condition.

[0060] As shown in the foregoing, the preset visual conditions are conditions that meet certain visual quality requirements. Among them, in the embodiment of the present application, objects may include multiple categories such as people, animals, and objects. For objects of different categories, the content of the preset visual conditions may be different. Optionally, in the case where the object is a person, the preset visual conditions may include at least one of the following conditions: the eyes of the person's face are open, the face is in a smiling state, and the face is facing the camera. Optionally, in the case where the object is an object (which can be understood as an object other than a person or an animal), the preset visual conditions may include that the object does not reflect light and the object is not blocked.

[0061] As one approach, the first target object may be an object pre-selected by a user.

[0062] In this way, the user can configure the object that can be used for object image replacement, or the user can configure the object that is expected to be replaced by the object image. Furthermore, the object that the user determines can be used for object image replacement can be determined as the first target object, or the object that the user expects to replace the object image can be determined as the first target object. For example, if the user expects that he is always in a better visual state (for example, always in an open-eyed state) in each picture taken, then he can be configured as the first target object. For another example, if the user expects that he is more likely to be smiling in the pictures taken, then he can also be configured as the first target object.

[0063] Optionally, in addition to the user of the electronic device, other people or animals can also be configured as the first target object. For example, the user of the electronic device can configure his or her family members or pets as the first target object.

[0064] As a method, the first target object may also be determined by combining the above two conditions. In this method, the first target object is an object pre-selected by the user whose image does not meet the preset visual condition.

[0065] In the embodiment of the present application, the electronic device may correspond to a plurality of shooting modes. In this case, after performing the shooting operation, the electronic device may detect the currently used shooting mode, and then determine the subsequent processing steps according to the currently used shooting mode.

[0066] Optionally, after executing the shooting operation, if the electronic device is currently in the first shooting mode, the reference image is identified to obtain a first object image of the object in the reference image, and then the second image obtained by the subsequent processing process is used as the image obtained by the shooting operation. Correspondingly, if the electronic device is currently in the second shooting mode, the first image is used as the image obtained by executing the shooting operation.

[0067] The first shooting mode can be understood as a shooting mode in which an object image can be replaced. In the first shooting mode, the object image of the first target object can be replaced. Correspondingly, the second shooting mode can be understood as a shooting mode in which an object image is not replaced. In the second shooting mode, the captured image can be directly output.

[0068] For example, Figure 7 As shown, Figure 7 The interface 20 shown is a preview interface, and the image currently captured by the camera is displayed in the interface 20. When the electronic device is in mode 1, the user can Figure 7 Slide in the direction indicated by the arrow in the left image to switch the electronic device to Mode 2 ( Figure 7 As shown in the image on the right), Mode 1 may be the aforementioned first shooting mode, and Mode 2 may be the aforementioned second shooting mode.

[0069] An image processing method provided by the present embodiment enables, through the above method, in the case of a first picture obtained by a shooting operation, to further combine a picture with a close acquisition time as a reference picture, and then obtain a first object image of the object from the reference picture, and in the case where the first object image is obtained by screening based on preset visual conditions, by replacing the object image of the first target object in the first picture with the first object image, the quality of the obtained second picture can be improved compared with the quality of the first picture, and in the case where the second picture is used as the picture finally obtained by the shooting operation, the quality of the picture obtained by shooting is improved.

[0070] See also Figure 8 , an image processing method provided by an embodiment of the present application, the method comprising:

[0071] S210: In response to the shooting operation, obtaining a first shot picture.

[0072] S220: Obtain a reference picture through a video whose acquisition time is close to the shooting time of the first picture, where the reference picture is a picture whose acquisition time is close to the shooting time of the first picture.

[0073] The acquisition time of the video is close to the shooting time of the first picture, which can be understood as the start acquisition time of the video is close to the shooting time of the first picture, or it can be understood as the end acquisition time of the video is close to the shooting time of the first picture. Alternatively, it can be understood as the start acquisition time of the video and the end acquisition time of the video are both close to the shooting time of the first picture. The start acquisition time of the video can be understood as the acquisition time of the first frame of the video, and the end acquisition time of the video can be understood as the acquisition time of the last frame of the video.

[0074] As shown in the foregoing, after the camera of the electronic device is started, even if the user does not trigger the shooting operation, the electronic device can also collect images in real time through the camera and cache them. In this case, the video obtained in this embodiment can be obtained based on the cached image. Wherein, in the process of obtaining the video from the cached image, the length of the obtained video is not specifically limited in the embodiment of the present application. As a way to determine the length of the video, the length of the obtained video can be pre-configured by the developer. As another way to determine the length of the video, the length of the obtained video can be determined by the electronic device according to actual conditions.

[0075] Optionally, the electronic device may determine the length of the acquired video according to the determined adjustment mode. It should be noted that the determined adjustment mode may be efficiency first or quality first. Among them, in the case of efficiency first, the electronic device is more concerned with how to quickly complete the replacement of the object image of the first target object. For example, in the reference picture, if the first object image of the first target object is not found, the object image of the first target object in the first picture can be replaced by an object image in the reference picture that relatively satisfies the preset visual conditions. In the case of quality first, the electronic device is more concerned with finding the first object image of each object in the reference picture as much as possible, thereby improving the quality of the final second picture.

[0076] Among them, in order to enable the electronic device to find the first object image of the first target object in the reference picture as much as possible, when the adjustment mode is quality priority, the length of the acquired video can be relatively longer. Among them, when the length of the acquired video is longer, the number of reference pictures acquired based on the acquired video is greater, and the first object image of the first target object can be found with a greater probability. Optionally, when the adjustment mode is quality priority, the length of the acquired video can be a first length, and when the adjustment mode is efficiency priority, the length of the acquired video can be a second length, wherein the second length is shorter than the first length. For example, the first length can be 4 seconds, and the second length can be 2 seconds.

[0077] Correspondingly, in order to improve the overall processing efficiency, when the adjustment mode is efficiency-first, the length of the acquired video can be relatively shorter. It should be noted that the shorter the length of the acquired video, the fewer the number of reference images obtained in the end, and the fewer images the electronic device needs to recognize. In addition, when efficiency is prioritized, it is not required to obtain the first object image. Therefore, it can reduce the time consumption of the electronic device for image recognition and complete the replacement of the object image of the first target object.

[0078] Optionally, the electronic device can also determine the length of the video obtained according to the user's configuration. In this way, the user can configure the length of the video to be obtained in the setting interface of the electronic device.

[0079] Optionally, the electronic device may also determine the length of the acquired video according to the number of objects in the first picture taken. It should be noted that, when the number of objects in the first picture is greater, the probability of the first target object being present is relatively greater. For example, when the object is a person, if there are more people in the first picture, there is a greater probability that the eyes of the person are closed, or there is a greater probability that the person does not smile. Therefore, when more objects are detected in the first picture, the length of the acquired video can be relatively longer, and when fewer objects are detected in the first picture, the length of the acquired video can be relatively shorter. For example, if the number of objects included in the first picture is greater than a preset number threshold, the length of the acquired video can be determined to be a third length, and if the number of objects included in the first picture is less than or equal to the preset number threshold, the length of the acquired video can be determined to be a fourth length, wherein the fourth length is shorter than the third length. For example, the third length may be 4 seconds, and the fourth length may be 2 seconds.

[0080] As a way, obtaining the reference picture by collecting a video whose capture time is close to the shooting time of the first picture may include: taking at least one frame of the multiple frames of pictures included in the video as the reference picture.

[0081] It is understandable that a video may include multiple frames of images, and each frame of image can be used as a picture, and thus a video may include multiple frames of images, or it can be understood that a video may include multiple pictures. Optionally, the video frame (one frame of image) at each timestamp of the video can be parsed out through the MediaMetadataRetriever tool and saved as a corresponding picture (for example, a picture in Bitmap format).

[0082] Optionally, multiple frames of pictures included in the video can be used as reference pictures. Exemplarily, the video includes picture P1, picture P2, picture P3 and picture P4, wherein picture P1 can be understood as the first frame image of the video, and picture P4 can be understood as the last frame image of the video. In this case, picture P1, picture P2, picture P3 and picture P4 can all be used as reference pictures.

[0083] Optionally, when the video includes multiple frames of pictures, some pictures can be selected from the multiple frames as reference pictures. For example, the video includes pictures P1, P2, P3, P4 and P5, where picture P1 can be understood as the first frame of the video, and picture P5 can be understood as the last frame of the video. In this case, a reference picture can be determined every other picture starting from picture P1, and then pictures P1, P3 and P5 can be used as reference pictures.

[0084] Optionally, when the video includes multiple frames of pictures, the difference between two adjacent frames of pictures may be compared. When the difference between the two adjacent frames of pictures is small, one frame of picture may be selected from the two adjacent frames of pictures as a reference picture.

[0085] As a method for determining the degree of difference between two adjacent frames of images, a difference value between the two adjacent frames of images can be determined based on image parameters of the two adjacent frames of images, and the difference value represents the degree of difference between the two adjacent frames of images. The image parameters include at least one of a pixel value and a brightness value.

[0086] Optionally, take the case where the image parameters include pixel values. It should be noted that, for a picture, each pixel included therein will have a corresponding pixel value. In this case, when calculating the difference between two adjacent frames of pictures, the pixel value difference between two pixels in the same position in the two adjacent frames of pictures can be calculated first to obtain the pixel value difference corresponding to all two pixels in the same position in the two adjacent frames of pictures, and then the absolute values ​​of all pixel value differences are taken and summed to obtain the difference between the two adjacent frames of pictures.

[0087] For example, Fig. 9 As shown, the two frames of pictures for difference value calculation include picture 30 and picture 31, wherein picture 30 includes pixel X11, pixel X12...pixel X33. Correspondingly, picture 31 includes pixel X11, pixel X12...pixel X33. Among them, the position of pixel X11 in picture 30 is the first in the first row in picture 30, and the position of pixel X11 in picture 31 is also the first in the first row in picture 31, then pixel X11 in picture 30 and pixel X11 in picture 31 can be understood as two pixels in the same position. By analogy, two pixels in the same position in all pictures 30 and 31 can be obtained. Among them, the pixel value difference between pixel X11 in picture 30 and pixel X11 in picture 31, the pixel value difference between pixel X12 in picture 30 and pixel X12 in picture 31...the pixel value difference between pixel X33 in picture 30 and pixel X33 in picture 31, can be taken by taking the absolute values ​​and then summing them up, then the difference value between picture 30 and picture 31 can be obtained.

[0088] Optionally, the pixel value difference between two pixels can be obtained by summing up the absolute values ​​of the differences between the two pixels in multiple color channels. For example, in RGB color mode, Fig.10 As shown, the pixel value difference between the two pixels can be obtained by calculating the difference between the two pixels in the red channel, the green channel, and the blue channel, and then taking the absolute values ​​of the differences of these channels and summing them up.

[0089] Optionally, when the image parameters include pixel values, the difference between two adjacent frames of images on a specified color channel can be used as the corresponding difference value. For example, for two frames of images for which the difference value is calculated, the channel means of the two frames of images on a specified color channel can be calculated, and then the respective channel means can be differenced to obtain the difference value. In an embodiment of the present application, in the process of calculating the channel mean of an image, the value of each pixel in the image in a specified color channel can be first obtained, and then the value of each pixel in the image in the specified color channel can be summed to obtain the total color value. By comparing the total color value with the number of pixels in the image, the channel mean of the specified color channel can be obtained.

[0090] Exemplarily, if the pixels in the picture include pixel X11, pixel X12, pixel X13, pixel X21, pixel X22 and pixel X23. Wherein, the designated color channel is the red channel. In this case, the values ​​of pixel X11, pixel X12, pixel X13, pixel X21, pixel X22 and pixel X23 on the red channel can be obtained, and the values ​​of pixel X11, pixel X12, pixel X13, pixel X21, pixel X22 and pixel X23 on the red channel can be summed to obtain the total color value. For example, the total color value can be V4. Then, by dividing V4 / 6, the channel mean of the picture on the red channel can be obtained.

[0091] Optionally, the acquired multiple frames of pictures can be converted into corresponding grayscale images, in which case the image parameters can be the brightness values ​​corresponding to the pixels. It should be noted that in the grayscale image, the brightness value of the pixel represents the grayscale level or brightness intensity of the pixel. A grayscale image is an image that contains only brightness information but not color information. In a grayscale image, each pixel is usually represented by a single value (for example, a brightness value between 0 and 255), where 0 represents black, 255 represents white, and the intermediate values ​​represent different degrees of gray. In this case, when calculating the difference between two pixels in the same position, only the difference in brightness value can be calculated without calculating the difference in each color channel, which can help reduce the amount of calculation and improve the final detection speed. It should be noted that the method of calculating the difference value based on the brightness value is the same as the method of calculating the difference value based on the pixel value. Therefore, the method of calculating the difference value based on the brightness value can refer to the aforementioned content, and the method of calculating the difference value based on the brightness value will not be introduced here.

[0092] When the difference value between two adjacent frames of images is obtained, the difference value can be compared with a preset threshold value. If the difference value is less than the preset threshold value, it is determined that the difference between the two adjacent frames of images is small. Correspondingly, if the difference value is greater than or equal to the preset threshold value, it is determined that the difference between the two adjacent frames of images is large.

[0093] Exemplarily, the pictures obtained from the video include picture P1, picture P2, picture P3 and picture P4, where if the difference between picture P1 and picture P2 is small, the difference between picture P2 and picture P3 is large, and the difference between picture P3 and picture P4 is large, then in addition to using picture P3 and picture P4 as reference pictures, one picture can be selected from picture P1 and picture P2 as a reference picture.

[0094] S230: Replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture, the first object image of the first target object is obtained from a reference picture, and the first object image satisfies a preset visual condition.

[0095] The present embodiment provides an image processing method, so that the quality of the second picture obtained by the above method can be improved compared with the quality of the first picture, and when the second picture is used as the picture finally obtained by the shooting operation, the quality of the picture obtained by shooting is improved. In addition, in the present embodiment, while shooting a picture, a video can also be collected, and then a reference picture can be obtained by collecting a video whose time is close to the shooting time of the first picture.

[0096] See also Fig.11 , an image processing method provided by an embodiment of the present application, the method comprising:

[0097] S310: In response to a shooting operation, obtaining a first shot picture.

[0098] S320: Identify the reference picture to obtain a set of object images of objects in the reference picture, where the reference picture is a picture whose acquisition time is close to the shooting time of the first picture.

[0099] It should be noted that when there are multiple reference pictures, the same object may appear in two or more reference pictures. In this case, the object images of the same object in different reference pictures are identified, and then a set of object images of the object can be obtained. Exemplarily, the reference pictures obtained may include pictures P5, P6, P7, and P8. Among them, object T1 and object T2 will appear in pictures P5, P6, P7, and P8. In this case, based on the object T1 in pictures P5, P6, P7, and P8, the object image set corresponding to object T1 can be obtained. Based on the object T2 in pictures P5, P6, P7, and P8, the object image set corresponding to object T2 can be obtained.

[0100] It should be noted that in an embodiment of the present application, the reference image can be collected by the electronic device (device that executes the image processing method) itself, or by other devices. In this way, the electronic device and other devices can be in an image acquisition state, and a communication connection can be maintained between the electronic device and the other devices. After the electronic device performs a shooting operation to obtain a first image, a picture acquisition request can be sent to other devices, and the picture acquisition request carries the shooting time of the first image, and then other devices can return a reference image based on the shooting time of the first image.

[0101] For example, if user U1 is using electronic device C1 to take a photo of a specific object, and at the same time, user U2 is also using electronic device C2 to take a photo of the feature object, in this case, the picture taken by electronic device C1 and the picture taken by electronic device C2 are close in shooting time, and electronic device C1 can use the picture taken by electronic device C2 as a reference picture.

[0102] As a method, the reference image can be identified by an AI (Artificial Intelligence) model to obtain a set of object images of the objects in the reference image. In this case, the obtained reference images can be input into the AI ​​model, and then the AI ​​model can directly output the set of object images of the objects in the reference image.

[0103] S330: Determine a first object image of an object in a reference picture from a set of object images according to a preset visual condition.

[0104] After obtaining the object image set of each object in the reference image, each image in the object image set can be detected to take the image that meets the preset visual condition as the first object image. Exemplarily, the object images included in the object image set corresponding to object T1 include object image Z1, object image Z2, object image Z3 and object image Z4. If object image Z4 meets the preset visual condition, object image Z4 can be determined as the first object image.

[0105] As a way, the detection of each image in the object image set can be completed by a neural network model. For example, when the object image set is a face image set, each face in the face image set can be detected by an AI aesthetic detection model to select the best character portrait (the most beautiful face image) as the first object image. The AI ​​aesthetic detection model can be understood as a model that uses artificial intelligence technology and algorithms (for example, deep learning technology) to evaluate the aesthetic quality of images (especially face images). The AI ​​aesthetic detection model can automatically extract aesthetic features in images by learning from a large amount of annotated image data, and perform aesthetic scoring or classification on images based on these features.

[0106] It should be noted that, as shown in the foregoing, in the embodiments of the present application, the objects may be of multiple categories such as people, animals, and articles. For objects of different categories, the corresponding preset visual conditions may be different. As a method, when the object is a person, the determined object image set is a face image set. Correspondingly, the preset visual conditions are conditions for faces. In this way, a face image in the face image set whose facial features meet the preset visual conditions can be used as the first object image.

[0107] S340: Replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture.

[0108] Next, pass Fig.12 The example shown in the following introduces an application scenario of the image processing method involved in this application. Fig.12 In the example shown, the scene involved is a photo shoot of multiple people, the objects are people, and the obtained object image set is a face image set.

[0109] For example, Fig.12 As shown, after the electronic device performs a shooting operation, a first picture and a video whose acquisition time is close to the shooting time of the first picture can be obtained. The video can be subjected to frame extraction processing to obtain each frame included in the video, and then each frame image is used as a reference picture. For the reference picture, a set of face images for each task can be obtained, and then an aesthetic analysis is performed on the set of face images for each task to obtain the best character portrait for each character. For the first target object in the first picture (the character whose face needs to be replaced), the corresponding best character portrait can be used for replacement to obtain the second picture.

[0110] The present embodiment provides an image processing method, so that, in the case of a first picture obtained by a shooting operation, a picture with a close acquisition time can be further combined as a reference picture, and then a set of facial images of the person is obtained from the reference picture, so that the facial image of the first target person in the first picture is replaced by the first object image determined from the facial image set of the first target task, so that the quality of the obtained second picture can be improved compared with the quality of the first picture, and when the second picture is used as the final picture obtained by the shooting operation, the quality of the picture obtained by shooting is improved.

[0111] See also Fig.13 , an image processing method provided by an embodiment of the present application, the method comprising:

[0112] S410: In response to a shooting operation, obtaining a first shot picture.

[0113] S420: Identify the reference picture to obtain a first object image of the object in the reference picture, where the reference picture is a picture whose acquisition time is close to the shooting time of the first picture, and the first object image is an object image that meets a preset visual condition.

[0114] S430: Replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture.

[0115] S440: Display the second picture.

[0116] S450: In response to a selection operation performed by the user in the second picture, taking the selected object as a second target object.

[0117] As a method, when the second image is displayed, the user can select the second target object by clicking. For example, when the user's click operation is detected, the position clicked by the user is compared with the position of the object included in the second image. If the position of an object is the same as the position clicked by the user, the object is used as the second target object. For example, Fig.14 As shown, the displayed second picture includes person 40, person 41, person 42, person 43 and person 44. If the user clicks on person 44, person 44 can be used as the second target object.

[0118] S460: Acquire a second object image determined by the user from the object image set of the second target object.

[0119] After detecting that the user selects the second target object, the object image set of the second target object can be displayed on the screen so that the user can select the second object image. Fig.15 As shown, after the user clicks on the character 44, the face images 51, 52, 53, and 54 in the face image set of the character 44 may be displayed on the screen. Furthermore, the user may determine the second object image through further clicking operations.

[0120] S470: Replace the object image of the second target object in the second picture with the second object image of the second target object to obtain a third picture.

[0121] This embodiment provides an image processing method, so that the quality of the second picture obtained by the above method can be improved compared with the quality of the first picture, and when the second picture is used as the picture finally obtained by the shooting operation, the quality of the picture obtained by shooting is improved. In addition, if the user is not satisfied with the quality of the second picture generated by the electronic device, the user can further manually select the second target object from the second picture to replace the object image, so as to further obtain a picture (third picture) that meets the user's quality requirements.

[0122] It should be noted that in the embodiment of the present application, the object image of the first target object in the first picture is replaced. The specific category of the first target object is not specifically limited in the example of the present application. For example, the first target object may be a person, an animal, or an object. Alternatively, the first target object may include at least one of the categories of a person, an animal, and an object.

[0123] As one approach, the electronic device may determine the first target object in combination with the user's personalized data.

[0124] In the embodiments of the present application, personalized data can be understood as data that characterizes the habits or preferences of a user. Alternatively, it can also be understood as data that characterizes a user profile of a user. Among them, the target user can be understood as the user referred to when obtaining personalized data, so that the obtained personalized data corresponds to the target user. Among them, the personalized data corresponds to the target user, which can be understood as the obtained personalized data characterizing the habits or preferences of the target user.

[0125] In the embodiment of the present application, the target user can be understood as the user of the electronic device, or can also be understood as the user who is currently using the electronic device. The user of the electronic device can be understood as the user corresponding to the identification information recorded in the electronic device. The identification information can include a user account or a current phone number.

[0126] As a method, the personalized data of the user of the electronic device can be stored in the electronic device. The personalized data stored locally in the electronic device can be personalized data on multiple aspects. For example, it can include personalized data on object preferences, or it can include personalized data on visual aesthetics, etc. In the case of a designated event trigger, the personalized data of the target user can be obtained as a reference. For example, the designated event can be a photo event.

[0127] As a way, the current user of the electronic device may not be the user of the electronic device (or, it can be understood that the current user of the electronic device is not the owner of the electronic device). For example, in some cases, the user of the electronic device may lend the electronic device to other users for use. In this case, if the personalized data is obtained directly based on the user of the electronic device, it may cause the acquired personalized data to not meet the needs of the current user. For example, the user of the electronic device C1 is user U1, and user U1 lends the electronic device C1 to user U2 for use. If user U2 triggers a specified event during the use of the electronic device C1, but the electronic device C1 still uses the personalized data of user U1 as the basis for the subsequent determination of the first target object, it will not only cause the privacy of user U1 to be leaked, but also make user U2 unable to obtain the desired shooting results. In this way, the electronic device can first perform user identification to use the identified user as the target user.

[0128] Among them, the method for performing user identification is not specifically limited in the embodiments of the present application. For example, as a user identification method, the electronic device can collect identity features through a functional device, and then identify the user's identity by matching the identity features. Optionally, the functional device can be a front camera or a structured light module. For example, the electronic device can perform image acquisition through a front camera, and then perform face recognition on the acquired image to use the identified user as the target user. Based on the aforementioned example of the electronic device C1, if user U1 lends the electronic device C1 to user U2 for use, the electronic device recognizes that the current user is user U2 through user identification, and the electronic device can obtain the personalized data of user U2.

[0129] It should be noted that after the electronic device obtains the identity feature, in order to facilitate the electronic device to successfully complete the user identification, the electronic device may store multiple user identity features. The identity feature may include a face feature, a fingerprint feature, or other identifiable features. For example, as shown in the following table:

[0130] ID Identity User ID 1 Feature T1 User U1 2 Feature T2 User U2 3 Features T3 User U3

[0131] As shown in the table above, the electronic device stores features T1, T2, and T3, where the user ID corresponding to feature T1 is user U1, the user ID corresponding to feature T2 is user U2, and the user ID corresponding to feature T3 is user U3. If the identity feature collected by the electronic device through the functional device is feature T2, it can be identified that the electronic device is currently being used by user U2.

[0132] It should be noted that, in the case where there are multiple ways to determine the target user, as one way, the electronic device can determine which way to use to determine the target user based on the current operating mode. For example, if the electronic device is currently in the guest mode, the target user can be determined by collecting identity features through functional devices. For another example, if the electronic device is currently in the master mode, the target user can be determined by obtaining the identification information recorded in the electronic device.

[0133] See also Fig.16 , an image processing device 500 provided in an embodiment of the present application, the device 500 includes:

[0134] The picture acquisition unit 510 is used to acquire a first picture obtained by shooting in response to a shooting operation.

[0135] The image processing unit 520 is used to replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture, the first object image of the first target object is obtained from a reference picture, the reference picture is a picture whose acquisition time is close to the shooting time of the first picture, and the first object image meets the preset visual conditions.

[0136] As a method, the image processing unit 520 is specifically configured to identify the reference image to obtain a first object image of the object in the reference image if the electronic device is currently in the first shooting mode, and to use the first image as the image obtained by performing the shooting operation if the electronic device is currently in the second shooting mode.

[0137] The image processing unit 520 is used to replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture.

[0138] As a method, the picture acquisition unit 510 is also used to obtain a reference picture by using a video whose acquisition time is close to the shooting time of the first picture. Optionally, the picture acquisition unit 510 is also specifically used to obtain a video whose acquisition time is close to the shooting time of the first picture; and use at least one frame of the multiple frames of pictures included in the video as a reference picture.

[0139] As a method, the image processing unit 520 is specifically used to identify the reference image to obtain an object image set of the object in the reference image; and determine the first object image of the object in the reference image from the object image set according to the preset visual condition. Optionally, the object includes a person, and the object image set is a face image set. In this case, the image processing unit 530 is specifically used to use the face image in the face image set whose facial features meet the preset visual conditions as the first object image.

[0140] As a method, the image processing unit 530 is also used to display a second picture; in response to a selection operation performed by a user in the second picture, the selected object is used as a second target object; a second object image determined by the user from a set of object images of the second target object is obtained; and the object image of the second target object in the second picture is replaced with the second object image of the second target object to obtain a third picture.

[0141] The image processing device provided in this embodiment can improve the quality of the second picture obtained compared with the quality of the first picture, and when the second picture is used as the final picture obtained by the shooting operation, the quality of the picture obtained by shooting is improved.

[0142] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0143] The following will be combined Fig.17 An electronic device provided by the present application is described.

[0144] See also Fig.17 Based on the above-mentioned image processing method and device, the embodiment of the present application also provides another electronic device 100 that can execute the above-mentioned image processing method. The electronic device 100 includes one or more (only one is shown in the figure) processors 102, a memory 104, a network module 106 and a camera 108 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above-mentioned embodiment, and the processor 102 can execute the program stored in the memory 104.

[0145] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.

[0146] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the terminal 100 during use.

[0147] The network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, communicate with an audio playback device. The network module 106 may include various existing circuit elements for performing these functions, for example, an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a user identity module (SIM) card, a memory, etc. The network module 106 may communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices via a wireless network. The above-mentioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may exchange information with a base station.

[0148] Please refer to Fig.18 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0149] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.

[0150] In summary, the present application provides an image processing method, device, and electronic device, in which a first picture obtained by shooting can be obtained in response to a shooting operation, and a first object image of a first target object can be obtained through a reference picture whose acquisition time is close to the shooting time of the first picture, and then the object image of the first target object in the first picture is replaced based on the first object image of the first target object to obtain a second picture. Thus, through the above method, in the case of the first picture obtained by the shooting operation, a picture with a close acquisition time can be further combined as a reference picture, and then the first object image of the object is obtained from the reference picture. In the case where the first object image is obtained by screening based on preset visual conditions, by replacing the object image of the first target object in the first picture with the first object image, the quality of the obtained second picture can be improved compared with the quality of the first picture, and in the case where the second picture is used as the picture finally obtained by the shooting operation, the quality of the picture obtained by shooting is improved.

[0151] When the technical solution provided in the embodiment of the present application is applied to character processing, on the basis of obtaining the original photo (first picture), the best head portrait content (a first object image) of each character in the video is obtained by combining AI analysis, and edited and replaced into the basic group photo, so as to achieve the goal of obtaining the best group photo (second picture) at the moment of taking the photo. At the same time, through the secondary editing method, each user can freely choose the group photo that he thinks is the best, so as to achieve maximum free customization. The beneficial effects are: 1. It is easy to capture the best group photo, and this group photo frame is the best photo of each person in different time dimensions; 2. The best group photo can be edited and freely selected according to everyone's preferences.

[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: In response to a shooting operation, acquiring a first picture taken; The object image of the first target object in the first picture is replaced with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture, the first object image of the first target object is obtained from a reference picture, the reference picture is a picture whose acquisition time is close to the shooting time of the first picture, and the first object image meets a preset visual condition.

2. The method according to claim 1, characterized in that Before replacing the object image of the first target object in the first picture with the first object image of the first target object to obtain the second picture, the method further includes: The reference picture is obtained by collecting a video whose capture time is close to the capture time of the first picture.

3. The method according to claim 2, characterized in that The step of obtaining a reference picture by collecting a video whose acquisition time is close to the shooting time of the first picture includes: Acquire a video whose acquisition time is close to the shooting time of the first picture; At least one frame of the multiple frames of pictures included in the video is used as a reference picture.

4. The method according to claim 1, characterized in that: Before replacing the object image of the first target object in the first picture with the first object image of the first target object to obtain the second picture, the method further includes: Identify the reference picture to obtain a set of object images of objects in the reference picture; Determining a first object image of an object in a reference picture from a set of object images according to the preset visual condition; A first object image of the first target object is acquired through the first object image of the object in the reference image.

5. The method according to claim 4, characterized in that The object includes a person, the object image includes a face image, the object image set is a face image set, and determining a first object image of the object in the reference picture from the object image set according to the preset visual condition includes: A face image in the face image set whose facial features meet the preset visual conditions is used as the first object image.

6. The method according to claim 4, characterized in that After replacing the object image of the first target object in the first picture with the first object image of the first target object to obtain the second picture, the method further includes: Display the second picture; In response to a selection operation performed by a user in the second picture, taking the selected object as a second target object; Acquire a second object image determined by a user from the object image set of the second target object; The object image of the second target object in the second picture is replaced by the second object image of the second target object to obtain a third picture.

7. The method according to claim 1, characterized in that The first target object is an object that satisfies at least one of the following conditions: The object image does not meet the preset visual condition; An object pre-selected by the user.

8. The method according to any one of claims 1 to 7, characterized in that: The step of replacing the object image of the first target object in the first picture with the first object image of the first target object to obtain the second picture further includes: Acquire a shooting mode of the electronic device; If the electronic device is currently in the first shooting mode, the object image of the first target object in the first picture is replaced with the first object image of the first target object to obtain a second picture; If the electronic device is currently in the second shooting mode, the first picture is used as the picture obtained by performing the shooting operation.

9. An image processing device, characterized in that: The device comprises: A picture acquisition unit, configured to acquire a first picture obtained by shooting in response to a shooting operation; An image processing unit is used to replace the object image of the first target object in the first picture with the first object image of the first target object to obtain a second picture, wherein the first target object is at least one object in the first picture, the first object image of the first target object is obtained from a reference picture, the reference picture is a picture whose acquisition time is close to the shooting time of the first picture, and the first object image meets a preset visual condition.

10. An electronic device, characterized in that: The method comprises a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement any one of the methods of claims 1-8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 8 is executed.