An image processing method, apparatus, device and storage medium

CN116188290BActive Publication Date: 2026-09-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211584120.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-09-25
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

然而,用户并不能很好对变形区域进行还原操作,变形区域的恢复效果不好;通过现有图像处理算法进行图像美化,也存在处理效果不自然的问题

Benefits of technology

[0019]本公开实施例的技术方案,通过提供的图像处理方法,首先响应所获取目标图像的变形触发操作,然后从目标图像中确定目标变形区域;之后在确定该图像变形区域中包含变形保护区域的情况下,可以根据变形保护区域的位置信息,确定该变形保护区域中图像内容对应的变形移动信息,最终可以按照该变形移动信息对该变形保护区域中图像内容进行变形移动。上述技术方案,区别于现有只对待变形图像区域中非保护区域的内容进行美化变形移动,本技术方案可以在选定的图像变形区域中包含变形保护区域时,同样考虑对变形保护区域中图像内容按照确定的变形移动信息进行变形移动。本技术方案的上述实现,能够更好的弱化待变形图像区域中非保护区域与保护区域内图像内容的变形界限,更好的达到了非保护区域与保护区域内图像内容变形程度的自然过渡,增加了待变形图像区域中图像内容美化变形的真实感,实现了图像内容的有效美化变形,提升了图像美化变形应用的用户体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188290B_ABST
    Figure CN116188290B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide an image processing method, device and equipment and storage medium. The method comprises: in response to a deformation trigger operation on a target image, determining an image deformation region from the target image; in the case that the image deformation region contains a deformation protection region, determining deformation movement information corresponding to image content in the deformation protection region according to position information of the deformation protection region; and moving the image content in the deformation protection region according to the deformation movement information. With this method, the deformation boundary between the non-protection region and the image content in the protection region in the image region to be deformed can be better weakened, the natural transition of the deformation degree of the image content in the non-protection region and the protection region is better achieved, the sense of reality of the beautification deformation of the image content in the image region to be deformed is increased, the effective beautification deformation of the image content is achieved, and the user experience of the image beautification deformation application is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, device, and storage medium. Background Technology

[0002] Currently, image enhancement is very popular. People can use image enhancement software to adjust and correct selected images, such as slimming down or beautifying the face of people in the image, or even beautifying their height.

[0003] In image enhancement applications, when enhancing the appearance of a person in an image, the display form of the object to be enhanced is adjusted. While adjusting the display form of the object to be enhanced, the shape of the background area in the image is also affected. The background area after the shape change often has the problem of image distortion or deformation, which affects the presentation effect of the image.

[0004] Existing solutions to the above problems include users manually restoring overly beautified areas, or image processing algorithms directly avoiding pre-selected non-beautified areas during image beautification. However, users cannot effectively restore deformed areas, resulting in poor restoration effects; and image beautification using existing image processing algorithms also suffers from unnatural processing results. Summary of the Invention

[0005] This disclosure provides an image processing method, apparatus, device, and storage medium to effectively enhance the content of an image to be beautified.

[0006] In a first aspect, embodiments of this disclosure provide an image processing method, which includes:

[0007] In response to a deformation trigger operation on the target image, the image deformation region is determined from the target image;

[0008] If it is determined that the image deformation area contains a deformation protection area, the deformation movement information corresponding to the image content in the deformation protection area is determined based on the location information of the deformation protection area;

[0009] The image content in the deformation protection area is deformed and moved according to the deformation and movement information.

[0010] Secondly, embodiments of this disclosure also provide an image processing apparatus, the image processing apparatus comprising:

[0011] A region determination module is used to determine the image deformation region from the target image in response to a deformation trigger operation on the target image;

[0012] The information determination module is used to determine, based on the location information of the deformation protection area, the deformation movement information corresponding to the image content in the deformation protection area when it is determined that the image deformation area contains a deformation protection area;

[0013] The protected area deformation module is used to deform and move the image content in the deformable protected area according to the deformation and movement information.

[0014] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0015] One or more processors;

[0016] Storage device for storing one or more programs.

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any embodiment of the present invention.

[0018] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the image processing method as described in any embodiment of the present invention.

[0019] The technical solution of this disclosure, through the provided image processing method, first responds to the deformation trigger operation of the acquired target image, and then determines the target deformation region from the target image. Subsequently, if it is determined that the image deformation region contains a deformation protection region, deformation movement information corresponding to the image content within the deformation protection region can be determined based on the location information of the deformation protection region. Finally, the image content within the deformation protection region can be deformed and moved according to the deformation movement information. This technical solution differs from existing methods that only perform beautification deformation and movement on the content in the non-protected areas of the image to be deformed. This technical solution can also consider deforming and moving the image content in the deformation protection region according to the determined deformation movement information when the selected image deformation region contains a deformation protection region. The above implementation of this technical solution can better weaken the deformation boundary between the image content in the non-protected and protected areas of the image to be deformed, better achieve a natural transition in the degree of deformation between the non-protected and protected areas, increase the realism of the beautification deformation of the image content in the image to be deformed, realize effective beautification deformation of the image content, and improve the user experience of image beautification deformation applications. Attached Figure Description

[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0021] Figure 1 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure;

[0022] Figure 1a An example diagram of the gridded data recording image in the image processing method provided in this embodiment is given;

[0023] Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure;

[0024] Figure 2a An image showing the effect of deforming the image region using the image processing method provided in this embodiment is provided.

[0025] Figure 3 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of the present disclosure;

[0026] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0027] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0028] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0029] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0031] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0032] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0033] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0034] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0036] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0037] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0038] It should be noted that the application scenario of this embodiment can be described as follows: A user of the image enhancement function wants to adjust the display shape of a certain area of ​​a selected image, such as slimming a face or slimming the body of a person in the image. When performing image enhancement using existing image processing methods, if a target area not to be enhanced is not selected in advance, other background objects in the image will also be deformed while the object to be enhanced is being enhanced, resulting in distortion of the background area. If a target area not to be enhanced can be selected in advance, the image content within the target area will not be affected by the deformation when the object to be enhanced is being enhanced. After processing, the pixels in the image will only have two states: deformed or skipped. The processing effect is unnatural, and it is easy to see obvious stretching of the image content at the edge of the target area.

[0039] The image processing method provided in this embodiment can effectively improve the problem of unnatural edge transition between the target protection area and the deformation area, and achieve natural beautification of image content.

[0040] Figure 1 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure. The embodiments of the present disclosure are applicable to the situation of deforming image content in an image. The method can be executed by an image processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.

[0041] like Figure 1 As shown, the method in this embodiment may specifically include:

[0042] S101. In response to a deformation triggering operation on the target image, determine the image deformation region from the target image.

[0043] In this embodiment, the target image can be understood as an image to be beautified in advance by the participants. The target image may be an image of a person. The deformation trigger operation can be understood as a function trigger operation that initiates the beautification processing of the image content in the target image. The generation process of the deformation trigger operation can be described as follows: First, the image editing interface for image beautification can be accessed by triggering the image beautification function icon. Then, the target image selected by the participants can be received. Finally, the deformation trigger operation can be generated after the participants select the image area to be beautified and deformed in the target image.

[0044] For example, from a visual interaction perspective, after triggering the image enhancement function on the desktop, an image editing interface can be entered and presented. After triggering the image selection control, the selected target image can be displayed in an area of ​​the image editing interface. Subsequently, after triggering the set control (such as a deformation operation trigger control), continuous detection can be performed to check if a deformation trigger operation has been received. This deformation trigger operation can be generated after a participant selects an area of ​​the target image to be beautified. This step can respond to the received deformation trigger operation and proceed to determine the image deformation area from the target image.

[0045] In this embodiment, the selected image region to be beautified and deformed in the target image can be denoted as the image deformation region. This region can be selected by a participant through touch and sliding, or by dragging with a mouse. For example, when the target image is a person image, the image region containing the person's face can be selected as the image deformation region as described above. This embodiment can respond to the deformation trigger operation after it is generated, and can also determine the image deformation region from the target image after responding to the deformation trigger operation.

[0046] For example, the process of determining the image deformation region can be described as follows: First, relevant meshed image data can be extracted from the deformation trigger operation, such as the coordinate information of the trajectory points formed when the touch slides, the coordinate information of the rectangular area of ​​the drag rectangle formed when the mouse drags, etc.; then, a closed region can be determined in the target image based on the meshed image data as the image deformation region, and the corresponding region information can be used to record the image deformation region.

