Image processing method and apparatus, and electronic device

By segmenting the target area of ​​the object to be floated in image processing and performing floating processing, the problem of achieving floating objects in static images without manual operation is solved, and the vividness and application flexibility of the image are improved.

WO2024179327A1PCT designated stage expired Publication Date: 2024-09-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/077692
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-28
Filing Date
2024-02-20
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The existing technology is difficult to make some objects in static images (such as hair, dresses, scarves, etc.) flutter without manual operation, making it difficult for ordinary non-professionals to process dynamic images.

Method used

By determining the target area of ​​the object to be floated in the image to be processed, dividing it into multiple sub-regions, and performing flutter processing based on these sub-regions to generate a dynamic image.

Benefits of technology

It realizes the natural fluttering effect of some objects in static images, making the images more vivid and flexible, improving the interest of image applications and the convenience of users to obtain image materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077692_06092024_PF_FP
    Figure CN2024077692_06092024_PF_FP
Patent Text Reader

Abstract

The present disclosure provides an image processing method and apparatus, and an electronic device. A specific implementation of the method comprises: acquiring an image to be processed, said image comprising an object waiting for fluttering; determining a target region corresponding to said object in said image; dividing the target region into a plurality of sub-regions, such that each sub-region corresponds to a part of said object; and on the basis of the sub-regions, performing fluttering processing on said object.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method, device and electronic equipment

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the application with CN application number 202310184701.4 and application date February 28, 2023, and claims its priority. The disclosed content of the CN application is hereby introduced as a whole into this application. Technical Field

[0003] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, and electronic device. Background Art

[0004] With the continuous development of digital imaging technology, people can use digital cameras to capture digital images to record beautiful moments in life, and can also draw digital cartoon images. Currently, in order to make images more vivid, a solution is needed to make some objects in static images (such as hair, dresses, scarves, etc.) flutter, thereby generating dynamic images.

[0005] Summary of the Invention

[0006] The present disclosure provides an image processing method, apparatus, and electronic device.

[0007] According to a first aspect, there is provided an image processing method, comprising:

[0008] Acquire an image to be processed, wherein the image to be processed includes an object to be floated;

[0009] Determining a target area corresponding to the object to be moved in the image to be processed;

[0010] dividing the target area into a plurality of sub-areas, so that the sub-areas correspond to parts of the objects to be floated;

[0011] Based on the sub-region, flutter processing is performed on the object to be fluttered.

[0012] According to a second aspect, there is provided an image processing apparatus, comprising:

[0013] An acquisition module is used to acquire an image to be processed; the image to be processed includes an object to be floated;

[0014] a determination module, configured to determine a target area corresponding to the object to be moved in the image to be processed;

[0015] a segmentation module, configured to segment the target area into a plurality of sub-areas, such that the sub-areas correspond to parts of the objects to be floated;

[0016] A processing module is used to perform flutter processing on the object to be fluttered based on the sub-region.

[0017] According to a third aspect, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the image processing method according to any one of the above-mentioned first aspects is implemented.

[0018] According to a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image processing method according to any one of the first aspects is implemented. It should be understood that the above general description and the detailed description that follows are merely exemplary and explanatory and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] FIG1 is a schematic diagram of an image processing scenario according to an exemplary embodiment of the present disclosure;

[0021] FIG2A is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure;

[0022] FIG2B is a schematic diagram of another image processing scenario according to an exemplary embodiment of the present disclosure;

[0023] FIG3 is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure;

[0024] FIG4 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;

[0025] FIG5 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure;

[0026] FIG6 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure. DETAILED DESCRIPTION

[0027] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.

[0028] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

[0029] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. As used in this disclosure, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0030] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."

[0031] With the continuous development of digital imaging technology, people can capture digital images with digital cameras to record beautiful moments in life, draw digital cartoons, and more. To make images more vivid, objects in static images (such as hair, dresses, scarves, etc.) can be made to flutter, thus producing dynamic images. In related technologies, professionals usually need to use professional image processing tools to manually process static images, and after repeated adjustments, to obtain effective dynamic images. This is difficult for ordinary non-professionals to achieve.

