Image processing method and apparatus, and electronic device
By dividing the layers to be processed with different occlusion relationships in image processing and performing grid processing, the automatic fluttering effect of objects in static images is achieved, which solves the problem of unrealistic and difficult-to-achieve fluttering effects in the existing technology, and improves image quality. display quality and applicability.
Patent Information
- Application Number
- PCT/CN2024/077550
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-28
- Filing Date
- 2024-02-19
- Publication Date
- 2024-09-06
AI Technical Summary
The existing technology is difficult to achieve the fluttering effect of some objects in static images without manual operation, resulting in the display effect of dynamic images lacking a sense of layering and space, and is difficult to achieve by ordinary people.
By determining the object to be fluttered and the reference object in the image to be processed, multiple layers to be processed are divided based on different occlusion relationships, and the fluttering effect of the object to be fluttered is generated. Grid processing and anchor point trajectory information are used to realize the pressing of the object to be fluttered. The layers are interlaced and fluttering.
Without manual operation, the real and vivid fluttering effect of some objects in static images is achieved, the display layering and spatial sense of the image are improved, and the flexibility and interest of image applications are enhanced.
Smart Images

Figure CN2024077550_06092024_PF_FP
Abstract
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 202310215668.7 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; the image to be processed includes an object to be moved;
[0009] determining the object to be moved and a reference object in the image to be processed;
[0010] Determining a plurality of layers to be processed based on the object to be floated and the reference object; wherein different layers to be processed correspond to different occlusion relationships;
[0011] Based on the multiple layers to be processed, a fluttering effect of the object to be fluttered is generated.
[0012] According to a second aspect, there is provided an image processing apparatus, comprising:
[0013] An acquisition module, configured to acquire an image to be processed, wherein the image to be processed includes an object to be moved;
[0014] a determination module, configured to determine the object to be moved and a reference object in the image to be processed;
[0015] a layering module, configured to determine a plurality of layers to be processed based on the object to be floated and the reference object; wherein different layers to be processed correspond to different occlusion relationships;
[0016] A generating module is used to generate a fluttering effect of the object to be fluttered based on the multiple layers to be processed.
[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.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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.
[0021] FIG1 is a schematic diagram of an image processing scenario according to an exemplary embodiment of the present disclosure;
[0022] FIG2 is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure;
[0023] FIG3 is a flowchart of another image processing method according to an exemplary embodiment of the present disclosure;
[0024] FIG4 is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure;
[0025] FIG5 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;
[0026] FIG6 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure;
[0027] FIG7 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure. DETAILED DESCRIPTION
[0028] 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.
[0029] 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.
[0030] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms "a," "the," and "the" used in this disclosure are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0031] 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."
[0032] With the continuous development of digital imaging technology, people can use digital cameras to capture digital images to record beautiful moments in life, and they can also draw digital cartoon images. To make the image more vivid, some objects in the static image (such as hair, dress, etc.) can be made to flutter, thereby producing a dynamic image. In the related art, professionals usually need to use professional image processing tools to manually process the static image and render the image data obtained after manual processing to produce a dynamic image. This is difficult for ordinary non-professionals to achieve. In addition, the resulting dynamic image has poor dynamic display effect and lacks layering and spatial perception.
[0033] The present disclosure provides an image processing method, which determines an object to be floated and a reference object in an image to be processed, and based on the object to be floated and the reference object, determines a plurality of layers to be processed corresponding to different occlusion relationships, and generates a floating effect of the object to be floated according to the plurality of layers to be processed. Since this embodiment takes into account the occlusion relationship in the image to be processed, and generates a floating effect of the object to be floated according to the layers to be processed with different occlusion relationships, the object to be floated in the animated image or video after the floating processing can float in an interlaced manner by layer based on a certain occlusion relationship. Thus, without the need for manual operation, the floating effect of some objects in a static image is achieved, and the display effect of the image is made more realistic and vivid, with a stronger sense of layering and space, and the flexibility and fun of image application are also improved.
[0034] Referring to FIG1 , which is a schematic diagram of an image processing scenario according to an exemplary embodiment, the solution of the present disclosure is schematically illustrated below with reference to FIG1 in conjunction with a complete and specific application example. The application example describes a specific image processing process.
[0035] As shown in Figure 1, 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 face 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.
[0036] In some embodiments, the object to be moved in the image A to be processed can be first identified to determine a 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.
[0037] Then, based on mask image B, the target region corresponding to the fluttering object is segmented to obtain a mask image C of multiple subregions. A subregion can be a region obtained by vertically segmenting the target region corresponding to the fluttering object. For example, if the fluttering object is hair, the subregion can be the region corresponding to a strand of hair. For another example, if the fluttering object is the hem of a person's clothing, the subregion can be the region corresponding to a strand of the hem. For another example, if the fluttering object is curtains, the subregion can be the region corresponding to a strand of curtains.
[0038] In some embodiments, a reference object in the image A to be processed can be identified to determine the area corresponding to the reference object, where there is an occlusion relationship between the reference object and the object to be moved. For example, if the object to be moved is hair, the reference object can be a face. For another example, if the object to be moved is a curtain, the reference object can be a window, etc.
[0039] In some embodiments, multiple layers to be processed with different occlusion relationships can be determined based on the mask image B of the object to be moved and the region corresponding to the reference object. A gridding process is then performed based on the mask image B of the object to be moved, the mask image C of the sub-region, and the multiple layers to be processed to obtain multiple grid layers, where each grid layer corresponds to a layer to be processed.
[0040] In some embodiments, anchor points may be extracted to constrain the floating object. Rendering is then performed based on the image A to be processed, the anchor points, and the multiple grid layers, thereby generating multiple frames of images for displaying an animated image or playing a video. These multiple frames can achieve the floating effect of the floating object.
[0041] Specifically, the trajectory information corresponding to each anchor point can be determined, and based on the trajectory information corresponding to each anchor point, the position points of each anchor point in each frame of the multi-frame image to be generated can be determined. Then, based on the position points of each anchor point in each frame of the image, the floating data corresponding to each layer of the grid can be determined. Based on the information of the occlusion relationship of different layers to be processed, the floating data corresponding to each layer of the grid is occluded. Based on the pixel values of each pixel point in the image to be processed and the data after occlusion processing, the pixel values of each pixel point in each frame of the image to be generated are determined, and rendering processing is performed to obtain multi-frame images. The multi-frame images can constitute a moving picture or video. If the multi-frame images are displayed, the floating effect of the object to be floated can be displayed.
[0042] The present disclosure will be described in detail below with reference to specific embodiments.
[0043] FIG2 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.
[0044] As shown in FIG. 2 , in step 201 , an image to be processed is acquired, and in step 202 , an object to be moved and a reference object in the image to be processed are determined.
[0045] In some embodiments, the image to be processed may be an image in RGB color mode, and may include a fluttering object capable of achieving a fluttering effect. Specifically, the fluttering object may be an object with a fixed upper end and a free lower end, capable of fluttering in the wind. For example, the fluttering object may be a person's hair, the hem of a person's dress, 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 category of the fluttering object.
[0046] The object to be fluttered in the image to be processed can be determined, that is, the region information corresponding to the object to be fluttered in the image to be processed can be obtained. Specifically, the object to be fluttered can be identified using a pre-trained recognition model, thereby determining the region information corresponding to the object to be fluttered 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 fluttered. Optionally, after determining the region information corresponding to the object to be fluttered in the image to be processed, a mask image corresponding to the object to be fluttered can be further obtained based on the region information corresponding to the object to be fluttered. For example, the pixel points in the region corresponding to the object to be fluttered in the image to be processed can be assigned a value of 0, and the pixel points in other regions can be assigned a value of 1, thereby obtaining a mask image of the object to be fluttered. The mask image of the object to be fluttered can be used in subsequent gridding processing and other processes.
[0047] In some embodiments, the image to be processed may also include a reference object. The reference object may be an object that is in an occlusion relationship with the object to be fluttered. When the object to be fluttered flutters, it may occlude the reference object, or the reference object may occlude the object to be fluttered. For example, if the object to be fluttered is a person's hair, the reference object may be the person's face. For another example, if the object to be fluttered is the hem of a person's skirt, the reference object may be the person's legs, etc.
[0048] A preset algorithm can be used to determine the region information corresponding to the reference object in the image to be processed. For example, if the object to be moved is a person's hair and the reference object is a face, a preset facial key point detection algorithm can be used to detect facial key points in the image to be processed. Facial key points can be points in key areas of the face. For example, facial key points may include, but are not limited to, multiple points in areas such as eyebrows, eyes, nose, and mouth. Then, based on the facial key points, the facial contour is determined, and information about the region enclosed by the facial contour is obtained as the region information corresponding to the reference object.
[0049] In step 203, a plurality of layers to be processed are determined based on the object to be floated and the reference object.
[0050] In some embodiments, the multiple layers to be processed may be multiple layers of regions corresponding to different occlusion relationships. The layer to be processed can be determined by obtaining the region corresponding to any layer to be processed. The multiple layers to be processed may include at least a first layer to be processed and a second layer to be processed. The region where the object to be floated overlaps with the reference object can be obtained as the region corresponding to the first layer to be processed, and the region of the object to be floated that does not overlap with the reference object can be obtained as the region corresponding to the second layer to be processed. The first layer to be processed occludes the reference object and the second layer to be processed, while the second layer to be processed does not occlude the reference object.
[0051] In some embodiments, the multiple layers to be processed may include, in addition to the first and second layers to be processed, a third layer to be processed. The area corresponding to the object to be fluttered may be obtained as the area corresponding to the third layer to be processed. The first layer to be processed occludes the reference object, the second layer to be processed, and the third layer to be processed; the second layer to be processed occludes the third layer to be processed but does not occlude the reference object; and the reference object occludes the third layer to be processed.
[0052] For example, if the object to be fluttered is a person's hair and the reference object is a face, the area where the hair and face overlap can be obtained as the area corresponding to the first layer to be processed. The area within the hair that does not overlap with the face can be obtained as the area corresponding to the second layer to be processed. The hair area can also be obtained as the area corresponding to the third layer to be processed. The first layer to be processed corresponds to the bangs of the hair, the second layer to be processed corresponds to the hair strands excluding the bangs, and the third layer to be processed corresponds to the entire hair. Therefore, the first layer to be processed, corresponding to the bangs, is at the top layer and obstructs both the face and the other two layers to be processed. The second layer to be processed, corresponding to the hair strands, is at the middle layer and does not obstruct both the face and the first layer to be processed, but does obstruct the third layer to be processed. The third layer to be processed, corresponding to the entire hair, is at the bottom layer and serves as the background layer. The face and the other two layers to be processed obstruct the third layer to be processed.
[0053] In step 204 , a fluttering effect of the object to be fluttered is generated based on the multiple layers to be processed.
[0054] In some embodiments, the mesh corresponding to each layer to be processed can be obtained to obtain a multi-layer mesh, and then information about the occlusion relationship corresponding to each layer to be processed can be obtained. Based on the multi-layer mesh and the occlusion relationship information, multiple frames of images can be generated. By playing these multiple frames of images, the floating effect of the object to be floated can be displayed.
[0055] The present disclosure provides an image processing method that determines an object to be floated and a reference object in an image to be processed, and based on the object to be floated and the reference object, determines multiple layers to be processed corresponding to different occlusion relationships, and generates a floating effect of the object to be floated based on the multiple layers to be processed. Since this embodiment takes into account the occlusion relationship in the image to be processed and generates a floating effect of the object to be floated based on the layers to be processed with different occlusion relationships, the object to be floated in the animated image or video after the floating processing can float in an interlaced manner by layer based on a certain occlusion relationship. Thus, without the need for manual operation, the floating effect of some objects in a static image is achieved, and the display effect of the image is made more realistic and vivid, with a stronger sense of layering and space, and the flexibility and fun of image application are also improved.
[0056] FIG3 is a flow chart showing another image processing method according to some embodiments. This embodiment describes a process of generating a floating effect of an object to be floated, including the following steps: 301 - 303 .
[0057] As shown in FIG3 , in step 301 , the grid corresponding to each layer to be processed is obtained to obtain a multi-layer grid.
[0058] In some embodiments, the area corresponding to each layer to be processed may be gridded to obtain a multi-layer grid. Specifically, the area corresponding to each layer to be processed may be obtained separately, and the area corresponding to each layer to be processed may be gridded to obtain a grid corresponding to each layer to be processed.
[0059] In some embodiments, the area corresponding to the object to be fluttered can be vertically divided into multiple sub-areas, each of which can be a fluttering unit. A gridding process can also be performed based on the multiple sub-areas. For example, if the object to be fluttered is a person's hair and the reference object is a face, the person's hair can be divided into multiple hair bundles. Then, a preset algorithm (such as a triangulation algorithm) can be used to grid each hair bundle, with the hair bundle as the unit, to obtain a grid corresponding to each hair bundle. For example, multiple points can be randomly selected in the area corresponding to the hair bundle, and the selected multiple points can be connected using a preset algorithm to generate a grid composed of multiple triangles.
[0060] Next, multiple first hair bundles within the region corresponding to the first to-be-treated layer can be determined, and multiple second hair bundles within the region corresponding to the second to-be-treated layer can be determined. A layer of meshes corresponding to the first to-be-treated layer can then be formed from the multiple meshes corresponding to the multiple first hair bundles, while a layer of meshes corresponding to the second to-be-treated layer can be formed from the multiple meshes corresponding to the multiple second hair bundles. Furthermore, a preset algorithm can be used to grid the entire hair region to obtain a layer of meshes corresponding to the third to-be-treated layer.
[0061] In step 302, information on the occlusion relationship corresponding to each to-be-processed layer is obtained, and in step 303, a floating effect of the to-be-floating object is generated based on the information on the multiple layers of grids and the occlusion relationship.
[0062] In some embodiments, multiple anchor points for constraining the fluttering of the object to be fluttered can be determined, and based on the multiple anchor points, each layer of grid is processed for a fluttering effect to obtain the fluttering data corresponding to each layer of grid. Specifically, first, the anchor points for the object to be fluttered can be determined. The anchor points for the object to be fluttered can include a first anchor point for fixing the object to be fluttered and a second anchor point for controlling the fluttering of the object to be fluttered. In the case where the area corresponding to the object to be fluttered is divided into multiple sub-areas, the anchor points corresponding to each sub-area can also be determined. The anchor points corresponding to any sub-area can include a third anchor point for fixing the sub-area and a fourth anchor point for controlling the fluttering of the sub-area.
[0063] Among them, for any sub-region, the highest point corresponding to the sub-region and the midline passing through the highest point can be determined, wherein 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. This embodiment does not limit the method for determining the midline. The highest point can be determined as the third anchor point for fixing the sub-region, and the points on the midline equidistantly selected according to the preset distance are determined as the fourth anchor point for controlling the movement of the sub-region.
[0064] For the object to be floated, key points of a reference object can be detected. Based on these key points, a fixed boundary line for securing the object to be floated can be determined. Points covered by the object to be floated from this fixed boundary line are selected as first anchor points for securing the object to be floated. For example, if the object to be floated is a person's hair and the reference object is a face, facial key points can be determined. Based on these key points, a forehead contour boundary line for securing the hair can be determined. Points covered by the hair from this forehead contour boundary line are selected as first anchor points for the entire hair. Furthermore, multiple points can be randomly selected from multiple fourth anchor points used to control the motion of the sub-region as second anchor points for controlling the movement of the object to be floated.
[0065] In some embodiments, after determining multiple anchor points, the corresponding trajectory points for each anchor point can be determined based on the desired floating effect. For the first anchor point used to fix the floating object and the third anchor point used to fix the sub-region, their corresponding trajectory points are fixed points. For the second anchor point used to control the floating of the floating object and the fourth anchor point used to control the floating of the sub-region, 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 multiple images to be generated is determined.
[0066] In some embodiments, the floating data corresponding to each layer of grid can be determined based on preset constraints (for example, the constraints can indicate the distance relationship between the anchor point and other points in the area, etc.) and the position points of each anchor point in each frame of the image. The floating data corresponding to any layer of grid can include the grid area information corresponding to the layer of grid. Finally, based on the information of the above-mentioned occlusion relationship, the floating data corresponding to each layer of grid can be occluded, and the pixel value of each pixel point in each frame of the image to be generated can be determined based on the pixel value of each pixel point in the image to be processed and the data after occlusion processing, so as to perform rendering processing and obtain multiple frames of images. The multiple frames of images can constitute a moving picture or video. If the multiple frames of images are displayed, the floating effect of the object to be floated can be displayed.
[0067] Since this embodiment generates the floating effect of the object to be floated through the information of the grid corresponding to each layer to be processed and the occlusion relationship corresponding to each layer to be processed, the floating effect of the object to be floated in the animated image or video after the floating processing can be made more realistic by staggered floating in layers based on certain occlusion relationships, further improving the floating effect of the object to be floated in the animated image or video after the floating processing.
[0068] 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.
[0069] Corresponding to the aforementioned image processing method embodiment, the present disclosure also provides an embodiment of an image processing device.
[0070] As shown in FIG4 , FIG4 is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure. The apparatus may include: an acquisition module 401 , a determination module 402 , a layering module 403 and a generation module 404 .
[0071] The acquisition module 401 is used to acquire an image to be processed, where the image to be processed includes an object to be moved.
[0072] The determination module 402 is configured to determine the object to be moved and the reference object in the image to be processed.
[0073] The layering module 403 is configured to determine a plurality of layers to be processed based on the object to be floated and the reference object, wherein different layers to be processed correspond to different occlusion relationships.
[0074] The generating module 404 is configured to generate a floating effect of the object to be floated based on the multiple layers to be processed.
[0075] In some embodiments, the multiple layers to be processed may include a first layer to be processed and a second layer to be processed, wherein the layering module 403 is configured to: determine the area where the object to be floated overlaps with the reference object as the area corresponding to the first layer to be processed; and determine the area in the object to be floated that does not overlap with the reference object as the area corresponding to the second layer to be processed.
[0076] In some embodiments, the multiple layers to be processed may further include a third layer to be processed, wherein the layering module 403 is further configured to: determine the area corresponding to the object to be fluttered as the area corresponding to the third layer to be processed.
[0077] In some embodiments, different layers to be processed correspond to different occlusion relationships, including: the first layer to be processed has occlusion on the reference object, the second layer to be processed, and the third layer to be processed; the second layer to be processed has occlusion on the third layer to be processed; and the reference object has occlusion on the third layer to be processed.
[0078] In some implementations, the generation module 404 may include: a first acquisition submodule, a second acquisition submodule, and a generation submodule (not shown in the figure).
[0079] The first acquisition submodule is used to acquire the grid corresponding to each layer to be processed to obtain a multi-layer grid.
[0080] The second acquisition submodule is used to obtain the occlusion relationship information corresponding to each layer to be processed.
[0081] The generation submodule is used to generate the floating effect of the object to be floated based on the information of the multi-layer grid and the occlusion relationship.
[0082] In some embodiments, the first acquisition submodule is configured to: perform gridding processing on the area corresponding to each layer to be processed to obtain a multi-layer grid.
[0083] In some embodiments, the generation submodule is configured to: perform floating effect processing on each layer of grid to obtain floating data corresponding to each layer of grid; based on the above-mentioned occlusion relationship information, perform occlusion processing on the floating data corresponding to each layer of grid to obtain multiple frames of images for displaying the floating effect.
[0084] 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.
[0085] Figure 5 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure. As shown in Figure 5, 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).
[0086] 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.
[0087] 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.
[0088] 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.
[0089] Figure 6 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 6 is only an example and does not impose any restrictions on the functions and scope of use of the embodiments of the present disclosure.
[0090] As shown in FIG6 , 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.
[0091] 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 FIG6 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.
[0092] 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.
[0093] Figure 7 is a schematic diagram of a storage medium provided in some embodiments of the present disclosure. For example, as shown in Figure 7, 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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, comprising: Acquire an image to be processed, wherein the image to be processed includes an object to be moved; Determining the object to be moved and a reference object in the image to be processed; Based on the object to be floated and the reference object, determining a plurality of layers to be processed, wherein different layers to be processed correspond to different occlusion relationships; Based on the multiple layers to be processed, a fluttering effect of the object to be fluttered is generated.
2. The image processing method according to claim 1, wherein: The multiple layers to be processed include a first layer to be processed and a second layer to be processed, and the determining the multiple layers to be processed based on the object to be floated and the reference object includes: Determine an area where the object to be floated overlaps with the reference object as an area corresponding to the first layer to be processed; An area of the object to be floated that does not overlap with the reference object is determined as an area corresponding to the second layer to be processed.
3. The image processing method according to claim 2, wherein: The plurality of layers to be processed further include a third layer to be processed, and the determining of the plurality of layers to be processed based on the object to be floated and the reference object further includes: The area corresponding to the object to be floated is determined as the area corresponding to the third layer to be processed.
4. The image processing method according to claim 3, wherein: The different layers to be processed correspond to different occlusion relationships, including: the first layer to be processed occludes the reference object, the second layer to be processed and the third layer to be processed; the second layer to be processed occludes the third layer to be processed; the reference object occludes the third layer to be processed.
5. The image processing method according to any one of claims 1 to 4, wherein: The generating the floating effect of the object to be floated based on the multiple layers to be processed includes: Obtaining the grid corresponding to each of the layers to be processed to obtain a multi-layer grid; Obtaining information about the occlusion relationship corresponding to each of the layers to be processed; Based on the information of the multi-layer grids and the occlusion relationship, a floating effect of the object to be floated is generated.
6. The image processing method according to claim 5, wherein: The obtaining of the grid corresponding to each of the layers to be processed to obtain the multi-layer grid includes: performing gridding processing on the area corresponding to each of the layers to be processed to obtain the multi-layer grid.
7. The image processing method according to claim 5 or 6, wherein: The generating the floating effect of the object to be floated based on the information of the multi-layer grid and the occlusion relationship comprises: Performing floating effect processing on the grids of each layer to obtain floating data corresponding to the grids of each layer; Based on the information of the occlusion relationship, occlusion processing is performed on the floating data corresponding to each layer of the grid to obtain multiple frames of images for displaying the floating effect.
8. The image processing method according to claim 7, wherein: The fluttering effect processing is performed on each layer of the grids to obtain fluttering data corresponding to each layer of the grids, including: Determining a plurality of anchor points for constraining the floating of the object to be floated; According to the fluttering effect, determining the trajectory point corresponding to each anchor point; Determine the position of each anchor point in each frame of the multiple frames of images to be generated according to the trajectory information corresponding to each anchor point; According to the preset constraints and the position points of each anchor point in each frame image, the floating data corresponding to each layer of grid is determined.
9. The image processing method according to claim 8, wherein: The multiple anchor points include a first anchor point for fixing the object to be floated and a second anchor point for controlling the floating of the object to be floated. When the area corresponding to the object to be floated is divided into multiple sub-areas, the multiple anchor points also include an anchor point corresponding to each sub-area, and the anchor point corresponding to each sub-area includes a third anchor point for fixing the sub-area and a fourth anchor point for controlling the floating of the sub-area.
10. An image processing device, comprising: An acquisition module, used for acquiring an image to be processed; The image to be processed includes an object to be moved; A determination module, used for determining the object to be moved and the reference object in the image to be processed; A layering module, used to determine a plurality of layers to be processed based on the object to be floated and the reference object; wherein different layers to be processed correspond to different occlusion relationships; A generating module is used to generate a fluttering effect of the object to be fluttered based on the multiple layers to be processed.
11. 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 9.
12. 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 9 is implemented.
13. 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 9.
14. 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 9.
Citation Information
Patent Citations
Image deformation method and device, electronic equipment and storage medium
CN114693515A
Image processing method and device and electronic equipment
CN116168123A
Special effect generation method and apparatus, electronic device and storage medium
WO2023020239A1