[0047] It is known that the target image and its deformed regions can be recorded using conventional pixel-based units; alternatively, a grid-based method can be used. This embodiment preferably employs a grid-based method for recording image data. Specifically, initially, a target image can be obtained for pixel-based image data recording. Then, a grid conversion can be performed, specifically determining the grid unit size. Each grid can be considered to consist of two triangular facets, and a grid can be represented by its four vertices. Compared to the traditional pixel-based recording method, using a grid for image data recording saves storage space and facilitates subsequent data processing.

[0048] S102. If it is determined that the image deformation area includes a deformation protection area, the deformation movement information corresponding to the image content in the deformation protection area is determined according to the location information of the deformation protection area.

[0049] In this embodiment, the image deformation region determined in the above steps is mainly used to achieve beautification deformation processing of the image content in the region. The key is that before performing deformation processing on the image deformation region, it is necessary to first determine whether the image deformation region contains a deformation protection region. If it contains the deformation protection region, the image content in the deformation protection region can be deformed through this step.

[0050] In this embodiment, the deformation protection region can be understood as the area requiring deformation protection during image enhancement deformation processing. The determination that the image deformation region contains a deformation protection region can be described as follows: First, determine whether a target protection region has been pre-defined in the target image. If a target protection region has been defined, then determine whether the image deformation region falls into a sub-region of that target protection region. If so, it can be determined that a deformation protection region exists within the image deformation region. For example, when the target image is a portrait image, the background area within the selected image deformation region can be considered the deformation protection region.

[0051] After determining that the image deformation area includes a deformation protection area, this step is equivalent to obtaining the gridded image data related to the deformation protection area. The location information of the deformation protection area can be obtained through the gridded image data of the deformation protection area, and then the deformation and movement information of the image content in the deformation protection area can be determined through the location information.

[0052] In one specific implementation, the location information of the deformation protection area can be used to determine the location information of each grid area contained in the deformation protection area. The location information of each grid area can be used to determine the distance from the edge of the deformation protection area to the corresponding grid area. Then, based on the determined distance, the deformation and movement information that the relevant image content in the grid area should have can be determined.

[0053] In this embodiment, the deformation and movement information of image content can be understood as the deformation and movement amplitude or deformation and movement distance of the pixels constituting the image content during deformation. Different regions of image content may have different deformation and movement information, or some regions may have image content deformation and movement information that remains unchanged or represents a set value indicating no movement; that is, the image content in these regions may not undergo deformation and movement.

[0054] This embodiment can distinguish the degree of deformation and movement of image content in the deformation protection area through the above method, thereby achieving a gradual change in the degree of deformation of image content in the non-deformation protection area and the deformation protection area, and thus making the deformation of image content in the image deformation area more natural.

[0055] S103. Perform deformation and movement on the image content in the deformation protection area according to the deformation and movement information.

[0056] In this embodiment, after determining the deformation and movement information of the image content in the deformation protection area through the above steps, this step can be used to control the image content in the deformation protection area to deform and move according to the relative deformation and movement information. Deformation and movement can be understood as the position of a certain pixel information in the image content being moved. For example, the position of the pixel information originally presented by the image content in a grid area of ​​the deformation and movement area is adjusted according to the deformation and movement amplitude given in the deformation and movement information.

[0057] In this embodiment, the position of pixel information of certain image content after deformation and movement in the deformation protection area changes compared to before deformation and movement, which is equivalent to stretching or shortening the image content presentation effect in terms of visual effect.

[0058] The technical solution described in this disclosure differs from existing methods that only beautify and deform the content in the non-protected area of ​​the image to be deformed. This technical solution, when the selected image deformation area includes a deformation protection area, also considers deforming and moving the image content in the deformation protection area according to determined deformation and movement information. This implementation of the technical solution can better weaken the deformation boundary between the image content in the non-protected and protected areas of the image to be deformed, achieving a more natural transition in the degree of deformation between the non-protected and protected areas. This increases the realism of the beautification and deformation of the image content in the image to be deformed, achieving effective beautification and deformation of the image content and improving the user experience of image beautification and deformation applications.

[0059] As a first optional embodiment of this disclosure, based on the above embodiments, this first optional embodiment may further include the following steps:

[0060] For the non-deformation protected area in the image deformation region, the image content in the non-deformation protected area is deformed and moved according to the deformation movement value determined by the deformation trigger operation;

[0061] The non-deformation protection area refers to the area outside the deformation protection area in the image deformation area.

[0062] In this optional embodiment, a deformation processing logic for image content within the non-deformation protection area of ​​the image deformation region is further provided. Specifically, the image area in the image deformation region that does not fall into the pre-defined target protection area can be recorded as the non-deformation protection area, or the entire image deformation region can be recorded as the non-deformation protection area when it is determined that the target image does not have a pre-defined target protection area.

[0063] This embodiment can achieve deformation and movement of image content within the non-deformation protection area of ​​the image protection region through the added logical steps described above. In one specific implementation, the deformation movement value contained in the deformation trigger operation can be obtained. This deformation movement value can be determined based on the sliding amplitude of the trigger slide when generating the deformation trigger operation, or based on the dragging amplitude of the mouse drag operation when generating the deformation trigger operation.

[0064] Following the above description, in this embodiment, all image content in the non-distortion protected area can be deformed and shifted using the determined deformation shift value. Similarly, the visual effect of the deformation shift of image content in the non-distortion protected area can be described as the change in the presentation position of pixel information included in the image content due to the adjustment of the deformation shift value.

[0065] It should be noted that, in this embodiment, the gridded image data of the target image is preferably recorded in the form of grid regions. In this embodiment, the determination of the deformation protection area and the non-deformation protection area can both be supported by the gridded image data in the form of grid regions. Correspondingly, the image deformation area, deformation protection area and non-deformation protection area can also be recorded in the form of grid data.

[0066] The technical solution of the first optional embodiment described above further realizes the deformation and movement of image content contained in the non-deformation protection area within the image deformation region. This technical solution divides the image deformation region into deformation protection areas and non-deformation protection areas, determines different deformation and movement information for image content at different locations within the deformation protection area, and achieves differentiated deformation and movement of image content within the deformation protection area, reflecting the transitional deformation of edge areas within the deformation protection area; on the other hand, it ensures normal deformation of image content within the non-deformation protection area. Through this technical solution, the realism of the beautification deformation of image content in the image region to be deformed is greatly enhanced, achieving effective beautification deformation of image content and improving the user experience of image beautification deformation applications.

[0067] As a second optional embodiment of this disclosure, based on the above embodiments, the following steps can be further optimized:

[0068] In response to the acquisition operation of the protected region of the target image, a target protected region is determined from the target image, the target protected region being used to determine the deformation protected region.

[0069] It is understood that a key condition in the above implementation of determining the deformation protection region in the image deformation region is that the target image participating in image processing has a pre-defined target protection region. In this second optional embodiment, the implementation logic for the target protection region is optimized and added. Specifically, the timing for determining the target protection region can be after receiving a protection region acquisition operation. Through the steps of this second optional embodiment, the acquisition operation can be responded to, and then the target protection region can be determined from the target image.

[0070] The operation of acquiring the protected area can be understood as a triggering operation that selects the image area that needs to be protected from deformation from the target image.

[0071] In one implementation of the operation to acquire the protected area, a protected area selection button (or protected area selection control) can be presented in the image editing interface that displays the target image. After the participant clicks the protected area selection button, the operation to acquire the protected area can be triggered.

[0072] Another implementation of the operation to acquire the protected area can be that a participant makes a specific touch gesture in the image editing interface that displays the target image, and the acquisition operation to generate the protected area is triggered by the specific touch gesture.

[0073] After generating the protected area using the above implementation, a pre-defined intelligent recognition algorithm can be used to intelligently determine the image region in the target image and directly use the identified image region as the target protected area. For example, when the target image is a person image, only the person in the image can be identified, and all other image regions besides the person can be identified as the target protected area. Alternatively, a fixed geometric shape can be used to delineate the target protected area.