[0032] The present disclosure provides an image processing method, which determines a target area corresponding to an object to be floated in an image to be processed, divides the target area into multiple sub-areas, and makes each sub-area correspond to a portion of the object to be floated. Based on the sub-areas, a floating process is performed on the object to be floated. Since the present embodiment divides the target area corresponding to the object to be floated into multiple floating units, and makes each floating unit correspond to a portion of the object to be floated, the object to be floated in a moving image or video after the floating process floats in a staggered manner in bundles. Thus, without the need for manual operation, the floating effect of a portion of an object in a static image is achieved, making the image display effect richer and more vivid, improving the flexibility and fun of image applications, and providing users with a new way to obtain image materials.

[0033] Referring to Figure 1, which is a schematic diagram illustrating an image processing scenario according to some embodiments, the solution of the present disclosure is schematically illustrated below with reference to Figure 1 in conjunction with a complete and specific application example. The application example describes a specific image processing process.

[0034] As shown in FIG1 , the image A to be processed may include an object to be fluttered, to which a fluttering effect can be added. For example, the image A to be processed may be a facial image of a person, and the object to be fluttered may be the person's hair. Another example may be a full-body image of a person, and the object to be fluttered may be the hem of the person's dress. Another example may be an image of interior decoration, and the object to be fluttered may be curtains.

[0035] In some embodiments, the object to be moved in the image A to be processed can first be identified to determine the target region corresponding to the object to be moved, and a mask image B of the object to be moved can be obtained based on the target region. For example, a pre-trained recognition model can be used to identify the object to be moved in the image A to be processed, and pixels in the target region of the image A to be processed can be assigned a value of 0, while pixels in other regions of the image A can be assigned a value of 1, thereby obtaining a mask image B of the object to be moved.

[0036] Then, based on the mask image B of the object to be floated, the target region corresponding to the object to be floated is segmented to obtain a mask image C of subregions. The subregions may be regional units obtained by segmenting the target region corresponding to the object to be floated, each subregion corresponding to a portion of the object to be floated. For example, if the object to be floated is hair, the subregion may be the region corresponding to a strand of hair. For another example, if the object to be floated is the hem of a person's dress, the subregion may be the region corresponding to a strand of the hem. For another example, if the object to be floated is a curtain, the subregion may be the region corresponding to a strand of the curtain.

[0037] Then, based on the mask image C of the sub-region, a gridding process can be performed to generate a grid layer for rendering. For example, based on the mask image C of the sub-region, a first grid layer corresponding to the sub-region can be generated. Specifically, each sub-region can be traversed, and for any hair bundle region, multiple points can be randomly selected in the sub-region, and a preset algorithm (such as a triangulation algorithm) can be used to generate a grid for the sub-region, and the grids corresponding to the multiple sub-regions can be used to form a first grid layer. Optionally, a grid layer corresponding to the entire target region can be generated based on the target region. For example, multiple points can be randomly selected from the target region, and a preset algorithm can be used to generate a grid for the target region as the second grid layer.

[0038] In some embodiments, key points of an object associated with the object to be floated in the image A to be processed can be identified to determine information about the key points in the image A to be processed. The key points of the object associated with the object to be floated can be an abstract description of a fixed area of ​​the object. The information about the key points can be location information of the key points in the image A to be processed. For example, if the object to be floated is hair, the key points of the object associated with the object to be floated can be key points of a face. For another example, if the object to be floated is the hem of a person's clothing, the key points of the object associated with the object to be floated can be key points of a human body. For another example, if the object to be floated is a curtain, the key points of the object associated with the object to be floated can be key points of a window, etc. Specifically, a pre-trained key point detection model can be used to determine information about the key points of the object associated with the object to be floated in the image A to be processed.

[0039] Based on the mask image C of the subregion and the information about the key points, anchor points can be extracted to constrain the movement of the floating object. Then, based on the image A to be processed, the anchor points, and the grid layer, rendering processing is performed to obtain multiple frames of images for displaying animated images or playing videos. These multiple frames can achieve the effect of the floating object. Specifically, based on the anchor points, the trajectory information of the floating object as a whole and the subregion can be determined. Furthermore, based on the pixel values ​​of each pixel in the image A to be processed, the grid layer, and the trajectory information, the pixel values ​​of each pixel in each frame are determined, thereby obtaining multiple frames of images.

[0040] FIG2A is a flowchart of an image processing method according to some embodiments. The execution subject of the method can be implemented as any device, platform, server or device cluster with computing and processing capabilities, and the method includes the following steps: 201 to 204.

[0041] As shown in FIG. 2A , in step 201 , an image to be processed is acquired, and in step 202 , a target area corresponding to an object to be floated in the image to be processed is determined.

