Image processing method, device, equipment and storage medium
By replacing the facial area in the picture, the problem of single image processing effect in the prior art is solved, and the replacement of facial expressions and the improvement of user experience is achieved.
Patent Information
- Application Number
- CN202110196637.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-02-22
AI Technical Summary
In the prior art, image processing can only adjust lines, colors, filters, etc., resulting in relatively single image processing effect and cannot meet user needs.
By replacing the first facial area in the displayed first picture to a second facial area different from it, the replacement of facial expressions is achieved, providing a richer image processing effect.
It realizes the replacement of facial expressions, improves the diversity of image processing and user experience, and meets the more complex needs of users.
Smart Images

Figure CN112818147B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a method, device, equipment and storage medium for image processing. Background Art
[0002] With the continuous development of the photography technology of electronic devices, mobile phones, tablet computers and other electronic devices have the function of image processing, such as adjusting the lines, colors, filters, etc. of the image.
[0003] In the process of implementing this application, the inventors found that there are at least the following problems in the prior art:
[0004] In the prior art, only image processing operations such as adjusting the lines, colors, and filters of an image can be realized, that is, only the display parameters of the image can be changed, so that the image processing effect is relatively simple and cannot meet user needs. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, device, equipment and storage medium for image processing, which can solve the technical problem that the image processing effect is relatively single and cannot meet user needs.
[0006] In order to solve the above technical problems, this application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for processing an image, the method comprising:
[0008] In a case where a first picture is displayed, receiving a first input; the first picture includes a first facial region;
[0009] In response to the first input, a second picture is displayed; the second picture is a picture generated after the first facial area in the first picture is replaced by the second facial area, and the first facial area and the second facial area correspond to different expressions.
[0010] In a second aspect, an embodiment of the present application provides a picture processing device, the device comprising:
[0011] A first receiving module is used to receive a first input when a first picture is displayed; the first picture includes a first facial area;
[0012] The first display module is used to display a second picture in response to the first input; the second picture is a picture generated after the first facial area in the first picture is replaced by the second facial area, and the first facial area and the second facial area have different corresponding expressions.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0016] In the embodiment of the present application, the first facial area in the displayed first picture is replaced with a second facial area that is different from the first facial area. Since the first facial area and the second facial area correspond to different expressions, the embodiment of the present application achieves the replacement of the facial expression in the first picture. Compared with the picture processing effect in the prior art that can only adjust the lines, colors, filters, etc. of the picture to change the display parameters of the image, the picture processing method provided by the embodiment of the present application can achieve the replacement of facial expressions and provide richer picture processing effects, thereby better meeting user needs and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a method for image processing provided by an embodiment of the present application;
[0018] Figure 2 is a schematic diagram of a display method of a first target control provided in an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of a display method of a first target control provided in an embodiment of the present application;
[0020] Figure 4 It is a schematic diagram of a display method of a facial area of an object and its corresponding controls provided in an embodiment of the present application;
[0021] Figure 5 is a schematic diagram of a display method of a candidate facial region provided in an embodiment of the present application;
[0022] Figure 6 is a schematic diagram of a display method of candidate facial regions provided in an embodiment of the present application;
[0023] Figure 7is a schematic diagram of a second picture provided in an embodiment of the present application;
[0024] Figure 8 is a schematic diagram of a display mode of a second target control provided in an embodiment of the present application;
[0025] Fig. 9 is a schematic diagram of a display method of a third target control provided in an embodiment of the present application;
[0026] Fig.10 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;
[0027] Fig.11 It is a structural schematic diagram of an electronic device provided in 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 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] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, the "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.
[0030] Based on the background technology, it can be known that in the prior art, when processing an image, the image can only be processed by adjusting the lines, colors, filters, etc. of the image, that is, only the display parameters of the image can be changed. This results in a relatively simple image processing effect that cannot meet user needs.
[0031] Based on the above findings, the embodiments of the present application provide a method, apparatus, device and storage medium for image processing, which can replace the first facial area in the displayed first image with a second facial area different from the first facial area. Since the expressions corresponding to the first facial area and the second facial area are different, the facial expression in the first image is replaced. Compared with the image processing effect in the prior art that can only adjust the lines, colors, filters and other image display parameters of the image, the image processing method provided in the embodiments of the present application can replace facial expressions and provide richer image processing effects, thereby better meeting user needs and improving user experience.
[0032] The following, in conjunction with the accompanying drawings, describes in detail the image processing method, apparatus, device and storage medium provided in the embodiments of the present application through specific embodiments and application scenarios.
[0033] Figure 1 A picture processing method provided by an embodiment of the present application is shown, and the picture processing method can be applied to electronic devices. Figure 1 As shown, the image processing method may include the following steps:
[0034] S110: When a first picture is displayed, receiving a first input.
[0035] The first picture may be any picture in the electronic device, and the picture may include a first facial region. The first facial region may be a region where a facial image of any object in the first picture is located, such as a region where a facial expression of any object in the first picture is located.
[0036] As an example, when the user wants to perform image processing to replace the facial area of the first image, the user can select an image, namely the first image. As a specific example, the first image can be an image in which the user is satisfied with the background but not satisfied with the facial area of one or several objects. Then, the user can enter the image editing preview interface, and then click the first target control to perform image processing so that the electronic device can receive the input instruction, namely the first input. Figure 2 As shown, Figure 2 The first target control is represented as "expression replacement". Or, Figure 3 As shown, Figure 3 The first target control in the image is represented as "This object has replaceable expressions, click to view the replacement effect."
[0037] It is understandable that the first input is not limited to the touch input in this embodiment, but can also be voice input or other input, as long as the electronic device can receive the first input. The embodiment of the present application does not limit the specific input method of the first input.
[0038] S120, in response to the first input, display a second picture.
[0039] The second picture may be a picture generated by replacing the first facial area in the first picture with the second facial area. The second facial area corresponds to a different expression than the first facial area, and the different expressions may include at least one of different expression types and the same expression type but different expression amplitudes.
[0040] As an example, after receiving the first input from the user, in response to the first input, a second facial region may be obtained, and the second facial region may be determined based on the image style type of the first image, the expression type of the first facial region in the first image, and the historical expression replacement behavior data of the user. Then, the first facial region of the first object may be replaced with the second facial region to obtain a second image, and the second image may be displayed.
[0041] In the embodiment of the present application, the first facial area in the displayed first picture is replaced with a second facial area that is different from the first facial area. Since the first facial area and the second facial area correspond to different expressions, the embodiment of the present application achieves the replacement of the facial expression in the first picture. Compared with the picture processing effect in the prior art that can only adjust the lines, colors, filters, etc. of the picture to change the display parameters of the image, the picture processing method provided by the embodiment of the present application can achieve the replacement of facial expressions and provide richer picture processing effects, thereby better meeting user needs and improving user experience.
[0042] In some embodiments, the first image may include facial regions of multiple objects. Accordingly, at this time, before receiving the first input to the first target control in the above step S110, the following steps may also be performed:
[0043] receiving a second input;
[0044] In response to the second input, determining the first object;
[0045] A first picture is displayed; the first facial region includes a facial region of a first subject.
[0046] The second input may be used to indicate selecting a first object from a plurality of objects. The first object may be any object in the first picture, such as any person in the picture.
[0047] As an example, when the first picture includes facial regions of multiple objects and the picture editing preview interface has been entered, the electronic device can detect the facial region position of each object in the first picture, and can mark and display the facial region of each object, and can provide a corresponding control for the facial region of each object for the user to click and select. Then, the user can click the control corresponding to the first object in the first picture so that the electronic device can receive the instruction input by the user, that is, the second input. After receiving the second input, the electronic device can determine the first object in the first picture in response to the second input. Figure 4 As shown, Figure 4 A display method of a facial region of an object and its corresponding controls is shown. Figure 4 The control corresponding to the object is represented as "Replace", and after the user clicks the "Replace" control, the electronic device receives a second input to determine the first object. After the first object is determined, a first picture can be displayed, and the first facial area in the first picture includes the facial area of the first object.
[0048] In this way, the facial area of each object in the first picture is displayed in a marked form, so that the user can more intuitively see the facial areas of all objects in the first picture; moreover, when the first picture includes facial areas of multiple objects, the user can select the first object for which the image processing is desired, that is, the first object for which the facial expression replacement is desired, thereby further improving the user experience.
[0049] In some embodiments, multiple candidate facial regions of the first object may be displayed for selection by the user. Accordingly, after the above step S110 and before the second image is displayed in step S120, the following steps may be performed:
[0050] In response to a first input, searching for a target image from a collection of images;
[0051] Determine a candidate facial region according to a region where a facial image of a first object in a target image is located;
[0052] receiving a third input of a second facial region;
[0053] Accordingly, the specific implementation method of displaying the second picture in step S120 may be:
[0054] In response to the third input, the second picture is displayed.
[0055] The target image may be an image including a facial image of the first object, and the target image may be one or more images. The expressions of the candidate facial regions and between the candidate facial regions and the first facial region are different from each other, the candidate facial regions include the second facial region, and the candidate facial regions may be multiple or one.
[0056] As an example, before displaying the second picture, the user may also select a second target area from the candidate facial areas of the first object. As a specific example, the electronic device may search for a target picture including a facial image of the first object from a picture collection of the electronic device in response to the first input, such as searching for the target picture from a photo album of the electronic device. Then, the candidate facial areas may be determined based on the area where the facial image of the first object is located in each target picture, such as extracting the area where the facial image of the first object is located in each target picture, deduplicating all extracted facial areas, and obtaining candidate facial areas. Then, the aforementioned candidate facial areas may be displayed for the user to select, such as Figure 5 As shown, Figure 5 Taking three candidate facial regions as an example, a display method of the candidate facial regions is shown. Afterwards, a third input of the user selecting a second facial region from the candidate facial regions of the first object can be received, and then in response to the third input, the first facial region of the first object in the first picture is replaced with the second facial region to obtain a second picture, and the second picture is displayed.
[0057] In this way, on the one hand, since the pictures in the picture collection of the user's electronic device may be updated over time, the pictures saved by the user in the picture collection are usually more representative of the facial expressions of the user's favorite facial areas. Therefore, when receiving the user's first input, the target picture is searched in real time from the picture collection, and the candidate facial area is determined, so that the determined candidate facial area can be more accurate, richer, and more in line with the user's preferences, thereby further improving the user experience. On the other hand, the multiple candidate facial areas corresponding to the first object are displayed on the interface, and the user can intuitively see all the candidate facial areas that can currently replace the first facial area of the first object. In this way, the user can select the facial area to be replaced according to personal preferences, thereby further improving the user experience.
[0058] In some embodiments, the candidate facial region may be determined according to at least one of the style type of the first image, the expression type corresponding to the first facial region, and the historical expression replacement behavior data of the user. Accordingly, the specific implementation method of determining the candidate facial region according to the facial region of the first object included in the target image may be as follows:
[0059] Get preset parameters;
[0060] According to preset parameters, a candidate facial region is determined from a region where a facial image of a first object in a target image is located.
[0061] The preset parameters may include at least one of the picture style type of the first picture, the expression type corresponding to the first facial area, and the user's historical expression replacement behavior data.
[0062] As an example, when determining a candidate facial region according to the region where the facial image of the first object in the target image is located, a preset parameter may be obtained, and the preset parameter may include at least one of the image style type of the first image, the expression type corresponding to the first facial region, and the user's historical expression replacement behavior data. The image style type of the first image may be determined according to the expressions, actions of other objects in the first image, the background environment in the first image, etc., and the image style type may be literary, Hong Kong style, fresh, etc.; the expression type corresponding to the first facial region of the first object in the first image may be smile, laugh, exaggerate, funny, cute, cry, angry, etc.; the user's historical expression replacement behavior data may be the relevant data of the user's expression replacement of the first object in the past period of time, such as the style type of the image corresponding to each historical expression replacement, the expression type corresponding to the original facial region of the object in the image whose facial region is replaced, and the facial region selected to replace the original facial region of the object in the image.
[0063] After obtaining preset parameters including at least one of the picture style type of the first picture, the expression type corresponding to the first facial region, and the historical expression replacement behavior data, the area where the facial image that the user may use when performing facial region replacement is located can be selected from the area where the facial image of the first object in the target picture is located according to the preset parameters, and determined as the candidate facial region. The area where the facial image that the user may use when performing facial region replacement is selected can be determined by matching the historical expression replacement behavior data with the picture style type of the first picture and the first expression type of the first facial region.
[0064] In this way, when determining the candidate facial area, at least one of the picture style type of the first picture, the expression type corresponding to the first facial area, and the user's historical expression replacement behavior data can be considered. That is, the determined candidate facial area can have at least one attribute of the picture style type, the first expression type of the first facial area, and the historical replacement behavior habits. In this way, the determined candidate facial area can be more in line with the user's actual replacement needs, thereby further improving the user experience.
[0065] In some embodiments, the interval between the generation time of the target picture including the facial image of the first object found from the picture collection and the generation time of the first picture may be less than or equal to a preset time.
[0066] As an example, when selecting a target picture, the generation time of the first picture can be determined first, and pictures whose interval time with the generation time of the first picture is within a preset time length are selected from the picture set, wherein the preset time length can be a preset maximum allowable time length between the target picture and the current time. Then, a target picture including the facial image of the first object can be selected from pictures whose interval time with the generation time of the first picture is within the preset time length.
[0067] In this way, considering that the picture style and expression types that users like will change with time, the first picture whose interval with the generation time of the first picture is within the preset time length is selected to determine the candidate facial area. This can make the determined candidate facial area more in line with the user's preferences, thereby further improving the user experience.
[0068] In some embodiments, the second image may include a third facial region of the second object. In this case, facial regions of other objects in the second image may be replaced according to the second facial region. Accordingly, after the second image is displayed in response to the first input in step S120, the following steps may be further performed:
[0069] Display the third picture.
[0070] The third picture may be a picture generated after the third facial region in the second picture is replaced by the fourth facial region of the second object, and the fourth facial region may be determined based on the second facial region.
[0071] The second object is an object other than the first object in the second image, the third facial region is a facial region of the second object in the second image, and the fourth facial region is a facial region used to replace the third facial region of the second object in the second image.
[0072] As an example, in the case where the second image includes the third facial region of the second object, after displaying the second image, the electronic device may also automatically determine a fourth facial region for replacing the third facial region of the second object based on the second facial region of the first object. Then, the third facial region of the second object in the second image may be replaced with the fourth facial region of the second object to obtain a third image, and the third image may be displayed.
[0073] In this way, considering that the atmosphere of the same picture is the same, the expression types of different objects are usually similar. Therefore, based on the second facial area of the first object, determining the fourth facial area of the second object belonging to the same picture as the first object can make the fourth facial area more in line with the picture atmosphere and picture type, so that the picture after expression replacement can better meet user needs, thereby further improving the user experience.
[0074] In some embodiments, the process of displaying the third picture may be performed by the electronic device according to user input. Accordingly, before the process of displaying the third picture, the following steps may be further included:
[0075] receiving a fourth input;
[0076] At this time, the specific implementation method of displaying the third picture may be: displaying the third picture in response to the fourth input.
[0077] The fourth input may be used to instruct selection of a second object for face replacement from the second picture.
[0078] As an example, after displaying the second picture, if the user still wants to replace the expression of an object other than the first object in the second picture, the object in the second picture that the user wants to replace the expression with, i.e., the second object, can be selected so that the electronic device can receive the user's input instruction, i.e., the fourth input. After receiving the fourth input, the electronic device can determine, in response to the fourth input, the fourth facial area to replace the third facial area of the second object based on the second facial area of the first object. For example, based on the expression type corresponding to the second facial area, the facial area of the second object in the picture set that is similar to the expression type corresponding to the second facial area can be determined as the fourth facial area of the second object. Then, the third facial area of the second object in the second picture can be replaced with the fourth facial area of the second object to obtain a third picture, and the third picture can be displayed.
[0079] It is understandable that after receiving the fourth input and determining the fourth facial region of the second object, the electronic device may also prompt the user whether to replace the facial region. The user may control the electronic device to perform image processing through input methods such as touch or voice, so that the electronic device can receive the input instruction. After the electronic device receives the input instruction, in response to the input instruction, the third facial region of the second object in the second image may be replaced with the fourth facial region of the second object to obtain a third image, and the third image may be displayed.
[0080] It should be noted that the fourth facial region may be a facial region with a high degree of similarity in expression type to the second facial region. In the case where there are multiple facial regions with a high degree of similarity in expression type to the second facial region, the facial region with the highest degree of similarity may be determined as the fourth facial region, or the aforementioned multiple facial regions may be displayed for the user to select.
[0081] In this way, on the one hand, based on the second facial area of the first object, determining the fourth facial area of the second object that belongs to the same picture as the first object can make the fourth facial area of the second object more consistent with the picture atmosphere and picture type, so that the picture after expression replacement is more consistent with user needs, thereby further improving the user experience. On the other hand, the user can also freely select the object for which expression replacement is required, thus further improving the user experience.
[0082] In some embodiments, after the above step S120, the following steps may also be performed:
[0083] receiving a fifth input of a second picture;
[0084] In response to the fifth input, a fourth picture is displayed.
[0085] The fourth picture is a picture generated after the second facial area in the second picture is replaced by the fifth facial area; the fifth facial area is a facial area among the candidate facial areas except the second facial area.
[0086] As an example, if the user is still not satisfied with the second picture, a facial region other than the second facial region may be selected from the candidate facial regions, i.e., a fifth facial region. Then, the electronic device may receive the user's input, i.e., the fifth input, and in response to the fifth input, the second facial region in the second picture may be replaced with the fifth facial region, so that the second picture is updated to the fourth picture, and the fourth picture is displayed.
[0087] like Figure 6 As shown, the user can select the fifth facial region from the candidate facial regions, such as sliding in the picture display area in the direction of the arrow, and the electronic device can automatically replace the second facial region with the fifth facial region, or, in the candidate facial region display area, click the fifth facial region, and the electronic device can automatically replace the second facial region with the fifth facial region, or, when the display area of the candidate facial regions is not enough to display all the candidate facial regions, the user can also slide in the display area of the candidate facial regions to display other candidate facial regions. It is understandable that Figure 6 This is only illustrative. In practice, the selection of the fifth facial region and the viewing of other candidate facial regions may be achieved through other methods.
[0088] In this way, when the user is still not satisfied with the second picture, he can continue to select other facial regions from the candidate facial regions, so that the generated fourth picture can be more in line with the user's preferences, thereby further improving the user experience.
[0089] In some embodiments, after the above step S120, at least one of the following may be further performed:
[0090] Update the first target control to the second target control;
[0091] Update the first target control to the third target control.
[0092] The second target control is used to instruct saving the second image, and the third target control is used to instruct returning to displaying the first image.
[0093] As an example, after displaying the second picture, the first target control on the interface may be updated to a second target control, and the second target control may be used to save the second picture. Figure 7 For the second picture, the second target control is Figure 8 The display may be represented as “save”. If the user is satisfied with the second picture, the user may click the second target control to save the second picture.
[0094] Alternatively, after displaying the second image, the first target control on the interface may be updated to a third target control, and the third target control may be used to return to displaying the first image. Fig. 9 The display may be represented as “return”. If the user is not satisfied with the second picture, the user may click the third target control to return to displaying the first picture.
[0095] It is understandable that if the user is satisfied with the second picture and saves the face replacement process, a fourth control may be displayed, which may be used to prompt the user whether the face area of other objects other than the first object in the first picture needs to be replaced. The replacement of the face area of other objects is similar to the replacement of the face area of the first object, which will not be described in detail here. If the user does not replace the face area of other objects or confirms to save the second picture, the second target control or the third target control may be displayed, or the second target control and the third target control may be displayed on the interface at the same time. The above process may also be performed after the fourth and fifth pictures are displayed.
[0096] In this way, if the user is satisfied with the second picture, the picture can be saved. If the user is not satisfied with the second picture, the first picture can be returned to display and the picture processing result can be abandoned. In this way, the user can save the pictures he likes, thereby further improving the user experience.
[0097] It should be noted that the image processing method provided in the embodiment of the present application can be executed by an image processing device, or by a control module in the image processing device for executing the loading image processing method. In the embodiment of the present application, the image processing method provided in the embodiment of the present application is described by taking the image processing device executing the loading image processing method as an example.
[0098] Fig.10 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application is shown. Fig.10 As shown, the image processing device 1000 may include:
[0099] A first receiving module 1010 is configured to receive a first input when a first picture is displayed; the first picture includes a first facial region;
[0100] The first display module 1020 is used to display a second picture in response to the first input; the second picture is a picture generated after the first facial area in the first picture is replaced by the second facial area, and the first facial area and the second facial area have different corresponding expressions.
[0101] In the embodiment of the present application, the first facial area in the displayed first picture is replaced with a second facial area that is different from the first facial area. Since the first facial area and the second facial area correspond to different expressions, the embodiment of the present application achieves the replacement of the facial expression in the first picture. Compared with the picture processing effect in the prior art that can only adjust the lines, colors, filters, etc. of the picture to change the display parameters of the image, the picture processing method provided by the embodiment of the present application can achieve the replacement of facial expressions and provide richer picture processing effects, thereby better meeting user needs and improving user experience.
[0102] Optionally, the first picture includes facial regions of multiple objects;
[0103] The image processing device 1000 further includes:
[0104] A second receiving module, used for receiving a second input;
[0105] A first determining module, configured to determine a first object in response to the second input;
[0106] The second display module is used to display the first picture; the first facial area includes the facial area of the first object.
[0107] In this way, when the first image includes facial regions of multiple objects, the user can select the first object for which the image processing is desired, that is, the facial expression replacement is desired, according to the user's needs, thereby further improving the user experience.
[0108] Optionally, the image processing device 1000 further includes:
[0109] A search module, configured to search for a target picture from a picture collection in response to the first input; the target picture is a picture including a facial image of a first object;
[0110] A second determination module is used to determine candidate facial regions according to the region where the facial image of the first object in the target image is located; the expressions of the candidate facial regions are different from each other and between the candidate facial regions and the first facial region, and the candidate facial regions include the second facial region;
[0111] A third receiving module, configured to receive a third input of the second facial region;
[0112] The third display module is used to display the second picture in response to the third input.
[0113] In this way, on the one hand, since the pictures in the picture collection of the user's electronic device may be updated over time, the pictures saved by the user in the picture collection are usually more representative of the facial expressions of the user's favorite facial areas. Therefore, when receiving the user's first input, the target picture is searched in real time from the picture collection, and the candidate facial area is determined, so that the determined candidate facial area can be more accurate, richer, and more in line with the user's preferences, thereby further improving the user experience. On the other hand, the multiple candidate facial areas corresponding to the first object are displayed on the interface, and the user can intuitively see all the candidate facial areas that can currently replace the first facial area of the first object. In this way, the user can select the facial area to be replaced according to personal preferences, thereby further improving the user experience.
[0114] Optionally, the second determining module includes:
[0115] An acquisition unit, configured to acquire preset parameters; the preset parameters include at least one of a picture style type of the first picture, an expression type corresponding to the first facial region, and historical expression replacement behavior data of the user;
[0116] A determination unit is used to determine the candidate facial region from the region where the facial image of the first object in the target image is located according to the preset parameters.
[0117] In this way, when determining the candidate facial area, at least one of the picture style type of the first picture, the expression type corresponding to the first facial area, and the user's historical expression replacement behavior data can be considered. That is, the determined candidate facial area can have at least one attribute of the picture style type, the expression type corresponding to the first facial area, and the historical replacement behavior habits. In this way, the determined candidate facial area can be more in line with the user's actual replacement needs, thereby further improving the user experience.
[0118] Optionally, the interval between the generation time of the target image and the generation time of the first image is less than or equal to a preset time.
[0119] In this way, considering that the picture style and expression types that users like will change with time, the first picture whose interval with the generation time of the first picture is within the preset time length is selected to determine the candidate facial area. This can make the determined candidate facial area more in line with the user's preferences, thereby further improving the user experience.
[0120] Optionally, the second image may include a third facial region of the second object, and the image processing apparatus 1000 further includes:
[0121] The fourth display module is used to display a third picture, where the third picture is a picture generated after the third facial area in the second picture is replaced by the fourth facial area of the second object, and the fourth facial area is determined based on the second facial area.
[0122] In this way, considering that the atmosphere of the same picture is the same, the expression types of different objects are usually similar. Therefore, based on the second facial area of the first object, determining the fourth facial area of the second object belonging to the same picture as the first object can make the fourth facial area more in line with the picture atmosphere and picture type, so that the picture after expression replacement can better meet user needs, thereby further improving the user experience.
[0123] The image processing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0124] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0125] The image processing device provided in the embodiment of the present application can achieve Figures 1 to 9 In order to avoid repetition, the various processes implemented by the image processing device in the method embodiment will not be described here.
[0126] Optionally, an embodiment of the present application also provides an electronic device, including a processor 1110, a memory 1109, and a program or instruction stored in the memory 1109 and executable on the processor 1110. When the program or instruction is executed by the processor 1110, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0127] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0128] Fig.11 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0129] The electronic device 1100 includes but is not limited to: a radio frequency unit 1101, a network module 1102, an audio output unit 1103, an input unit 1104, a sensor 1105, a display unit 1106, a user input unit 1107, an interface unit 1108, a memory 1109, and a processor 1110 and other components.
[0130] Those skilled in the art will appreciate that the electronic device 1100 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.11 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0131] The user input unit 1107 is used to receive a first input when the first picture is displayed;
[0132] The display unit 1106 is configured to display a second picture in response to the first input.
[0133] In the embodiment of the present application, the first facial area in the displayed first picture is replaced with a second facial area that is different from the first facial area. Since the first facial area and the second facial area correspond to different expressions, the embodiment of the present application achieves the replacement of the facial expression in the first picture. Compared with the picture processing effect in the prior art that can only adjust the lines, colors, filters, etc. of the picture to change the display parameters of the image, the picture processing method provided by the embodiment of the present application can achieve the replacement of facial expressions and provide richer picture processing effects, thereby better meeting user needs and improving user experience.
[0134] Optionally, the first picture includes facial regions of multiple objects;
[0135] The user input unit 1107 is further used to receive a second input;
[0136] The processor 1110 is configured to determine a first object in response to the second input;
[0137] The display unit 1106 is configured to display the first image.
[0138] In this way, when the first image includes facial regions of multiple objects, the user can select the first object for which the image processing is desired, that is, the facial expression replacement is desired, according to the user's needs, thereby further improving the user experience.
[0139] Optionally, the display unit 1106 is further configured to search for a target image from a collection of images in response to the first input; determine a candidate facial region according to a region where a facial image of a first object in the target image is located;
[0140] The user input unit 1107 is further configured to receive a third input on the second facial region;
[0141] The display unit 1106 is configured to display the second picture in response to the third input.
[0142] In this way, on the one hand, since the pictures in the picture collection of the user's electronic device may be updated over time, the pictures saved by the user in the picture collection are usually more representative of the facial expressions of the user's favorite facial areas. Therefore, when receiving the user's first input, the target picture is searched in real time from the picture collection, and the candidate facial area is determined, so that the determined candidate facial area can be more accurate, richer, and more in line with the user's preferences, thereby further improving the user experience. On the other hand, the multiple candidate facial areas corresponding to the first object are displayed on the interface, and the user can intuitively see all the candidate facial areas that can currently replace the first facial area of the first object. In this way, the user can select the facial area to be replaced according to personal preferences, thereby further improving the user experience.
[0143] Optionally, the processor 1110 is further configured to:
[0144] Get preset parameters;
[0145] The candidate facial region is determined from a region where the facial image of the first object in the target image is located according to the preset parameters.
[0146] In this way, when determining the candidate facial area, at least one of the picture style type of the first picture, the expression type corresponding to the first facial area, and the user's historical expression replacement behavior data can be considered. That is, the determined candidate facial data has at least one attribute of the picture style type, the expression type corresponding to the first facial area, and the historical replacement behavior habits. In this way, the determined candidate facial area can be more in line with the user's actual replacement needs, thereby further improving the user experience.
[0147] Optionally, the display unit 1106 is further used to display a third picture, where the third picture is generated after the third facial area in the second picture is replaced by the fourth facial area of the second object, and the fourth facial area is determined based on the second facial area.
[0148] In this way, considering that the atmosphere of the same picture is the same, the expression types of different objects are usually similar. Therefore, based on the second facial area of the first object, determining the fourth facial area of the second object belonging to the same picture as the first object can make the fourth facial area more in line with the picture atmosphere and picture type, so that the picture after expression replacement can better meet user needs, thereby further improving the user experience.
[0149] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0150] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0151] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0152] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0153] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0155] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for processing an image, characterized in that: include: When the first picture is displayed, receiving a first input; The first picture includes a first facial region of a first subject; In response to the first input, a second picture is displayed; the second picture is a picture generated after a first facial region in the first picture is replaced by a second facial region, the first facial region and the second facial region correspond to different expressions, the second picture includes a third facial region of a second object, and the second object is an object in the second picture other than the first object; A third picture is displayed, where the third picture is generated after the third facial area in the second picture is replaced by the fourth facial area of the second object, where the fourth facial area is a facial area determined based on a similarity in expression type with the second facial area.
2. The method according to claim 1, characterized in that The first picture includes facial regions of a plurality of objects; Before receiving the first input, the method further includes: receiving a second input; In response to the second input, determining a first object; The first picture is displayed; the first facial region includes a facial region of the first object.
3. The method according to claim 1 or 2, characterized in that: After receiving the first input and before displaying the second picture, the method further includes: In response to the first input, searching for a target picture from a picture collection; the target picture is a picture including a facial image of a first object; Determine candidate facial regions according to the region where the facial image of the first object in the target image is located; the expressions of the candidate facial regions are different from each other and between the candidate facial regions and the first facial region, and the candidate facial regions include the second facial region; receiving a third input of the second facial region; The displaying the second picture specifically includes: displaying the second picture in response to the third input.
4. The method according to claim 3, characterized in that The step of determining a candidate facial region according to a region where a facial image of a first object in the target image is located includes: Acquire preset parameters; the preset parameters include at least one of the picture style type of the first picture, the expression type corresponding to the first facial area, and the user's historical expression replacement behavior data; The candidate facial region is determined from a region where the facial image of the first object in the target image is located according to the preset parameters.
5. The method according to claim 3, characterized in that: The interval between the generation time of the target image and the generation time of the first image is less than or equal to a preset time.
6. A picture processing device, characterized in that: include: A first receiving module, configured to receive a first input when a first picture is displayed; The first picture includes a first facial region of a first subject; a first display module, configured to display a second picture in response to the first input; the second picture is a picture generated after a first facial region in the first picture is replaced by a second facial region, the first facial region and the second facial region correspond to different expressions, the second picture includes a third facial region of a second object, and the second object is an object in the second picture other than the first object; The fourth display module is used to display a third picture, where the third picture is generated after the third facial area in the second picture is replaced by the fourth facial area of the second object, and the fourth facial area is a facial area determined based on the similarity of expression type with the second facial area.
7. The device according to claim 6, characterized in that The first picture includes facial regions of a plurality of objects; The image processing device further includes: A second receiving module, used for receiving a second input; A first determining module, configured to determine a first object in response to the second input; The second display module is used to display the first picture; the first facial area includes the facial area of the first object.
8. The device according to claim 6 or 7, characterized in that The image processing device further includes: A search module, configured to search for a target picture from a picture collection in response to the first input; the target picture is a picture including a facial image of a first object; A second determination module is used to determine candidate facial regions according to the region where the facial image of the first object in the target image is located; the expressions of the candidate facial regions are different from each other and between the candidate facial regions and the first facial region, and the candidate facial regions include the second facial region; A third receiving module, configured to receive a third input of the second facial region; The third display module is used to display the second picture in response to the third input.
9. The device according to claim 8, characterized in that The second determining module includes: An acquisition unit, configured to acquire preset parameters; the preset parameters include at least one of a picture style type of the first picture, an expression type corresponding to the first facial region, and historical expression replacement behavior data of the user; A determination unit is used to determine the candidate facial region from the region where the facial image of the first object in the target image is located according to the preset parameters.
10. The device according to claim 8, characterized in that The interval between the generation time of the target image and the generation time of the first image is less than or equal to a preset time.
11. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method as described in any one of claims 1 to 5.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the image processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Information Processing Device And Recording Medium
CN103888658A
Image processing method, image processing device and terminal
CN107123081A
Image replacement processing method and device, storage medium and electronic equipment
CN108520493A
Image processing method and device
CN110378840A
Image processing method and device, electronic equipment and readable storage medium
CN112083863A