[0074] In addition, after generating the protected area acquisition operation through the above implementation, an operation listening thread can also be started to listen for whether there is a touch swipe behavior to select the target protected area, or to listen for whether there is a mouse drag behavior to select the target protected area. Then, by recognizing the image area associated with the touch swipe behavior or mouse drag behavior, the screen area corresponding to the above behavior in the target image can be determined, and the determined screen area can be used as the target protected area.

[0075] As described above, after responding to the triggered operation of acquiring the protected area, relevant image data information can be extracted from the target protected area determined by intelligent identification or the target protected area determined by listening to the selected behavior, thereby obtaining the gridded data of the recorded target protected area.

[0076] The technical solution of the second optional embodiment described above provides a logical implementation for determining the target protection area. The determined target protection area can be used as prerequisite information for image enhancement and deformation processing, and is used to determine the deformation protection area in the image deformation area. This technical solution provides basic data support for the logical execution of image processing provided in this embodiment, and is also a key feature that distinguishes image enhancement and deformation from existing technologies.

[0077] Based on the above-described second optional embodiment, as one implementation of this second optional embodiment, the determination of the target protected area from the target image can be optimized to the following steps:

[0078] a0) Determine the area location information associated with the acquisition operation of the protected area.

[0079] In this embodiment, after receiving the operation to acquire the protected area, one implementation description is: by listening to the selected behavior (touch swiping behavior or mouse dragging behavior) performed by the participant, the operation-related information contained in the listened selected behavior can be extracted. The operation-related information can include touch trajectory information or mouse drag trajectory information.

[0080] Another implementation description could be to perform intelligent identification of the protected area based on a given intelligent identification strategy, and extract the area information of the identified protected area, or to delineate the protected area with a set geometric shape and extract the area information of the delineated protected area.

[0081] The operation-related information or regional information obtained through the above implementation logic can be used as the regional location information for this step.

[0082] For example, if the selected behavior being monitored includes touch trajectory information or drag trajectory information, the image region associated with the touch or drag can be determined based on the aforementioned information, and the region location information of that image region can be obtained. If the region information of the region identified after intelligent recognition is obtained, or the region information of a region with a set geometric shape is obtained, the obtained region information can be directly used as the region location information. In this embodiment, the region location information can be recorded using the edge coordinates that constitute the selected image region.

[0083] b0) Based on the location information of the area and the gridded data of the target image, determine the grid data of the protected area.

[0084] In this embodiment, the image information of the target image can be recorded in a gridded data format. It should be noted that the conventional way to record an image is to record the pixel information of each pixel, which requires a large amount of storage space. This embodiment preferably uses a gridded recording format, that is, dividing an image into a grid and recording only the vertex coordinates of each grid, instead of recording all pixels. A grid can be a combination of two triangle textures. To ensure the effectiveness of the image data information, the grid areas set for each image are very dense, and each grid area may only contain a certain number of pixels.

[0085] For each grid region, two sets of coordinate data can be used to record image information. One set of coordinate data mainly consists of the vertex position coordinates that make up the grid region, while the other set of coordinate data mainly records the color information of the grid region. This coordinate data does not directly record the color information, but rather records the position coordinates of the color information in the original image. Thus, the color information at that coordinate position can be extracted from the original image using this coordinate data.

[0086] After obtaining the location information of the region, the data information of the grid region that matches the location information can be found from the gridded data of the target image, thereby obtaining the gridded data of the protected area. In this embodiment, this gridded data is recorded as the protected area grid data. As described above, the protected area grid data determined in this step actually includes the relevant grid data of all grid regions constituting the protected area. Specifically, it can include the horizontal and vertical coordinates of the vertices of each grid region in the protected area, as well as the horizontal and vertical coordinates of the vertices that record the color information of each grid region.

[0087] Figure 1a An example image of the gridded data recording image provided in this embodiment is given. Figure 1a As shown, the grid effect after gridding the target image 11 is displayed. The target image 11 can contain many small grid regions 12. For this target image 11, image data can be recorded in a gridded form based on the region information of each grid region. It should be noted that... Figure 1a For ease of demonstration, the grid area presented is relatively large. In practical applications, the grid area of ​​an image is divided very densely, and the size of each grid area is relatively small after gridding.

[0088] The steps for determining the grid region of the target image can be described as follows: divide the target image into triangular patches, then combine adjacent triangular patches to form a grid region, and finally obtain many grid regions composed of adjacent triangular patches.

[0089] It should be noted that the above Figure 1a The image shown is only an illustration of the effect of a single grid area. At the level of visual interaction in image enhancement processing, participants cannot intuitively see the target image for which the grid area has been divided.

[0090] c0) Obtain the target protected area from the target image, which is recorded with the protected area grid data.

[0091] In this optional embodiment, the protected area grid data obtained through the above steps can determine the regional location and regional color information of the protected area. This embodiment uses the protected area grid data to represent the target protected area.

[0092] In this second optional embodiment, the determination of the target protection area is implemented by recording the target image in the form of gridded data. When determining the target protection area using gridded data, the storage space occupied by image data recording is effectively reduced while ensuring the accuracy of the protection area determination.

[0093] Based on the above embodiments, the condition that the image deformation region includes a deformation protection region is preferably: a target protection region is predetermined relative to the target image, and the image deformation region includes a deformation protection region belonging to the target protection region.

[0094] In this embodiment, the core idea of ​​the beautification and deformation process for the target image can be described as follows: After determining the image deformation area to be beautified and deformed, it is necessary to first determine whether the image deformation area contains an area that needs to be deformed and protected. If not, the image content in the image deformation area can be moved and deformed according to the determined deformation movement value. If it does contain, the location of the deformation-protected area needs to be analyzed, and then the movement force for deformation movement can be determined according to the analysis results. The beautification and deformation implemented through the above processing logic can effectively avoid the problem of unnatural beautification and deformation effects in existing methods.

[0095] It should be noted that, in this optional embodiment, the condition for determining whether an image deformation region contains a deformation protection region can be that the target image undergoing beautification deformation processing contains a target protection region to be deformed, and that image content falling into the target protection region exists within the selected image deformation region. This embodiment can construct the deformation protection region within the image deformation region based on the area where the image content is located.

[0096] Based on the second optional embodiment described above in this disclosure, a method for forming the acquisition operation of the protected area and the deformation triggering operation in the method provided in this embodiment is further provided, which may include the following steps:

[0097] a1) Presents an image editing interface, wherein the target image is displayed in the first area of ​​the image editing interface.

[0098] For example, responding to the triggering of the image enhancement application icon on the desktop can enter the image editing interface of the image enhancement application software.

[0099] The menu bar or control display area of ​​the image editing interface can display a selection control for the image to be beautified. In response to the triggering of the image beautification selection control, the image to be beautified selected by the participants can be obtained. In this embodiment, it is referred to as the target image. In this embodiment, the target image can be displayed in the first area of ​​the image editing interface.

[0100] The first area can be the image editing area in the image editing interface.

[0101] b1) In the second area of ​​the image editing interface, a protection area selection control is displayed. After the protection area selection control is triggered, the acquisition operation of the protection area that determines the target protection area in the target image is generated.

[0102] As can be seen, the image editing interface also displays a protected area selection control. This protected area selection control is specifically displayed in the second area of ​​the image editing interface and can be used to guide participants in selecting a protected area. Following the above description, after selecting the target image, participants can trigger the protected area selection control displayed in the second area. In this embodiment, the protected area acquisition operation can be generated in response to this triggering operation.

[0103] Based on the description of the technical implementation in this embodiment, the acquisition operation of the protected area can be responded to based on the corresponding method steps, thereby determining the target protected area in the target image.

[0104] c1) In the third area of ​​the image editing interface, a deformation operation trigger control is displayed. After the deformation operation trigger control is triggered, a deformation trigger operation is received on the target image in the first area.

[0105] In this embodiment, a deformation operation trigger control can also be displayed in the image editing interface. Specifically, the deformation operation trigger control can be displayed in the third area of ​​the image editing interface and can be used to guide participants to select the deformation area.

[0106] For example, the triggering of the deformation operation trigger control by the participant can be performed after the target protection area is determined through the acquisition operation of the generated protection area. After triggering the deformation operation trigger control, the execution subject of the method provided in this embodiment can be considered to have entered the deformation area selection listening mode. Specifically, it can listen for whether it receives a deformation trigger operation generated after the participant selects the relevant deformation area on the target image. After receiving the deformation trigger operation, the image deformation area can be determined from the target image through the method steps provided above in this embodiment.