[0042] In some embodiments, the image to be processed may be an image in RGB color mode, and the image to be processed may include a floating object capable of achieving a fluttering effect. Specifically, the floating object may be an object with a fixed upper end and a free lower end, capable of fluttering in the wind. For example, the floating object may be a person's hair, the hem of a person's clothing, a tassel on an ornament, a scarf worn by a person, or a curtain, etc. It will be understood that this embodiment does not limit the specific type of floating object.

[0043] In some embodiments, the target area corresponding to the object to be moved can be the area covered by the object to be moved in the image to be processed. Specifically, a pre-trained recognition model can be used to identify the object to be moved, thereby determining the location information of the target area in the image to be processed. The recognition model can be trained based on a large number of sample images including the object to be moved. In some embodiments, after determining the location information of the target area in the image to be processed, a mask image corresponding to the object to be moved can be further obtained based on the location information of the target area. For example, the pixels in the target area of ​​the image to be processed can be assigned a value of 0, and the pixels in other areas can be assigned a value of 1, thereby obtaining a mask image of the object to be moved. This mask image of the object to be moved can be used in subsequent processes such as region segmentation.

[0044] In step 203, the target area is divided into a plurality of sub-areas, so that each sub-area corresponds to a part of the object to be floated.

[0045] In some embodiments, the target area corresponding to the floating object can be segmented to divide the floating object into multiple sub-areas. For example, if the floating object is hair, the hair can be segmented into multiple hair bundles. For another example, if the floating object is the hem of a person's clothing, the hem can be segmented into multiple hem bundles.

[0046] In some embodiments, a pre-trained target model can be used to segment the target region in the image to be processed vertically to obtain multiple sub-regions. For example, a mask image of the target region can be input into the target model to obtain mask images of the multiple sub-regions. Alternatively, after segmenting the target region in the image to be processed, the segmented regions can be optimized to obtain multiple sub-regions.

[0047] Specifically, taking the case where the object to be floated is a skirt as an example, as shown in FIG2B , image 211 is a mask image of the skirt of a person. Image 211 can be input into a target model for segmenting the skirt to obtain image 212, and then image 212 is optimized to obtain image 213. Specifically, a width threshold can be set in advance for the width of the skirt. After obtaining image 212, it can be detected whether the maximum width of each initial region obtained by segmentation is greater than the above-mentioned width threshold. If the maximum width of any initial region is greater than the above-mentioned width threshold, the initial region can be further subdivided into multiple sub-regions. For example, based on the maximum width of the initial region and the above-mentioned width threshold, the number of sub-regions that need to be subdivided can be estimated, and then the initial region can be subdivided based on the number so that the maximum width of the subdivided sub-regions is less than the above-mentioned width threshold.

[0048] After the initial region is subdivided, each subregion can be further sharpened and smoothed. For example, for any subregion, the subregion can be divided into two curves based on the upper and lower endpoints of the subregion. Polynomial fitting is then performed on each curve based on multiple points on each curve to obtain two new curves. The area enclosed by the two new curves is the subregion after the sharpening and smoothing process.

[0049] Since this embodiment optimizes the result of the preliminary segmentation to obtain multiple sub-regions with smoother edges, the floating effect of the object to be floated in the animated image or video after the floating processing is better.

[0050] In step 204 , based on the multiple sub-regions, flutter processing is performed on the object to be fluttered.

[0051] In some embodiments, anchor points can be determined in the image to be processed to constrain the fluttering of the object to be floated. The anchor points can include anchor points for subregions, and the anchor points for any subregion can be used to constrain the fluttering of the portion of the object to be floated corresponding to that subregion. Alternatively, the anchor points can also include anchor points for the entire target region, and the anchor points for the entire target region can be used to constrain the fluttering of the entire object to be floated. Fluttering processing can be performed on the target region based on the anchor points for the target region, and flutter processing can be performed on the subregion based on the anchor points for the subregion.

[0052] In some embodiments, key points of a predetermined object in the image to be processed can be first detected, where the predetermined object is an object that fixes the object to be floated. For example, if the object to be floated is hair, the key points of the predetermined object can be key points of a face. For another example, if the object to be floated is the hem of a person's clothing, the key points of the predetermined object can be key points of the body, etc. A pre-trained key point detection model can be used to detect key points in the image to be processed.

