Image processing method and apparatus, terminal device, and storage medium
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-06-30
- Publication Date
- 2026-08-06
Smart Images

Figure CN2025106301_06082026_PF_FP_ABST
Abstract
Description
A method, apparatus, terminal device, and storage medium for image processing.
[0001] This application claims priority to Chinese Patent Application No. 202411383989.9, filed on September 27, 2024, entitled "A Method, Apparatus, Terminal Equipment and Storage Medium for Image Processing", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application belongs to the field of data processing technology, and in particular relates to an image processing method, apparatus, terminal device and storage medium. Background Technology
[0003] With the continuous development of electronic device technology, image processing capabilities have also improved. Electronic devices can not only beautify images, but also perform various types of image processing through artificial intelligence (AI), such as image style transformation or image restoration. Taking image style transformation as an example, AI image processing can transform captured images into anime or period drama styles, thus providing users with more interesting and diverse images.
[0004] However, as users spend more time using the image library, the number of images stored in the library also increases. When users need to perform AI image processing, they often have to select the target image from a massive number of images, which greatly increases the difficulty and efficiency of image selection during AI image processing and reduces the user experience. Summary of the Invention
[0005] This application provides an image processing method, apparatus, terminal device, and storage medium, which can solve the problems of existing image processing technologies, such as the difficulty and low efficiency of selecting suitable images from a large number of images when performing image style transformation.
[0006] In a first aspect, embodiments of this application provide an image processing method, including:
[0007] In response to a first operation, at least one first image is determined from the image library; the first image is an image that satisfies a first constraint; the first operation is to trigger the display of a list of images that satisfy the first constraint on the image selection interface; the first constraint is used to filter candidate images for AI image generation processing.
[0008] Thumbnails of the at least one first image are displayed in the image selection interface;
[0009] In response to a second operation, at least one second image is obtained based on a target image in the at least one first image, the second image being obtained by processing the target image, the processing including AI image generation processing, the target image being the first image selected by the second operation.
[0010] Implementing the embodiments of this application has the following beneficial effects: The terminal device can filter the images in the image library to obtain the first image that meets the AI image generation function, and display the thumbnail of the first image in the image selection interface. Subsequently, the user can select the target image for AI image generation processing from at least one first image, reducing the number of images displayed in the image selection interface, thereby reducing the difficulty for the user to select images and improving the user's operating efficiency.
[0011] In one possible implementation of the first aspect, determining at least one first image from the image library in response to the first operation includes:
[0012] Based on the first constraint, at least one first image is selected from the image library;
[0013] If the foreground object in any of the selected first images does not meet the preset second constraint, then the first image is recomposed so that the foreground object in the recomposed first image meets the second constraint.
[0014] In one possible implementation of the first aspect, if the foreground object in the target image does not satisfy the preset second constraint condition, the processing further includes performing a secondary composition on the target image so that the foreground object in the secondary composed target image satisfies the second constraint condition.
[0015] In one possible implementation of the first aspect, if the foreground object in the target image does not satisfy a preset second constraint, before obtaining at least one second image based on the target image in the at least one first image in response to the second operation, the method further includes:
[0016] In response to the selection operation of the target image, the target image is re-composed so that the foreground object in the re-composed target image satisfies the second constraint condition;
[0017] The second operation is an operation performed based on the target image after the secondary composition.
[0018] In one possible implementation of the first aspect, the secondary composition includes at least one of scaling operation, cropping operation, rotation operation, and content expansion operation.
[0019] In one possible implementation of the first aspect, the second constraint includes at least one of the following:
[0020] The area proportion of the foreground object is within a preset ratio range;
[0021] The area proportion of the key parts of the foreground object is within a preset ratio range;
[0022] The foreground object is on the axis of the first image;
[0023] The key part of the foreground object is on the axis of the first image;
[0024] The specified portion of the foreground object is not visible in the first image.
[0025] In one possible implementation of the first aspect, the first constraint includes at least one of the following:
[0026] The number of foreground objects contained in the first image is within a preset range;
[0027] The foreground object's pose is within a preset pose range, and the object pose includes the foreground object's facial pose and / or body pose.
[0028] The image quality index of the first image is within a preset index range, and the image quality index includes at least one of the following: image resolution, image brightness value, sharpness of the foreground object, and sharpness of key parts of the foreground object.
[0029] In one possible implementation of the first aspect, displaying thumbnails of the at least one first image in the image selection interface includes:
[0030] The image selection interface displays thumbnails of multiple images; the multiple images include at least one first image; the first image includes a marker; the marker is used to indicate that the first image is a candidate image for AI image generation processing.
[0031] In one possible implementation of the first aspect, the image style type of the second image is determined based on the foreground object in the target image.
[0032] In one possible implementation of the first aspect, the image style type is determined based on descriptive information of foreground objects in the target image.
[0033] In one possible implementation of the first aspect, the image style type is determined based on the foreground object of the target image and the scene information corresponding to the user of the terminal device when the second operation is initiated.
[0034] In one possible implementation of the first aspect, the descriptive information is obtained by performing object recognition on the target image; or
[0035] The description information is obtained after the user adjusts the recognition result of the target image; the recognition result is generated by object recognition of the target image.
[0036] In one possible implementation of the first aspect, the second image is generated based on a first pose of a foreground object in the target image and the image style type; the second pose of the foreground object in the second image is the same as or different from the first pose.
[0037] In one possible implementation of the first aspect, the second posture is obtained by adjusting the posture of a specified part in the first posture when the first posture meets the preset posture adjustment conditions; the specified part in the second posture does not meet the posture adjustment conditions.
[0038] In one possible implementation of the first aspect, the designated part is the hand; the posture adjustment conditions include at least one of the following:
[0039] The hand in the first posture is in a raised hand posture;
[0040] The hand is visible in the first posture;
[0041] The distance between the hand and the face in the first posture is within a preset distance range.
[0042] In one possible implementation of the first aspect, if a first support object exists below the hand in the first pose, the process further includes: replacing the first support object in the target image with a second support object.
[0043] In one possible implementation of the first aspect, the first pose is used to determine a transformation template that matches the image style type; the AI image generation process is to perform AI image generation processing on the target image using the transformation template.
[0044] In one possible implementation of the first aspect, if the target image has an occlusion that obscures the foreground object, the process further includes: removing the occlusion from the target image.
[0045] In one possible implementation of the first aspect, the processing further includes a quality control process performed after the AI image generation process.
[0046] In one possible implementation of the first aspect, the quality control processing includes at least one of: posture anomaly processing, contour anomaly processing, color anomaly processing, and lighting anomaly processing.
[0047] In one possible implementation of the first aspect, obtaining at least one second image based on the target image in the at least one first image in response to the second operation includes:
[0048] Send an image generation instruction to the server, the image generation instruction including the target image;
[0049] Receive the at least one second image sent by the server.
[0050] In one possible implementation of the first aspect, the image generation instruction further includes: description information of the foreground object of the target image, the description information being used to determine the image style type corresponding to the at least one second image to be generated.
[0051] In one possible implementation of the first aspect, the image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
[0052] In one possible implementation of the first aspect, obtaining at least one second image based on the target image in the at least one first image in response to the second operation includes:
[0053] In response to the second operation, at least one image style type corresponding to the target image is determined;
[0054] The target image is processed based on the image style type to obtain at least one second image that matches the image style type.
[0055] In one possible implementation of the first aspect, obtaining at least one second image based on the target image in the at least one first image in response to the second operation includes:
[0056] Display multiple second images; the multiple second images include at least two second images of different image style types;
[0057] In response to the third operation, some or all of the plurality of second images are added to the wallpaper library.
[0058] In one possible implementation of the first aspect, the method is performed by a first application in the terminal device.
[0059] In a second aspect, an image processing apparatus includes:
[0060] A first image determination unit is configured to determine at least one first image from a library in response to a first operation; the first image is an image that satisfies a first constraint condition; the first operation is to trigger the display of a list of images that satisfy the first constraint condition on an image selection interface; the first constraint condition is used to filter candidate images for AI image generation processing.
[0061] An image display unit is used to display a thumbnail of the at least one first image in the image selection interface;
[0062] An image acquisition unit is configured to, in response to a second operation, acquire at least one second image based on a target image in the at least one first image, wherein the second image is obtained by processing the target image, the processing including AI image generation processing, and the target image is the first image selected by the second operation.
[0063] In one possible implementation of the second aspect, the first image determining unit includes:
[0064] The second image determination unit is used to filter out the at least one first image from the image library based on the first constraint condition;
[0065] The secondary composition unit is used to perform secondary composition on the first image if the foreground object in any of the selected first images does not meet the preset second constraint condition, so that the foreground object in the second composed first image meets the second constraint condition.
[0066] In one possible implementation of the second aspect, if the foreground object in the target image does not satisfy the preset second constraint condition, the processing further includes performing a secondary composition on the target image so that the foreground object in the secondary composed target image satisfies the second constraint condition.
[0067] In one possible implementation of the second aspect, if the foreground object in the target image does not satisfy a preset second constraint condition, the apparatus further includes:
[0068] An image selection unit is configured to perform secondary composition on the target image in response to a selection operation on the target image, so that the foreground object in the target image after secondary composition satisfies the second constraint condition;
[0069] The preview unit is used to display the target image after the secondary composition, and the second operation is an operation performed based on the target image after the secondary composition.
[0070] In one possible implementation of the second aspect, the composition adjustment operation includes at least one of scaling, cropping, rotating, and content expansion operations.
[0071] In one possible implementation of the second aspect, the second constraint includes at least one of the following:
[0072] The area proportion of the foreground object is within a preset ratio range;
[0073] The area proportion of the key parts of the foreground object is within a preset ratio range;
[0074] The foreground object is on the axis of the first image;
[0075] The key part of the foreground object is on the axis of the first image;
[0076] The specified portion of the foreground object is not visible in the first image.
[0077] In one possible implementation of the second aspect, the first constraint includes at least one of the following:
[0078] The number of foreground objects contained in the first image is within a preset range;
[0079] The foreground object's pose is within a preset pose range, and the object pose includes the foreground object's facial pose and / or body pose.
[0080] The image quality index of the first image is within a preset index range, and the image quality index includes at least one of the following: image resolution, image brightness value, sharpness of the foreground object, and sharpness of key parts of the foreground object.
[0081] In one possible implementation of the second aspect, the image display unit includes:
[0082] The image library display unit is used to display thumbnails of multiple images in the image selection interface; the multiple images include at least one first image; the first image includes a marker; the marker is used to indicate that the first image is a candidate image for AI image generation processing.
[0083] In one possible implementation of the second aspect, the image style type of the second image is determined based on the foreground object in the target image.
[0084] In one possible implementation of the second aspect, the image style type is determined based on descriptive information of foreground objects in the target image.
[0085] In one possible implementation of the second aspect, the image style type is determined based on the foreground object of the target image and the scene information corresponding to the user of the terminal device when the second operation is initiated.
[0086] In one possible implementation of the second aspect, the descriptive information is obtained by performing object recognition on the target image; or
[0087] The description information is obtained after the user adjusts the recognition result of the target image; the recognition result is generated by object recognition of the target image.
[0088] In one possible implementation of the second aspect, the second image is generated based on a first pose of a foreground object in the target image and the image style type; the second pose of the foreground object in the second image may be the same as or different from the first pose.
[0089] In one possible implementation of the second aspect, the second posture is obtained by adjusting the posture of a specified part in the first posture when the first posture meets the preset posture adjustment conditions; the specified part in the second posture does not meet the posture adjustment conditions.
[0090] In one possible implementation of the second aspect, the designated part is the hand; the posture adjustment conditions include at least one of the following:
[0091] The hand in the first posture is in a raised hand posture;
[0092] The hand is visible in the first posture;
[0093] The distance between the hand and the face in the first posture is within a preset distance range.
[0094] In one possible implementation of the second aspect, if a first support object exists below the hand in the first pose, the process further includes: replacing the first support object in the target image with a second support object.
[0095] In one possible implementation of the second aspect, the first pose is used to determine a transformation template that matches the image style type; the AI image generation process is to perform AI image generation processing on the target image using the transformation template.
[0096] In one possible implementation of the second aspect, if the target image contains an occluder that obscures the foreground object, the process further includes removing the occluder from the target image.
[0097] In one possible implementation of the second aspect, the processing further includes a quality control process performed after the AI image generation process.
[0098] In one possible implementation of the second aspect, the quality control processing includes at least one of: posture anomaly processing, contour anomaly processing, color anomaly processing, and lighting anomaly processing.
[0099] In one possible implementation of the second aspect, the image acquisition unit includes:
[0100] An instruction sending unit is configured to send an image generation instruction to a server, the image generation instruction including the target image;
[0101] An image receiving unit is used to receive the at least one second image sent by the server.
[0102] In one possible implementation of the second aspect, the image generation instruction further includes: descriptive information of the foreground object of the target image, the descriptive information being used to determine the image style type corresponding to the at least one second image to be generated.
[0103] In one possible implementation of the second aspect, the image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
[0104] In one possible implementation of the second aspect, the image acquisition unit includes:
[0105] A style type determination unit is configured to determine at least one image style type corresponding to the target image in response to the second operation;
[0106] A style conversion unit is used to perform the processing on the target image based on the image style type to obtain at least one second image that matches the image style type.
[0107] In one possible implementation of the first aspect, the image acquisition unit includes:
[0108] A multi-image display unit is used to display multiple second images; the multiple second images include at least two second images with different image style types;
[0109] A wallpaper adding unit is used to add some or all of the plurality of second images to the wallpaper library in response to a third operation.
[0110] In one possible implementation of the second aspect, the method is performed by a first application in the terminal device.
[0111] Thirdly, embodiments of this application provide an image processing method, including:
[0112] In response to the second operation, at least one second image is obtained based on the target image in the at least one first image, the second image being obtained by processing the target image, the first image being an image in the image library that satisfies a first constraint condition, the first constraint condition being used to filter candidate images for AI image generation processing, the processing including AI image generation processing, and the target image being the first image selected by the second operation.
[0113] Implementing the embodiments of this application has the following beneficial effects: the electronic device can perform AI image generation processing on the target image selected by the user to obtain at least one second image. Since the target image selected by the user is obtained after filtering the image library, it can improve the user's image selection efficiency and reduce the user's operation difficulty.
[0114] In one possible implementation of the third aspect, the image style type of the second image is determined based on the foreground object in the target image.
[0115] In one possible implementation of the third aspect, the image style type is determined based on descriptive information of foreground objects in the target image.
[0116] In one possible implementation of the third aspect, the image style type is determined based on the foreground object of the target image and the scene information corresponding to the user of the terminal device when the second operation is initiated.
[0117] In one possible implementation of the third aspect, the descriptive information is obtained by performing object recognition on the target image; or
[0118] The description information is obtained after the user adjusts the recognition result of the target image; the recognition result is generated by object recognition of the target image.
[0119] In one possible implementation of the third aspect, the second image is generated based on a first pose of a foreground object in the target image and the image style type; the second pose of the foreground object in the second image may be the same as or different from the first pose.
[0120] In one possible implementation of the third aspect, the second posture is obtained by adjusting the posture of a specified part in the first posture when the first posture meets the preset posture adjustment conditions; the specified part in the second posture does not meet the posture adjustment conditions.
[0121] In one possible implementation of the third aspect, the designated part is the hand; the posture adjustment conditions include at least one of the following:
[0122] The hand in the first posture is in a raised hand posture;
[0123] The hand is visible in the first posture;
[0124] The distance between the hand and the face in the first posture is within a preset distance range.
[0125] In one possible implementation of the third aspect, if a first support object exists below the hand in the first pose, the process further includes: replacing the first support object in the target image with a second support object.
[0126] In one possible implementation of the third aspect, the first pose is used to determine a transformation template that matches the image style type; the AI image generation process is to perform AI image generation processing on the target image using the transformation template.
[0127] In one possible implementation of the third aspect, if the target image has an occlusion that obscures the foreground object, the process further includes: removing the occlusion from the target image.
[0128] In one possible implementation of the third aspect, the processing further includes a quality control process performed after the AI image generation process.
[0129] In one possible implementation of the third aspect, the quality control processing includes at least one of: posture anomaly processing, contour anomaly processing, color anomaly processing, and lighting anomaly processing.
[0130] In one possible implementation of the third aspect, obtaining at least one second image based on the target image in the at least one first image in response to the second operation includes:
[0131] Send an image generation instruction to the server, the image generation instruction including the target image;
[0132] Receive the at least one second image sent by the server.
[0133] In one possible implementation of the third aspect, the image generation instruction further includes: description information of the foreground object of the target image, the description information being used to determine the image style type corresponding to the at least one second image to be generated.
[0134] In one possible implementation of the third aspect, the image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
[0135] In one possible implementation of the third aspect, obtaining at least one second image based on the target image in the at least one first image in response to the second operation includes:
[0136] In response to the second operation, at least one image style type corresponding to the target image is determined;
[0137] The target image is processed based on the image style type to obtain at least one second image that matches the image style type.
[0138] In one possible implementation of the third aspect, obtaining at least one second image based on the target image in the at least one first image in response to the second operation includes:
[0139] Display multiple second images; the multiple second images include at least two second images of different image style types;
[0140] In response to the third operation, some or all of the plurality of second images are added to the wallpaper library.
[0141] In one possible implementation of the third aspect, the method is performed by a first application in the terminal device.
[0142] Fourthly, an image processing apparatus, comprising:
[0143] An image acquisition unit is configured to, in response to a second operation, acquire at least one second image based on a target image in the at least one first image, wherein the second image is obtained by processing the target image, the first image is an image in a library that satisfies a first constraint condition, the first constraint condition being used to filter candidate images for AI image generation processing, the processing including AI image generation processing, and the target image being the first image selected by the second operation.
[0144] In one possible implementation of the fourth aspect, the image style type of the second image is determined based on the foreground object in the target image.
[0145] In one possible implementation of the fourth aspect, the image style type is determined based on descriptive information of foreground objects in the target image.
[0146] In one possible implementation of the fourth aspect, the image style type is determined based on the foreground object of the target image and the scene information corresponding to the user of the terminal device when the second operation is initiated.
[0147] In one possible implementation of the fourth aspect, the descriptive information is obtained by performing object recognition on the target image; or
[0148] The description information is obtained after the user adjusts the recognition result of the target image; the recognition result is generated by object recognition of the target image.
[0149] In one possible implementation of the fourth aspect, the second image is generated based on a first pose of a foreground object in the target image and the image style type; the second pose of the foreground object in the second image is the same as or different from the first pose.
[0150] In one possible implementation of the fourth aspect, the second posture is obtained by adjusting the posture of a specified part in the first posture when the first posture meets the preset posture adjustment conditions; the specified part in the second posture does not meet the posture adjustment conditions.
[0151] In one possible implementation of the fourth aspect, the designated part is the hand; the posture adjustment conditions include at least one of the following:
[0152] The hand in the first posture is in a raised hand posture;
[0153] The hand is visible in the first posture;
[0154] The distance between the hand and the face in the first posture is within a preset distance range.
[0155] In one possible implementation of the fourth aspect, if a first support object exists below the hand in the first pose, the process further includes: replacing the first support object in the target image with a second support object.
[0156] In one possible implementation of the fourth aspect, the first pose is used to determine a transformation template that matches the image style type; the AI image generation process is to perform AI image generation processing on the target image using the transformation template.
[0157] In one possible implementation of the fourth aspect, if the target image contains an occluder that obscures the foreground object, the process further includes removing the occluder from the target image.
[0158] In one possible implementation of the fourth aspect, the processing further includes a quality control process performed after the AI image generation process.
[0159] In one possible implementation of the fourth aspect, the quality control processing includes at least one of: posture anomaly processing, contour anomaly processing, color anomaly processing, and lighting anomaly processing.
[0160] In one possible implementation of the fourth aspect, the image acquisition unit includes:
[0161] An instruction sending unit is configured to send an image generation instruction to a server, the image generation instruction including the target image;
[0162] An image receiving unit is used to receive the at least one second image sent by the server.
[0163] In one possible implementation of the fourth aspect, the image generation instruction further includes: descriptive information of the foreground object of the target image, the descriptive information being used to determine the image style type corresponding to the at least one second image to be generated.
[0164] In one possible implementation of the fourth aspect, the image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
[0165] In one possible implementation of the fourth aspect, the image acquisition unit includes:
[0166] A style type determination unit is configured to determine at least one image style type corresponding to the target image in response to the second operation;
[0167] A style conversion unit is used to perform the processing on the target image based on the image style type to obtain at least one second image that matches the image style type.
[0168] In one possible implementation of the fourth aspect, the image acquisition unit includes:
[0169] A multi-image display unit is used to display multiple second images; the multiple second images include at least two second images with different image style types;
[0170] A wallpaper adding unit is used to add some or all of the plurality of second images to the wallpaper library in response to a third operation.
[0171] In one possible implementation of the fourth aspect, the method is performed by a first application in the terminal device.
[0172] Fifthly, embodiments of this application provide a terminal device, including: a memory, a processor, and a program stored in the memory, wherein the processor executes the program to implement the steps of the image processing method described in any one of the first aspects and / or the steps of the image processing method described in any one of the third aspects.
[0173] In a sixth aspect, embodiments of this application provide a readable storage medium storing a program that, when executed by a processor, implements the steps of the image processing method described in any of the first aspects and / or the steps of the image processing method described in any of the third aspects.
[0174] In a seventh aspect, embodiments of this application provide a program product that, when run on a device, causes the device to perform the steps of the display method described in any one of the first aspects and / or the steps of the image processing method described in any one of the third aspects.
[0175] Eighthly, embodiments of this application provide an image processing system, including a terminal device and a server;
[0176] The terminal device is configured to, in response to a first operation, determine at least one first image from a gallery; the first image is an image that satisfies a first constraint condition; the first operation is to trigger the display of a list of images that satisfy the first constraint condition on an image selection interface; the first constraint condition is used to filter candidate images for AI image generation processing.
[0177] The terminal device is used to display thumbnails of the at least one first image in the image selection interface;
[0178] The terminal device is configured to send an image generation instruction to the server in response to a second operation, the image generation instruction including a target image; the target image is the first image selected by the second operation.
[0179] The server is used to process the target image to obtain at least one second image, the processing including AI image generation processing;
[0180] The terminal device is also used to receive the at least one second image sent by the server.
[0181] In one possible implementation of the eighth aspect, the image generation instruction further includes: description information of the foreground object of the target image, the description information being used to determine the image style type corresponding to the at least one second image to be generated.
[0182] In one possible implementation of the eighth aspect, the image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
[0183] In this embodiment, the terminal device can filter images in the image library to obtain at least one first image, reducing the number of images selected by the user and improving the efficiency of selecting target images. It can then send the target image that needs to be processed by AI image generation to the server so that the server can complete the AI image generation process and achieve the purpose of AI image generation. Since the server has strong computing power, it can improve the efficiency of AI image generation and reduce the computing pressure on the terminal device.
[0184] Other implementations can refer to the aforementioned aspects and will not be elaborated further.
[0185] The beneficial effects of the above aspects can be referenced from each other, and will not be elaborated further here. Attached Figure Description
[0186] Figure 1 is a flowchart of the existing image style transformation operation;
[0187] Figure 2 is a flowchart of an image style transformation provided in an embodiment of this application;
[0188] Figure 3 is a flowchart illustrating the implementation of an image processing method in the preprocessing stage according to an embodiment of this application;
[0189] Figure 4 is a flowchart illustrating the implementation of constructing an image feature library according to an embodiment of this application;
[0190] Figure 5 is a schematic diagram of image filtering based on a first constraint condition provided in an embodiment of this application;
[0191] Figure 6 is a flowchart illustrating the specific implementation of step S302 in an image processing method provided in an embodiment of this application.
[0192] Figure 7 is a schematic diagram of the composition adjustment provided in an embodiment of this application when condition 2.1 is not met;
[0193] Figure 8 is a schematic diagram of the composition adjustment provided in an embodiment of this application when conditions 2.1 and 2.2 are not met;
[0194] Figure 9 is a schematic diagram of the transformation of images in the image library during the preprocessing stage provided in an embodiment of this application;
[0195] Figure 10 is a flowchart illustrating the secondary patterning provided in an embodiment of this application;
[0196] Figure 11 is a flowchart of the display of a first image provided in an embodiment of this application;
[0197] Figure 12 is a schematic diagram of a photo album interface provided in an embodiment of this application;
[0198] Figure 13 is a schematic diagram of an image set provided in an embodiment of this application;
[0199] Figure 14 is a flowchart illustrating the implementation of an image processing method in the style transformation stage according to an embodiment of this application;
[0200] Figure 15 is a schematic diagram of the second operation provided in an embodiment of this application;
[0201] Figure 16 is a schematic diagram of a second operation provided in another embodiment of this application;
[0202] Figure 17 is a flowchart of processing a target image based on a terminal device according to an embodiment of this application;
[0203] Figure 18 is a schematic diagram of foreground objects and style types provided in an embodiment of this application;
[0204] Figure 19 is a schematic diagram of the adjustment of object features provided in an embodiment of this application;
[0205] Figure 20 is a schematic diagram illustrating the determination of image style type according to an embodiment of this application;
[0206] Figure 21 is a schematic diagram of the structure of an image style model provided in an embodiment of this application;
[0207] Figure 22 is a schematic diagram of adjusting the appearance of a hand in a foreground object in an image according to an embodiment of this application;
[0208] Figure 23 is a schematic diagram of replacing the hand support of a foreground object in an image according to an embodiment of this application;
[0209] Figure 24 is a schematic diagram of removing occlusions of foreground objects in an image according to an embodiment of this application;
[0210] Figure 25 is a schematic diagram of the result of image style transformation controlled by template according to an embodiment of this application;
[0211] Figure 26 is a schematic diagram of an image style conversion process provided in an embodiment of this application;
[0212] Figure 27 is an interaction flowchart between a terminal device and an electronic device when a second image is generated based on a server, according to an embodiment of this application.
[0213] Figure 28 is a schematic diagram of the display interface of the second image provided in an embodiment of this application;
[0214] Figure 29 is a schematic diagram of the selection of a second image provided in an embodiment of this application;
[0215] Figure 30 is a structural block diagram of an image processing apparatus provided in an embodiment of this application;
[0216] Figure 31 is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0217] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0218] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0219] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0220] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0221] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0222] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0223] With the continuous development of terminal device technology, the image processing capabilities of devices have also improved. Terminal devices can not only adjust relevant image parameters, such as brightness, resolution, sharpness, and saturation, but also generate image content through artificial intelligence, i.e., AI image processing. AI image processing can include image expansion, image style transformation, and face swapping. For example, Figure 1 shows an existing flowchart for triggering AI image processing. Referring to Figure 1, when a user needs to perform AI image processing on an image, the specific steps may include:
[0224] Step 1: Open the application
[0225] Referring to Figure 1(a), a user can install an application with AI image processing capabilities, such as the "Meitu" app, on their terminal device. The corresponding control on the main interface is icon control 11. The user can launch the "Meitu" app and generate the corresponding operation interface by clicking the icon control 11.
[0226] Step 2: Select Image Style
[0227] As shown in Figure 1(b), after the user opens the above-mentioned "Meitu" application, they can select the desired image style in the corresponding operation interface, such as the control 12 for "anime style", the control 13 for "ancient style" and the control 14 for "mechanical style". After selecting the desired image style, the user can click the next control 15 to access the image selection interface.
[0228] Step 3: Select the target image
[0229] As shown in Figure 1(c), after the user selects an image style, the application can read all the images stored in the image library on the terminal device and generate an image selection interface. The user can select an image as the target image for style transformation in the image selection interface, such as image 16, and click the next control 17.
[0230] Step 4: Style Transformation Processing
[0231] After the terminal device determines that the user has selected the target image, it can use the Meitu app to style the target image, such as transforming the face in the image into another image with an ancient style.
[0232] Step 5: Generate image
[0233] After generating an image with the corresponding style, the terminal device can display the style-transformed image, as shown in Figure 1(d). Users can choose to save the style-transformed image to their gallery by clicking the "Save" control 18, or they can choose to set the image as wallpaper by clicking the "Set Wallpaper" control 19. Users can choose the corresponding control according to their actual needs.
[0234] While the aforementioned applications can style-change the images selected by the user to enhance their interest and richness, the operation steps are complex. In particular, when the gallery contains a large number of images, selecting an image takes a considerable amount of time. Gallery libraries typically store hundreds or thousands of images. If the thumbnails of each image in the selection interface are small, although the number of images on the screen increases, the time required for the user to distinguish each image also increases. If the thumbnails of each image in the selection interface are large, the user needs to repeatedly swipe to select the target image.
[0235] Furthermore, the image library often contains images unsuitable for AI image processing. For example, image 20 in Figure 1(c) has a solid color background, while the user selected an "ancient style" image. Image 20 lacks objects suitable for style transformation, making it impossible for the application to perform style transformation on this type of image. Similarly, image 21 has low resolution and noticeable pixelation, failing to meet the application's image quality requirements; users would also not choose this type of image for style transformation. Therefore, although the image library contains a vast number of images, not all are suitable for AI image processing. These types of images remain in the image selection interface, occupying unnecessary display area, increasing the difficulty for users to select target images, and reducing the efficiency of image selection.
[0236] Example 1:
[0237] To address the problems existing in image processing technology, this application provides an image processing method that can filter images in a gallery based on preset first constraints to obtain a first image for AI image generation processing. The filtered first image is then displayed in an image selection interface. This allows for image filtering within the gallery before the user initiates the AI image processing function, preventing invalid images that do not meet the AI image processing requirements from appearing in the image selection interface. This improves the efficiency of the user in selecting target images and reduces the difficulty and efficiency of image selection. This image processing method can be applied to terminal devices with display modules, such as smartphones, tablets, laptops, desktop computers, and smartwatches. Users can view the filtered first image from the gallery through the display module, and then select the target image for AI image processing through the interactive module on the terminal device, thereby increasing the diversity and interest of the images.
[0238] The AI image generation processing in this embodiment can be specifically implemented using Artificial Intelligence Generated Content (AIGC) technology.
[0239] The AI image processing process performed by the user on images within the gallery includes at least two stages: a preprocessing stage and a style transformation stage. For example, Figure 2 shows a flowchart of an AI image processing embodiment provided by this application. Referring to Figure 2, a user can launch an application with AI image processing capabilities through a terminal device. When the terminal device receives the application launch notification, it enters the preprocessing stage 21, which involves preprocessing the image gallery within the terminal device. This preprocessing operation includes image filtering 211. In some implementations, the preprocessing operation further includes a secondary composition operation 212.
[0240] After completing the preprocessing operations of the image library, the terminal device can generate an image selection interface, which displays the filtered first images. Users can select one or more of these first images as target images for AI image processing. After the user completes image selection, the process enters the second stage of the AI image processing flow, namely AI image processing stage 22. This AI image processing stage 22 includes two phases: determining the image style type 221 and controlling the processing result 222, thereby obtaining the second image after AI image processing of the target image.
[0241] In this embodiment, through the related operations of the above two stages, not only can invalid images that cannot be used for AI image processing be avoided from being displayed on the image selection interface, thereby improving the efficiency of users in selecting target images, but also suitable image style types can be matched according to the images selected by users, and the processing effect of the final output second image can be guaranteed through the processing result control operation. At the same time, both the diversity of style types and the controllability of processing results are taken into account, thereby improving the user experience of AI image processing functions.
[0242] The following describes in detail the specific implementation process of each operation in each stage of the above AI image processing:
[0243] Phase 1: Preprocessing Phase
[0244] For example, Figure 3 shows a flowchart of the image processing method provided in an embodiment of this application during the preprocessing stage. Referring to Figure 3, in the preprocessing stage, the image processing method provided in this embodiment specifically includes the following steps:
[0245] In S301, a first operation initiated by the user in the first application is received. The first operation triggers the display of a list of images that meet the first constraint conditions on the image selection interface.
[0246] In this embodiment, the first application is specifically an application with AI image processing capabilities, or an application capable of implementing AI image processing capabilities through a server. For example, the first application could be a Meitu app, such as "Meitu Xiu Xiu". TM "Beauty Camera" TM "wait.
[0247] For example, the first application mentioned above can be a wallpaper application or a theme application. The theme application can be used to set wallpapers within a theme. Taking a theme application as an example, it can also perform AI image processing on the target image selected by the user. The image obtained through AI image processing by the theme application can be added to the wallpaper library to provide multiple strongly related wallpapers. For instance, the theme application can set the target image selected by the user as the wallpaper in the screen-off state, while using the second image obtained after AI image processing of the target image as the wallpaper for different screen-on scenarios on the terminal device.
[0248] In some scenarios, terminal devices can add the aforementioned AI image processing functions to system applications. For example, AI image processing controls can be added to photo album or wallpaper management applications on the terminal device. Users can then perform AI image processing locally within the system applications without installing additional applications, thereby improving the efficiency of AI image processing. In some implementations, the aforementioned system applications can perform AI image processing through a server.
[0249] In this embodiment, when a user needs to perform AI image processing, they can initiate a first operation through a first application to trigger the display of a list of images that can be used for AI image generation processing on the image selection interface of the first application. For example, when a user clicks on the Meitu application, an operation interface can be opened, which includes an "image selection" control. The first operation can be clicking the aforementioned "image selection" control to display the image selection interface in the Meitu application.
[0250] For example, if the terminal device is a smartphone, the first operation described above can be clicking the icon control of the first application with AI image processing function, such as clicking the icon control 11 in Figure 1(a), thereby launching the corresponding application. That is, when the terminal device is a smartphone, the first operation described above can be a touch operation.
[0251] For example, if the terminal device is a laptop computer, the first operation described above can be to control the mouse to move the cursor displayed on the screen to the shortcut icon of the first application with AI image processing function, and double-click the shortcut icon to launch the corresponding application. That is, when the terminal device is a laptop computer, the first operation described above can be a keyboard and mouse operation.
[0252] In S302, in response to the first operation, at least one first image is determined from the image library; the first image is an image in the image library that satisfies a first constraint condition; the first constraint condition is used to filter images for AI image processing.
[0253] In this embodiment, after receiving the first operation initiated by the user in the first application, before opening the image selection interface corresponding to the first application, the terminal device can filter the images stored in the image library of the terminal device according to the preset first constraints, thereby obtaining images for AI image processing.
[0254] In some implementations, to improve the efficiency of image library filtering, the terminal device can construct a corresponding image feature library for the images in the library. Specifically, Figure 4 shows a flowchart of the implementation of constructing an image feature library according to an embodiment of this application. Referring to Figure 4, the above-mentioned method of constructing an image feature library specifically includes:
[0255] In S41, the terminal device acquires any image from the gallery.
[0256] In S42, the terminal device determines the feature label of any image in the image library through a feature extraction algorithm.
[0257] In this embodiment, the terminal device may be configured with one or more feature dimensions. For example, these feature dimensions may include: facial feature dimension, image quality feature dimension, pose feature dimension, aesthetic evaluation dimension, etc.
[0258] Facial feature dimensions can be used to determine whether an image contains a face, and if it does, to determine the number of faces, the proportion of faces, etc.
[0259] Image quality dimensions can be used to determine image quality-related parameters, such as resolution, sharpness, and brightness.
[0260] Pose feature dimension can be used to determine the pose information of foreground objects in an image, such as torso pose, hand pose, and face pose.
[0261] Aesthetic evaluation dimensions can be used to determine aesthetic indicators calculated based on a preset aesthetic evaluation algorithm.
[0262] In this embodiment, different feature dimensions can correspond to a single feature extraction algorithm, or a single feature extraction algorithm can be used to extract one or more feature dimensions, depending on the specific circumstances. When a terminal device adds a new image to its image library, it can import the image into the aforementioned feature extraction algorithm to generate the corresponding feature label for that image.
[0263] In S43, an image feature library corresponding to the image library is constructed based on the feature labels corresponding to each image in the library.
[0264] In this embodiment, after determining the feature label corresponding to each image, the terminal device can establish a correspondence between the feature label and the image, and determine the above-mentioned image feature library based on all correspondences.
[0265] In S44, the terminal device can match the image with the first constraint condition mentioned above based on the image feature library.
[0266] In this embodiment, the terminal device can match the image with the first constraint condition using the various feature tags recorded in the image feature library to determine whether the image meets the first constraint condition. If each feature tag in the image meets the first constraint condition, the image is identified as the first image and added to the image list of the image selection interface. Otherwise, if a feature tag in the image does not meet the first constraint condition, the image is not added to the image list of the image selection interface.
[0267] In some implementations, the first constraint mentioned above can be one or a combination of two or more of the following conditions:
[0268] Condition 1.1: The number of foreground objects is within a preset range. To improve the effect and accuracy of AI image processing, the number can be no more than one; preferably, the number of foreground objects is one.
[0269] Condition 1.2: The pose of the foreground object is within a preset pose range. The object pose can be a facial pose. If the first image needs to include facial features, the facial pose can be within a preset pose angle range, such as a facial pose angle between -30° and 30°. Alternatively, the object pose can also be a body pose, for example, a standing or sitting pose.
[0270] Condition 1.3: Image quality metrics are within a preset range. To meet the quality requirements of AI image processing—namely, to avoid excessively blurry generated images or inaccurate identification of foreground object contours—the image quality metrics for AI image processing must be within a preset range. These image quality metrics may include at least one of the following: image resolution, image brightness value, foreground object sharpness, and sharpness of key parts of the foreground object. For example, the image resolution may be greater than a preset resolution threshold, and the image brightness value may be within a preset brightness range to avoid images that are too bright or too dark.
[0271] The sharpness of the foreground object can be characterized by either the resolution of the image within its bounding rectangle or the image size of that bounding rectangle. Similarly, the sharpness of key parts of the foreground object can be characterized by either the resolution of those key parts within the image or the image size of the image within the bounding rectangle of those key parts. These key parts can be the face, head, or upper body of the foreground object.
[0272] For example, Figure 5 shows a schematic diagram of image filtering based on a first constraint condition provided in an embodiment of this application. Referring to Figure 5, the first constraint condition includes four dimensions: facial feature dimension, image quality dimension, facial pose dimension, and body pose dimension. Specifically, the constraint condition for the facial feature dimension is: including both facial features and single-person conditions; the constraint condition for the image quality dimension is: resolution not less than 300 dots per inch (dpi), brightness value greater than 125; the constraint condition for the facial pose dimension is: facial area occupancy not less than 1 / 15, facial integrity greater than 70%, facial pose angle between -30° and 30°, facial expression within a preset range (smiling, calm); the constraint condition for the body pose dimension is: torso pose within a preset first pose range; hand pose within a preset second pose range; limb pose within a preset third pose range.
[0273] It should be noted that the values of each feature dimension in the first constraint condition above can be set according to the actual situation. The above values are only used for illustrative purposes and are not intended to limit the implementation parameters of this embodiment.
[0274] The terminal device can match the image with the conditions of each dimension in the first constraint condition according to the labels configured in the image feature library. For example, the feature labels corresponding to image 1 in Figure 5 are: {"portrait", "single person", "resolution 600dpi", "brightness 175", "face proportion 1 / 4", "face integrity 85%", "face pose angle 10°", "laughing"...}. The terminal device can match the aforementioned feature labels with the corresponding dimensional constraints. It can be determined that the feature labels of the face feature dimension in image 1 match the constraints corresponding to the face feature dimension in the first constraint. Similarly, the feature labels of the image quality dimension in image 1 also match the constraints corresponding to the image quality dimension in the first constraint. However, the expression label in the facial pose dimension of image 1 does not match the expression range in the facial pose dimension in the first constraint. Therefore, image 1 is identified as not matching the first constraint and is not added to the image set. The feature labels corresponding to image 2 are: {"portrait", "single person", "resolution 600dpi", "brightness 175", "face proportion 1 / 4", "face integrity 85%", "facial pose angle 10°", "smile"...}. All feature labels match the first constraint. At this time, image 2 can be identified as the aforementioned first image and added to the image set.
[0275] In some implementations, the aforementioned first constraint is determined based on the application providing AI image processing capabilities. For example, the application can perform AI image processing not only on images with human portraits in the foreground but also on images with pets in the foreground, such as some pet image editing applications. In such cases, the facial feature dimension in the first constraint can be adjusted to a facial feature dimension, with the corresponding range including either human or pet faces. Other conditions can also be adjusted accordingly. For another example, if an application has an image restoration function, meaning it has lower resolution requirements and can perform pixel completion, the lower limit of the resolution range in the first constraint can also be lowered, such as a resolution of no less than 100 dpi. Based on this, the terminal device can determine the first constraint corresponding to the first application based on the user's first operation, and perform image filtering based on the first constraint to obtain candidate images for AI image generation processing of the first application. The image list in the image selection interface is then determined based on the first image.
[0276] In some implementations, the first constraint condition is obtained in two different ways: online and offline. Details are as follows:
[0277] Method 1: Obtain online
[0278] In this embodiment, if the terminal device can access the Internet, it can send an acquisition request to the server corresponding to the first application providing AI image processing. The server can then send the first constraint condition corresponding to the first application to the terminal device. Since the image filtering conditions of the first application can change based on factors such as version updates or algorithm adjustments, the terminal device, when connected to the Internet, can send the aforementioned acquisition request to the server of the first application upon receiving a first user operation or after the first application is launched. This allows it to obtain the first constraint condition corresponding to the application and subsequently filter images in the image library using the first constraint condition.
[0279] Method 2: Offline Acquisition
[0280] In this embodiment, if the terminal device is temporarily unable to access the internet, it can filter the images in the aforementioned image library using locally stored first constraints. It should be noted that the terminal device can have multiple first applications with AI image processing capabilities installed. In this case, the terminal device can store the first constraints corresponding to different first applications. When a user initiates a first operation on a particular first application, they can filter images using the locally stored first constraints for that first application to obtain a list of images corresponding to that first application.
[0281] In some implementations, when the terminal device is offline, the first constraints of different first applications can be reused. For example, the terminal device has at least two first applications with AI image processing capabilities installed, namely application A and application B. The terminal device stores the first constraint corresponding to application A, i.e., condition A. When the user launches application B, and the terminal device is offline, since the first constraint corresponding to application B, such as condition B, cannot be immediately obtained, the terminal device can reuse condition A to filter images in the image library. That is, the image selection interface in application B displays a list of images filtered based on condition A. Subsequently, when the terminal device reconnects to the internet, it can re-obtain and store condition B corresponding to application B. When application B is used again subsequently, the images in the image library can be filtered using condition B.
[0282] Furthermore, as another embodiment of this application, before determining the first image and displaying the image selection interface, the terminal device can also perform secondary composition on the first image that does not meet the second constraint condition, so that all the first images displayed in the image selection interface meet the second constraint condition. For example, FIG6 shows a flowchart of the specific implementation of S302 in an image processing method provided in an embodiment of this application. Referring to FIG6, S302 in this image processing method specifically includes S302.1 and S302.2, which are described in detail below:
[0283] In S302.1, based on the first constraint, at least one first image is selected from the image library; the first image is an image in the image library that satisfies the first constraint.
[0284] In this embodiment, the terminal device can filter images in the image library using a first constraint condition, and the filtered image is the first image mentioned above. The specific process of filtering images in the image library using the first constraint condition can be found in the description above and will not be repeated here.
[0285] In S302.2, if the foreground object in any of the selected first images does not meet the preset second constraint condition, the first image is recomposed so that the foreground object in the recomposed first image meets the second constraint condition.
[0286] In this embodiment, the terminal device can determine whether there is a first image in the filtered first image that does not meet the second constraint condition. If there is a second image that does not meet the second constraint condition, the first image can be recomposed, so that the foreground object in the second optimized first image is in a suitable position in the image, thereby improving the processing effect of subsequent AI image processing. The user does not need to make recomposition adjustments after style change, reducing the operations required by the user in the AI image processing process and improving the user's operation efficiency.
[0287] Specifically, the second constraint is used to ensure that the foreground object in the image is of an appropriate size and position. For example, after recomposing the image using the second constraint, the foreground object in the resulting image is centered and its area proportion is within a preset range.
[0288] In some implementations, the second constraint described above may include a combination of one or more of the following conditions:
[0289] Condition 2.1: The area proportion of the foreground object is within the preset ratio range.
[0290] By constraining the proportion of the foreground object, it can be ensured that the foreground object is clearly visible in the image after composition processing, meaning that the foreground object is neither too large nor too small. For example, if the foreground object is too large, only the face area is included, making it impossible to reflect the matching degree with the target image style by changing clothing or accessories; only the makeup of the face can be adjusted, which limits the content that can be adjusted, thus reducing the fit between the AI image processing image and the image style type. On the other hand, if the foreground object is too small, it will increase the difficulty and visibility of adding image style content. For example, if it is necessary to transform the image into an ancient style, a display content such as a "paper umbrella" that matches the ancient style can be added to the image. If the foreground object is too small, it will be more difficult to add the paper umbrella in order to maintain the proportional relationship with the foreground object, and the visibility of the paper umbrella in the image will also be reduced, thus reducing the matching degree with the image style type.
[0291] In this embodiment, the terminal device can be set with a corresponding ratio range. The second image obtained by filtering through the first constraint condition can be used to identify the foreground object. Based on the area of the region where the foreground object is located in the second image and the total image area of the second image, the aforementioned region ratio is determined, and it is determined whether the region ratio is within the aforementioned ratio range, so as to determine whether the second image satisfies the aforementioned second constraint condition.
[0292] Condition 2.2: The area proportion of the key parts of the foreground object is within the preset proportion range.
[0293] In this embodiment, in addition to using the area proportion of the foreground object as the standard for secondary composition, the area proportion of key parts of the foreground object can also be used as the standard for secondary composition. Key parts may include the face, such as determining whether the area proportion of the face of the foreground object in the first image is within a preset proportion range. The proportion range corresponding to the area proportion of the key parts may be different from or the same as the proportion range of the foreground object's area proportion; it can be set according to the actual situation and is not limited here.
[0294] Condition 2.3: The foreground object is on the image axis.
[0295] In general AI image processing, style transformation is often applied to images containing portraits of people or pets, where the visual focus is on the foreground object. Therefore, to extract the visual focus from the image, during secondary composition, it's necessary to determine whether the foreground object is centered, i.e., whether the foreground is aligned with the image's axis.
[0296] Condition 2.4: The specified part of the foreground object is not visible in the image.
[0297] Because certain parts of the body are prone to abnormal transformations during AI image processing—for example, if an image contains fingers, the output image may show extra or missing fingers, or abnormal finger postures—affecting the final image output. Therefore, to reduce these issues, the terminal device can avoid including specified body parts in the image during AI image processing. The terminal device can store a list of specified body parts and perform image recognition on the second image that meets the first constraint condition. It can then determine which body parts are included in the foreground object of the second image, and further determine whether the specified body parts appear in the foreground object, thereby determining whether the second image satisfies condition 2.3.
[0298] In this embodiment, the terminal device can perform conditional judgment on the filtered first image based on the second constraint conditions. If the first image meets all the conditions in the second constraint conditions, it can be directly added to the image list of the image selection interface without secondary image composition processing. Conversely, if the first image does not meet any of the conditions in the second constraint conditions, the first image can be recomposed to make the recomposed first image meet all the second constraint conditions, and then the recomposed first image can be added to the image list of the image selection interface.
[0299] In some implementations, the aforementioned secondary composition operations include, but are not limited to, scaling, cropping, and content expansion operations. When the terminal device performs secondary composition on the second image, one or more composition adjustment operations can be used to adjust the second image, the specifics of which can be determined according to the actual situation.
[0300] For example, Figure 7 shows a schematic diagram of composition adjustment when condition 2.1 is not met, according to an embodiment of this application. If the first image does not meet condition 1, as shown in Figure 7(a), the foreground object 1 in image 1 is located to the left of the axis, and the entire foreground object is not on the axis of the image. In this case, image 1 does not meet the above-mentioned condition 2.1. In this case, the terminal device can process image 1 by image cropping and enlarge its image size to the screen size of the terminal device by scaling operation to obtain image 2. As shown in Figure 7(b), the foreground object 1 in the adjusted image 2 is on the axis. At this time, it can be determined that the adjusted image 2 meets the above-mentioned condition 1 and is identified as the first image.
[0301] For example, Figure 8 shows a schematic diagram of composition adjustment when conditions 2.1 and 2.2 are not met, according to an embodiment of this application. Since the first image does not meet both conditions, as shown in Figure 8(a), and since the portrait area in image 1 is relatively small, the terminal device can first adjust the proportion of the portrait area in image 1 by scaling to obtain image 2, as shown in Figure 8(b). After scaling, the portrait is still not centered, so image 2 can be adjusted by cropping to obtain image 3, as shown in Figure 8(c). The portrait in image 3 simultaneously meets the two conditions of portrait being centered and the portrait area having a suitable proportion. At this time, image 3 can be added to the image set.
[0302] In this embodiment, after the terminal device obtains a first image by filtering the images in the image library through the first constraint, in order to further improve the image quality of subsequent image style processing and reduce the need for recomposition adjustment, the terminal device can perform secondary composition on the first image that does not meet the second constraint through a preset second constraint, thereby obtaining a first image that meets the aesthetic requirements. The first image that has been filtered and recompositioned is obtained as the image list of the image selection interface, reducing the probability that the user needs to adjust the image composition again after the transformation.
[0303] For example, Figure 9 illustrates a schematic diagram of image transformation in a gallery during the preprocessing stage provided in an embodiment of this application. Referring to Figure 9(a), before image filtering, the gallery contains multiple images, including image 91 depicting a landscape and images 92 to 94 containing portraits. Image 93 contains multiple portraits, while the portraits in image 94 are relatively small. After the terminal device filters the images in the gallery using a first constraint, it excludes image 91 depicting a landscape and image 93 containing multiple portraits. That is, images 92 and 94 are filtered, as shown in Figure 9(b). After the filtering is completed, the filtered images can be recomposed. For example, if the human figure area in image 94 is relatively small, image 94 can be adjusted through the recomposition adjustment operation. Finally, the corresponding image set is obtained through filtering and recomposition, as shown in Figure 9(c), image 92 and image 94 obtained after recomposition. That is, the recomposition operation does not reduce the number of the first images obtained by filtering, but adjusts the first images that do not meet the second constraint. The number of images obtained by recomposition after meeting the second constraint is consistent with the number of images obtained by filtering based on the first constraint.
[0304] For ease of understanding, Figure 10 shows a schematic flowchart of a secondary composition process provided in an embodiment of this application. Referring to Figure 10, the input to the secondary composition module is the filtered first image and the screen size corresponding to the terminal device. The aforementioned masking size can be used to determine whether the foreground object is centered and whether the area proportion is within a preset proportion range. Then, the object detection unit in the secondary composition module can determine the foreground object in the first image, and the second constraint condition in the composition rule unit can determine whether the foreground object in the first image meets the requirements. If the second constraint condition is not met, the first image is recomposed using a scaling unit, an image expansion unit, a cropping unit, and a rotation unit, finally obtaining the first image after secondary composition.
[0305] In S303, a thumbnail of the at least one first image is displayed in the image selection interface.
[0306] In this embodiment, after filtering the images in the gallery, the terminal device obtains a corresponding image list and displays a thumbnail of the first image in the image selection interface. For example, Figure 11 shows a flowchart of the display of the first image provided in an embodiment of this application. Referring to Figure 11(a), the main interface of the terminal device displays various icon controls, including an icon control 111 for "wallpaper". Clicking the icon control 111 indicates that the terminal device has initiated a first operation. Before displaying the corresponding image selection interface in the wallpaper application, the image list corresponding to the image selection interface can be determined using the image processing method provided in this embodiment. When the wallpaper application interface is opened, only the filtered first image is displayed, as shown in Figure 11(b).
[0307] In some implementations, if the user needs to select the corresponding function control when the wallpaper application is launched for the first time, as shown in Figure 11(c), then when the user clicks the above-mentioned "Multi-style wallpaper change" function control 112, the first image mentioned above can be determined, and when selecting the target image for the "Multi-style wallpaper change" operation, the first image in the image set can be displayed again as shown in Figure 11(b).
[0308] In some implementations, if the photo album application of the terminal device has AI image processing capabilities, then when the user opens the photo album application interface, they can also determine the first image using the image processing method provided in this application embodiment. Simultaneously, the first image can be displayed in the corresponding interface of the photo album application, along with other images that do not meet the first constraint condition. To distinguish between the first image that meets the first constraint condition and other images that do not, the first image can be highlighted within the photo album application interface using a preset marker. This marker indicates that the first image is a candidate image for AI image generation processing.
[0309] For example, Figure 12 shows a schematic diagram of a photo album interface provided in an embodiment of this application. Referring to Figure 12(a), the interface of this photo album application can display various images contained in the gallery, including images that meet the first constraint condition, such as images 121 and 122, and images that do not meet the first constraint condition, such as image 123. In order to facilitate the differentiation of which images can be used for AI image processing, the first images can be marked with an asterisk, such as images 121 and 122 with an asterisk, while image 123 is not marked with an asterisk.
[0310] When a user clicks on an image marked with an asterisk, such as image 121, the user will enter the corresponding preview interface, as shown in Figure 12(b). This preview interface includes AI image processing controls, such as the "Style Transformation" control 124. If the user clicks on an image without an asterisk, such as image 123, the user will enter the preview interface shown in Figure 12(c). This preview interface does not include the aforementioned "Style Transformation" control, meaning the user cannot perform AI image processing on this type of image.
[0311] In some implementations, the first image can be clustered to obtain multiple image sets, with different image sets corresponding to different objects. Specifically, when constructing the image feature library corresponding to the image library, the image feature library contains object labels. These object labels can be determined based on the facial features of foreground objects in the image, i.e., used to identify objects that have appeared in the image. For example, if an image contains user A and pet B, after extracting the facial features of the image, corresponding object labels "user A" and "pet B" can be added to the image. Correspondingly, other images can also have corresponding object labels added based on the objects they contain. When determining the image set, the terminal device can divide it into different image sets based on the object labels corresponding to the first image; each image set can correspond to one object label.
[0312] For example, Figure 13 shows a schematic diagram of an image set provided in an embodiment of this application. Referring to Figure 13(a), if the object labels are divided based on the gender and age of the foreground object, the image set may include an image set 131 for "young males," an image set 132 for "young females," and an image set 133 for "children." Referring to Figure 13(b), if the object labels are divided based on facial features, the image set may include an image set 134 for "user A," an image set 135 for "user B," and an image set 136 for "pet C," etc. Specifically, the method of dividing the image set can be determined according to the actual situation and is not limited here.
[0313] As can be seen from the above, when a user needs to open the image selection interface of an application with AI image processing, the terminal device can filter the images in the image library, thereby determining the first image that meets the requirements of AI image processing and displaying the first image in the image selection interface. This reduces the number of images displayed, thereby reducing the difficulty for the user to select images and improving the user's operating efficiency.
[0314] Phase 2: Style Transformation Phase
[0315] For example, Figure 14 shows a flowchart of the implementation of an image processing method in the style transformation stage according to an embodiment of this application. Referring to Figure 14, in the preprocessing stage, the image processing method provided in this embodiment specifically includes the following steps:
[0316] In S1401, in response to the second operation, at least one second image is obtained based on the target image in the at least one first image. In this embodiment, the terminal device can display the filtered first images on the image selection interface, and the user can select the target image for AI image processing from the first images. Specifically, the second operation is the operation of triggering the AI image generation function on the target image. For example, FIG15 shows a schematic diagram of the second operation provided in an embodiment of this application. Referring to FIG15(a), the interface is the image selection interface in an application with AI image processing function. The image selection interface can display the first images that can be filtered by the first constraint conditions and are capable of AI image processing. The user can select the target image for AI image processing from the above images. For example, the user can click on image 151 in the interface as the target image for AI image processing, and after the selection is completed, click the next control 152. The terminal device recognizes that the user has completed the selection, determines that image 151 is the target image for AI image processing, and executes the subsequent processing flow. It should be noted that users can also select multiple images as target images for AI image processing operations in the above interface. For example, after selecting image 151 and image 153 at the same time, as shown in Figure 15(b), and then clicking the next control 152, the target image selected by the user can be highlighted in bold.
[0317] Specifically, AI image generation processing of the target image refers to generating a new image, such as the second image, based on the target image using AI image generation.
[0318] In some possible implementations, after the user selects a target image, a preview interface for the target image may be included. That is, after displaying the target image selected by the user, the first operation is initiated within the preview interface. That is, before S1401, it may also include:
[0319] In S1400, in response to the selection operation of the target image, the target image is displayed.
[0320] In this embodiment, the user can initiate a selection operation from the image selection interface, that is, select the target image to be processed by AI image processing from at least one first image.
[0321] In some possible implementations, the first image may not be recomposed before its thumbnail is displayed on the image selection interface. Instead, after the user initiates the selection operation, a second constraint is used to determine whether recomposition of the target image is necessary. If the target image selected by the user does not meet the second constraint, recomposition can be performed, and the recomposed target image is then displayed. The specific recomposition process can be found in the relevant description of S302.2 above, and will not be repeated here.
[0322] For example, Figure 16 illustrates a schematic diagram of the second operation provided in another embodiment of this application. After the user clicks the "Multi-style Wallpaper Change" control as shown in Figure 11, the image selection interface shown in Figure 16(a) can be displayed. This image selection interface can display a first image that can be processed by AI image processing, which has been filtered by the first constraint condition. The user can click on image 161 in the interface as the target image for AI image processing, that is, initiate a selection operation on image 161. At this time, the preview interface corresponding to the target image can be displayed, as shown in Figure 16(b). At this time, if image 161 does not meet the second constraint condition, image 161 can be recomposed, and the recomposed image 161 can be displayed in the preview interface. If the user determines that image 161 needs to be set as wallpaper, he / she can click the "Set as Wallpaper" control 162. The terminal device then recognizes that the user has completed the selection and performs subsequent processing operations.
[0323] In this embodiment, after initiating the second operation, the electronic device can obtain at least one second image, which is obtained by processing the target image, including AI image processing. It should be noted that the processing can be implemented by the electronic device or by a server.
[0324] In some possible implementations, Figure 17 illustrates a flowchart of processing a target image based on a terminal device according to an embodiment of this application. Referring to Figure 17, when the process of processing the target image to obtain a second image is implemented locally on the terminal device, the above-mentioned S1401 further includes:
[0325] In S1701, in response to the second operation, at least one image style type corresponding to the target image is determined.
[0326] In this embodiment, after the terminal device determines the target image specified by the second operation, it can determine the image style type that matches the target image.
[0327] In some implementations, the image style type can be determined based on foreground objects in the target image. For example, different users can correspond to different lists of image styles. The terminal device can determine the user identifier corresponding to the foreground object, determine the corresponding list of image styles based on the user identifier, and select one or more from the list as the image style type to be used in this processing.
[0328] In some implementations, the image style type can also be determined based on the descriptive information of foreground objects in the target image. The terminal device can identify foreground objects in the first image, perform object recognition on the foreground objects, determine the descriptive information of the foreground objects, and select an image style type that matches the aforementioned descriptive information as the image style type used when processing the target image. This descriptive information can be the age and / or gender of the foreground object. The age can be the age range to which the foreground object belongs, or it can be a predicted age value.
[0329] In some implementations, after selecting the target image and determining the corresponding image style type, the terminal device can directly process the target image according to the image style type, that is, perform the operation of S1702.
[0330] In some implementations, after selecting a target image and determining the corresponding image style type, the terminal device can display an image style type that matches the target image.
[0331] For example, Figure 18 shows a schematic diagram of foreground objects and style types provided in an embodiment of this application. Referring to Figure 18(a), if the foreground object in the target image is a young woman, the matched image style type may include: ancient style, mechanical style, frontier style, etc.; referring to Figure 18(b), if the foreground object in the target image is a young man, the matched image style type may include: warrior style, mecha style, and scholar style, etc.; referring to Figure 18(c), if the foreground object in the target image is a child, the matched image style type may include: elf style and ancient style.
[0332] In some implementations, the terminal device constructs a corresponding image feature library for the images in the image library. This image feature library records the feature labels corresponding to each image, and the first image is obtained by filtering the image library according to the first constraint condition; that is, the feature label of the target image is also recorded in the aforementioned image feature library. The terminal device can determine the descriptive information of the foreground object in the target image based on the feature label of the target image, and then determine the image style type based on the descriptive information. There is no need to perform image recognition on the first image again to determine the foreground features. The feature labels in the already constructed image feature library can be directly reused, thereby improving the efficiency of image style type determination and reducing the computational load of the terminal device.
[0333] In some implementations, the image style type that matches the target image can include multiple types. In this case, the user can select one of the multiple image style types as the target image style type. Subsequently, the description information image can be converted into a second image that matches the target image style type selected by the user. As shown in Figure 18, if the foreground object is a woman, the user can select one of the three style types, namely, ancient style, mechanical style, and frontier style, as the target style type. For example, if the ancient style is selected, a second image that matches the ancient style style type will be generated.
[0334] In some implementations, the image style type matching the target image can include multiple types. In this case, the user can select two or more image style types as the target image style type. Correspondingly, multiple second images with different image style types can be generated simultaneously. Continuing with Figure 18 as an example, if the foreground object is a woman, the user can select two image style types, namely, ancient style and mechanical style, as the target style type and click the "Next" control 181. Subsequently, the terminal device will generate a fourth image of the corresponding image style type according to the user's style selection, such as generating a fourth image matching the ancient style type and a fourth image matching the mechanical style type.
[0335] In this embodiment, the terminal device can determine the image style type corresponding to the target image based on the descriptive information of the foreground object in the target image. The descriptive information can be object tags from an image feature library, or it can be generated by processing the first image using a preset object recognition algorithm, such as extracting facial features from the first image and generating descriptive information based on those facial features. The specific method for determining the object features can be determined according to the actual situation and is not limited here.
[0336] In some implementations, the terminal device can display descriptive information about the foreground object and the image style type matched by the first image. Referring again to the figures in Figure 16, it can display descriptive information such as "young woman," "young man," and "child."
[0337] In this embodiment, the terminal device can respond to the adjustment operation of the description information and adjust the description information accordingly. For example, FIG19 shows a schematic diagram of the adjustment of description information provided in an embodiment of this application. Referring to FIG19(a), the interface displaying the image style type may include an adjustment control 191. Since the foreground object in image 192 is a short-haired portrait, the terminal device may identify it as a young male, but the actual subject is a female, and the description information needs to be adjusted. At this time, the user can click the aforementioned adjustment control 191 to access the corresponding attribute adjustment interface, as shown in FIG19(b). The user can edit attributes from the relevant controls in the adjustment interface, for example, adjusting the corresponding gender through the gender adjustment control 193, and adjusting the corresponding age type through the age category control 194. Optionally, in addition to adjusting the description information through selection, the description information can also be input through text input, for example, by clicking the aforementioned direct input control 195 to input the user-set description information.
[0338] Since the above is a gender recognition operation, the user can click the gender adjustment control 193 to select the correct gender, and complete the adjustment operation by clicking the "Complete" control 196 after the adjustment is completed. At this time, the terminal device can redetermine the image style type corresponding to the target image based on the description information entered by the user, as shown in (c) of Figure 19.
[0339] In some implementations, when determining the image style type corresponding to the target image, the terminal device can also obtain the current scene information. This scene information can include weather information, time information, and location information. The time information can include the moment the first operation was initiated, the date, festival, solar term, etc. The terminal device can determine the matching image style type based on the description information of the foreground object and the aforementioned scene information. For example, if the current weather is winter, the corresponding image style type could be "Winter Ancient Style"; if the current date is Qixi Festival (Chinese Valentine's Day), the corresponding image style type could be "Qixi Ancient Style"; if the current user's location is Mount Hua, the corresponding image style type could be "Mountain Climbing Ancient Style." This ensures that the image obtained through subsequent AI image processing has a certain correlation with the scene information corresponding to the user when the second operation was initiated, thereby improving the fit between the transformed image and the scene, and also increasing the diversity of the transformed image.
[0340] For example, Figure 20 illustrates a schematic diagram of determining an image style type according to an embodiment of this application. Referring to Figure 20, the terminal device can determine at least one style keyword matching the description information of the foreground object in the target image. For example, for a young woman, the corresponding style keywords may include two style keywords: "ancient style" and "frontier region." Then, the terminal device can obtain the scene information corresponding to the current user, thereby obtaining scene-related keywords, such as keywords related to festivals like "Mid-Autumn Festival" and keywords related to weather like "sunny day." Finally, the image style type matching the target image is determined based on the aforementioned style keywords and scene keywords. Since the scene keywords can change depending on the scene information initiating the second operation, the purpose of dynamically updating the image style type can be achieved.
[0341] In S1702, the target image is processed based on the image style type to obtain at least one second image that matches the image style type.
[0342] In this embodiment, after determining the image style type corresponding to the target image, the terminal device can process the target image using a preset AI image processing algorithm to transform the target image into a second image that matches the image style type. The processing includes AI image processing to achieve the purpose of image style transformation.
[0343] In this embodiment, the AI image processing operation described above can be implemented using a preset AI image processing model. The terminal device can input the target image requiring style transformation into the AI image processing model and output a second image. It should be noted that different image style types can correspond to different AI image processing models. After determining the image style type corresponding to the target image, the terminal device can process the target image using the AI image processing model corresponding to the image style type. Different image style types can also correspond to the same AI image processing model. In this case, before importing the target image into the AI image processing model, the terminal device can simultaneously input the image style type into the AI image processing model to adjust the relevant transformation parameters of the AI image processing model, thereby enabling the targeted output of a second image of the specified image style type.
[0344] For example, Figure 21 shows a schematic diagram of the structure of an image style model provided in an embodiment of this application. The image style model may include the following multiple units: a pose processing unit 211, a semantic understanding unit 212, a style transformation unit 213, and a quality control unit 214. The terminal device can input the target image into the pose processing unit 211 and the semantic understanding unit 212. The pose processing unit 211 determines the pose and contour information of the foreground object in the target image and imports it into the pose correction unit to correct the pose of the foreground object, outputs the pose data of the foreground object in the target image, and sends the pose data to the style transformation unit 213. At the same time, the semantic understanding unit 212 can also perform semantic understanding on the target image to determine the semantic expression corresponding to the target image. For example, the semantic keywords corresponding to the input target image in Figure 21 include: "snow mountain", "youth", "woman", "long hair", "T-shirt", etc. The semantic keywords are integrated by a sentence description integration algorithm, and the semantic description can be expressed as "a young woman with long hair wearing a T-shirt on a snow mountain". The corresponding semantic data is then sent to the style transformation unit 213.
[0345] In this embodiment, pose data is obtained through pose processing unit 211 and semantic data is obtained through semantic understanding unit 212, thereby ensuring that the second image obtained after AI image processing is consistent with the foreground object in the target image. While achieving style diversity, it can also retain the personalized features of the foreground object in the target image, avoid the uncontrollable generation result after style transformation, and improve the efficiency of AI image processing.
[0346] In this embodiment, the style transformation unit 213 can perform AI image processing on the target image using pose data and semantic data to obtain a second image matching a specified image style type. This ensures that the foreground object in the target image and the foreground object in the style-transformed second image have the same features in a preset feature dimension, which is determined based on the pose data and semantic data. For example, if it is necessary to maintain the same facial and body poses for the foreground objects in the target image and the second image, the facial and body poses of the foreground object can be determined based on the pose data, thus ensuring that the foreground objects in the two style-transformed images have the same facial and body poses. Similarly, if it is necessary to maintain the same headwear for the foreground objects in the target image and the second image, the headwear can be determined to be a hat based on the semantic description "child wearing a hat" corresponding to the semantic data. Therefore, the hat worn by the foreground object in the target image can be retained in the second image, ensuring that the two images have the same headwear. By importing pose data and semantic data into the style transformation unit 213, the results of AI image processing can be controlled, satisfying image diversity while ensuring consistency in the specified feature dimensions of the foreground object.
[0347] It should be noted that the image style module described above can directly output the image output by the style transformation unit 213, that is, the image output by the style transformation unit 213 can be used as the second image. In other words, the second image can be directly displayed and stored without the quality control unit 214 performing quality control processing on the second image.
[0348] In this embodiment, the style transformation unit 213 can input the style-transformed second image into the aforementioned quality control unit 214. The quality control unit 214 performs quality control processing on the style-transformed second image, including pose anomaly processing, contour anomaly processing, color anomaly processing, and lighting anomaly processing. If a transformation anomaly (such as pose anomaly, contour anomaly, color anomaly, or lighting anomaly) is detected in the second image, quality control processing is performed on the areas of the second image with transformation anomalies, and the quality-controlled second image is output. If no transformation anomaly is detected in the second image, the second image of the style transformation unit 213 is output. Since transformation anomalies may occur during the style transformation process, the style transformation unit 214 can perform secondary anomaly detection, improving the accuracy of AI image processing and reducing the probability of abnormal images that do not conform to aesthetics and common sense.
[0349] For example, if the target image input to the AI image processing unit 213 contains fingers of a foreground object, after style conversion, there may be cases of extra or missing fingers. Or, if the target image contains the head of a foreground object, after style conversion, there may be cases of multiple heads or multiple faces. The above-mentioned abnormal situations are all errors that do not conform to common sense. Therefore, secondary anomaly detection can be performed by the quality control unit 214. For example, the contour data of the foreground object in the second image can be extracted by the contour recognition algorithm, and the contour data can be used to determine whether there are contour anomalies, such as extra fingers, missing fingers, multiple heads, and multiple faces. When contour anomalies occur, quality control processing is performed.
[0350] In some implementations, the aforementioned quality control unit 214 may also include a pose detection algorithm. By performing pose recognition on the foreground object in the second image of the foreground object in the style transformation unit 213, the pose of the foreground object in the second image is determined, and it is judged whether the pose of the object meets the preset pose conditions. This enables the identification of pose distortions that occur after AI image processing. If the pose of the foreground object in the second image does not meet the pose conditions, the pose of the foreground object can be adjusted, and the second image after pose adjustment can be output.
[0351] In some implementations, the quality control unit 214 may also be configured with a sensitive content recognition algorithm. When the second image input by the AI image processing unit 214 is imported into the quality control unit 214, the quality control unit 214 can use the sensitive content recognition algorithm to determine whether the second image contains any content in a preset list of sensitive content, such as sensitive content involving pornography, violence, or religion. If the quality control unit 214 detects that the second image contains sensitive content, the area of the sensitive content in the second image can be adjusted so that the output second image does not contain sensitive content.
[0352] It should be noted that the above-mentioned contour anomaly processing, pose anomaly processing, and sensitive content processing can be processed in parallel, or one or more of them can be processed sequentially based on a preset processing order. The specific settings can be made according to the actual situation, and no restrictions are imposed here.
[0353] In some implementations, to achieve controllable AI image processing results, the pose processing unit 211 can perform image processing on the input target image using one or a combination of the following two methods, and then send the processed pose data to the style transformation unit 213. The two methods may include:
[0354] Method 1: Attitude Control
[0355] In this embodiment, the pose processing unit 211 can determine the pose type of the foreground object by performing pose recognition on the foreground object in the input target image. If the pose type of the foreground object is within a preset pose adjustment range, the pose processing unit 211 can adjust the pose of the foreground object in the target image, thereby ensuring that the pose of the foreground object in the image is within a controllable range when performing image style conversion on the target image. This not only increases the number of templates that can be selected during image style conversion but also improves the accuracy of the algorithm processing during subsequent style conversion. Specifically, the situations requiring adjustment of the foreground object's pose can include the following three:
[0356] Case 1: A hand appears in the foreground object of the target image.
[0357] In this embodiment, the pose processing unit 211 can obtain the contour information and pose information of the foreground object in the target image. The contour information can be used to determine whether the hand of the foreground object appears in the target image. If the hand of the foreground object appears in the target image, that is, the contour information includes the hand contour, the pose of the hand of the foreground object in the target image can be adjusted.
[0358] For example, Figure 22 shows a schematic diagram of adjusting the hand of a foreground object in an image according to an embodiment of this application. Referring to Figure 22, the hand of object 1 in image 1 is in a raised hand posture. Since images containing hands are prone to anomalies such as extra fingers or missing fingers after AI image processing, or the hand posture may not conform to common sense, in order to reduce the probability of the above anomalies, when the posture processing unit 211 detects the presence of a foreground object's hand in the target image, and the hand posture is a raised hand posture, the hand posture can be adjusted to a vertically downward posture, such as the hand of object 1 in image 2 being adjusted to a vertically downward posture, while the postures of other parts remain unchanged. Because the pose processing unit 211 adjusts the pose of object 1 in image 1, changing its hand pose from a raised pose to a vertically downward pose, its fingers will be in a closed pose or invisible. The adjusted pose data is then sent to the style transformation unit 213, ensuring that the foreground objects in the output image of the style transformation unit 213 are generated based on the adjusted pose. For example, the hand pose of object 1 in image 3 is the same as that of object 1 in image 2, both being vertically downward poses, and not consistent with the original pose (i.e., the pose of object 1 in image 1). By adjusting the pose of the foreground object through the pose processing unit 211 and then processing it through the style transformation unit 213, subsequent issues such as extra or missing fingers due to image style transformation are avoided.
[0359] Scenario 2: The foreground object's hand in the target image has a supporting structure.
[0360] In this embodiment, after the pose processing unit 211 obtains the contour information of the foreground object in the target image, if the contour information determines that the foreground object in the target image contains a hand contour and there is a support below the hand contour, the support can be replaced. For example, the support in the target image can be replaced with a support that matches the image style type.
[0361] For example, Figure 23 illustrates a schematic diagram of replacing the support for the hand of a foreground object in an image according to an embodiment of this application. Referring to Figure 23, there is a support below the hand of object 1 in image 1; this support is object 1's knee. In this case, if the converted image style is an ancient style, a table can be selected as the replacement support, and the knee of object 1 in image 1 can be replaced with a table, just as the support below object 1's hand in image 2 of Figure 23 is replaced with a table. The pose processing unit 211 can send the target image with the replaced support to the style conversion unit 213, thereby enabling the style-converted image to include the replaced support, as shown in image 3 of Figure 23, where the support below object 1's hand is the same as in image 2, which is a table.
[0362] In some implementations, if a support is found below the hand, it can be determined whether the support matches the image style type to be converted. If the support below the foreground object's hand in the target image matches the image style type, the support can be retained, i.e., no support replacement is performed; conversely, if the support below the foreground object's hand in the target image does not match the image style type, the support can be replaced with a support that matches the image style type.
[0363] Case 3: The foreground object in the target image is occluded by an occluder.
[0364] In this embodiment, after obtaining the contour information of the foreground object in the target image through the pose processing unit 211, it can be determined whether the contour of the foreground object is continuous. If the contour of the foreground object is not continuous, it means that the foreground object in the target image is occluded by other objects, that is, there is an occluder. At this time, the occluder in the target image can be removed. Conversely, if the contour of the foreground object is continuous, it means that the foreground object in the first object is not occluded. At this time, other judgments (such as judgments of case 1 and case 2) can be performed, or image processing can be performed through the style transformation unit 213.
[0365] For example, Figure 24 illustrates a schematic diagram of removing occlusions from a foreground object in an image according to an embodiment of this application. Referring to Figure 24, in image 1, object 1 is holding a doll 241, which occludes a portion of area 242 of object 1. In this case, the pose processing unit 211 can remove the doll 241, and the missing area can be automatically filled using a content filling algorithm. As shown in image 2 of Figure 24, object 1 no longer holds the doll 241, and the content of area 243 is filled in. After subsequent image processing by the style transformation unit 213, image 3 of Figure 24 is obtained. In image 3, object 1 no longer holds the doll 241, i.e., the occlusion has been removed, thereby improving the integrity of the foreground object after image style transformation.
[0366] In this embodiment, the terminal device can perform pose control on the foreground object of the input target image, thereby reducing the probability of transformation anomalies caused by object pose during subsequent AI image processing. While ensuring the diversity of the image after style transformation, it can also make the transformation result controllable, thus improving the effect and accuracy of style transformation.
[0367] Method 2: Template Control
[0368] In this embodiment, the pose processing unit can extract the pose of the foreground object in the target image and select a candidate conversion template that matches the object pose from the conversion template library as the target conversion template. Then, when the style transformation unit 213 performs image processing on the target image, the above-mentioned target conversion template can be used to output the corresponding image. The pose of the foreground object in the image output by the target conversion template is consistent with the object pose in the target conversion template.
[0369] In some implementations, the aforementioned conversion template library is determined based on the image style type that the target image needs to be converted to. That is, different image style types can correspond to different conversion template libraries, thereby enabling the selected target conversion template to match the image style type corresponding to the target image.
[0370] In some implementations, the terminal device can determine the template pose corresponding to each candidate transformation template and calculate the pose similarity between the object pose of the foreground object in the target image and the template pose, thereby selecting the candidate transformation template with the highest pose similarity as the target transformation template.
[0371] For example, Figure 25 illustrates a schematic diagram of controlling AI image processing results through templates according to an embodiment of this application. Referring to Figure 25, object 1 in image 1 is in pose 1, and the conversion template library contains at least two conversion templates, namely template 1 and template 2. Template 1 has a template pose of pose 2, while template 2 has a template pose of pose 3. Since pose 2 in template 1 is highly similar to pose 1 of object 1 in image 1, template 1 can be determined as the target conversion template. Then, AI image processing is performed on image 1 using template 1 to obtain image 2. In image 2, the pose 4 of object 1 is the same as pose 2 in template 1, thus ensuring that the object pose remains unchanged after conversion. This improves the controllability of the conversion result and also generates a style-converted image with the same image style type as the target conversion template.
[0372] In some implementations, when generating a second image through a conversion template, a face replacement method can be used to generate the second image. That is, the face image of the foreground object is extracted from the first image, and the face image is fused with the conversion template to obtain the second image, so that the first image and the second image have the same facial features.
[0373] In some implementations, when generating the second image through the conversion template, facial features of the first image can be extracted, facial features of the foreground object of the second image can be generated based on the feature vector of the facial features of the first image, and the facial features of the second image can be fused with the conversion template to obtain the second image, so that the first image and the second image have the same facial features.
[0374] In this embodiment, the terminal device can create a conversion template library, thereby selecting candidate conversion templates with the pose of foreground objects in the target image as target conversion templates during AI image processing, thus improving the controllability of the conversion results. By continuously expanding and updating the number of candidate conversion templates in the conversion template library, the diversity of image style conversion can be increased.
[0375] It should be noted that when performing image style transfer, the pose of the foreground object in the target image can be adjusted according to the pose of the foreground object in the target image using the method described above 1, so that the style transfer result is controllable. Alternatively, the target image can be processed by AI image processing using the method described above 2, by selecting a suitable target transfer template, so that the style transfer result is controllable.
[0376] In some implementations, the terminal device can also combine Method 1 and Method 2 to make the image style conversion result controllable. For example, Figure 26 shows a schematic flowchart of an image style conversion provided in an embodiment of this application. Referring to Figure 26, the hand state of object 1 in image 1 is a raised hand posture. In this case, object 1 satisfies condition 1 of Method 1, and the posture of object 1 in image 1 can be adjusted using the corresponding posture adjustment method to obtain image 2. Then, based on the object posture of object 1 in image 2, template 1 is determined as the target conversion template, and then AI image processing is performed on image 2 using template 1 to obtain image 3, thereby improving the controllability of the AI image processing result.
[0377] In some implementations, if there are large blank areas after style conversion, such as only a solid color background, the quality judgment unit 214 can also add corresponding decorations to the blank areas according to the image style type. For example, add a hat that matches the image style type to the foreground object, or add decorations. For example, in the ancient style, you can add background objects with ancient style characteristics such as red lanterns, city gates, and drum towers to the background.
[0378] In another implementation, the process of processing the target image described above can be implemented by a server. For example, Figure 27 shows a flowchart of the interaction between the terminal device and the electronic device when the second image is generated based on the server. Referring to Figure 27, S1401 above may include:
[0379] In S2701, the terminal device responds to the second operation by sending an image generation instruction to the server, the image generation instruction including the target image.
[0380] In this embodiment, the server can be a server corresponding to the first application, or a server providing AI image processing functions. The terminal device can send an image generation instruction to the server to generate a second image corresponding to the target image.
[0381] In some implementations, the terminal device can send the target image selected by the user directly to the server, or it can send the target image obtained after secondary mapping based on the second constraint to the server.
[0382] In some implementations, the terminal device can also determine the image style type of the target image. In this case, the image generation instruction sent above may also include the image style type.
[0383] In some implementations, the terminal device can also add the scene information corresponding to the initiation of the second operation to the above-mentioned image generation instruction and send it to the server so that the server can generate a second image based on the scene information.
[0384] In S2702, the server processes the target image to obtain at least one second image, the processing including AI image generation processing.
[0385] In this embodiment, the server can process the target image, including AI image generation processing. The specific implementation process can be found in the description of the terminal device processing the target image in S1401, and will not be repeated here. For example, the server can be configured with an image style model as shown in Figure 21, which is used to process the target image to obtain a second image. It should be noted that the above processing may also include secondary composition, support replacement, posture adjustment, occlusion removal, and quality control processing, among other things.
[0386] In S2703, the terminal device receives at least one second image sent by the server.
[0387] In this embodiment, the terminal device can filter images in the image library to obtain at least one first image, reducing the number of images selected by the user and improving the efficiency of selecting target images. It can then send the target image that needs to be processed by AI image generation to the server so that the server can complete the AI image generation process and achieve the purpose of AI image generation. Since the server has strong computing power, it can improve the efficiency of AI image generation and reduce the computing pressure on the terminal device.
[0388] In S1402, at least one second image is displayed.
[0389] In this embodiment, after generating a second image from the target image and performing style conversion, the terminal device can display the second image. For example, FIG28 shows a schematic diagram of the display interface of the second image provided in an embodiment of this application. Referring to FIG28(a), the interface displays the converted image 281, and also includes a save control 282 and a control 283 for setting as wallpaper, and may also include a re-conversion control 284. If the user needs to save the image 281, they can add the image 281 to the terminal device's gallery by clicking the save control 282, or quickly set it as the terminal device's desktop wallpaper by clicking the set as wallpaper control 283, or add the second image selected by the user to the wallpaper library.
[0390] In some implementations, after the user clicks the save control 282, the terminal device can add image 281 to the terminal device's wallpaper library. During the use of the terminal device, the terminal device can update the wallpaper on the main interface and / or lock screen using the images stored in the wallpaper library.
[0391] In some implementations, if a user needs to perform a style conversion again, for example, if they are not satisfied with the style conversion result, they can click the control 284 mentioned above. At this time, the image style type selection interface will be displayed, as shown in Figure 28(b). The user can redefine the image style type and then perform the AI image processing operation again.
[0392] In some implementations, when determining the image style type corresponding to the target image, the terminal device can determine two or more image style types for the target image. Each image style type can output one or more second images. In this case, the terminal device can display all the obtained second images, and the user can select the second image to be saved from all the second images.
[0393] For example, Figure 29 illustrates a schematic diagram of selecting a second image according to an embodiment of this application. Referring to Figure 29, the terminal device can generate multiple images with different image styles based on the input image 1, such as image 291 and image 292. The user can select one or more of these images to save as needed. The selected image can be displayed with a thickened border; for example, if the user selects image 291, its border will be thickened. After making the selection, the user can click the save control 293 to save the selected image, such as saving image 291.
[0394] As can be seen above, the terminal device can filter images in the image library to obtain the first image that can be used for AI image generation processing, and display the thumbnail of the first image in the image selection interface. Subsequently, the user can select the target image for AI image generation processing from at least one first image, reducing the number of images displayed in the image selection interface, thereby reducing the difficulty for the user to select images and improving the user's operating efficiency.
[0395] Example 2:
[0396] Corresponding to the implementation flow of an image processing method in Embodiment 1 above, Figure 30 shows a structural block diagram of an image processing apparatus provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0397] Referring to Figure 30, the image processing apparatus described above includes:
[0398] The first image determination unit 301 is configured to determine at least one first image from a library in response to a first operation; the first image is an image that satisfies a first constraint condition; the first operation is to trigger the display of a list of images that satisfy the first constraint condition on an image selection interface; the first constraint condition is used to filter candidate images for AI image generation processing.
[0399] Image display unit 302 is used to display thumbnails of the at least one first image in the image selection interface;
[0400] Image acquisition unit 303 is configured to, in response to a second operation, acquire at least one second image based on a target image in the at least one first image, wherein the second image is obtained by processing the target image, the processing including AI image generation processing, and the target image is the first image selected by the second operation.
[0401] Optionally, the first image determination unit includes:
[0402] The second image determination unit is used to filter out the at least one first image from the image library based on the first constraint condition;
[0403] The secondary composition unit is used to perform secondary composition on the first image if the foreground object in any of the selected first images does not meet the preset second constraint condition, so that the foreground object in the second composed first image meets the second constraint condition.
[0404] Optionally, if the foreground object in the target image does not satisfy the preset second constraint condition, the process further includes recomposing the target image so that the foreground object in the recomposed target image satisfies the second constraint condition.
[0405] Optionally, if the foreground object in the target image does not satisfy a preset second constraint condition, the device further includes:
[0406] An image selection unit is configured to perform secondary composition on the target image in response to a selection operation on the target image, so that the foreground object in the target image after secondary composition satisfies the second constraint condition;
[0407] The preview unit is used to display the target image after the secondary composition, and the second operation is an operation performed based on the target image after the secondary composition.
[0408] Optionally, the composition adjustment operation includes at least one of the following: scaling operation, cropping operation, rotation operation, and content expansion operation.
[0409] Optionally, the second constraint includes at least one of the following:
[0410] The area proportion of the foreground object is within a preset ratio range;
[0411] The area proportion of the key parts of the foreground object is within a preset ratio range;
[0412] The foreground object is on the axis of the first image;
[0413] The key part of the foreground object is on the axis of the first image;
[0414] The specified portion of the foreground object is not visible in the first image.
[0415] Optionally, the first constraint includes at least one of the following:
[0416] The number of foreground objects contained in the first image is within a preset range;
[0417] The foreground object's pose is within a preset pose range, and the object pose includes the foreground object's facial pose and / or body pose.
[0418] The image quality index of the first image is within a preset index range, and the image quality index includes at least one of the following: image resolution, image brightness value, sharpness of the foreground object, and sharpness of key parts of the foreground object.
[0419] Optionally, the image display unit includes:
[0420] The image library display unit is used to display thumbnails of multiple images in the image selection interface; the multiple images include at least one first image; the first image includes a marker; the marker is used to indicate that the first image is a candidate image for AI image generation processing.
[0421] Optionally, the image style type of the second image is determined based on the foreground object in the target image.
[0422] Optionally, the image style type is determined based on the descriptive information of the foreground objects in the target image.
[0423] Optionally, the image style type is determined based on the foreground object of the target image and the scene information corresponding to the user of the terminal device when the second operation is initiated.
[0424] Optionally, the descriptive information is obtained by performing object recognition on the target image; or
[0425] The description information is obtained after the user adjusts the recognition result of the target image; the recognition result is generated by object recognition of the target image.
[0426] Optionally, the second image is generated based on the first pose of the foreground object in the target image and the image style type; the second pose of the foreground object in the second image may be the same as or different from the first pose.
[0427] Optionally, the second posture is obtained by adjusting the posture of a specified part in the first posture when the first posture meets the preset posture adjustment conditions; the specified part in the second posture does not meet the posture adjustment conditions.
[0428] Optionally, the designated part is the hand; the posture adjustment conditions include at least one of the following:
[0429] The hand in the first posture is in a raised hand posture;
[0430] The hand is visible in the first posture;
[0431] The distance between the hand and the face in the first posture is within a preset distance range.
[0432] Optionally, if a first support object exists below the hand in the first pose, the process further includes replacing the first support object in the target image with a second support object.
[0433] Optionally, the first pose is used to determine a transformation template that matches the image style type; the AI image generation process is to perform AI image generation processing on the target image using the transformation template.
[0434] Optionally, if the target image contains an occluder that obstructs the foreground object, the process further includes removing the occluder from the target image.
[0435] Optionally, the process further includes a quality control process, which is performed after the AI image generation process.
[0436] Optionally, the quality control process includes at least one of the following: posture anomaly processing, contour anomaly processing, color anomaly processing, and lighting anomaly processing.
[0437] Optionally, the image acquisition unit includes:
[0438] An instruction sending unit is configured to send an image generation instruction to a server, the image generation instruction including the target image;
[0439] An image receiving unit is used to receive the at least one second image sent by the server.
[0440] Optionally, the image generation instruction further includes: description information of the foreground object of the target image, the description information being used to determine the image style type corresponding to the at least one second image to be generated.
[0441] Optionally, the image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
[0442] Optionally, the image acquisition unit includes:
[0443] A style type determination unit is configured to determine at least one image style type corresponding to the target image in response to the second operation;
[0444] A style conversion unit is used to perform the processing on the target image based on the image style type to obtain at least one second image that matches the image style type.
[0445] In one possible implementation of the first aspect, the image acquisition unit includes:
[0446] A multi-image display unit is used to display multiple second images; the multiple second images include at least two second images with different image style types;
[0447] A wallpaper adding unit is used to add some or all of the plurality of second images to the wallpaper library in response to a third operation.
[0448] Optionally, the method is performed by a first application in the terminal device.
[0449] Figure 31 is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. As shown in Figure 31, the terminal device 31 of this embodiment includes: at least one processor 310 (only one processor is shown in Figure 31, and the number of processors may match the actual number of chips included in the terminal device in the embodiment), a memory 311, and a program 312 stored in the memory 311 and executable on the at least one processor 310. When the processor 310 executes the program 312, it implements the steps in any of the above-described image processing method embodiments.
[0450] The terminal device 31 may be a smartphone, tablet computer, laptop computer, desktop computer, etc. This terminal device may include, but is not limited to, a processor 310 and a memory 311. Those skilled in the art will understand that Figure 31 is merely an example of the terminal device 31 and does not constitute a limitation on the terminal device 31. It may include more or fewer components than shown, or combine certain components, or different components; for example, it may also include input / output terminal devices, network access terminal devices, etc.
[0451] The processor 310 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0452] In some embodiments, the memory 311 may be an internal storage unit of the terminal device 31, such as a hard disk or memory of the terminal device 31. In other embodiments, the memory 311 may be an external storage terminal device of the terminal device 31, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 31. Furthermore, the memory 311 may include both internal storage units and external storage terminal devices of the terminal device 31. The memory 311 is used to store the operating system, applications, bootloader, data, and other programs, such as program code. The memory 311 can also be used to temporarily store data that has been output or will be output.
[0453] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0454] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0455] This application also provides a terminal device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.
[0456] This application also provides a readable storage medium storing a program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0457] This application provides a program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0458] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0459] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0460] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 this application, and should all be included within the protection scope of this application.
Claims
1. A method of image processing, characterized by, Applied to a terminal device, the method includes: In response to a first operation, at least one first image is determined from the image library; the first image is an image that satisfies a first constraint; the first operation is to trigger the display of a list of images that satisfy the first constraint on the image selection interface; the first constraint is used to filter candidate images for AI image generation processing. Thumbnails of the at least one first image are displayed in the image selection interface; In response to a second operation, at least one second image is obtained based on a target image in the at least one first image, the second image being obtained by processing the target image, the processing including AI image generation processing, the target image being the first image selected by the second operation.
2. The method of claim 1, wherein, The response to the first operation, determining at least one first image from the image library, includes: Based on the first constraint, at least one first image is selected from the image library; If the foreground object in any of the selected first images does not meet the preset second constraint, then the first image is recomposed so that the foreground object in the recomposed first image meets the second constraint.
3. The method of claim 1, wherein, If the foreground object in the target image does not meet the preset second constraint condition, the process further includes recomposing the target image so that the foreground object in the recomposed target image meets the second constraint condition.
4. The method of claim 1, wherein, If the foreground object in the target image does not satisfy a preset second constraint, before obtaining at least one second image based on the target image in the at least one first image in response to the second operation, the method further includes: In response to the selection operation of the target image, the target image is re-composed so that the foreground object in the re-composed target image satisfies the second constraint condition; The second operation is an operation performed based on the target image after the secondary composition.
5. The method according to any one of claims 2-4, characterized in that, The secondary composition includes at least one of the following: scaling operation, cropping operation, rotation operation, and content expansion operation.
6. The method according to any one of claims 2-4, characterized in that, The second constraint includes at least one of the following: The area proportion of the foreground object is within a preset ratio range; The area proportion of the key parts of the foreground object is within a preset ratio range; The foreground object is on the axis of the first image; The key part of the foreground object is on the axis of the first image; The specified portion of the foreground object is not visible in the first image.
7. The method according to any one of claims 1 to 6, characterized in that, The first constraint includes at least one of the following: The number of foreground objects contained in the first image is within a preset range; The foreground object's pose is within a preset pose range, and the object pose includes the foreground object's facial pose and / or body pose. The image quality index of the first image is within a preset index range, and the image quality index includes at least one of the following: image resolution, image brightness value, sharpness of the foreground object, and sharpness of key parts of the foreground object.
8. The method according to any one of claims 1 to 7, characterized in that, Displaying thumbnails of at least one first image in the image selection interface includes: The image selection interface displays thumbnails of multiple images; the multiple images include at least one first image; the first image includes a marker; the marker is used to indicate that the first image is a candidate image for AI image generation processing.
9. The method according to any one of claims 1 to 8, characterized in that, The image style type of the second image is determined based on the foreground objects in the target image.
10. The method of claim 9, wherein, The image style type is determined based on the descriptive information of the foreground objects in the target image.
11. The method according to claim 9 or 10, characterized in that, The image style type is determined based on the foreground object of the target image and the scene information corresponding to the user of the terminal device when the second operation is initiated.
12. The method of claim 10, wherein, The descriptive information is obtained by performing object recognition on the target image; or The description information is obtained after the user adjusts the recognition result of the target image; the recognition result is generated by object recognition of the target image.
13. The method according to any one of claims 9-12, characterized in that, The second image is generated based on the first pose of the foreground object in the target image and the image style type; the second pose of the foreground object in the second image may be the same as or different from the first pose.
14. The method of claim 13, wherein, The second posture is obtained by adjusting the posture of a specified part in the first posture, provided that the first posture meets the preset posture adjustment conditions; the specified part in the second posture does not meet the posture adjustment conditions.
15. The method of claim 14, wherein, The designated body part is the hand; the posture adjustment conditions include at least one of the following: The hand in the first posture is in a raised hand posture; The hand is visible in the first posture; The distance between the hand and the face in the first posture is within a preset distance range.
16. The method of claim 13, wherein, If a first support object exists below the hand in the first pose, the process further includes replacing the first support object in the target image with a second support object.
17. The method of claim 13, wherein, The first pose is used to determine a transformation template that matches the image style type; the AI image generation process is to perform AI image generation processing on the target image using the transformation template.
18. The method according to any one of claims 1 to 17, characterized in that, If the target image contains an occluder that obstructs the foreground object, the process further includes removing the occluder from the target image.
19. The method according to any one of claims 1 to 18, characterized in that, The process also includes a quality control process, which is performed after the AI image generation process.
20. The method of claim 19, wherein, The quality control process includes at least one of the following: posture anomaly processing, contour anomaly processing, color anomaly processing, and lighting and shadow anomaly processing.
21. The method of any one of claims 1-20, wherein, The response to the second operation, obtaining at least one second image based on the target image in the at least one first image, includes: Send an image generation instruction to the server, the image generation instruction including the target image; Receive the at least one second image sent by the server.
22. The method of claim 21, wherein, The image generation instruction further includes: description information of the foreground object of the target image, the description information being used to determine the image style type corresponding to the at least one second image to be generated.
23. The method of claim 21 or 22, wherein, The image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.
24. The method of any one of claims 1-20, wherein, The response to the second operation, obtaining at least one second image based on the target image in the at least one first image, includes: In response to the second operation, at least one image style type corresponding to the target image is determined; The target image is processed based on the image style type to obtain at least one second image that matches the image style type.
25. The method of any one of claims 1-24, wherein, The response to the second operation, obtaining at least one second image based on the target image in the at least one first image, includes: Display multiple second images; the multiple second images include at least two second images of different image style types; In response to the third operation, some or all of the plurality of second images are added to the wallpaper library.
26. The method of any one of claims 1-25, wherein, The method is executed by a first application in the terminal device.
27. A terminal device, comprising: The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 26.
28. A computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 26.
29. A system for image processing, characterized by The system includes terminal devices and servers; The terminal device is used for: In response to a first operation, at least one first image is determined from the image library; the first image is an image that satisfies a first constraint; the first operation is to trigger the display of a list of images that satisfy the first constraint on the image selection interface; the first constraint is used to filter candidate images for AI image generation processing. Thumbnails of the at least one first image are displayed in the image selection interface; In response to the second operation, an image generation instruction is sent to the server, the image generation instruction including a target image; the target image is the first image selected by the second operation; The server is used for: The target image is processed to obtain at least one second image, the processing including AI image generation processing; Send the at least one second image to the terminal device; The terminal device is also used to receive the at least one second image sent by the server.
30. The system of claim 29, wherein, The image generation instruction further includes: description information of the foreground object of the target image, the description information being used to determine the image style type corresponding to the at least one second image to be generated.
31. The system of claim 29 or 30, wherein, The image generation instruction further includes: scene information corresponding to the user of the terminal device, the scene information being used to determine the generation of the at least one second image.