[0107] It should be noted that the description of steps a1 to c1 in this embodiment is equivalent to explaining the implementation of image deformation processing from a visual perspective. Displaying the protection area selection control and the deformation operation trigger control in the image editing interface can better guide the participants to perform image beautification and deformation operations. When the participants use the image beautification and deformation function, they are also given the operation prompt to first select the protection area and then select the deformation area. Thus, while ensuring the image beautification and deformation effect, the user experience of the image deformation and beautification function is also better improved.

[0108] As a third optional embodiment of this disclosure, based on the above optimizations... Figure 2 A flowchart illustrating an image processing method provided in an embodiment of this disclosure is given, as follows: Figure 2 As shown, the image processing method provided in this embodiment may include the following steps:

[0109] S201, In response to a deformation trigger operation on the target image.

[0110] For example, this step can be used to respond to a received deformation trigger operation, which can be performed after selecting a target image or after selecting a target protected area from the target image. The target protected area can be determined after responding to a protected area acquisition operation, which can be generated by relevant participants performing relevant operations in the image editing interface of the selected target image. The operation performed can be triggering a protected area selection button or triggering based on a specific touch gesture.

[0111] In this embodiment, the following S202 to S204 provide a specific implementation for determining the image deformation region.

[0112] S202. Determine the location information of the deformation region associated with the deformation triggering operation.

[0113] In this embodiment, the operation-related information contained in the response deformation trigger operation can be extracted. The operation-related information may include touch trajectory information when the participant selects the deformation area by touch, or drag trajectory information when the participant selects the deformation area by mouse dragging.

[0114] For example, this step can extract touch trajectory information or drag trajectory information from the deformation trigger operation, thereby forming a corresponding trajectory line. Then, the radiation area of ​​the trajectory line in the target image can be determined, and the regional position information of the radiation area can be determined. The radiation area can be regarded as the image deformation area selected by the participant, and the corresponding regional position information can be used as the deformation area position information in this embodiment.

[0115] In this embodiment, the size of the area radiated by the trajectory line can be determined by the width and length of the trajectory line. A wider and longer trajectory line corresponds to a relatively larger radiated area, while a thinner and shorter trajectory line corresponds to a relatively smaller radiated area. The width and length of the trajectory line can be determined based on the contact area when the participant performs a touch operation on the target image, or based on the thickness of the cursor point when dragging the mouse in the target image.

[0116] It is understood that this embodiment can record the edge coordinate data that constitutes the image deformation region. When recording the target image with gridded data, the edge coordinate data can be the vertex coordinate information of the grid region located at the edge.

[0117] S203. Based on the location information of the deformed region and the mesh data of the target image, determine the mesh data of the deformed region.

[0118] In this embodiment, gridded data of the recorded target image can be obtained. After obtaining the location information of the deformed region, the data information of the grid region that matches the location information of the deformed region can be found from the final gridded data, thereby obtaining the grid data of the deformed region recorded with gridded data.

[0119] Based on the above description of the data content contained in the grid region, it can be known that the deformable region grid data determined in this step actually contains the relevant grid data of all grid regions constituting the deformable region. Specifically, it can include the horizontal and vertical coordinates of the vertices of each grid region in the deformable region, as well as the horizontal and vertical coordinates of the vertex samples that record the color information of each grid region.

[0120] S204. Obtain the image deformation region recorded with the deformation region grid data from the target image.

[0121] In this embodiment, by obtaining the deformed region grid data through the above steps, the regional location and regional color information of the deformed region can be determined. In this embodiment, the deformed region in the deformed region grid data table is recorded as the image deformed region.

[0122] The following steps S205 to S209 in this embodiment provide a specific implementation for determining whether a deformation protection region exists in the image deformation region.

[0123] S205. If a target protection area is predetermined relative to the target image, the protection area grid data of the determined target protection area is obtained, and S206 is executed.

[0124] In this embodiment, after identifying the image deformation area, a check can be performed to determine whether the target image contains a target protection area. Specifically, the target protection area can be determined by whether the target image has recorded protection area grid data. When the target image has recorded protection area grid data, it can be assumed that the target image has a pre-determined target protection area, and this step can be used to obtain the recorded protection area grid data.

[0125] It should be noted that if there is no protected area grid data, it can be assumed that the target image does not currently have a target protected area. Therefore, there is no need for the subsequent steps in this embodiment. The deformed area of ​​the image can be directly determined as a non-deformed protected area. Thus, the execution logic provided by this embodiment for the non-deformed protected area can be used to realize the movement and deformation of the image content in the deformed area of ​​the image.

[0126] S206. Based on the deformation region grid data of the image deformation region, the image deformation region is divided into at least one deformation grid region.

[0127] In this embodiment, following the above steps, if a target protection area exists in the target image, the determination of whether the image deformation area contains a deformation protection area that falls into the target protection area can be further determined through the steps from this step to S209.

[0128] Specifically, this step first obtains the deformable region grid data of the identified image deformable areas. Then, it extracts the relevant data constituting each unit grid region from the deformable region grid data, and each unit grid region can be considered a deformable grid region. The number of unit grid data points contained in the deformable region grid data indicates the number of deformable grid regions.

[0129] S207. For each deformed mesh region, determine whether the deformed mesh coordinates of the deformed mesh region fall into the protected area mesh data. If so, execute S208.

[0130] This step is equivalent to processing each deformable mesh region. As described above, each deformable mesh region can be represented by two sets of coordinate data, one of which is the horizontal and vertical coordinates of the vertices of the deformable mesh region. In this embodiment, this set of vertex horizontal and vertical coordinates can be used as the deformable mesh coordinates of the deformable mesh region.

[0131] This step can match the deformed mesh coordinates with the x and y coordinates of each set of vertices contained in the protected area mesh data. If the x and y coordinates of each vertex in the deformed mesh coordinates are all in the protected area mesh data, it can be considered that the deformed mesh coordinates fall into the protected area mesh data. In this case, step S208 can be executed.

[0132] If the deformed mesh coordinates contain vertex x and y coordinates that are not within the protected area mesh data, then the deformed mesh coordinates can be considered to fall within the protected area mesh data. In this case, this embodiment considers the deformed mesh region corresponding to the deformed mesh coordinates to belong to the non-deformation protected region. In this situation, no further steps are needed, and the execution logic provided by this embodiment for the non-deformation protected region can still be used to implement the movement and deformation of image content in the image deformation region.

[0133] S208. The deformed mesh region is recorded as the protection mesh region belonging to the target protection region.

[0134] After satisfying the determination in S207 above, the deformed mesh region can be recorded as a protected mesh region belonging to the target protected region through this step. S207 and S208 above apply to the processing of each deformed mesh region within the image deformed region.

[0135] S209. Combine the protection grid areas to obtain the deformation protection areas, and obtain the protection grid coordinates of each protection grid area.

[0136] This step summarizes each protective grid region determined in the above steps and constructs a deformation protection region within the image deformation region based on each protective grid region. It is understood that after determining each protective grid region, the vertex coordinates of each protective grid region can also be obtained accordingly; in this embodiment, these can be denoted as the protective grid coordinates of that region.

[0137] In this embodiment, deformation and movement information of the image content contained in the deformation protection area can be determined by the following steps S210 and S211.

[0138] S210. For the protection grid area, determine the relative position between the protection grid area and the target protection area according to the corresponding protection grid coordinates.

[0139] In this embodiment, to determine the deformation and movement information of the image content contained in the deformation protection area, each protection grid area can also be treated as a logical processing unit, and the relevant logic can be executed through this step.

[0140] For example, for each protected grid area, the protected grid coordinates of that protected grid area can be obtained; at the same time, after knowing the protected area grid data of the target protected area, the grid area that constitutes the edge area of ​​the target protected area can be found, and then the distance between the protected grid coordinates and the grid area that is the edge area can be calculated, and the relative position of the protected grid area and the target protected area can be recorded by the distance calculation result.

[0141] Specifically, in this embodiment of the disclosure, the determination of the relative position between the protection grid region and the target protection region based on the corresponding protection grid coordinates can be further optimized as follows:

[0142] a2) Determine the edge grid region of the target protection area and obtain the edge grid coordinates of the edge grid region.