[0053] Next, based on the detected key points, a fixed boundary can be determined to secure the floating object. For example, if the floating object is hair, the fixed boundary can be the outline of a person's forehead. For another example, if the floating object is the hem of a person's clothing, the fixed boundary can be the waistline of the clothing. For another example, if the floating object is a curtain, the fixed boundary can be the curtain's hanging rod.

[0054] Finally, multiple points covered by the target area can be selected from the fixed edge line according to a preset selection rule (eg, equidistant selection) as anchor points for the target area.

[0055] In some embodiments, for any sub-region, the highest point corresponding to the sub-region and the midline passing through the highest point can be determined, and based on the highest point and the midline passing through the highest point, the anchor point for fixing the sub-region is determined. The highest point corresponding to the sub-region can be determined based on the coordinates of the sub-region in the image, and the highest point can be the point with the largest vertical coordinate in the sub-region. The midline passing through the highest point also passes through the lowest point corresponding to the sub-region, and the midline can divide the sub-region into two parts. The midline can be determined by any reasonable algorithm, and this embodiment does not limit the method for determining the midline. The highest point can be determined as the anchor point for fixing the sub-region, and the points on the midline selected at equal distances according to preset distances can be determined as anchor points for controlling the movement of the sub-region.

[0056] In some embodiments, multiple anchor points used to control the movement of the sub-regions may be randomly selected as anchor points used to control the overall movement of the target region.

[0057] Since this embodiment separately determines the anchor points for the entire target area and the anchor points for each sub-area in the image to be processed, it is possible to achieve the effect of the object to be floated as a whole and staggered floating by sub-areas, making the floating effect of the object to be floated in the animated image or video after floating processing more realistic and vivid.

[0058] In some embodiments, flutter processing can be performed on the target fluttering object based on the anchor points and sub-regions. A gridding process can be performed based at least on the sub-regions. For example, a first grid layer can be generated based on the sub-regions. Optionally, a second grid layer can be generated based on the target region. It is understood that more grid layers can be generated as needed, and this embodiment does not limit the specific number of grid layers.

[0059] In some embodiments, a preset algorithm can be used for meshing. For example, for any sub-region, multiple points can be randomly selected in the area corresponding to the sub-region, and the selected points can be connected using a triangulation algorithm to generate a first mesh layer composed of multiple triangles. For another example, multiple points can be randomly selected in the target area, and the selected points can be connected using a triangulation algorithm to generate a second mesh layer composed of multiple triangles.

[0060] In some embodiments, the trajectory points corresponding to each anchor point can also be determined. For anchor points used to fix the target area and anchor points used to fix sub-areas, their corresponding trajectory points are fixed points. For anchor points used to control the movement of the target area and anchor points used to control the movement of sub-areas, the trajectory information corresponding to each anchor point can be calculated using a preset algorithm based on the desired floating effect. Based on the trajectory information corresponding to each anchor point, the position of each anchor point in each frame of the image to be played is determined.

[0061] In some embodiments, based on preset constraints (for example, the constraints may indicate that the distance between the anchor point and other points in the area should remain as constant as possible or change as little as possible) and the position points of each anchor point in each frame of the image to be played, the first grid layer and the second grid layer after deformation due to floating (that is, the sub-area and the target area corresponding to the grid layer after deformation due to floating) in each frame of the image to be played can be calculated.

[0062] In some embodiments, the pixel values ​​of each pixel in each frame of the image to be processed and the first and second grid layers of each frame of the image to be played can be determined based on the pixel values ​​of each pixel in the image to be processed and the deformation of the first and second grid layers due to the fluttering of each frame of the image to be played, thereby performing rendering processing to obtain multiple frames of images to be played. These multiple frames of images to be played can constitute an animated image or video. When displayed, these multiple frames of images to be played can show the fluttering effect of the object to be played.

[0063] Since this embodiment is rendered through the grid layers corresponding to the sub-regions and the target region, it is possible to avoid the gaps between the sub-regions during the interlaced floating of the sub-regions, thereby improving the floating effect of the object to be floated in the animated image or video after the floating processing.

[0064] For this embodiment, a specific application scenario may be that when user A is creating a personal homepage, he or she may select a personal static image and use the image processing method provided by the present disclosure to quickly obtain a corresponding animated image with a hair fluttering effect, and apply the animated image with a hair fluttering effect to the personal homepage, making the personal homepage more vivid and flexible, and improving the flexibility and fun of image application.

