Image processing method and device, electronic equipment and storage medium
By identifying the overlapping area of the target real-life object and the liquid special-effect object, determining the center area of the superimposed ripple and rendering preset ripple effect, the problems of poor superimposed rendering effect and poor stability in the prior art are solved, and the more Real and efficient special effects rendering.
Patent Information
- Application Number
- CN202310982098.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-04
- Publication Date
- 2025-02-18
AI Technical Summary
现有技术在使用水特效工具进行人像与水面叠加时,渲染效果较差,稳定性不佳,容易出现抖动问题,并且实时抠图消耗性能较大。
By identifying the overlapping area between the target real-life object and the liquid special-effect object, determining the center area of the superimposed ripple, and rendering the preset ripple effect, the interactive effect between the target real-life object and the liquid surface is achieved.
It improves the authenticity and effect of special effects rendering, reduces performance consumption, improves stability, and avoids the need for real-time cutouts.
Smart Images

Figure CN119478163A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an image processing method, device, electronic device and storage medium. Background Art
[0002] At present, users can easily use special effects tools to produce content to improve richness. For example, water special effects tools can be used to render water surface effects in the captured scene images. In related technologies, the main method is to identify portraits and cut out the images, and then add the foreground and background water surface materials of the cut out portraits to achieve the superimposed effect of the portraits and the water surface. However, this method has poor superimposed rendering effects and poor stability, and is prone to jitter problems. The performance consumption required for real-time cutouts is also relatively high. Summary of the invention
[0003] The embodiments of the present disclosure at least provide an image processing method, device, electronic device and storage medium.
[0004] In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
[0005] In response to a triggering operation on a liquid special effect object, acquiring a captured image to be processed;
[0006] Determine a real scene image region representing a target real scene object in the image to be processed, and determine a liquid rendering region of the liquid special effect object in the image to be processed;
[0007] In response to a partial area of the real scene image area being located in the liquid rendering area, determining an overlapping area between the real scene image area and the liquid rendering area, and determining a superimposed ripple central area from the overlapping area;
[0008] According to the central area of the superimposed ripples, a preset ripple effect rendering is performed to obtain a first target special effect image.
[0009] In a second aspect, the present disclosure also provides an image processing device, including:
[0010] An acquisition module, configured to acquire the captured image to be processed in response to a trigger operation on the liquid special effect object;
[0011] A first determination module is used to determine a real scene image region representing a target real scene object in the image to be processed, and to determine a liquid rendering region of the liquid special effect object in the image to be processed;
[0012] A second determining module is configured to determine an overlapping area between the real scene image area and the liquid rendering area in response to a partial area of the real scene image area being located in the liquid rendering area, and determine a superimposed ripple central area from the overlapping area;
[0013] A rendering module is used to perform preset ripple effect rendering according to the central area of the superimposed ripples to obtain a first target special effect image.
[0014] In a third aspect, an optional implementation of the present disclosure further provides an electronic device, comprising a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the above-mentioned first aspect, or the steps in any possible implementation of the first aspect.
[0015] In a fourth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-mentioned first aspect, or the steps in any possible implementation of the first aspect.
[0016] In the embodiment of the present disclosure, in response to a trigger operation for a liquid special effect object, a captured image to be processed is acquired; a real scene image region representing a target real scene object in the image to be processed is determined, and a liquid rendering region of the liquid special effect object in the image to be processed is determined; in response to a partial region of the real scene image region being located in the liquid rendering region, an overlapping region of the real scene image region and the liquid rendering region is determined, and a superimposed ripple center region is determined from the overlapping region; a preset ripple effect rendering is performed according to the superimposed ripple center region to obtain a first target special effect image, so that the target special effect image is identified. When some areas of the real-scene image area of the target real-scene object and the liquid rendering area of the liquid special effect object overlap, that is, when the target real-scene object interacts with the liquid special effect object, the ripple effect can be superimposed in the superimposed ripple center area below the liquid surface, so that when the target real-scene object extends out of or into the liquid surface, there will be a more obvious ripple effect in some areas of the liquid surface, which improves the authenticity and special effect of the special effect rendering, and by determining the overlapping area and the superimposed ripple center area, etc., the ripple effect superimposed rendering does not require real-time clipping, which reduces performance consumption and improves stability.
[0017] For a description of the effects of the above-mentioned image processing device, electronic device, and computer-readable storage medium, please refer to the description of the above-mentioned image processing method, which will not be repeated here.
[0018] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure.
[0019] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0021] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure is shown;
[0022] Figure 2 An example diagram of the central area of superimposed ripples provided by an embodiment of the present disclosure is shown;
[0023] Figure 3 A flowchart of another image processing method provided by an embodiment of the present disclosure is shown;
[0024] Figure 4 An effect example diagram of an image processing method provided by an embodiment of the present disclosure is shown;
[0025] Figure 5 A schematic diagram of an image processing device provided by an embodiment of the present disclosure is shown;
[0026] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0027] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0028] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0029] Through research, it is found that users can use special effects tools to produce content to improve the richness, for example, shooting short videos with special effects. There are also various types of special effects tools, such as flooding special effects, water out of the water special effects, etc. In related technologies, it is mainly through identifying the portrait and cutting out, and then adding the foreground and background water surface materials of the cut-out portrait to achieve the superimposed effect of the portrait and the water surface. However, this method has poor stability and depends on the stability of portrait recognition. It is prone to jitter problems, and the performance consumption required for real-time cutout is also large. In addition, in related technologies, the real-scene objects identified on the water surface can be subtracted from the water surface according to the rendered water surface height. This will result in an obvious cutout area on the water surface, and the rendering effect of the combination of the water surface and the real scene is poor.
[0030] Based on the above research, the present disclosure provides an image processing method. When using a liquid special effects object, in response to a trigger operation on the liquid special effects object, a captured image to be processed is obtained; a real-scene image area representing a target real-scene object in the image to be processed is determined, and a liquid rendering area of the liquid special effects object in the image to be processed is determined; in response to a partial area of the real-scene image area being located in the liquid rendering area, an overlapping area between the real-scene image area and the liquid rendering area is determined, and a superimposed ripple center area is determined from the overlapping area, and then a preset ripple effect rendering is performed according to the superimposed ripple center area to obtain a first target special effects image. In this way, by identifying the real-scene image area of the target real-scene object and the rendered liquid rendering area, a ripple effect is superimposed in the overlapping area below the liquid surface, so that when the target real-scene object extends out or extends into the liquid surface, there will be a more obvious ripple effect in a partial area of the liquid surface, which is more realistic and improves the rendering effect of the combination position of the target real-scene object and the liquid surface.
[0031] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0032] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0033] To facilitate understanding of this embodiment, an image processing method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the image processing method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities, and the electronic device includes, for example: a terminal device or a server or other processing device. The terminal device can be a user equipment (UE), a mobile device, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., wherein a personal digital assistant is a handheld electronic device with some functions of an electronic computer, which can be used to manage personal information, browse the Internet, send and receive emails, etc. It is generally not equipped with a keyboard and can also be called a handheld computer. In some possible implementations, the image processing method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0034] The image processing method provided by the embodiment of the present disclosure is described below by taking the execution subject as a terminal device as an example.
[0035] See also Figure 1 FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure, the method comprising:
[0036] S101: In response to a triggering operation on a liquid special effect object, a captured image to be processed is acquired.
[0037] In the embodiments of the present disclosure, it is mainly aimed at the scenes of applying special effects in images or videos, and in the embodiments of the present disclosure, the captured image to be processed can be a pre-captured image or a current frame image of the video. For example, when shooting a short video, the user can choose to use some special effects to enrich the video content, and then the captured video frame image can be combined with the special effects in real time and the special effects after the combination can be displayed.
[0038] Among them, the liquid special effect object represents special effects with liquid characteristics, such as water, magma, etc., which is not limited in the embodiments of the present disclosure.
[0039] S102: Determine a real scene image region representing a target real scene object in the image to be processed, and determine a liquid rendering region of a liquid special effect object in the image to be processed.
[0040] For step S102, the present disclosure provides possible implementations, including:
[0041] 1) Determine a real scene image region representing a target real scene object in the image to be processed.
[0042] In the embodiment of the present disclosure, the captured image to be processed may generally include the real-scene object and the background actually captured, and special effects processing is generally performed on the real-scene object actually captured. Therefore, in the embodiment of the present disclosure, the position of the real-scene object in the image to be processed may be determined first, and specifically, the real-scene image area representing the target real-scene object in the image to be processed is determined, including: obtaining depth information of the image to be processed; according to the depth information, determining a plurality of pixel points that meet the depth judgment condition from the image to be processed, and determining the area formed by the determined plurality of pixel points as the real-scene image area representing the target real-scene object.
[0043] Among them, the depth information of the image to be processed can characterize the distance between each point in the captured scene and the shooting device. The depth information can be constrained to divide the real-scene image area actually shot. For example, when a user shoots a short video of his hand, the user's hand is the target real-scene object, and the real-scene image area of the hand in the currently shot image to be processed can be identified.
[0044] In this way, in the embodiment of the present disclosure, the method of image depth recognition is adopted to identify the target real scene object, which is simpler to implement, reduces resource consumption, is more stable, and improves performance.
[0045] 2) Determine the liquid rendering area of the liquid special effect object in the image to be processed.
[0046] In the embodiments of the present disclosure, the liquid rendering area refers to the area position where the liquid special effect object needs to be rendered in the image to be processed. For example, in one possible implementation, the liquid level height can be preset, so that the area included in the distance from the bottom of the image to be processed to the liquid level height is determined as the liquid rendering area of the liquid special effect object.
[0047] For another example, in another possible implementation, the regional position of the liquid special effect object in the image to be processed may be pre-set or selected by the user, and then the liquid rendering area of the liquid special effect object may be determined according to the set or selected regional position.
[0048] Of course, in the embodiment of the present disclosure, the liquid rendering area may also be determined by other methods, which are not limited in the embodiment of the present disclosure.
[0049] S103: In response to a partial area of the real scene image area being located in the liquid rendering area, determining an overlapping area between the real scene image area and the liquid rendering area, and determining a superimposed ripple central area from the overlapping area.
[0050] In the embodiment of the present disclosure, executing step S103 may include:
[0051] 1) In response to a partial area of the real scene image area being located in the liquid rendering area, determining an overlapping area between the real scene image area and the liquid rendering area.
[0052] In the disclosed embodiments, part of the real-scene image area is located in the liquid rendering area, which may indicate that the target real-scene object extends out of the page from being completely below the liquid surface, or that the target real-scene object enters below the liquid surface from other positions. The disclosed embodiments are mainly aimed at this situation. Due to the liquid characteristics that the liquid special effects object should have, the position where the target real-scene object and the liquid surface are combined should have a more obvious and realistic special effects effect.
[0053] Therefore, in the embodiment of the present disclosure, when it is detected that part of the real-scene image area is located in the liquid rendering area, the overlapping area is determined. For example, the liquid special effect object is water, and the target real-scene object is a hand. At the beginning, the hand is completely in the water, and the real-scene image area of the hand completely overlaps with the liquid rendering area of the water. Then, when the user extends the hand out of the water, the hand and part of the water will overlap in the process. The overlapping area is the area where the hand is still in the water.
[0054] 2) Determine the center area of the superimposed ripples from the overlapping area.
[0055] In the embodiments of the present disclosure, several possible implementations are provided for determining the central area of the superimposed ripples from the overlapping areas:
[0056] In a possible implementation manner: determining the center area of the superimposed ripples from the overlapping area includes: according to the overlapping area and the preset pixel distance, starting from the liquid surface of the liquid rendering area to the preset pixel distance in the target direction, and determining the center area of the superimposed ripples from the overlapping area; wherein the target direction represents the direction from the liquid surface to the liquid rendering area.
[0057] In the embodiments of the present disclosure, considering that when the hand is extended or inserted into the water, stronger vibrations will not occur in the entire underwater area, therefore, in the embodiments of the present disclosure, ripples are not superimposed in all overlapping areas, but partial areas are determined from the overlapping areas to serve as the central area of the superimposed ripples. Preferably, the central area of the superimposed ripples may be a partial area close to the liquid surface, wherein the preset pixel distance may be pre-set based on experience and demand, and is not limited in the embodiments of the present disclosure.
[0058] Furthermore, in the embodiment of the present disclosure, the position of the liquid rendering area in the image to be processed is not limited. For example, if the liquid rendering area is in the left area of the image to be processed, the superimposed ripple center area can be a preset pixel distance from the liquid surface to the left boundary direction of the image to be processed.
[0059] In another possible implementation, determining the center area of the superimposed ripples from the overlapping area includes: determining the liquid level of the liquid rendering area; determining a first area at a preset pixel distance downward from the position of the liquid level in the image to be processed; and determining the center area of the superimposed ripples based on the overlapping position of the overlapping area and the first area.
[0060] For the more common water surface scene, the water is usually below the image to be processed. Therefore, in the embodiment of the present disclosure, for this scene, when determining the center area of the superimposed ripples, it can also be determined according to the liquid level. The area below the liquid level in the image to be processed is the liquid rendering area, and the part of the area below the liquid surface can be determined as the center area of the superimposed ripples.
[0061] For example, see Figure 2 As shown in FIG. 1 , an example diagram of the central area of the superimposed ripples in the embodiment of the present disclosure is shown. The depth recognition is performed on the image to be processed. According to the depth information, the pixel points with different depth information values in the image to be processed can be distinguished, such as Figure 2 As shown, taking the target real scene object as a person as an example, Figure 2 (1) is the image to be processed. After selecting the liquid special effects object, depth recognition is performed based on the depth information of the image to be processed. Figure 2 (2) shows the depth recognition result. It should be noted that Figure 2 Only the depth recognition result of the liquid rendering area below the liquid surface is shown in FIG. Different color areas represent different depth information, and the lighter the color, the closer it is to the shooting device, and the darker the color, the farther it is. The nearest area is identified as the real scene image area, and then from the overlapping area of the real scene image area and the liquid rendering area, the part below the liquid surface and the overlapping position of the real scene image area are determined as the center area of the superimposed ripples, such as Figure 2 As shown in (3), the center area of the superimposed ripples is the white area displayed in the liquid rendering area.
[0062] The liquid level height may be pre-set or dynamically adjusted by the user according to demand, which is not limited in the embodiments of the present disclosure.
[0063] S104: Rendering a preset ripple effect according to the superimposed ripple center area to obtain a first target special effect image.
[0064] In the disclosed embodiment, after selecting a liquid special effects object, the image to be processed is superimposed on the liquid special effects object, and the liquid special effects object is rendered in the image to be processed, including other areas in the liquid rendering area except a preset range of the central area of the superimposed ripples, and rendering of the central area of the superimposed ripples.
[0065] Specifically, the present disclosure provides possible implementations: 1) Based on the first amplitude strength, non-annular ripple rendering is performed with the first amplitude strength in other areas of the liquid rendering area except for a preset range of the superimposed ripple center area.
[0066] 2) Different implementation methods are also provided for rendering the central area of the superimposed ripples. In one implementation method, a preset ripple effect rendering is performed based on the central area of the superimposed ripples, including: based on preset ripple parameters, non-annular ripple rendering is performed within a preset range of the central area of the superimposed ripples, wherein the preset ripple parameters include at least a second amplitude intensity, and the second amplitude intensity is greater than the first amplitude intensity.
[0067] In this embodiment, stronger ripples can be rendered in the central area of the superimposed ripples than in other areas. In this way, when the target real-scene object extends into or out of the liquid surface, a stronger ripple oscillation effect can be seen in the part close to the liquid surface, thereby improving the authenticity of the special effects.
[0068] In one embodiment, a preset ripple effect rendering is performed based on the central area of the superimposed ripples, including: rendering non-annular ripples within a preset range of the central area of the superimposed ripples based on the second amplitude intensity in the preset ripple parameters, and superimposing and rendering annular ripples.
[0069] In this embodiment, not only stronger ripples are superimposed in the central area of the superimposed ripples, but also annular ripples can be superimposed, so that the ripples can be presented to spread from the partially overlapping position of the target real-scene object and the liquid surface to the surrounding ripples, thereby further enhancing the authenticity and effect of the special effects.
[0070] It should also be noted that the preset ripple parameters of the superimposed ripples may include not only amplitude intensity, but also frequency, speed, etc., wherein the amplitude intensity represents the ripple vibration intensity, the frequency represents the density of the ripples, and the speed may represent the diffusion or change speed of the ripples, which is not limited in the specific embodiments of the present disclosure.
[0071] In the disclosed embodiment, in response to a trigger operation for a liquid special effects object, a captured image to be processed is acquired; a real-scene image region representing a target real-scene object in the image to be processed is determined, and a liquid rendering region of the liquid special effects object in the image to be processed is determined; in response to a partial region of the real-scene image region being located in the liquid rendering region, an overlapping region between the real-scene image region and the liquid rendering region is determined, and a superimposed ripple center region is determined from the overlapping region; a preset ripple effect rendering is performed according to the superimposed ripple center region to obtain a first target special effects image. In this way, when using the liquid special effects object, the position where the target real-scene object and the liquid special effects object are combined can be identified, and the superimposed ripple center region can be determined to perform a superimposed preset ripple effect. This can achieve a more realistic special effects effect when the target real-scene object and the liquid special effects object are interactively combined, and also improve performance.
[0072] Furthermore, in order to improve the liquid surface rendering effect and authenticity and avoid the obvious sense of cutout, liquid surface feathering can be added in the embodiment of the present disclosure, and a possible implementation method is specifically provided to determine the first liquid surface position associated with the overlapping area, and perform edge feathering processing on the first liquid surface position according to the edge feathering method; or, according to the edge feathering method, perform edge feathering processing on the second liquid surface position associated with the liquid rendering area.
[0073] That is, in the embodiment of the present disclosure, the liquid surface can also be feathered, and when feathering, the edge feathering treatment can be performed on the liquid surface of the entire liquid rendering area to enhance the softness of the overall liquid surface. In addition, since the position where the target real-scene object is combined with the liquid rendering area is in the overlapping area, the combination of different objects may be more likely to be mismatched. Therefore, in the embodiment of the present disclosure, only the edge feathering treatment can be performed on the liquid surface in the overlapping area. In this way, the liquid surface boundary can be made softer and more blurred, so that the gap between the target real-scene object and the liquid surface is not too obvious, thereby improving the rendering effect.
[0074] Furthermore, in an embodiment of the present disclosure, after executing the above-mentioned step S104, if the target real-scene object has not moved, taking into account the actual scenes of entering or exiting the water, the water will vibrate more strongly mainly at the moment of entering or exiting the water. After a period of no movement, the water will gradually return to its original calmness. Therefore, in view of this, the present disclosure also provides a possible implementation method. In response to the fact that the overlapping area has not changed after the preset ripple effect rendering exceeds the preset time length or frame interval, for the frame image corresponding to the image to be processed that exceeds the preset time length or frame interval, a third amplitude intensity is determined according to the second amplitude intensity and the attenuation coefficient, and non-annular ripple rendering is performed with the third amplitude intensity within a preset range of the central area of the superimposed ripples until the second amplitude intensity drops to the first amplitude intensity; and / or, for the frame image corresponding to the image to be processed that exceeds the preset time length or frame interval, the annular ripple is not superimposed and rendered.
[0075] In addition, in an embodiment of the present disclosure, in a scene where the main target real-scene object exits or enters the liquid surface, different ripple effects can be rendered for other areas of the superimposed ripple center area and the liquid rendering area to enhance the display of special effects at the junction. If the target real-scene object is completely in the liquid rendering area, different effects can be rendered regardless of the area. Specifically, the present disclosure provides a possible implementation method. In response to the real-scene image area being located in the liquid rendering area, according to the first amplitude intensity, non-annular ripple rendering is performed in the liquid rendering area with the first amplitude intensity to obtain a second target special effect image.
[0076] The following uses a specific application scenario to illustrate the image processing method in the embodiment of the present disclosure, taking the liquid special effect object as a water special effect as an example, see Figure 3 FIG. 1 is a flowchart of another image processing method provided by an embodiment of the present disclosure, the method comprising:
[0077] S301: In a liquid rendering area in an image to be processed, non-annular ripple rendering is performed with a first amplitude intensity.
[0078] For example, at the beginning of shooting a short video, for example, the target real-scene object has not been identified yet, or the target real-scene object does not overlap with part of the liquid rendering area, or for example, the target real-scene object is completely located in the liquid rendering area. At this time, ordinary water ripples can be rendered, that is, non-annular ripples are rendered with a first amplitude intensity, so that when the target real-scene object does not touch the water surface, an ordinary water surface flow effect can be presented.
[0079] S302: Determine the real scene image area of the target real scene object and the liquid rendering area of the liquid special effect object, and determine the overlapping area of the real scene image area and the liquid rendering area, and determine the first area at a preset pixel distance below the liquid level according to the liquid level, and determine the superimposed ripple center area according to the overlapping position of the overlapping area and the first area.
[0080] In the disclosed embodiment, an image depth recognition method may be used to identify a target real scene object from an image to be processed. When the target real scene object is identified and the target real scene object partially overlaps with a water rendering area, it may be indicated that the target real scene object is emerging from the water or is about to extend into the water. In this case, the overlapping position may be determined and a specific superimposed ripple center area may be determined.
[0081] S303: According to the second amplitude strength in the preset ripple parameters, non-annular ripple rendering is performed within a preset range of the central area of the superimposed ripples, and annular ripples are superimposed and rendered.
[0082] Among them, the second amplitude intensity is greater than the first amplitude intensity. In this way, higher intensity ripples and annular ripples are superimposed in the central area of the superimposed ripples, which can make obvious water wave oscillations appear at the location where the target real scene object and the water surface are combined, thereby achieving a more realistic special effects.
[0083] For example, taking the target real scene object as a hand, and for the short video shooting scene, the image to be processed is a video frame image, refer to Figure 4 As shown in FIG. 1 , it is an effect example diagram of an image processing method in an embodiment of the present disclosure. Figure 4 In (1), the hand is completely in the water, and ordinary water ripples are rendered, where Figure 4 The adjustment controls on the left side of the image to be processed are used to adjust the water surface height. Figure 4 As shown in (2), at the position where the hand meets the water surface, water ripples and circular ripples with higher intensity can be presented, simulating the water wave vibration and ripple effects when the hand passes through the water surface in a real scene, which is more realistic and improves the rendering effect.
[0084] S304: performing edge feathering processing on the first liquid level position associated with the overlapping area according to an edge feathering method.
[0085] In the disclosed embodiment, a real-scene image area of a target real-scene object and a liquid rendering area of a liquid special effect object are identified, and when a portion of the real-scene image area is located in the liquid rendering area, an overlapping area is determined, and a central area of a superimposed ripple is determined from the overlapping area, and then ripples and annular ripples with higher intensity can be superimposed in the central area of the superimposed ripples, so that an interactive combination position of the target real-scene object and the liquid special effect object can be achieved, a more realistic rendering effect can be achieved, performance can be improved, and user experience can be enhanced.
[0086] It should be noted that the effect example diagram in the embodiment of the present disclosure is only a possible example and does not limit the embodiment of the present disclosure.
[0087] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0088] Based on the same inventive concept, an image processing device corresponding to the image processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0089] Reference Figure 5 FIG. 1 is a schematic diagram of an image processing device provided by an embodiment of the present disclosure, the device comprising:
[0090] An acquisition module 51 is used to acquire the captured image to be processed in response to a trigger operation on a liquid special effect object;
[0091] A first determining module 52 is used to determine a real scene image region representing a target real scene object in the image to be processed, and to determine a liquid rendering region of the liquid special effect object in the image to be processed;
[0092] A second determining module 53 is configured to determine an overlapping area between the real scene image area and the liquid rendering area in response to a partial area of the real scene image area being located in the liquid rendering area, and determine a superimposed ripple central area from the overlapping area;
[0093] The rendering module 54 is used to perform preset ripple effect rendering according to the superimposed ripple center area to obtain a first target special effect image.
[0094] In an optional implementation manner, when determining the real scene image region representing the target real scene object in the image to be processed, the first determining module 52 is used to:
[0095] Obtaining depth information of the image to be processed;
[0096] According to the depth information, a plurality of pixel points meeting the depth judgment condition are determined from the image to be processed, and an area formed by the determined plurality of pixel points is determined as a real scene image area representing a target real scene object.
[0097] In an optional implementation manner, when determining the superimposed ripple center area from the overlapping area, the second determination module 53 is used to:
[0098] According to the overlapping area and the preset pixel distance, the central area of the superimposed ripples is determined from the overlapping area by starting from the liquid surface of the liquid rendering area and moving toward the preset pixel distance in the target direction; wherein the target direction represents the direction from the liquid surface to the liquid rendering area.
[0099] In an optional implementation manner, when determining the superimposed ripple center area from the overlapping area, the second determination module 53 is used to:
[0100] Determining a liquid level height of the liquid rendering area;
[0101] Determine a first area in the image to be processed that is a preset pixel distance downward from the position of the liquid level;
[0102] The central area of the superimposed ripples is determined according to the overlapping position of the overlapping area and the first area.
[0103] In an optional implementation, the rendering module 54 is further configured to: perform non-annular ripple rendering with the first amplitude intensity in other areas of the liquid rendering area except for a preset range of the superimposed ripple center area according to the first amplitude intensity;
[0104] When performing preset ripple effect rendering according to the superimposed ripple center area, the rendering module 54 is used to:
[0105] According to preset ripple parameters, non-annular ripple rendering is performed within a preset range of the central area of the superimposed ripples, wherein the preset ripple parameters include at least a second amplitude intensity, and the second amplitude intensity is greater than the first amplitude intensity; or, according to the second amplitude intensity in the preset ripple parameters, non-annular ripple rendering is performed within a preset range of the central area of the superimposed ripples, and annular ripples are superimposed and rendered.
[0106] In an optional implementation, the method further includes an edge feathering processing module 55, which is used to:
[0107] Determine a first liquid level position associated with the overlapping area, and perform edge feathering processing on the first liquid level position according to an edge feathering method; or, perform edge feathering processing on a second liquid level position associated with the liquid rendering area according to the edge feathering method.
[0108] In an optional implementation manner, the rendering module 54 is further configured to:
[0109] In response to the fact that all the real scene image areas are located in the liquid rendering area, non-annular ripple rendering is performed in the liquid rendering area with the first amplitude intensity according to the first amplitude intensity to obtain a second target special effect image.
[0110] In an optional implementation manner, the rendering module 54 is further configured to:
[0111] In response to the overlapping area not changing after the preset ripple effect rendering exceeds the preset time length or frame interval, for the frame image corresponding to the image to be processed that exceeds the preset time length or frame interval, a third amplitude intensity is determined based on the second amplitude intensity and the attenuation coefficient, and non-annular ripple rendering is performed with the third amplitude intensity within a preset range of the central area of the superimposed ripple until the second amplitude intensity drops to the first amplitude intensity; and / or, for the frame image corresponding to the image to be processed that exceeds the preset time length or frame interval, the annular ripple is not superimposed and rendered.
[0112] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0113] The present disclosure also provides an electronic device, such as Figure 6 FIG. 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, including:
[0114] A processor 61 and a memory 62; the memory 62 stores machine-readable instructions executable by the processor 61, and the processor 61 is used to execute the machine-readable instructions stored in the memory 62. When the machine-readable instructions are executed by the processor 61, the processor 61 is used to perform the following steps:
[0115] In response to a triggering operation on the liquid special effect object, acquiring the captured image to be processed;
[0116] Determine a real scene image region representing a target real scene object in the image to be processed, and determine a liquid rendering region of the liquid special effect object in the image to be processed;
[0117] In response to a partial area of the real scene image area being located in the liquid rendering area, determining an overlapping area between the real scene image area and the liquid rendering area, and determining a superimposed ripple central area from the overlapping area;
[0118] According to the central area of the superimposed ripples, a preset ripple effect rendering is performed to obtain a first target special effect image.
[0119] In an optional implementation manner, when determining the real scene image area representing the target real scene object in the image to be processed, the processor 61 is used to:
[0120] Obtaining depth information of the image to be processed;
[0121] According to the depth information, a plurality of pixel points meeting the depth judgment condition are determined from the image to be processed, and an area formed by the determined plurality of pixel points is determined as a real scene image area representing a target real scene object.
[0122] In an optional implementation manner, when determining the superimposed ripple center area from the overlapping area, the processor 61 is used to:
[0123] According to the overlapping area and the preset pixel distance, the central area of the superimposed ripples is determined from the overlapping area by starting from the liquid surface of the liquid rendering area and moving toward the preset pixel distance in the target direction; wherein the target direction represents the direction from the liquid surface to the liquid rendering area.
[0124] In an optional implementation manner, when determining the superimposed ripple center area from the overlapping area, the processor 61 is used to:
[0125] Determining a liquid level height of the liquid rendering area;
[0126] Determine a first area in the image to be processed that is a preset pixel distance downward from the position of the liquid level;
[0127] The central area of the superimposed ripples is determined according to the overlapping position of the overlapping area and the first area.
[0128] In an optional implementation, the processor 61 is further configured to: perform non-annular ripple rendering with the first amplitude intensity in other areas of the liquid rendering area except for a preset range of the superimposed ripple center area according to the first amplitude intensity;
[0129] When rendering the preset ripple effect according to the central area of the superimposed ripples, the processor 61 is used to: render non-annular ripples within a preset range of the central area of the superimposed ripples according to preset ripple parameters, wherein the preset ripple parameters include at least a second amplitude strength, and the second amplitude strength is greater than the first amplitude strength; or, render non-annular ripples within a preset range of the central area of the superimposed ripples according to the second amplitude strength in the preset ripple parameters, and superimpose rendering of annular ripples.
[0130] In an optional embodiment, the processor 61 is also used to: determine a first liquid level position associated with the overlapping area, and perform edge feathering processing on the first liquid level position according to an edge feathering method; or, perform edge feathering processing on a second liquid level position associated with the liquid rendering area according to the edge feathering method.
[0131] In an optional embodiment, the processor 61 is also used for: in response to the real scene image areas being all located in the liquid rendering area, according to the first amplitude intensity, performing non-annular ripple rendering in the liquid rendering area with the first amplitude intensity to obtain a second target special effect image.
[0132] In an optional embodiment, the processor 61 is also used for: in response to the overlapping area not changing after the preset ripple effect rendering exceeds the preset time length or frame interval, determining a third amplitude intensity according to the second amplitude intensity and the attenuation coefficient for the frame image corresponding to the image to be processed that exceeds the preset time length or frame interval, and performing non-annular ripple rendering with the third amplitude intensity within a preset range of the central area of the superimposed ripple until the second amplitude intensity drops to the first amplitude intensity; and / or, not superimposing and rendering the annular ripple for the frame image corresponding to the image to be processed that exceeds the preset time length or frame interval.
[0133] The above-mentioned memory 62 includes internal memory 621 and external memory 622; the memory 621 here is also called internal memory, which is used to temporarily store the calculation data in the processor 61, as well as the data exchanged with the external memory 622 such as the hard disk. The processor 61 exchanges data with the external memory 622 through the internal memory 621.
[0134] The specific execution process of the above instructions can refer to the steps of the image processing method described in the embodiment of the present disclosure, which will not be repeated here.
[0135] The present disclosure also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0136] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the image processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0137] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0138] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0141] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0142] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: include: In response to a triggering operation on a liquid special effect object, acquiring a captured image to be processed; Determine a real scene image region representing a target real scene object in the image to be processed, and determine a liquid rendering region of the liquid special effect object in the image to be processed; In response to a partial area of the real scene image area being located in the liquid rendering area, determining an overlapping area between the real scene image area and the liquid rendering area, and determining a superimposed ripple central area from the overlapping area; According to the central area of the superimposed ripples, a preset ripple effect rendering is performed to obtain a first target special effect image.
2. The method according to claim 1, characterized in that The determining of a real scene image region representing a target real scene object in the image to be processed includes: Obtaining depth information of the image to be processed; According to the depth information, a plurality of pixel points meeting the depth judgment condition are determined from the image to be processed, and an area formed by the determined plurality of pixel points is determined as a real scene image area representing a target real scene object.
3. The method according to claim 1 or 2, characterized in that: The step of determining the central area of the superimposed ripples from the overlapping area comprises: According to the overlapping area and the preset pixel distance, starting from the liquid surface of the liquid rendering area and moving toward the target direction by the preset pixel distance, the central area of the superimposed ripples is determined from the overlapping area; The target direction indicates a direction from the liquid surface to the liquid rendering area.
4. The method according to claim 1 or 2, characterized in that: The step of determining the central area of the superimposed ripples from the overlapping area comprises: Determining a liquid level height of the liquid rendering area; Determine a first area in the image to be processed that is a preset pixel distance downward from the position of the liquid level; The central area of the superimposed ripples is determined according to the overlapping position of the overlapping area and the first area.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: According to the first amplitude strength, in the liquid rendering area, except for the preset range of the superimposed ripple center area, non-annular ripple rendering is performed with the first amplitude strength; Then, performing preset ripple effect rendering according to the superimposed ripple center area includes: According to preset ripple parameters, non-annular ripple rendering is performed within a preset range of the central area of the superimposed ripples, wherein the preset ripple parameters at least include a second amplitude strength, and the second amplitude strength is greater than the first amplitude strength; or According to the second amplitude strength in the preset ripple parameters, non-annular ripple rendering is performed within a preset range of the central area of the superimposed ripples, and annular ripples are superimposed and rendered.
6. The method according to claim 5, characterized in that The method further comprises: determining a first liquid level position associated with the overlapping region, and performing edge feathering processing on the first liquid level position according to an edge feathering method; or, According to the edge feathering method, edge feathering processing is performed on the second liquid surface position associated with the liquid rendering area.
7. The method according to claim 1, characterized in that The method further comprises: In response to the fact that all the real scene image areas are located in the liquid rendering area, non-annular ripple rendering is performed in the liquid rendering area with the first amplitude intensity according to the first amplitude intensity to obtain a second target special effect image.
8. The method according to claim 5, characterized in that The method further comprises: In response to the overlapping area not changing after the preset ripple effect rendering exceeds the preset time length or frame interval, for the frame image corresponding to the to-be-processed image exceeding the preset time length or frame interval, determining a third amplitude intensity according to the second amplitude intensity and the attenuation coefficient, and performing non-annular ripple rendering with the third amplitude intensity within a preset range of the central area of the superimposed ripple until the second amplitude intensity drops to the first amplitude intensity; And / or, for the frame image corresponding to the image to be processed that exceeds a preset time length or frame interval, the annular ripple is not superimposed and rendered.
9. An image processing device, characterized in that: include: An acquisition module, configured to acquire the captured image to be processed in response to a trigger operation on the liquid special effect object; A first determination module is used to determine a real scene image region representing a target real scene object in the image to be processed, and to determine a liquid rendering region of the liquid special effect object in the image to be processed; A second determining module is configured to determine an overlapping area between the real scene image area and the liquid rendering area in response to a partial area of the real scene image area being located in the liquid rendering area, and determine a superimposed ripple central area from the overlapping area; A rendering module is used to perform preset ripple effect rendering according to the central area of the superimposed ripples to obtain a first target special effect image.
10. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor performs the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.