[0143] In this embodiment, the grid regions located at the edges of the target protected area can be determined using the protected area grid data. In this embodiment, these are referred to as edge grid regions, and the edge grid coordinates of each edge grid region can be obtained. The edge grid coordinates also include information about the horizontal and vertical coordinates of each vertex of the edge grid region.

[0144] b2) Determine the relative distance between the protective grid region and the edge grid region based on the edge grid coordinates and the protective grid coordinates.

[0145] In this embodiment, a target protection area may contain multiple edge grid areas, and each edge grid area corresponds to an edge grid coordinate. This step calculates the distance between the protection grid coordinate and each edge grid coordinate to determine the relative distance between the protection grid area and each edge grid area.

[0146] c2) Determine whether the relative distance is greater than the set edge threshold. If yes, proceed to step d2); otherwise, proceed to step e2.

[0147] In this embodiment, a set edge threshold is provided as a criterion for judging whether the image content in the deformation protection area participates in deformation movement. This step can compare each relative distance with the set edge threshold, or directly compare the minimum distance value among the relative distances with the set edge threshold to determine whether the relative distance is greater than the set edge threshold.

[0148] Understandably, if the minimum relative distance is still greater than the set edge threshold, the protected grid area can be considered to be relatively close to the center of the target protected area, and step d2 can be executed in this case; conversely, if the minimum relative distance is less than or equal to the set edge threshold, or if there are other relative distances less than or equal to the set edge threshold, the protected grid area can be considered to be relatively close to the edge of the target protected area, and step e2 can be executed in this case.

[0149] d2) The relative position of the protected grid area within the target protected area is defined as the area relative position.

[0150] This step is the subsequent execution logic when the relative distance is greater than the set edge threshold. At this time, the relative position of the region can be that the protection grid region is within the target protection region.

[0151] e2) The relative position of the protected grid area at the edge of the target area is taken as the area relative position.

[0152] This step is the subsequent execution logic for the above relative distance being less than or equal to the set edge threshold. At this time, the relative position of the region can be that the protection grid region is at the edge of the target protection region.

[0153] In this optional embodiment, the execution of the above logical steps is mainly used to determine the relative position of the protected grid area and the target protected area. The determined relative position can serve as the basic data support for determining deformation and movement information.

[0154] S211. Based on the relative position of the regions, determine the deformation and movement information corresponding to the image content in the protected grid region.

[0155] In this embodiment, after obtaining the relative positions of the protected grid area and the target protected area, the matching deformation and movement information can be determined based on the relative positions. In this embodiment, the movement information of the image content within the deformed protected area of ​​the image deformed area is related to the location of each protected grid area contained within the deformed protected area.

[0156] For example, this embodiment considers deforming and moving the protective grid area located at the edge of the target protection area with a small deformation amplitude. The protective grid area located inside the target protection area, that is, at the center of the target protection area, may not participate in the deformation and movement.

[0157] The reason for determining the deformation and movement information in the above manner is that the target protection area delineated in the target image can be regarded as the image area in the target image that the participant does not want to participate in the beautification deformation. During the deformation processing of the determined image deformation area, if there is a deformation protection area in the image deformation area that falls into the target protection area, if all image content in the deformation protection area is controlled not to participate in the deformation and movement, then there will be a clear boundary between the non-deformed area and the deformed area at the edge of the target protection area, which will lead to the problem that the image after beautification deformation processing looks unnatural.

[0158] Through the processing logic of this embodiment, the protective grid area located at the edge of the target protected area can be subjected to deformation processing with gradual deformation intensity. The closer the gradual deformation intensity is to the non-deformable protected area, the greater the deformation amplitude of the image content in the protective grid area. The deformation amplitude of the image content can be determined by looking up a pre-determined protection intensity information table. First, by looking up the protection intensity information table, the protection intensity of the deformable protected area can be obtained. The protection intensity information can be a value between 0 and 1. Based on the protection intensity and the deformation movement value associated with the deformation trigger operation, the deformation amplitude of the deformable protected area can be determined. Finally, the deformation amplitude can be used as the deformation movement information of the image content within the protected grid area.

[0159] Specifically, in this embodiment of the disclosure, determining the deformation and movement information corresponding to the image content in the protected grid area based on the relative position of the area can be further optimized into the following steps:

[0160] a3) When the relative position of the regions is such that the protection grid region is within the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined to remain unchanged.

[0161] It can be understood that in this case, the protected grid area can be considered to be located within the central area of ​​the target protected area. Considering that the image content of the target protected area is an object that does not participate in deformation and movement, this embodiment can set the deformation and movement information of the protected grid area within the central area to a data value that represents the position remaining unchanged, such as 0.

[0162] b3) When the relative position of the regions is such that the protection grid region is at the edge of the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined according to the protection strength value of the protection grid region.

[0163] It can be understood that, in this case, the protected grid area can be considered to be located within the edge area of ​​the target protected area. Although the image content of the target protected area is an object that does not participate in deformation and movement, considering that the image content in the target image needs to achieve a natural and realistic effect of change and movement adjustment, this embodiment can assign a certain deformation amplitude to the protected grid area within the edge area as deformation and movement information of the protected grid area.

[0164] The deformation amplitude can be determined based on the protection strength value corresponding to the protected grid area. The protection strength value can be understood as the protection intensity when deforming the grid area in the target protected area. The protection strength value can be a value between 0 and 1. Assuming that the value of 0 is taken as the minimum protection strength, it can be considered that the grid area closer to the edge of the protected area has a protection strength value closer to 0; conversely, the grid area farther away from the edge of the protected area has a protection strength value closer to 1.

[0165] In this embodiment, the protection strength value of each grid area in the target protection area can be predetermined. For the deformation protection area in the image deformation area, the corresponding protection strength value of each protection grid area in the deformation protection area can be obtained by looking up a table. Then, the deformation movement information of the image content in each protection grid area can be determined by combining the deformation movement value assigned by the participant relative to the image deformation area.

[0166] S212. Perform deformation and movement on the image content in the deformation protection area according to the deformation and movement information.

[0167] In this embodiment, for each protective grid area in the deformation protection area, corresponding deformation movement information can be obtained. This step can use the deformation movement information of each protective grid area to control the image content in that protective grid area to move according to the determined deformation movement information.

[0168] It should be noted that when the target image is represented as gridded data, each grid region records its vertex coordinates using one set of coordinate data and its color information using another set of coordinate data (vertex sampled coordinates). The process of deforming and shifting the image content within the protected grid region according to the deformation and shift information is equivalent to shifting the vertex coordinates of the protected grid region according to the deformation and shift information. After the shift, the original color information of the protected grid region can be obtained through vertex sampled coordinates, and by adjusting the shift of these vertex sampled coordinates, the original color information is associated with the adjusted vertex sampled coordinates. This allows the protected grid region to retain its original color information after the deformation and shift.

[0169] To facilitate a better understanding of the image processing method provided in this embodiment, Figure 2a An image illustrating the effect of deforming the image region using the image processing method provided in this embodiment is given. For example... Figure 2a As shown, it can be regarded as a response to the above. Figure 1a The result of further processing of the target image. Figure 2a The target image 11 also includes a water cup 111 and a background image area (the area other than the water cup). Assuming that the background image area in the target image 11 is determined to be the target protection area, it can be known that the area in the target protection area that is close to the water cup 111 is the edge area of ​​the target protection area.

[0170] Following the above description, after determining the image area within the rectangular frame in the target image 11 as the image deformation area 13, it can be determined that the image deformation area 13 includes a portion of the image content of the water cup 111 and the deformation protection area outside the water cup 111 that falls into the target protection area. For example... Figure 2a As shown, during the image deformation processing of the image deformation area, in addition to the deformation and movement of a part of the image content of the water cup 111, the deformation protection area falling into the target protection area also undergoes deformation of different intensity. It can be seen that the deformation protection area closer to the water cup 111 has a greater deformation amplitude.

[0171] Unlike existing methods that only deform and move the image content of the water cup 111 falling within the image deformation region 13, this technical solution also considers deforming and moving the image content within the deformation protection region according to determined deformation and movement information. This better weakens the boundary between the deformed and undeformed image content of the water cup 111 within the image deformation region 13 and the image content within the deformation protection region, achieving a more natural transition in the degree of image deformation within the image deformation region 13 and increasing the realism of the beautified deformation of the image content within the image deformation region 13.