[0065] Another specific application scenario is that when user B is placing a skirt advertisement, he can select a full-body static image of the model, and use the image processing method provided by the present invention to quickly obtain a dynamic image with the special effect of the skirt fluttering in the wind, and place the dynamic image with the special effect of the skirt fluttering in the wind into the advertisement, thereby making the display effect of the advertisement better and more flexible, and providing users with a more convenient way to obtain advertising materials.

[0066] This embodiment is not limited to the above-mentioned application scenarios, and can also be applied to other scenarios. The present disclosure provides an image processing method, which determines the target area corresponding to the object to be floated in the image to be processed, and divides the target area into multiple sub-areas, so that each sub-area corresponds to a part of the object to be floated, and performs floating processing on the object to be floated based on the sub-area. Since this embodiment divides the target area corresponding to the object to be floated into multiple floating units, so that each floating unit corresponds to a part of the object to be floated, the object to be floated in the animated image or video after the floating processing floats in a staggered manner in bundles. Thereby, without the need for manual operation, the floating effect of some objects in the static image is achieved, making the image display effect richer and more vivid, improving the flexibility and fun of image application, and providing users with a new way to obtain image materials.

[0067] It should be noted that although the operations of the methods of the embodiments of the present disclosure are described in a specific order in the above embodiments, this does not require or imply that these operations must be performed in this specific order, or that all of the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flowcharts can be performed in a different order. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0068] Corresponding to the aforementioned image processing method embodiment, the present disclosure also provides an embodiment of an image processing device.

[0069] As shown in FIG3 , FIG3 is a block diagram of an image processing device according to some embodiments of the present disclosure. The device may include: an acquisition module 301 , a determination module 302 , a segmentation module 303 and a processing module 304 .

[0070] The acquisition module 301 is used to acquire an image to be processed, where the image to be processed includes an object to be floating.

[0071] The determination module 302 is used to determine the target area corresponding to the object to be floated in the image to be processed.

[0072] The segmentation module 303 is used to segment the target area into multiple sub-areas, so that each sub-area corresponds to a part of the object to be floated.

[0073] The processing module 304 is configured to perform flutter processing on the object to be fluttered based on the sub-regions.

[0074] In some embodiments, the segmentation module 303 is configured to: obtain a mask image corresponding to the target area, and segment the target area in the mask image along the longitudinal direction to obtain a plurality of sub-areas.

[0075] In some embodiments, the segmentation module 303 segments the target area in the mask image vertically to obtain multiple sub-areas by determining a width threshold pre-set for the sub-areas, and segmenting the target area in the mask image vertically into multiple sub-areas whose widths are less than or equal to the width threshold.

[0076] In some embodiments, the processing module 304 is configured to: determine an anchor point in the image to be processed, the anchor point being used to constrain the movement of the object to be moved, and perform movement processing on the object to be moved based on the anchor point and the sub-region.

[0077] In some embodiments, the processing module 304 determines the anchor points in the image to be processed by: determining the anchor points for the target region in the image to be processed, and determining the anchor points for the sub-region in the image to be processed.

[0078] In some embodiments, the processing module 304 determines anchor points for the target region in the image to be processed by detecting key points of a predetermined object in the image to be processed, where the predetermined object is an object that fixes the object to be floated. Based on the key points, a fixed boundary line for fixing the object to be floated is determined, and points on the fixed boundary line that are covered by the target region are selected as anchor points for the target region.

[0079] In some embodiments, for any sub-area, the processing module 304 determines the anchor point for the sub-area in the following manner: determining the highest point corresponding to the sub-area, determining the center line corresponding to the sub-area, the center line passing through the highest point, determining a fixed anchor point for fixing the sub-area based on the highest point, and determining a control anchor point for controlling the floating of the sub-area based on the center line.

[0080] In some embodiments, the processing module 304 performs floating processing on the floating object based on the anchor points and sub-areas in the following manner: based on the anchor points for the target area, the target area is floated; based on the anchor points for the sub-areas, the sub-areas are floated.

[0081] In some embodiments, the object to be floated includes hair, and the sub-region includes an area corresponding to a strand of hair. Alternatively, the object to be floated includes a dress, and the sub-region includes an area corresponding to a hem of the dress. Alternatively, the object to be floated includes a silk scarf, and the sub-region includes an area corresponding to a strand of the silk scarf.