[0172] The technical solutions described in this disclosure provide a specific implementation of image processing. Firstly, it provides the specific implementation logic for the image deformation region, then the specific implementation logic for the deformation protection region, and finally the specific implementation logic for deformation movement information. Through this embodiment's technical solution, the deformation movement of the image content under deformation protection is associated with the position information of the grid region where the image content is located, causing the grid region at the edge of the protection region to also undergo small-amplitude deformation movement. This better weakens the deformation boundary between the unprotected and protected areas of the image content in the image to be deformed, achieving a more natural transition in the degree of deformation between the unprotected and protected areas. This increases the realism of the beautification deformation of the image content in the image to be deformed region, achieving effective beautification deformation of the image content and improving the user experience of image beautification deformation applications.

[0173] As a fourth optional embodiment of this disclosure, based on the above embodiments, the following steps are further optimized:

[0174] The protection strength value of the image content in the target protection area corresponding to the target image is determined, so as to determine the deformation and movement information corresponding to the image content in the deformation protection area.

[0175] In this embodiment, after determining the target protection area from the target image, the protection strength value of the image content within the target protection area can be further determined through this optional embodiment. This protection strength value can be understood as the level of protection required to prevent image content from being deformed when the image content within the target protection area involves deformation and movement processing.

[0176] It is known that the protection strength value is related to the position of the image content in the target protection area. The closer to the center of the target protection area, the stronger the protection strength recorded by the image content; the closer to the edge of the target protection area, the weaker the protection strength recorded by the image content.

[0177] Based on the third optional embodiment described above, as one implementation method, the step of determining the protection strength value can be specified as follows:

[0178] a4) Extract the protection area grid data of the target protection area to form a mask image of the same size as the target image.

[0179] In this embodiment, an initial overlay image of the same size as the target image can be pre-constructed, and the color information of this initial overlay image can be set to pure white, or it can be set to any pre-defined color. After determining the protection area grid data of the target protection area through the above technical solution, the protection area grid data can be extracted through this step, and the image data information contained in the protection area grid data can be aligned to the initial overlay image. The color information of the image content in the target protection area is used to replace the content at the same position on the initial overlay image, thereby obtaining an overlay image containing the target protection area.

[0180] The protected grid area is a grid area within the target protected area.

[0181] b4) Perform binarization on the masking image to obtain the binarized image of the masking image.

[0182] The masked image obtained in the above steps presents the image content of the target protected area, while the remaining image areas retain their initial color information. This step can perform binarization processing on the masked image. Specifically, the color information of the image content in the target protected area can be converted into the pixel value 0 corresponding to pure black in the binarized scene. At this time, the color information of other image areas can be the pixel value 1 corresponding to pure white in the binarized scene, thus forming the binarized image of the masked image.

[0183] Following the above description, in another binarization implementation, the color information of the image content in the target protected area can be converted into the pixel value 1 corresponding to pure white in the binarization scene, while the color information in other image areas can be the pixel value 0 corresponding to pure black in the binarization scene, thus forming a binarized image of the mask image. This embodiment does not specifically limit the color information of the target protected area and other image areas, as long as it can distinguish the target protected area.

[0184] It should be noted that a gridded approach can also be used to record image data information in the resulting binarized image.

[0185] c4) Feather the target protected area in the binarized image to obtain a binarized feathered image.

[0186] In this embodiment, to avoid simply dividing the target image into a deformed protection state and a non-deformed protection state based on the target protection area, which would lead to abrupt changes in the edge state of the target protection area, this embodiment can perform feathering processing on the binarized image.

[0187] In this embodiment, the target protection area in the binarized image can be regarded as the feathering object. The binarized image also records image data information in a gridded form. The target protection area can contain multiple grid areas. Each grid area also has two sets of grid coordinates: one set is the horizontal and vertical coordinates of the grid vertex, and the other set is the horizontal and vertical coordinates of the vertex sampling representing the color information of the grid area.

[0188] This step of feathering the target protected area can be converted into feathering each grid region within the target protected area. Feathering refers to blurring the transition between the protected area and other image regions, thereby creating a gradual transition between the protected area and other image regions, achieving a natural connection. This embodiment can use Gaussian blur, directed distance field for distance transformation, or other methods to achieve feathering.

[0189] d4) Extract the image grayscale values ​​of each grid region in the target protection area from the binarized feathered image, and determine the protection strength value of the image content in the corresponding grid region.

[0190] It should be noted that in the binary feathered image obtained by feathering, it is equivalent to performing color gradient processing on the grid area connecting the target protection area and other image areas. The pixel value corresponding to the finally connected grid area is not an absolute 0 or 1, but a gray value between 0 and 1.

[0191] This step obtains the pixel values ​​of each grid region in the binarized feathered image, which can then be recorded as image grayscale values. In one implementation, a predefined transformation function can be used, inputting the image grayscale values ​​of the image content within each grid region into the transformation function, and then obtaining the protection strength value output by the function.

[0192] The above-described technical solution of this optional embodiment provides a description of the determination of the protection strength value in the target protection area. Specifically, it adopts mask extraction, binarization processing and feathering processing of the target protection area. This method avoids the problem of abrupt deformation state at the edge of the target protection area. The protection strength value of each image content in the determined target protection area can be stored as pre-determined protection strength information. In the actual application of image processing, the gradual change of deformation movement intensity can be achieved by calling the protection strength information of the corresponding area, so that the image deformation processing is presented in a more natural and realistic state.

[0193] As a fifth optional embodiment of the present disclosure, based on the above embodiments, the following steps can be optimized: when the image deformation region in the target image is detected to have completed deformation and movement, the target image that has completed deformation and movement is displayed, and the corresponding mesh data is recorded.

[0194] In this fifth optional embodiment, after implementing the deformation and movement logic on the image deformation region, the logic for displaying the target image after deformation and movement is further optimized and added. Simultaneously, the gridded data of the target image after deformation and movement can be recorded in real time. Using gridded data to record the target image requires only a small amount of storage space to effectively record the target image data information. Therefore, when a rollback operation is received after an image deformation operation, the gridded data recorded after each image deformation can be used to flexibly and quickly perform image deformation rollback.

[0195] The technical solution of the fifth optional embodiment described above realizes the visual effect display of the target image after deformation and movement, and also realizes the real-time recording of the gridded data corresponding to the target image. In this optional technical solution, the target image presents the deformation effect of different degrees of deformation of image content at different positions in the image deformation area, which increases the naturalness and realism of image beautification deformation. It also realizes flexible and fast rollback of image beautification editing through image data recorded in the form of gridded data, and better improves the user experience of image beautification deformation application.

[0196] Figure 3 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of the present disclosure, as shown below. Figure 3 As shown, the device includes: a region determination module 31, an information determination module 32, and a protected area deformation module 33, wherein,

[0197] The region determination module 31 is used to determine the image deformation region from the target image in response to a deformation trigger operation on the target image;

[0198] The information determination module 32 is used to determine the deformation movement information corresponding to the image content in the deformation protection area based on the location information of the deformation protection area when it is determined that the image deformation area contains a deformation protection area.

[0199] The protected area deformation module 33 is used to deform and move the image content in the deformable protected area according to the deformation and movement information.

[0200] The image processing apparatus provided in this disclosure executes a method logic that differs from existing methods that only beautify and deform the content in the non-protected area of ​​the image to be deformed. This technical solution, when the selected image deformation area includes a deformation protection area, also considers deforming and moving the image content in the deformation protection area according to determined deformation and movement information. This implementation of the technical solution can better weaken the deformation boundary between the image content in the non-protected and protected areas of the image to be deformed, achieving a more natural transition in the degree of deformation between the non-protected and protected areas. This increases the realism of the beautification and deformation of the image content in the image to be deformed, achieving effective beautification and deformation of the image content and improving the user experience of image beautification and deformation applications.

[0201] Furthermore, the device also includes: a deformation module for the non-protected area.

[0202] The non-deformation protection zone deformation module is used to deform and move the image content in the non-deformation protection zone of the image deformation zone by means of a deformation movement value determined by the deformation trigger operation.

[0203] The non-deformation protection area refers to the area outside the deformation protection area in the image deformation area.

[0204] Furthermore, the device also includes: a protected area determination module,

[0205] The protected area determination module is used to determine a target protected area from the target image in response to the operation of acquiring the protected area of ​​the target image, and the target protected area is used to determine the deformation protected area.

[0206] Furthermore, the device may also include:

[0207] A presentation module is used to present an image editing interface, wherein the target image is displayed in a first area of ​​the image editing interface;

[0208] The first triggering module is used to display a protected area selection control in the second area of ​​the image editing interface, and after triggering the protected area selection control, generate the operation of obtaining the protected area to determine the target protected area in the target image;

[0209] The second trigger module is used to display a deformation operation trigger control in the third area of ​​the image editing interface, and after triggering the deformation operation trigger control, receive a deformation trigger operation performed on the target image in the first area.

[0210] Furthermore, the protected area determination module is specifically used for:

[0211] In response to the acquisition operation of the protected region of the target image;

[0212] Determine the area location information associated with the acquisition operation of the protected area;

[0213] Based on the location information of the area and the gridded data of the target image, the grid data of the protected area is determined;

[0214] The target protected area is obtained from the target image by recording the protected area grid data.

[0215] Furthermore, the region determination module 31 is specifically used for:

[0216] Responding to deformation-triggered operations on the target image;

[0217] Determine the location information of the deformation region associated with the deformation triggering operation;

[0218] Based on the location information of the deformed region and the meshed data of the target image, the mesh data of the deformed region is determined;

[0219] The image deformation region is obtained from the target image by recording the deformation region grid data.

[0220] Furthermore, the device also includes: a deformation region determination module, used to determine that the image deformation region contains a deformation protection region belonging to the target protection region;

[0221] The deformation region determination module can specifically be used for:

[0222] Obtain the protected area grid data of the pre-determined target protected area;

[0223] Based on the deformation region grid data of the image deformation region, the image deformation region is divided into at least one deformation grid region;

[0224] For each deformed mesh region, determine whether the deformed network coordinates of the deformed mesh region fall into the protected area mesh data;

[0225] If so, the deformed mesh region is recorded as a protected mesh region belonging to the target protected region;

[0226] By combining the aforementioned protective grid area, a deformation protection area is obtained.

[0227] Furthermore, the information determination module 32 may specifically include:

[0228] The obtaining unit is used to obtain each protective grid region constituting the deformation protection region, and to obtain the protective grid coordinates of each of the protective grid regions;

[0229] The first determining unit is used to determine the relative position between the protection grid area and the target protection area based on the corresponding protection grid coordinates for the protection grid area.

[0230] The second determining unit is used to determine the deformation and movement information corresponding to the image content in the protected grid area based on the relative position of the area.

[0231] Furthermore, the first determining unit can specifically be used for:

[0232] Determine the edge grid region of the target protection area and obtain the edge grid coordinates of the edge grid region;

[0233] The relative distance between the protective grid region and the edge grid region is determined based on the edge grid coordinates and the protective grid coordinates.

[0234] If the relative distance is greater than a set edge threshold, then the relative position of the protected grid area within the target protected area is taken as the relative position of the area; otherwise,

[0235] The relative position of the protected grid area to the edge of the target area is taken as the area's position.

[0236] Furthermore, the second determining unit can specifically be used for:

[0237] When the relative position of the regions is such that the protection grid region is within the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined to remain unchanged;

[0238] When the relative position of the regions is such that the protection grid region is at the edge of the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined based on the protection strength value of the protection grid region.

[0239] Furthermore, the device also includes: an intensity information determination module.

[0240] The intensity information determination module can be used for:

[0241] Extract the protection area grid data of the target protection area to form a mask image of the same size as the target image;

[0242] The masking image is binarized to obtain a binarized image of the masking image;

[0243] The target protected area is feathered in the binarized image to obtain a binarized feathered image;

[0244] Extract the image grayscale values ​​of each grid region in the target protected area from the binarized feathered image, and determine the protection strength value of the image content in the corresponding grid region.

[0245] Furthermore, the device also includes: an image display module,

[0246] The image display module is used to display the target image that has completed deformation and movement when it detects that the image deformation region in the target image has completed deformation and movement, and to record the corresponding mesh data.

[0247] The image processing apparatus provided in this disclosure can execute the image processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0248] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.

[0249] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 4 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 4 The diagram below shows the structure of the terminal device or server 400. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0250] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, image processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Edit / output (I / O) interface 405 is also connected to bus 404.

[0251] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0252] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.

[0253] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0254] The electronic device provided in this embodiment and the image processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0255] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the image processing method provided in the above embodiments.

[0256] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0257] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0258] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0259] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: in response to a deformation triggering operation on a target image, determine an image deformation region from the target image; if it is determined that the image deformation region includes a deformation protection region, determine deformation movement information corresponding to the image content in the deformation protection region based on the location information of the deformation protection region; and deform and move the image content in the deformation protection region according to the deformation movement information.

[0260] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0261] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0262] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0263] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0264] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0265] According to one or more embodiments of this disclosure, [Example 1] provides an image processing method, the method comprising:

[0266] In response to a deformation trigger operation on the target image, the image deformation region is determined from the target image;

[0267] If it is determined that the image deformation area contains a deformation protection area, the deformation movement information corresponding to the image content in the deformation protection area is determined based on the location information of the deformation protection area;

[0268] The image content in the deformation protection area is deformed and moved according to the deformation and movement information.

[0269] According to one or more embodiments of this disclosure, [Example 2] provides an image processing method, which may further include:

[0270] For the non-deformation protected area in the image deformation region, the image content in the non-deformation protected area is deformed and moved according to the deformation movement value determined by the deformation trigger operation;

[0271] The non-deformation protection area refers to the area outside the deformation protection area in the image deformation area.

[0272] According to one or more embodiments of this disclosure, [Example 3] provides an image processing method, which may further include:

[0273] In response to the acquisition operation of the protected region of the target image, a target protected region is determined from the target image, the target protected region being used to determine the deformation protected region.

[0274] According to one or more embodiments of this disclosure, [Example 4] provides an image processing method, which may further include:

[0275] An image editing interface is presented, and the target image is displayed in a first area of ​​the image editing interface;

[0276] In the second area of ​​the image editing interface, a protection area selection control is displayed. After the protection area selection control is triggered, an operation to obtain the protection area that determines the target protection area in the target image is generated.

[0277] In the third area of ​​the image editing interface, a warp operation trigger control is displayed. After the warp operation trigger control is triggered, a warp trigger operation is received on the target image in the first area.

[0278] According to one or more embodiments of this disclosure, [Example 5] provides an image processing method, the method comprising:

[0279] Optionally, determining the target protected area from the target image includes:

[0280] Determine the area location information associated with the acquisition operation of the protected area;

[0281] Based on the location information of the area and the gridded data of the target image, the grid data of the protected area is determined;

[0282] The target protected area is obtained from the target image by recording the protected area grid data.

[0283] According to one or more embodiments of this disclosure, [Example Six] provides an image processing method, the method comprising:

[0284] Optionally, determining the image deformation region from the target image includes:

[0285] Determine the location information of the deformation region associated with the deformation triggering operation;

[0286] Based on the location information of the deformed region and the meshed data of the target image, the mesh data of the deformed region is determined;

[0287] The image deformation region is obtained from the target image by recording the deformation region grid data.

[0288] According to one or more embodiments of this disclosure, [Example Seven] provides an image processing method, the method comprising:

[0289] Optionally, the determination step of whether the image deformation region includes a deformation protection region includes:

[0290] Obtain the protected area grid data of the pre-determined target protected area;

[0291] Based on the deformation region grid data of the image deformation region, the image deformation region is divided into at least one deformation grid region;

[0292] For each deformed mesh region, determine whether the deformed network coordinates of the deformed mesh region fall into the protected area mesh data;

[0293] If so, the deformed mesh region is recorded as a protected mesh region belonging to the target protected region;

[0294] By combining the aforementioned protective grid area, a deformation protection area is obtained.

[0295] According to one or more embodiments of this disclosure, [Example Eight] provides an image processing method, the method comprising:

[0296] Optionally, determining the deformation movement information corresponding to the image content in the deformation protection area based on the location information of the deformation protection area includes:

[0297] Obtain each protective grid region constituting the deformation protection region, and obtain the protective grid coordinates of each of the protective grid regions;

[0298] For the protected grid area, the relative position between the protected grid area and the target protected area is determined according to the corresponding protected grid coordinates;