[0082] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment scheme of the present disclosure. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0083] Figure 4 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure. As shown in Figure 4, the electronic device 910 includes a processor 911 and a memory 912, which can be used to implement a client or a server. The memory 912 is used to store computer-executable instructions (such as one or more computer program modules) non-transiently. The processor 911 is used to run the computer-executable instructions, and when the computer-executable instructions are run by the processor 911, one or more steps in the image processing method described above can be executed, thereby implementing the image processing method described above. The memory 912 and the processor 911 can be interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0084] For example, the processor 911 may be a central processing unit (CPU), a graphics processing unit (GPU), or other processing units with data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) may be an X86 or ARM architecture. The processor 911 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 910 to perform desired functions.

[0085] For example, the memory 912 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), a hard disk, an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, a flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 911 may execute one or more computer program modules to implement various functions of the electronic device 910. Various applications and various data, as well as various data used and / or generated by the applications, may also be stored in the computer-readable storage medium.

[0086] It should be noted that, in the embodiment of the present disclosure, the specific functions and technical effects of the electronic device 910 can be referred to the above description of the image processing method, which will not be repeated here.

[0087] Figure 5 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure. The electronic device 920 is, for example, suitable for implementing the image processing method provided by the embodiments of the present disclosure. The electronic device 920 may be a terminal device, etc., which can be used to implement a client or a server. The electronic device 920 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), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. It should be noted that the electronic device 920 shown in Figure 5 is only an example and does not impose any restrictions on the functions and scope of use of the embodiments of the present disclosure.

[0088] As shown in FIG5 , the electronic device 920 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 921, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 922 or a program loaded from a storage device 928 into a random access memory (RAM) 923. Various programs and data required for the operation of the electronic device 920 are also stored in the RAM 923. The processing device 921, the ROM 922, and the RAM 923 are connected to each other via a bus 924. An input / output (I / O) interface 925 is also connected to the bus 924.

[0089] Typically, the following devices may be connected to the I / O interface 925: an input device 926 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 927 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 928 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 929. The communication device 929 may allow the electronic device 920 to communicate with other electronic devices wirelessly or by wire to exchange data. Although FIG5 shows the electronic device 920 with various devices, it should be understood that it is not required to implement or have all of the devices shown, and the electronic device 920 may alternatively implement or have more or fewer devices.

[0090] For example, according to an embodiment of the present disclosure, the above-mentioned image processing method can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for executing the above-mentioned image processing method. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 929, or installed from the storage device 928, or installed from the ROM 922. When the computer program is executed by the processing device 921, the functions defined in the image processing method provided by the embodiment of the present disclosure can be implemented.

[0091] Figure 6 is a schematic diagram of a storage medium provided in some embodiments of the present disclosure. For example, as shown in Figure 6, storage medium 930 may be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions 931. When non-transitory computer-executable instructions 931 are executed by a processor, the image processing method described in the embodiments of the present disclosure may be implemented. For example, when non-transitory computer-executable instructions 931 are executed by a processor, one or more steps of the image processing method described above may be performed.

[0092] For example, the storage medium 930 may be applied to the above-mentioned electronic device. For example, the storage medium 930 may include a memory in the electronic device.

[0093] For example, the storage medium may include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a flash memory, or any combination of the above storage media, or other applicable storage media.

[0094] For example, the description of the storage medium 930 can refer to the description of the memory in the embodiment of the electronic device, and the repeated parts are not repeated. The specific functions and technical effects of the storage medium 930 can refer to the description of the image processing method above, and are not repeated here.

[0095] It should be noted that in the context of the present disclosure, a computer-readable medium may 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 computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. A computer-readable storage medium may 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 computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0096] The present disclosure also provides a computer program product, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method of any of the aforementioned embodiments.

[0097] The present disclosure also provides a computer program, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method of any of the aforementioned embodiments.

[0098] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0099] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, include: Acquire an image to be processed, wherein the image to be processed includes an object to be floated; Determine a target area corresponding to the object to be floated in the image to be processed; Dividing the target area into a plurality of sub-areas, so that the sub-areas correspond to parts of the objects to be floated; Based on the sub-region, flutter processing is performed on the object to be fluttered.

2. The image processing method according to claim 1, in, The dividing the target area into a plurality of sub-areas comprises: Acquire a mask image corresponding to the target area; In the mask image, the target area is segmented along the vertical direction to obtain the multiple sub-areas.