[0299] Based on the relative positions of the regions, the deformation and movement information corresponding to the image content in the protected grid region is determined.

[0300] According to one or more embodiments of this disclosure, [Example Nine] provides an image processing method, the method comprising:

[0301] Optionally, determining the relative position between the protection grid area and the target protection area based on the corresponding protection grid coordinates includes:

[0302] Determine the edge grid region of the target protection area and obtain the edge grid coordinates of the edge grid region;

[0303] The relative distance between the protective grid region and the edge grid region is determined based on the edge grid coordinates and the protective grid coordinates.

[0304] If the relative distance is greater than a set edge threshold, then the relative position of the protected grid area within the target protected area is taken as the relative position of the area; otherwise,

[0305] The relative position of the protected grid area to the edge of the target area is taken as the area's position.

[0306] According to one or more embodiments of this disclosure, [Example 10] provides an image processing method, the method comprising:

[0307] Optionally, determining the deformation and movement information corresponding to the image content in the protected grid area based on the relative position of the area includes:

[0308] When the relative position of the regions is such that the protection grid region is within the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined to remain unchanged;

[0309] When the relative position of the regions is such that the protection grid region is at the edge of the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined based on the protection strength value of the protection grid region.

[0310] According to one or more embodiments of this disclosure, [Example 11] provides an image processing method, the method comprising:

[0311] Optionally, the step of determining the protection strength value includes:

[0312] Extract the protection area grid data of the target protection area to form a mask image of the same size as the target image;

[0313] The masking image is binarized to obtain a binarized image of the masking image;

[0314] The target protected area is feathered in the binarized image to obtain a binarized feathered image;

[0315] Extract the image grayscale values ​​of each grid region in the target protected area from the binarized feathered image, and determine the protection strength value of the image content in the corresponding grid region.

[0316] According to one or more embodiments of this disclosure, [Example Twelve] provides an image processing method, which may further include:

[0317] When the deformation region in the target image is detected to have completed deformation and movement, the target image that has completed deformation and movement is displayed, and the corresponding mesh data is recorded.

[0318] According to one or more embodiments of this disclosure, [Example Thirteen] provides an image processing apparatus, the apparatus comprising:

[0319] A region determination module is used to determine the image deformation region from the target image in response to a deformation trigger operation on the target image;

[0320] The information determination module is used to determine, based on the location information of the deformation protection area, the deformation movement information corresponding to the image content in the deformation protection area when it is determined that the image deformation area contains a deformation protection area;

[0321] The protected area deformation module is used to deform and move the image content in the deformable protected area according to the deformation and movement information.

[0322] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0323] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0324] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. An image processing method, characterized in that, include: In response to a deformation trigger operation on a target image, an image deformation region is determined from the target image, the image deformation region including at least one deformation mesh region; If it is determined that the image deformation area contains a deformation protection area, the deformation movement information corresponding to the image content in the deformation protection area is determined according to the position information of the deformation protection area. The deformation protection area is a sub-region that falls into the target protection area. The target protection area is pre-defined in the target image. The deformation protection area is determined by determining whether the deformation grid area overlaps with the target protection area. The image content in the deformation protection area is deformed and moved according to the deformation and movement amplitude given in the deformation and movement information. The deformation and movement is an adjustment of the position of the pixel information presented by the image content.

2. The method according to claim 1, characterized in that, Also includes: For the non-deformation protected area in the image deformation region, the image content in the non-deformation protected area is deformed and moved according to the deformation movement value determined by the deformation trigger operation; The non-deformation protection area refers to the area outside the deformation protection area in the image deformation area.

3. The method according to claim 1, characterized in that, Also includes: In response to the acquisition operation of the protected region of the target image, a target protected region is determined from the target image, the target protected region being used to determine the deformation protected region.

4. The method according to claim 3, characterized in that, Also includes: An image editing interface is presented, and the target image is displayed in a first area of ​​the image editing interface; In the second area of ​​the image editing interface, a protection area selection control is displayed. After the protection area selection control is triggered, an operation to obtain the protection area that determines the target protection area in the target image is generated. In the third area of ​​the image editing interface, a deformation operation trigger control is displayed. After the deformation operation trigger control is triggered, a deformation trigger operation is received on the target image in the first area.

5. The method according to claim 3, characterized in that, Determining the target protected area from the target image includes: Determine the area location information associated with the acquisition operation of the protected area; Based on the location information of the area and the gridded data of the target image, the grid data of the protected area is determined; The target protected area is obtained from the target image by recording the protected area grid data.

6. The method according to claim 1, characterized in that, Determining the image deformation region from the target image includes: Determine the location information of the deformation region associated with the deformation triggering operation; Based on the location information of the deformed region and the meshed data of the target image, the mesh data of the deformed region is determined; The image deformation region is obtained from the target image by recording the deformation region grid data.

7. The method according to claim 1, characterized in that, The steps for determining whether the image deformation region contains a deformation protection region include: Obtain the protected area grid data of the pre-determined target protected area; Based on the deformation region grid data of the image deformation region, the image deformation region is divided into at least one deformation grid region; For each deformed mesh region, determine whether the deformed network coordinates of the deformed mesh region fall into the protected area mesh data; If so, the deformed mesh region is recorded as a protected mesh region belonging to the target protected region; By combining the aforementioned protective grid area, a deformation protection area is obtained.

8. The method according to claim 1, characterized in that, The step of determining the deformation movement information corresponding to the image content in the deformation protection area based on the location information of the deformation protection area includes: Obtain the protective mesh region constituting the deformation protection region, and obtain the protective mesh coordinates of the protective mesh region; For the protected grid area, the relative position between the protected grid area and the target protected area is determined according to the corresponding protected grid coordinates; Based on the relative positions of the regions, the deformation and movement information corresponding to the image content in the protected grid region is determined.

9. The method according to claim 8, characterized in that, Determining the relative position between the protection grid area and the target protection area based on the corresponding protection grid coordinates includes: Determine the edge grid region of the target protection area and obtain the edge grid coordinates of the edge grid region; The relative distance between the protective grid region and the edge grid region is determined based on the edge grid coordinates and the protective grid coordinates. If the relative distance is greater than a set edge threshold, then the relative position of the protected grid area within the target protected area is taken as the relative position of the area; otherwise, The relative position of the protected grid area to the edge of the target protected area is taken as the area's relative position.

10. The method according to claim 8, characterized in that, The step of determining the deformation and movement information corresponding to the image content in the protected grid area based on the relative position of the area includes: When the relative position of the regions is such that the protection grid region is within the target protection region, the deformation and movement information corresponding to the image content in the protection grid region is determined to remain unchanged; When the relative position of the protected grid area is such that the protected grid area is at the edge of the target protected area, the deformation and movement information corresponding to the image content in the protected grid area is determined according to the protection strength value of the protected grid area.

11. The method according to claim 10, characterized in that, The steps for determining the protection strength value include: Extract the protection area grid data of the target protection area to form a mask image of the same size as the target image; The masking image is binarized to obtain a binarized image of the masking image; The target protected area is feathered in the binarized image to obtain a binarized feathered image; Extract the image grayscale values ​​of each grid region in the target protection area from the binarized feathered image, and determine the protection strength value of the image content in the corresponding grid region; The protected grid area is a grid area within the target protected area.

12. The method according to any one of claims 1-11, characterized in that, Also includes: When the deformation region in the target image is detected to have completed deformation and movement, the target image that has completed deformation and movement is displayed, and the corresponding mesh data is recorded.

13. An image processing apparatus, characterized in that, include: A region determination module is used to determine an image deformation region from the target image in response to a deformation trigger operation on the target image, the image deformation region including at least one deformation mesh region; The information determination module is used to determine the deformation movement information corresponding to the image content in the deformation protection area based on the position information of the deformation protection area when it is determined that the image deformation area contains a deformation protection area. The deformation protection area is a sub-region that falls into the target protection area. The target protection area is pre-delineated in the target image. The deformation protection area is determined by determining whether the deformation grid area overlaps with the target protection area. The protected area deformation module is used to deform and move the image content in the deformable protected area according to the deformation and movement amplitude given in the deformation and movement information. The deformation and movement is to adjust the position of the pixel information presented by the image content.

14. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Face image processing method and device, electronic device and storage medium

    CN109377446A

  • Image processing method and device for preventing distortion of head

    CN114882562A