3. The image processing method according to claim 2, in, In the mask image, the target area is segmented along the vertical direction to obtain the multiple sub-areas including: Determine a width threshold pre-set for the sub-region; The target area in the mask image is divided into a plurality of sub-areas with widths less than or equal to the width threshold along the longitudinal direction.

4. The image processing method according to any one of claims 1 to 3, in, The performing the flutter processing on the object to be fluttered based on the sub-region comprises: Determine an anchor point in the image to be processed, wherein the anchor point is used to constrain the floating of the object to be floated; Based on the anchor point and the sub-region, flutter processing is performed on the object to be fluttered.

5. The image processing method according to claim 4, in, Determining the anchor point in the image to be processed comprises: Determining an anchor point for the target area in the image to be processed; and An anchor point for the sub-region in the image to be processed is determined.

6. The image processing method according to claim 5, in, Determining the anchor point for the target area in the image to be processed includes: Detecting key points of a preset object in the image to be processed, wherein the preset object is an object that fixes the object to be floated; Determine a fixed edge line for fixing the object to be floated based on the key points; Points covered by the target area are selected from the fixed edge as anchor points for the target area.

7. The image processing method according to claim 5 or 6, in, For any sub-region, the anchor point for the sub-region is determined as follows: Determine the highest point corresponding to the sub-area; Determine a center line corresponding to the sub-region, wherein the center line passes through the highest point; Determine a fixed anchor point for fixing the sub-area based on the highest point; A control anchor point for controlling the floating of the sub-region is determined based on the center line.

8. The image processing method according to any one of claims 5 to 7, in, The performing the flutter processing on the object to be fluttered based on the anchor point and the sub-area includes: Based on the anchor point of the target area, performing floating processing on the target area; Based on the anchor point for the sub-region, the sub-region is subjected to floating processing.

9. The image processing method according to any one of claims 1 to 8, in: The object to be floated includes hair, and the sub-region includes a region corresponding to a bunch of hair; and / or The object to be floated includes a dress, and the sub-region includes a region corresponding to a hem of the dress; and / or The object to be floated includes a silk scarf, and the sub-region includes a region corresponding to a strand of the silk scarf.

10. The image processing method according to claim 8 or 9, in, The performing floating processing on the sub-region based on the anchor point of the sub-region comprises: Performing gridding processing based on the sub-region to obtain a first grid layer; Determine a trajectory point corresponding to each anchor point of the sub-region; Determine the position of each anchor point of the sub-region in each frame of the image to be played according to the trajectory point corresponding to each anchor point of the sub-region; Determine the first grid layer after deformation due to floating in each frame of the image to be played according to the preset constraint condition and the position point of each anchor point of the sub-region in each frame of the image to be played; Rendering is performed according to the pixel value of each pixel point in the image to be processed and the first grid layer deformed due to the fluttering in each frame of the image to be played.

11. The image processing method according to any one of claims 8 to 11, in, The performing floating processing on the target area based on the anchor point of the target area includes: Performing gridding processing based on the target domain to obtain a second grid layer; Determine a trajectory point corresponding to each anchor point of the target area; Determine the position of each anchor point in the target area in each frame of the image to be played according to the trajectory point corresponding to each anchor point in the target area; Determine the second grid layer after deformation due to floating in each frame of the image to be played according to the preset constraint condition and the position point of each anchor point of the target area in each frame of the image to be played; Rendering is performed according to the pixel value of each pixel point in the image to be processed and the second grid layer deformed due to the fluttering in each frame of the image to be played.

12. An image processing device, include: An acquisition module, used for acquiring an image to be processed; The image to be processed includes an object to be floated; A determination module, used for determining a target area corresponding to the object to be floated in the image to be processed; A segmentation module, used for segmenting the target area into a plurality of sub-areas, so that the sub-areas correspond to parts of the objects to be floated; A processing module is used to perform flutter processing on the object to be fluttered based on the sub-area.

13. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the image processing method according to any one of claims 1 to 11.

14. An electronic device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the image processing method according to any one of claims 1 to 11 is implemented.

15. A computer program product, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method according to any one of claims 1 to 11.

16. A computer program, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Portrait hairline flowing special effect implementation method

    CN111986212A

  • Image processing method and device, electronic equipment and storage medium

    CN112488977A

  • Image processing method and device and electronic equipment

    CN115984295A

  • Image processing device, image processing method, and program

    JP2021086458A

  • System and method for simulating hair and cloth using polyhedral-based constraints

    US20110273445A1