Image Processing Method, Apparatus, Electronic Device, and Storage Medium

By using directed distance field images in image processing, the collision between fluid particles and the subject to collision is solved, and the problem of high time-consuming collision processing and unfavorable GPU parallel processing in the prior art is solved, and efficient fluid collision processing and display effects are achieved.

CN115082285BActive Publication Date: 2025-05-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210681394.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-15
Publication Date
2025-05-27
Estimated Expiration
2042-06-15

AI Technical Summary

Technical Problem

In the prior art, collision algorithms take a lot of time to process collision bodies of complex shapes and are not easy to parallelize the graphics processor (GPU), resulting in slow processing speed and poor display effect.

Method used

By acquiring the target scene image and determining the corresponding directed distance field image, the closest distance between each pixel point from the subject to be collided, quickly detect whether the fluid particles collide with the subject to be collided, and determine the target display information of the fluid particles based on the detection results.

Benefits of technology

It realizes rapid simulation of the collision effect between the fluid particles and the subject to collision, improves the speed of fluid collision processing, supports the parallel processing of each pixel point in the target scene image, and ensures the display effect of fluid collision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082285B_ABST
    Figure CN115082285B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose an image processing method, apparatus, electronic device, and storage medium. The method includes: obtaining a target scene image to be processed, and determining a corresponding oriented distance field image for the target scene image, where the target scene image includes at least one object to be collided; when it is detected that the target scene image includes fluid particles, detecting whether the fluid particles collide with the object to be collided according to the oriented distance field image; determining target display information of the fluid particles according to the detection result, and displaying the fluid particles based on the target display information. The technical solution of the embodiments of the present disclosure can quickly detect the collision between the fluid particles and the object to be collided through the oriented distance field image corresponding to the target scene image. Moreover, this detection method is not limited by the shape of the object to be collided, and also supports parallel processing of each pixel point in the target scene image by the GPU, improving the collision processing speed and ensuring the display effect of fluid collision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of image processing technologies, and in particular, to an image processing method, apparatus, electronic device, and storage medium. Background Art

[0002] In order to enrich the display effects in a video, some dynamic elements, such as fluid particles, are often designed. The display manner of the dynamic elements in the video often presents a fixed display effect according to a pre-set manner. This makes the display of the video lack interest.

[0003] In related technologies, in order to increase the interest of the dynamic display, some collision scenarios are added to the fluid particles. However, the related collision algorithms have the problem of relatively long processing time when performing collision processing operations. Especially for collision bodies with complex shapes, the impact on the processing speed is more prominent, and the time consumption is serious. Moreover, the related collision algorithms are not easy to be parallelized by a graphics processing unit (GPU). Summary of the Invention

[0004] Embodiments of the present disclosure provide an image processing method, apparatus, electronic device, and storage medium to achieve...

[0005] In a first aspect, an image processing method is provided according to an embodiment of the present disclosure. The method includes:

[0006] Obtain a target scene image to be processed, and determine a corresponding signed distance field image for the target scene image, where at least one object to be collided is included in the target scene image;

[0007] When the target scene image includes an object to be collided and fluid particles, detect whether the fluid particles collide with the object to be collided according to the signed distance field image;

[0008] Determine target display information of the fluid particles according to the detection result, and display the fluid particles based on the target display information.

[0009] In a second aspect, an image processing apparatus is further provided according to an embodiment of the present disclosure. The apparatus includes:

[0010] An image acquisition module, configured to obtain a target scene image to be processed, and determine a corresponding signed distance field image for the target scene image, where at least one object to be collided is included in the target scene image;

[0011] A collision detection module, configured to detect whether the fluid particles collide with the object to be collided according to the signed distance field image when the target scene image includes an object to be collided and fluid particles;

[0012] A particle display module, configured to determine target display information of the fluid particles according to the detection result, and display the fluid particles based on the target display information.

[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes:

[0014] One or more processors;

[0015] A storage device, configured to store one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method provided in any embodiment of the present disclosure.

[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the image processing method provided in any embodiment of the present disclosure is implemented.

[0018] The technical solution of the embodiment of the present disclosure can calculate the closest distance between each pixel point in the target scene image and the object to be collided by obtaining a target scene image including at least one object to be collided to be processed and determining a corresponding directed distance field image. Then, when it is detected that the target scene image includes fluid particles, it can quickly detect whether the fluid particles collide with the object to be collided according to the directed distance field image, and this detection method is applicable to collision bodies of various shapes. Finally, the target display information of the fluid particles is determined according to the detection result, and the fluid particles are displayed based on the target display information, which can simulate the image display effect after collision, solve the technical problems that the related collision algorithms consume a lot of time in collision processing operations and are not conducive to GPU parallel processing, realize the simulation of the collision effect between the fluid particles and the object to be collided, and is not limited by the shape of the object to be collided, and also supports the parallel processing of each pixel point in the target scene image by the GPU, improving the fluid collision processing speed and ensuring the display effect of fluid collision. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present disclosure, the following briefly introduces the drawings required for describing the embodiments. Obviously, the introduced drawings are only the drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.

[0020] Figure 1Flow schematic diagram of an image processing method provided by an embodiment of the present disclosure;

[0021] Figure 2 Flow schematic diagram of another image processing method provided by an embodiment of the present disclosure;

[0022] Figure 3 Flow schematic diagram of another image processing method provided by an embodiment of the present disclosure;

[0023] Figure 4 Flow schematic diagram of yet another image processing method provided by an embodiment of the present disclosure;

[0024] Figure 5 Flow schematic diagram of an optional example of an image processing method provided by an embodiment of the present disclosure;

[0025] Figure 6 Structural schematic diagram of an image processing apparatus provided by an embodiment of the present disclosure;

[0026] Figure 7 Structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0028] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0029] The term "including" and its variants used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

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

[0031] It should be noted that the modifications of "one" and "multiple" mentioned in this disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information. It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, 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.

[0033] For example, when responding to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message.

[0034] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0035] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manners of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manners of the present disclosure.

[0036] It can be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.

[0037] Figure 1 It is a schematic flowchart of an image processing method provided for Embodiment 1 of the present disclosure. This embodiment is applicable to the situation of simulating the collision of fluid particles in a video or an animation. This method can be executed by an image processing device, and this device can be implemented by software and / or hardware, and can be configured in a terminal and / or a server to implement the image processing method in the embodiments of the present disclosure.

[0038] As Figure 1 shown, the method of this embodiment may specifically include:

[0039] S110. Obtain a target scene image to be processed, and determine a corresponding signed distance field image for the target scene image.

[0040] Among them, the target scene image can be the obtained scene image to be processed. Among them, the signed distance field image can be understood as an image used to represent the pixel value of each pixel point in the target scene image for representing the minimum signed distance between the pixel point and the object to be collided with.

[0041] Specifically, a target scene image containing the object to be collided with can be obtained, and the minimum signed distance between each pixel point in the target scene image and the boundary of the object to be collided with can be determined respectively to obtain the signed distance field image. In other words, the generation of the signed distance field is achieved by searching for the distance between each pixel and the boundary of the object to be collided with one by one, and recording the closest distance as the distance value of the pixel, that is, the generation of the signed distance field texture is completed. The pixel value of each pixel point in the signed distance field image is the distance value of the closest distance between the pixel point and the boundary of the object to be collided with.

[0042] Optionally, obtaining the target scene image to be processed includes: obtaining each frame image in the target video as the target scene image to be processed. The advantage of such a setting is that each frame image in the target video can be processed to respond in a timely manner to the information changes in the target video, so as to achieve the effect of fine processing of the target video.

[0043] Optionally, obtaining the target scene image to be processed includes: obtaining the target scene image to be processed in the target video according to a preset scene image acquisition rule. Among them, the scene image acquisition rule includes but is not limited to randomly obtaining images in the target video, obtaining a preset first number of images in the target video every other preset number of image frames, an image acquisition method determined based on a preset frame rate and a preset number of images to be acquired, or obtaining a preset second number of images in the target video every other preset time period, etc. It should be noted that the scene image acquisition rule in the embodiments of the present disclosure can be set according to actual situations and is not specifically limited herein.

[0044] Optionally, obtaining a target scene image to be processed includes: when it is detected that at least one main body to be collided in the target video changes, obtaining a target image frame in which the main body to be collided in the target video changes, and using the target image frame as the target scene image to be processed. In an application scenario where it is necessary to detect whether the main body to be collided and fluid particles in the target scene image collide, since the signed distance field image is determined based on the main body to be collided in the target scene image, when the main body to be collided in the target scene image does not change, the signed distance field image corresponding to the target scene image generally does not change either. The advantage of adopting this technical solution is that it can specifically detect the scene image where a collision may occur, without repeatedly performing the operation of generating the signed distance field image on the image where the main body to be collided does not change, reducing the computational amount of image processing, and thus improving the collision processing efficiency.

[0045] Among them, the main body to be collided can be understood as the main body in the target scene image that can collide with fluid particles. In other words, the main body to be collided can be understood as an obstacle that may hinder the movement of fluid particles preset in the target scene image. In the embodiments of the present disclosure, the main body to be collided can be set according to actual needs, and parameters such as its specific form or material are not limited. For example, the main body to be collided can be a stone, flowers and plants, a barrier, a building wall, wind, and other fluid particles, etc. It can be understood that the number of main bodies to be collided in the target scene image can be one or more. The shape and size of the main body to be collided can be generated according to user needs and / or server instructions.

[0046] Among them, the target video can be understood as the video to be detected. For example, it can be video materials displayed on a terminal device, and can include but is not limited to fluid particle videos, dynamic interaction games, and dynamic simulation tests, etc. The target image frame can be understood as the image after the main body to be collided in the target video changes. It should be noted that the target image frame can be the first image after the main body to be collided in the target video changes, or an image determined by combining the moment when it is detected that the main body to be collided in the target video changes and the preset scene image acquisition rule. The change of the main body to be collided can be that the user changes the information of the shape, size, and / or hue of the main body to be collided by sending an instruction or triggering a control. The change of the main body to be collided can be that the server makes corresponding changes to the main body to be collided when reaching the corresponding timestamp according to the preset operation instruction.

[0047] Specifically, when the server receives an instruction from the client to change the object to be collided or / and the server executes an operation instruction to change the object to be collided preset in advance, it indicates that the object to be collided has changed. Then the server randomly selects any frame of video image after the change of the object to be collided as the target video frame. And this video frame is determined as the target scene image to be processed to determine the corresponding directed distance field image.

[0048] S120. When the target scene image includes the object to be collided and fluid particles, determine whether the fluid particles collide with the object to be collided according to the directed distance field image.

[0049] Among them, the fluid particles can refer to the dynamic elements in the video image. The shape of the fluid particles can be a regular shape or an irregular shape. Exemplarily, the fluid particles can be fluid particles simulating natural phenomena in nature, such as particles simulating snow, rain, mudslides or magma and other scenes. Specifically, the fluid particles can include circular or water-drop-shaped liquid particles or snowflake particles, etc.

[0050] Optionally, the display method of the fluid particles can include: displaying in the target scene image according to a preset display method, or, in response to a particle display trigger operation input for the target scene image, displaying the fluid particles in the target scene image.

[0051] Specifically, when it is detected that the user triggers the release of the fluid particle control, or, executes the fluid particle release program, it indicates that fluid particles appear in the target video. When the target scene image includes the object to be collided and fluid particles, detect whether the fluid particles collide with the object to be collided according to the directed distance field image corresponding to the target scene image.

[0052] Exemplarily, detecting whether the fluid particles collide with the object to be collided according to the directed distance field image includes: determining the first position information of the fluid particles in the target scene image, and determining the target distance value corresponding to the first position information in the directed distance field image; detecting whether the fluid particles collide with the object to be collided according to the target distance value and a preset distance threshold.

[0053] Among them, the first position information can be understood as the particle display position of the fluid particles in the specific image of the target scene. The target distance value can be understood as the distance value determined according to the directed distance field image and the first position information. This target distance value is used to represent the closest distance between the current display position of the fluid particles and the object to be collided. The preset distance threshold can be a critical value for determining collision with the object to be collided.

[0054] As described above, the directed distance field image can reflect the nearest distance between each pixel point in the target scene image and the object to be collided with. When the target scene image is obtained, the position where the fluid particle is displayed in the target scene image can be determined, that is, the first position information. Furthermore, according to the directed distance field image, the nearest distance between the pixel point at the first position information and the boundary of the object to be collided with can be determined, thereby determining whether a collision has occurred between the fluid particle and the object to be collided with. Specifically, if the nearest distance is greater than the preset distance threshold, it can be determined that the fluid particle has not collided with the object to be collided with. If the nearest distance is less than or equal to the preset distance threshold, it can be determined that the fluid particle has collided with the object to be collided with.

[0055] S130. Determine the target display information of the fluid particle according to the detection result, and display the fluid particle based on the target display information.

[0056] Among them, the target display information can be understood as the display style that the fluid particle should present in the target video determined according to the detection result, such as: sliding, falling, floating, bouncing, etc. It should be noted that the target display information includes the display information when no collision occurs and the display information after a collision occurs.

[0057] Specifically, when the fluid particle does not collide with the object to be collided with, the fluid particle can continue to move along the current motion trajectory and at the current speed. At this time, the target display information of the fluid particle can be falling in the air, sliding along the wall, etc. When the fluid particle collides with the object to be collided with, the target display information of the fluid particle can be bouncing after impact, floating in the wind, floating on the water surface, etc. After the server determines the target display information of the fluid particle, it displays the next-stage motion display style of the fluid particle in the target video according to the corresponding target display information.

[0058] Optionally, determining the target display information of the fluid particle according to the detection result can be to determine the target display information of the fluid particle according to the detection result and the initial display information of the fluid particle. Specifically, if the fluid particle collides with the object to be collided with, obtain the previous frame image adjacent to the target scene image, and determine the target display information of the fluid particle according to the position information of the fluid particle in the previous frame image and the position information in the target scene image; if the fluid particle collides with the object to be collided with, determine the target display information of the fluid particle by using the initial display information of the fluid particle.

[0059] Optionally, in the embodiments of the present disclosure, determining the position information of the fluid particle in the target scene image, that is, the collision position, specifically includes: determining the pixel point coordinates of the fluid particle, and calculating the unit normal vector of the boundary of the object to be collided at the collision position according to the pixel point coordinates; determining the position information of the fluid particle in the target scene image according to the pixel point coordinates, the minimum relative distance, the unit normal vector, and a preset collision distance threshold.

[0060] Among them, the initial display information can be understood as the display information of the fluid particle preset in the target scene image without collision. Exemplarily, the initial display information moves at a preset speed in a preset direction. For example, specifically, it can be controlled that the fluid particle is displayed in a free-fall motion from above the screen of the terminal device, where the mass of the fluid particle can be preset according to requirements. Further, the natural environment information that can act on the fluid particle can also be simulated, such as wind force, the resistance and friction of the object to be collided, etc.

[0061] Specifically, if a collision occurs between the fluid particle and the object to be collided, it is necessary to determine the display style of the fluid particle after the collision. The target display information of the fluid particle can be determined according to the initial display information of the fluid particle, the display information of the fluid particle in the previous frame image where the collision occurs, and the collision information. Exemplarily, the position of the fluid particle in the previous frame image where the collision occurs and the position of the fluid particle in the current frame image can be compared and analyzed to obtain information such as the angle, speed, and friction when the fluid particle collides with the object to be collided. Furthermore, according to the initial display information of the fluid particle, the display information of the fluid particle after the collision with the object to be collided is determined, and the fluid particle is displayed based on this display information.

[0062] Optionally, if no collision occurs between the fluid particle and the object to be collided, the fluid particle without collision is continuously displayed in the target display area according to the initial display information.

[0063] The technical solution of this embodiment can calculate the closest distance from each pixel point in the target scene image to the object to be collided by obtaining the target scene image to be processed including at least one object to be collided and determining the corresponding directed distance field image. Then, when it is detected that the target scene image includes fluid particles, it can quickly detect whether the fluid particles collide with the object to be collided according to the directed distance field image, and this detection method is applicable to collision bodies of various shapes. Finally, the target display information of the fluid particles is determined according to the detection result, and the fluid particles are displayed based on the target display information, which can simulate the image display effect after collision, solve the technical problems of time-consuming and unfavorable GPU parallel processing in the relevant collision algorithms during collision processing operations, realize the simulation of the collision effect between fluid particles and the object to be collided, and is not limited by the shape of the object to be collided. It also supports GPU parallel processing of each pixel point in the target scene image, improves the fluid collision processing speed, and ensures the display effect of fluid collision.

[0064] Figure 2 FIG. is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure. Based on any optional technical solution in the embodiment of the present disclosure, this embodiment details how to determine the directed distance field image corresponding to the target scene image. Optionally, determining the directed distance field image corresponding to the target scene image includes: performing binary processing on the target scene image according to the object to be collided in the target scene image to obtain a to-be-converted scene image corresponding to the target scene image; respectively calculating the minimum distance value corresponding to each pixel point in the to-be-converted scene image, and generating a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point. The specific implementation manner can refer to the detailed description of this technical solution. Among them, the same or corresponding technical terms as those in the above embodiment will not be elaborated here.

[0065] As Figure 2 shown, the method of this embodiment may specifically include

[0066] S210. Obtain the target scene image to be processed.

[0067] It can be understood that the obtained target scene image to be processed may or may not include the object to be collided. Optionally, if the target scene image includes the object to be collided, then execute S220; if the target scene image does not include the object to be collided, then obtain the next frame of the target scene image to be processed.

[0068] S220. Perform binary processing on the target scene image according to the object to be collided in the target scene image to obtain a to-be-converted scene image corresponding to the target scene image.

[0069] Among them, the binarization process can be understood as a processing method that converts the pixel values of the pixel points on the target scene image into two values. Typically, the pixel values of the target scene image can be converted into 0 or 255, or 0 or 1. That is, the entire target scene image can be presented with only black and white visual effects. The image to be transformed can be understood as the image obtained after the binarization process of the target scene image, and is used to distinguish the display area of the object to be collided and other areas except the object to be collided. The advantage of such a setting is that the specific position of the object to be collided can be clearly identified..

[0070] Specifically, after obtaining the target scene image, the pixel points belonging to the object to be collided in the target scene image can be set to a pixel value, and the pixel points belonging to the area except the object to be collided in the target scene image can be set to another pixel value, so as to obtain the image to be transformed corresponding to the target scene image.

[0071] S230. Calculate the minimum distance value corresponding to each pixel point in the image to be transformed respectively, and generate a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

[0072] Among them, the minimum distance value can refer to the distance between each pixel point in the image to be transformed and the nearest pixel point in the object to be collided. It can be understood that the minimum distance value between the pixel points in the object to be collided and the object to be collided is 0. In the embodiments of the present disclosure, the minimum distance value is the relative distance between the object to be collided in the image to be transformed and the area except the object to be collided.

[0073] In the embodiments of the present disclosure, the minimum distance value corresponding to the pixel value of each pixel point in the area except the object to be collided is the distance between each pixel point in the area except the object to be collided and the boundary point of the object to be collided; the minimum distance value corresponding to the pixel value of each pixel point in the object to be collided is the distance between each pixel point of the object to be collided and the boundary point of the area except the object to be collided.

[0074] Optionally, the generating a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point includes: for each pixel point, normalizing the minimum distance value corresponding to the pixel point according to a preset distance threshold, a preset adjustment parameter, and the minimum distance value corresponding to the pixel point, to obtain the target distance value corresponding to the pixel point; generating a directed distance field image corresponding to the target scene image according to the target distance value corresponding to each pixel point.

[0075] Among them, the normalization process can refer to an operation of making various types of data at the same order of magnitude after data standardization processing on the minimum distance value corresponding to each pixel point. Generally, the normalization process is used to convert the minimum distance value corresponding to each pixel point into a value within a preset value range (for example, from 0 to 1). The preset adjustment parameter can be understood as a constant used to convert the minimum distance value corresponding to each pixel point into a value within the preset value range. The target distance value is the distance value after normalization processing.

[0076] Exemplarily, assume that the preset distance threshold is 0.5. Normalizing the minimum distance value corresponding to the pixel point according to the preset distance threshold, the preset adjustment parameter, and the minimum distance value corresponding to the pixel point includes: for the pixel points within the object to be collided with, sdf(x,y) = 0.5 - distance((x,y),P(x,y)) * scale, where sdf(x,y) represents the minimum distance value corresponding to the normalized pixel point, P(x,y) represents the position of the boundary point of the object to be collided with that is closest to the position of the pixel point (x,y) located in the area other than the object to be collided with, distance((x,y),P(x,y)) represents the distance value between the pixel point (x,y) and the boundary point P(x,y) of the object to be collided with, and scale is the preset adjustment parameter. For the pixel points in the area other than the object to be collided with, sdf(x,y) = 0.5 + distance((x,y),P(x,y)) * scale. It should be noted that if the calculated sdf(x,y) is greater than 1, then sdf(x,y) is set to 1; if the calculated sdf(x,y) is less than 0, then sdf(x,y) is set to 0. After normalizing the minimum distance value corresponding to the pixel point, data storage is more convenient.

[0077] In the embodiments of the present disclosure, the minimum distance value corresponding to each pixel point and the identification information of the pixel point can be stored in a database so as to obtain the minimum distance between the corresponding pixel point and the object to be collided with at any time. Among them, the identification information of the pixel point can be the position information or number of the pixel point, etc., which can distinguish different pixel points. Here, the specific content or form of the identification information is not specifically limited.

[0078] S240. When the target scene image includes an object to be collided with and fluid particles, determine whether the fluid particles collide with the object to be collided with according to the signed distance field image.

[0079] Exemplarily, determining whether a fluid particle collides with a subject to be collided with can specifically be as follows. Assume the position of the fluid particle is (x, y), sdf(x, y) represents the sdf value at the position of the fluid particle (after normalization, it is between 0 and 1), and the preset collision distance threshold is 0.5. If sdf(x, y) < 0.5, it is considered that the fluid particle collides with the subject to be collided with. If it is determined that the fluid particle does not collide with the subject to be collided with.

[0080] S250. Determine the target display information of the fluid particle according to the detection result, and display the fluid particle based on the target display information.

[0081] The technical solution of this embodiment, by performing binary processing on the target scene image according to the subject to be collided with in the target scene image, obtains a to-be-converted scene image corresponding to the target scene image, can simply and quickly generate a signed distance field image, thereby improving the fluid collision processing speed and ensuring the display effect of fluid movement.

[0082] Figure 3 As a schematic flowchart of another image processing method provided by an embodiment of the present disclosure, on the basis of any optional technical solution in the embodiment of the present disclosure, optionally, the calculating the minimum distance value corresponding to each pixel point in the to-be-converted scene image respectively includes: taking the subject to be collided with as the obstacle area of the to-be-converted scene image, and calculating the minimum distance value of each pixel point in the image area except the subject to be collided with in the to-be-converted scene image from the obstacle area respectively; taking the image area except the subject to be collided with in the to-be-converted scene image as the obstacle area, and calculating the minimum distance value of each pixel point of the subject to be collided with from the obstacle area respectively. The specific implementation manner can refer to the detailed description of this technical solution. Among them, the same or corresponding technical terms as those in the above embodiment will not be described again here.

[0083] As Figure 3 shown, the method of this embodiment can specifically include:

[0084] S310. Obtain a target scene image to be processed.

[0085] S320. Perform binary processing on the target scene image according to the subject to be collided with in the target scene image, and obtain a to-be-converted scene image corresponding to the target scene image.

[0086] S330. Take the subject to be collided with as the obstacle area of the to-be-converted scene image, and calculate the minimum distance value of each pixel point in the image area except the subject to be collided with in the to-be-converted scene image from the obstacle area respectively.

[0087] Among them, the obstacle area can be understood as the area that may affect the movement of fluid particles. Specifically, after obtaining the image of the scene to be transformed, the boundary points of the object to be collided in the image of the scene to be transformed can be determined. For each pixel point outside the object to be collided, the distance value between the pixel point and the boundary point of the object to be collided that is closest to the pixel point is calculated as the minimum distance value of the pixel point from the obstacle area.

[0088] Optionally, the distances between each pixel point and each boundary point of the obstacle are calculated respectively, and the minimum distance value among the calculated distance values is used as the minimum distance value of the pixel point from the obstacle area.

[0089] S340: Take the image area in the image of the scene to be transformed except the object to be collided as the obstacle area, and calculate the minimum distance value of each pixel point of the object to be collided from the obstacle area respectively.

[0090] Among them, the obstacle area can refer to the area except the object to be collided. It can be understood that the obstacle area and the non-obstacle area are relative. Optionally, the boundary of the object to be collided can still be used as the boundary of the obstacle area. Then, for each pixel point inside the object to be collided, the minimum distance between the pixel point and the obstacle area is calculated.

[0091] Similarly, the distances between each pixel point and each boundary point of the obstacle are calculated respectively, and the minimum distance value among the calculated distance values is used as the minimum distance value of the pixel point from the obstacle area.

[0092] S350: Generate a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

[0093] Specifically, for each pixel point in the target scene image, the minimum distance value corresponding to the pixel point is used as the pixel value of the pixel point, and a directed distance field map corresponding to the target scene image is obtained.

[0094] S360: When the target scene image includes the object to be collided and fluid particles, determine whether the fluid particles collide with the object to be collided according to the directed distance field image.

[0095] S370: Determine the target display information of the fluid particles according to the detection result, and display the fluid particles based on the target display information.

[0096] In the technical solution of this embodiment, by using the object to be collided as the obstacle area of the scene image to be transformed, the minimum distance value from each pixel point in the image area except the object to be collided in the scene image to be transformed to the obstacle area is calculated respectively. Then, the image area except the object to be collided in the scene image to be transformed is used as the obstacle area, and the minimum distance value from each pixel point of the object to be collided to the obstacle area is calculated respectively, so that the information contained in the directed distance field image is richer, providing data support for implementing more complex and changeable application scenarios, helping to improve the fluid collision processing speed, and ensuring the display effect of fluid collision.

[0097] Figure 4 It is a flowchart of another image processing method provided by an embodiment of the present disclosure. Based on any optional technical solution in the embodiment of the present disclosure, this embodiment details how to quickly calculate the minimum distance value corresponding to each pixel point in the scene image to be transformed. Optionally, the step of using the object to be collided as the obstacle area of the scene image to be transformed and calculating the minimum distance value corresponding to each pixel point in the image area except the object to be collided in the scene image to be transformed respectively includes: setting the pixel coordinates of each pixel point in the object to be collided as the coordinates of the pixel point itself, and setting the pixel coordinates of each pixel point in the image area except the object to be collided in the scene image to be transformed as infinity; for each pixel point in the image area except the object to be collided in the scene image to be transformed, iteratively update the pixel coordinates of the pixel point to be calculated according to the pixel coordinates of the neighboring pixel points corresponding to the pixel point to be calculated to obtain the target pixel coordinates of the pixel point to be calculated; calculate the minimum distance value from each pixel point in the image area except the object to be collided in the scene image to be transformed to the boundary of the object to be collided according to the target pixel coordinates of each pixel point. The specific implementation manner can refer to the detailed description of this technical solution. Among them, the same or corresponding technical terms as those in the above embodiment will not be elaborated here.

[0098] As Figure 4 shown, the method of this embodiment may specifically include:

[0099] S410. Obtain a target scene image to be processed.

[0100] S420. Perform binarization processing on the target scene image according to the object to be collided in the target scene image to obtain a scene image to be transformed corresponding to the target scene image.

[0101] S430. Set the pixel coordinates of each pixel point in the to-be-collided object as the coordinates of the pixel point itself. For the pixel points in the image area other than the to-be-collided object in the to-be-converted scene image, regard them as to-be-updated pixel points. Take the pixel coordinates of the boundary pixel point closest to the to-be-collided object among the to-be-updated pixel points as the to-be-updated coordinates, and set the to-be-updated coordinates to infinity.

[0102] Among them, the coordinates of the pixel point itself can be understood as the original coordinates of the pixel point in the preset coordinate system. The to-be-updated pixel points can be understood as the pixel points for which the minimum distance value is to be calculated. The to-be-updated coordinates can be understood as the coordinates of the to-be-updated pixel points.

[0103] In the embodiments of the present disclosure, when calculating the minimum distance value between each pixel point in the image area other than the to-be-collided object and the to-be-collided object, regard the to-be-collided object as an obstacle. At this time, there is no need to calculate the minimum distance value for the pixel points within the to-be-collided object, and mark their coordinates as the coordinates of the pixel point itself. Update the minimum distance value for each pixel point in the image area other than the to-be-collided object. Before the calculation starts, the coordinate position of the to-be-updated pixel point can be set to infinity as the initial value of the coordinate position of the to-be-updated pixel point.

[0104] S440. For each to-be-updated pixel point in the to-be-converted scene image, iteratively update the to-be-updated pixel coordinates of the to-be-updated pixel point according to the to-be-updated pixel coordinates of the neighboring pixel points corresponding to the to-be-updated pixel point, so as to obtain the target pixel coordinates of the to-be-updated pixel point.

[0105] Among them, the target pixel coordinates can be understood as the coordinates of the obstacle boundary point closest to the to-be-updated pixel point. The neighboring pixel points corresponding to the to-be-updated pixel point can be understood as the pixel points adjacent to the to-be-updated pixel point in the display position in the to-be-converted scene image. It should be noted that the neighboring pixel points corresponding to the to-be-updated pixel point can include but are not limited to the pixel points immediately adjacent to the to-be-updated pixel point in the display position. It can be understood that adjacent is a relative concept and depends on the reference pixel point. In the embodiments of the present disclosure, the selection method of the neighboring pixel points is not limited. For example, it can be the 4-neighborhood or 8-neighborhood pixel points of the to-be-updated pixel point. The distance between the to-be-updated pixel point and the neighboring pixel points is not limited here either. Exemplarily, in the embodiments of the present disclosure, the neighboring pixel points corresponding to the to-be-updated pixel point can especially be the pixel points closest to the to-be-updated pixel point in the preset direction and whose to-be-updated pixel coordinates have been updated.

[0106] Specifically, the neighborhood pixel points corresponding to the pixel point to be updated can be determined, and then, according to the pixel coordinates to be updated corresponding to the neighborhood pixel points, the pixel coordinates to be updated of the pixel point to be updated are iteratively updated. That is, the pixel coordinates to be updated of the pixel point to be updated are gradually updated to the coordinates of the obstacle boundary point closest to the pixel point to be updated.

[0107] Exemplarily, the step of iteratively updating the pixel coordinates to be updated of the pixel point to be updated according to the pixel coordinates of the neighborhood pixel points corresponding to the pixel point to be updated to obtain the target pixel coordinates of the pixel point to be updated includes: in each iteration process, calculating the shortest distance from each neighborhood pixel point corresponding to the pixel point to be updated to the obstacle area and the shortest distance from the pixel point to be updated to the obstacle area respectively, and updating the pixel coordinates of the pixel point corresponding to the minimum value among the calculated shortest distances to the pixel coordinates to be updated.

[0108] Specifically, in the iterative process, by calculating the shortest distance between the neighborhood pixel points of the pixel point to be updated and the obstacle boundary respectively, the shortest distance from each neighborhood pixel point of the pixel point to be updated to the obstacle area can be obtained, as well as the shortest distance from the pixel point to be updated to the obstacle area. Comparing the shortest distances corresponding to each neighborhood pixel point and the shortest distance corresponding to the pixel point to be updated, and selecting the pixel coordinates of the shortest distance with the smallest value to update the pixel coordinates to be updated of the pixel point to be updated. That is, selecting the coordinates of the pixel point closest to the obstacle boundary as the pixel coordinates to be updated.

[0109] Exemplarily, before the step of iteratively updating the pixel coordinates to be updated according to the pixel coordinates of the neighborhood pixel points corresponding to the pixel point to be updated, it further includes: determining the target number of iterations of the pixel coordinates to be updated, so as to iteratively update the pixel coordinates to be updated according to the target number of iterations.

[0110] Among them, the target number of iterations can be understood as the number of times that the pixel point to be updated needs to be updated and iterated at least.

[0111] Optionally, determining the target number of iterations of the pixel coordinates to be updated includes: obtaining the upper limit value of the number of iterations preset corresponding to the pixel coordinates to be updated, and using the upper limit value of the number of iterations as the target number of iterations of the pixel coordinates to be updated. Among them, the upper limit value of the number of iterations can be set according to actual needs, and its specific value is not limited herein.

[0112] Optionally, determining the target number of iterations of the pixel coordinates to be updated includes: determining the target number of iterations of the pixel coordinates to be updated according to the distance between two adjacent pixel points in the scene image to be transformed and the number of pixel points.

[0113] Exemplarily, assume that the pixel coordinates to be updated of the pixel point to be updated are (x, y), and the pixel coordinates to be updated of the neighboring pixel points of the pixel point to be updated are (x + i, y + j). The number of pixels in the scene image to be transformed is N*N, where i and j can take values from the three values of -k, 0, and k. If the pixel point to be updated is updated iteratively with the least number of iterations, the value of k is selected in sequence as N / 2, N / 4, N / 8,..., 1, that is, k is halved each time until k = 1. For example, when N is 128, the value of k changes in sequence as 64, 32, 16, 8, 4, 2, 1, for a total of 7 iterations, that is, the target number of iterations is 7 times. The pixel point to be updated is updated iteratively according to the obtained target number of iterations. It should be noted that when the number of iterations is n, the maximum distance of the distance field diffusion is 2^n pixels. In practical applications, an appropriate number of iterations is selected according to the diffusion distance to ensure performance.

[0114] Optionally, before iteratively updating the pixel coordinates to be updated of the pixel point to be updated according to the pixel coordinates to be updated of the neighboring pixel points corresponding to the pixel point to be updated, it further includes: for each iterative update of the pixel coordinates of the pixel point to be updated, the neighboring pixel points corresponding to the pixel point to be updated at each iteration are respectively determined according to the pixel coordinates of the pixel point to be updated and a preset spacing adjustment step size.

[0115] Among them, the preset spacing adjustment step size can be understood as the distance between the neighboring pixel points and the pixel point to be updated set in advance. In other words, at each iteration, the interval value used to select the neighboring pixel points, that is, the value of k in the above example.

[0116] Specifically, after the pixel point to be updated is iteratively updated, the coordinate values of the neighboring pixel points of the pixel point to be updated will also change. The spacing of the neighboring pixel points can be gradually reduced through the updated pixel coordinate positions to determine the coordinate positions of the neighboring pixel points of the pixel point to be updated. The advantage of such a setting is that the minimum distance value can be calculated as soon as possible in a limited number of iterations to obtain a directed distance field image.

[0117] S450. Calculate the minimum distance value of each pixel point in the image area other than the object to be collided with in the scene image to be transformed from the boundary of the object to be collided with according to the target pixel coordinates of each pixel point.

[0118] Specifically, calculate the distance between the target pixel coordinates and the original pixel coordinates in the area other than the object to be collided with, and use the calculated distance as the minimum distance value between the pixel point and the object to be collided with.

[0119] S460. Take the image area other than the to-be-collided object in the to-be-transformed scene image as the obstacle area, and calculate the minimum distance value of each pixel point of the to-be-collided object from the obstacle area respectively.

[0120] Similarly, set the pixel coordinates of each pixel point in the image area other than the to-be-collided object in the to-be-transformed scene image as the coordinates of the pixel point itself, take each pixel point in the image area other than the to-be-collided object as the to-be-updated pixel point, take the pixel coordinates of the boundary pixel point closest to the image area other than the to-be-collided object in the to-be-transformed scene image as the to-be-updated coordinates, and set the to-be-updated coordinates to infinity; for each to-be-updated pixel point in the to-be-transformed scene image, iteratively update the to-be-updated pixel coordinates of the to-be-updated pixel point according to the to-be-updated pixel coordinates corresponding to the neighborhood pixel points corresponding to the to-be-updated pixel point to obtain the target pixel coordinates of the to-be-updated pixel point; calculate the minimum distance value of each pixel point in the image area other than the to-be-collided object in the to-be-transformed scene image from the boundary of the to-be-collided object according to the target pixel coordinates of each pixel point.

[0121] In the embodiments of the present disclosure, for the intermediate texture image generated during the iteration process, the ping-pong form can be adopted, that is, two textures A and B are used. In the first iteration, read A and write to B, and in the second iteration, read B and write to A until the iteration ends.

[0122] S470. Generate a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

[0123] S480. When the target scene image includes the to-be-collided object and fluid particles, determine whether the fluid particles collide with the to-be-collided object according to the directed distance field image.

[0124] S490. Determine the target display information of the fluid particles according to the detection result, and display the fluid particles based on the target display information.

[0125] Exemplarily, sampling the four pixel points above, below, left, and right of the to-be-updated pixel point can obtain the distance change on the surface. Furthermore, the unit normal vector of the boundary of the to-be-collided object at the collision position can be solved. After obtaining the unit normal vector, it is necessary to move the collided fluid particles in the reverse direction of the unit normal vector by a distance. The distance that the fluid particles move in the reverse direction of the normal unit vector is related to the preset collision intensity. The greater the preset collision intensity, the farther the reverse movement distance.

[0126] In the technical solution of this embodiment, by setting the pixel coordinates of each pixel point in the to-be-collided object as the coordinates of the pixel point itself, regarding each pixel point in the image area other than the to-be-collided object in the to-be-converted scene image as a to-be-updated pixel point, taking the pixel coordinates of the boundary pixel point closest to the to-be-collided object of the to-be-updated pixel point as the to-be-updated coordinates, and setting the to-be-updated coordinates to infinity, pixel coordinates can be assigned to each pixel point. Then, for each to-be-updated pixel point in the to-be-converted scene image, the to-be-updated pixel coordinates of the to-be-updated pixel point are iteratively updated according to the to-be-updated pixel coordinates corresponding to the neighboring pixel points corresponding to the to-be-updated pixel point, so as to obtain the target pixel coordinates of the to-be-updated pixel point, improving the fluid collision processing speed. Finally, according to the target pixel coordinates of each pixel point, the minimum distance value from each pixel point in the image area other than the to-be-collided object in the to-be-converted scene image to the boundary of the to-be-collided object is calculated, realizing the parallel processing of each pixel point in the target scene image, improving the fluid collision processing speed, and ensuring the display effect of the fluid collision.

[0127] Embodiment 5

[0128] Figure 5 It is a schematic flowchart of an optional example of an image processing method provided by an embodiment of the present disclosure. As an optional example of the above embodiment, the process is optimized on the basis of the above optional embodiments. As Figure 5 shown, the specific process of this method includes: initializing the positions and velocities of fluid particles to control the movement of the fluid particles with the positions and velocities, and updating the velocities and positions of the fluid particles, and rendering the fluid particles with updated information in the target scene image. During the display of the fluid particles, the constraint conditions corresponding to the fluid particles can also be determined to constrain the display of the fluid particles, so as to ensure the display effect of the fluid particles.

[0129] In this embodiment, a target scene image can be obtained, where the target scene image can be an image corresponding to a predefined scene, and the target scene image includes a to-be-collided object. Generate a directed distance field image for the obtained target scene image; further, determine whether the target scene image has changed. If so, obtain a new target scene image again and generate a new directed distance field; otherwise, it is possible to detect whether the fluid particles collide with the to-be-collided object by combining the current directed distance field image and the constraint conditions of the fluid particles. Further, according to the detection result of whether the fluid particles collide with the to-be-collided object, the fluid particles can be processed in combination with the constraint conditions to obtain the target display information of the fluid particles, and the fluid particles are displayed in the target scene image based on the target display information.

[0130] In the technical solution of this embodiment, for limited computing resources, in a scenario where the directed distance field image does not change frequently, the form of generating a directed distance field image for each frame of the target video can be modified to an event-triggered form generated when the scenario changes, reducing computing resource consumption. It can be understood that in different scenarios, different collision field precisions are required, and the resolution of the directed distance field image can be appropriately reduced without losing a large amount of details, greatly optimizing the performance.

[0131] Figure 6 FIG. 4 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present disclosure. The image processing apparatus provided by this embodiment can be implemented by software and / or hardware, and can be configured in a terminal and / or a server to implement the image processing method in the embodiment of the present disclosure. The apparatus may specifically include: an image acquisition module 610, a collision detection module 620, and a particle display module 630.

[0132] Among them, the image acquisition module 610 is configured to acquire a target scene image to be processed and determine a directed distance field image corresponding to the target scene image; the collision detection module 620 is configured to, when the target scene image includes a main body to be collided and fluid particles, detect whether the fluid particles collide with the main body to be collided according to the directed distance field image; the particle display module 630 is configured to determine target display information of the fluid particles according to the detection result and display the fluid particles based on the target display information.

[0133] The technical solution of this embodiment can calculate the shortest distance from each pixel point in the target scene image to the main body to be collided by acquiring a target scene image to be processed including at least one main body to be collided and determining a directed distance field image corresponding to the target scene image. Then, when it is detected that the target scene image includes fluid particles, it can quickly detect whether the fluid particles collide with the main body to be collided according to the directed distance field image, and this detection method is applicable to collision bodies of various shapes. Finally, the target display information of the fluid particles is determined according to the detection result, and the fluid particles are displayed based on the target display information, which can simulate the image display effect after collision, solve the technical problems that the relevant collision algorithms have a long time consumption and are not conducive to GPU parallel processing during collision processing operations, realize the simulation of the collision effect between the fluid particles and the main body to be collided, and is not limited by the shape of the main body to be collided, and also supports GPU parallel processing of each pixel point in the target scene image, improving the fluid collision processing speed and ensuring the display effect of fluid collision.

[0134] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image acquisition module 610 is specifically configured to: when it is detected that at least one subject to be collided in the target video changes, acquire a target image frame in which the subject to be collided in the target video changes, and use the target image frame as a target scene image to be processed.

[0135] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image processing device further includes an oriented distance field image acquisition module, configured to: perform binarization processing on the target scene image according to the subject to be collided in the target scene image to obtain a to-be-converted scene image corresponding to the target scene image; respectively calculate the minimum distance value corresponding to each pixel point in the to-be-converted scene image, and generate an oriented distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

[0136] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image processing device further includes a distance determination module, configured to: use the subject to be collided as an obstacle area of the to-be-converted scene image, and respectively calculate the minimum distance value of each pixel point in the image area other than the subject to be collided in the to-be-converted scene image from the obstacle area; use the image area other than the subject to be collided in the to-be-converted scene image as an obstacle area, and respectively calculate the minimum distance value of each pixel point of the subject to be collided from the obstacle area.

[0137] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the distance determination module is specifically configured to: set the pixel coordinates of each pixel point in the subject to be collided as the coordinates of the pixel point itself, use each pixel point in the image area other than the subject to be collided in the to-be-converted scene image as a to-be-updated pixel point, use the pixel coordinates of the boundary pixel point closest to the subject to be collided of the to-be-updated pixel point as the to-be-updated coordinates, and set the to-be-updated coordinates to infinity; for each to-be-updated pixel point in the to-be-converted scene image, iteratively update the to-be-updated pixel coordinates of the to-be-updated pixel point according to the to-be-updated pixel coordinates corresponding to the neighboring pixel points of the to-be-updated pixel point to obtain the target pixel coordinates of the to-be-updated pixel point; calculate the minimum distance value of each pixel point in the image area other than the subject to be collided in the to-be-converted scene image from the boundary of the subject to be collided according to the target pixel coordinates of each pixel point.

[0138] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image processing device further includes an iterative update module, configured to calculate, in each iteration process, the closest distance from each neighborhood pixel point corresponding to the pixel point to be updated to the obstacle area and the closest distance from the pixel point to be updated to the obstacle area, and update the pixel coordinates of the pixel point corresponding to the minimum value among the calculated closest distances to the pixel coordinates to be updated.

[0139] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the iterative update module is further configured to: determine the target number of iterations of the pixel coordinates to be updated, so as to iteratively update the pixel coordinates to be updated according to the target number of iterations.

[0140] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the image processing device further includes an iteration number determination module, configured to determine the target number of iterations of the pixel coordinates to be updated according to the distance between two adjacent pixel points in the scene image to be transformed and the number of pixel points.

[0141] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the iterative update module is further configured to: before iteratively updating the pixel coordinates to be updated according to the pixel coordinates to be updated corresponding to the neighborhood pixel points corresponding to the pixel point to be updated, for each iterative update of the pixel coordinates of the pixel point to be updated, determine the neighborhood pixel points corresponding to the pixel point to be updated at each iteration according to the pixel coordinates of the pixel point to be updated and the preset distance adjustment step size.

[0142] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the oriented distance field image acquisition module is further configured to: for each pixel point, normalize the minimum distance value corresponding to the pixel point according to a preset distance threshold, a preset adjustment parameter, and the minimum distance value corresponding to the pixel point, to obtain the target distance value corresponding to the pixel point; generate an oriented distance field image corresponding to the target scene image according to the target distance value corresponding to each pixel point.

[0143] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the collision detection module 620 is specifically configured to: determine the first position information of the fluid particle in the target scene image, and determine the target distance value corresponding to the first position information in the oriented distance field image, and detect whether the fluid particle collides with the object to be collided according to the target distance value and a preset distance threshold.

[0144] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the particle display module 630 is specifically configured to:

[0145] If the fluid particle collides with the object to be collided, obtain the previous frame image adjacent to the target scene image, and determine the target display information of the fluid particle according to the position information of the fluid particle in the previous frame image and the position information in the target scene image;

[0146] If the fluid particle collides with the object to be collided, determine the target display information of the fluid particle from the initial display information of the fluid particle.

[0147] The above image processing device can execute the image processing method provided in any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the image processing method.

[0148] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present disclosure.

[0149] Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. The following refers to Figure 7 , which shows a schematic structural diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure (such as Figure 7 in the terminal device or server). The terminal device in the embodiments of the present disclosure may include, but is not limited to, terminal devices such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present disclosure.

[0150] As Figure 7 shown, the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage device 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 705. The editing / output (I / O) interface 704 is also connected to the bus 705.

[0151] Typically, the following devices can be connected to the I / O interface 704: input devices 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. The communication device 709 can allow the electronic device 700 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 7 the electronic device 700 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or had.

[0152] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. 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 codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above functions defined in the methods of the embodiments of the present disclosure are executed.

[0153] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0154] The electronic device provided by the embodiment of the present disclosure and the image processing method provided by the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0155] The embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the image processing method provided by the above embodiment is implemented.

[0156] It should be noted that the computer-readable medium described above can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can 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 of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0157] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0158] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.

[0159] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:

[0160] Obtain a target scene image to be processed and determine a signed distance field image corresponding to the target scene image;

[0161] When the target scene image includes a main body to be collided and fluid particles, determine whether the fluid particles collide with the main body to be collided according to the signed distance field image;

[0162] Determine target display information of the fluid particles according to the detection result, and display the fluid particles based on the target display information.

[0163] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include, but are not limited to, object-oriented programming languages - such as Java, Smalltalk, C++; and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or, alternatively, may be connected to an external computer (e.g., by connecting through an Internet service provider via the Internet).

[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0165] The units involved in the embodiments of the present disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".

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

[0167] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

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

[0169] Obtain a target scene image to be processed, and determine a corresponding directed distance field image of the target scene image;

[0170] In the case where the target scene image includes a subject to be collided with and fluid particles, determine whether the fluid particles collide with the subject to be collided with according to the directed distance field image;

[0171] Determine target display information of the fluid particles according to the detection result, and display the fluid particles based on the target display information.

[0172] According to one or more embodiments of the present disclosure, [Example 2] provides an image processing method, the method further comprising:

[0173] Optionally, the obtaining the target scene image to be processed includes:

[0174] When it is detected that at least one subject to be collided with in the target video changes, obtain a target image frame in which the subject to be collided with in the target video changes, and use the target image frame as the target scene image to be processed.

[0175] According to one or more embodiments of the present disclosure, [Example Three] provides an image processing method, which further includes:

[0176] Optionally, the determining the directed distance field image corresponding to the target scene image includes:

[0177] Performing binarization processing on the target scene image according to the main body to be collided in the target scene image to obtain a to-be-converted scene image corresponding to the target scene image;

[0178] Calculating the minimum distance value corresponding to each pixel point in the to-be-converted scene image respectively, and generating a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

[0179] According to one or more embodiments of the present disclosure, [Example Four] provides an image processing method, which further includes:

[0180] Optionally, the calculating the minimum distance value corresponding to each pixel point in the to-be-converted scene image respectively includes:

[0181] Taking the main body to be collided as the obstacle area of the to-be-converted scene image, and calculating the minimum distance value of each pixel point in the image area except the main body to be collided in the to-be-converted scene image from the obstacle area respectively;

[0182] Taking the image area except the main body to be collided in the to-be-converted scene image as the obstacle area, and calculating the minimum distance value of each pixel point of the main body to be collided from the obstacle area respectively.

[0183] According to one or more embodiments of the present disclosure, [Example Five] provides an image processing method, which further includes:

[0184] Optionally, the taking the main body to be collided as the obstacle area of the to-be-converted scene image, and calculating the minimum distance value corresponding to each pixel point in the image area except the main body to be collided in the to-be-converted scene image respectively includes:

[0185] Setting the pixel coordinates of each pixel point in the main body to be collided as the pixel point's own coordinates, taking each pixel point in the image area except the main body to be collided in the to-be-converted scene image as a to-be-updated pixel point, taking the pixel coordinates of the boundary pixel point closest to the main body to be collided of the to-be-updated pixel point as the to-be-updated coordinates, and setting the to-be-updated coordinates to infinity;

[0186] For each pixel point to be updated in the to-be-converted scene image, iteratively update the to-be-updated pixel coordinates of the to-be-updated pixel point according to the to-be-updated pixel coordinates corresponding to the neighboring pixel points of the to-be-updated pixel point, so as to obtain the target pixel coordinates of the to-be-updated pixel point;

[0187] Calculate the minimum distance value of each pixel point in the image area except the to-be-collided object in the to-be-converted scene image from the boundary of the to-be-collided object according to the target pixel coordinates of each pixel point.

[0188] According to one or more embodiments of the present disclosure, [Example Six] provides an image processing method, and the method further includes:

[0189] Optionally, the iteratively updating the to-be-updated pixel coordinates of the to-be-updated pixel point according to the pixel coordinates of the neighboring pixel points corresponding to the to-be-updated pixel point to obtain the target pixel coordinates of the to-be-updated pixel point includes:

[0190] In each iteration process, calculate the shortest distance from each neighboring pixel point corresponding to the to-be-updated pixel point to the obstacle area and the shortest distance from the to-be-updated pixel point to the obstacle area respectively, and update the pixel coordinates of the pixel point corresponding to the minimum value among the calculated shortest distances to the to-be-updated pixel coordinates.

[0191] According to one or more embodiments of the present disclosure, [Example Seven] provides an image processing method, and the method further includes:

[0192] Optionally, before the iteratively updating the to-be-updated pixel coordinates according to the pixel coordinates of the neighboring pixel points corresponding to the to-be-updated pixel point, it further includes:

[0193] Determine the target number of iterations of the to-be-updated pixel coordinates, so as to iteratively update the to-be-updated pixel coordinates according to the target number of iterations.

[0194] According to one or more embodiments of the present disclosure, [Example Eight] provides an image processing method, and the method further includes:

[0195] Optionally, the determining the target number of iterations of the to-be-updated pixel coordinates includes:

[0196] Determine the target number of iterations of the to-be-updated pixel coordinates according to the distance between two adjacent pixel points in the to-be-converted scene image and the number of pixel points.

[0197] According to one or more embodiments of the present disclosure, [Example Nine] provides an image processing method, and the method further includes:

[0198] Optionally, before iteratively updating the to-be-updated pixel coordinates corresponding to the neighborhood pixel points corresponding to the to-be-updated pixel points according to the to-be-updated pixel points, the method further includes:

[0199] For each iterative update of the pixel coordinates of the to-be-updated pixel points, determine the neighborhood pixel points corresponding to the to-be-updated pixel points at each iteration according to the pixel coordinates of the to-be-updated pixel points and a preset spacing adjustment step size.

[0200] According to one or more embodiments of the present disclosure, [Example Ten] provides an image processing method, and the method further includes:

[0201] Optionally, the generating a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point includes:

[0202] For each pixel point, perform normalization processing on the minimum distance value corresponding to the pixel point according to a preset distance threshold, a preset adjustment parameter, and the minimum distance value corresponding to the pixel point to obtain a target distance value corresponding to the pixel point;

[0203] Generate a directed distance field image corresponding to the target scene image according to the target distance value corresponding to each pixel point.

[0204] According to one or more embodiments of the present disclosure, [Example Eleven] provides an image processing method, and the method further includes:

[0205] Optionally, the detecting whether the fluid particle collides with the to-be-collided main body according to the directed distance field image includes:

[0206] Determine the first position information of the fluid particle in the target scene image, and determine the target distance value corresponding to the first position information in the directed distance field image;

[0207] Detect whether the fluid particle collides with the to-be-collided main body according to the target distance value and a preset distance threshold.

[0208] According to one or more embodiments of the present disclosure, [Example Twelve] provides an image processing method, and the method further includes:

[0209] Optionally, the determining the target display information of the fluid particle according to the detection result and the initial display information of the fluid particle includes:

[0210] If the fluid particle collides with the object to be collided, obtain the previous frame image adjacent to the target scene image, and determine the target display information of the fluid particle according to the position information of the fluid particle in the previous frame image and the position information in the target scene image;

[0211] If the fluid particle collides with the object to be collided, determine the target display information of the fluid particle based on the initial display information of the fluid particle.

[0212] According to one or more embodiments of the present disclosure, [Example XIII] provides an image processing apparatus, the apparatus includes:

[0213] An image acquisition module, configured to acquire a target scene image to be processed and determine a directed distance field image corresponding to the target scene image, where at least one object to be collided is included in the target scene image;

[0214] A collision detection module, configured to detect whether the fluid particle collides with the object to be collided according to the directed distance field image when the object to be collided and the fluid particle are included in the target scene image;

[0215] A particle display module, configured to determine the target display information of the fluid particle according to the detection result and display the fluid particle based on the target display information.

[0216] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present disclosure.

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

[0218] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.

Claims

1. An image processing method, characterized in that, comprising: obtaining a target scene image to be processed and determining a corresponding signed distance field image of the target scene image; when the target scene image includes a main body to be collided and fluid particles, determining whether the fluid particles collide with the main body to be collided according to the signed distance field image; determining target display information of the fluid particles according to the detection result and displaying the fluid particles based on the target display information; the determining the corresponding signed distance field image of the target scene image includes: performing binarization processing on the target scene image according to the main body to be collided in the target scene image to obtain a to-be-converted scene image corresponding to the target scene image; taking pixel points in the image area except the main body to be collided in the to-be-converted scene image as to-be-updated pixel points, and taking the pixel coordinates of the boundary pixel point closest to the main body to be collided of the to-be-updated pixel points as to-be-updated coordinates; for each to-be-updated pixel point in the to-be-converted scene image, gradually updating the to-be-updated pixel coordinates of the to-be-updated pixel point to the coordinates of the boundary point of the obstacle area closest to the to-be-updated pixel point to obtain the target pixel coordinates of the to-be-updated pixel point; calculating the minimum distance value of each pixel point in the image area except the main body to be collided in the to-be-converted scene image from the boundary of the main body to be collided according to the target pixel coordinates of each pixel point; generating a signed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

2. The method according to claim 1, characterized in that, the obtaining the target scene image to be processed includes: when it is detected that at least one main body to be collided in the target video changes, obtaining a target image frame in which the main body to be collided in the target video changes, and taking the target image frame as the target scene image to be processed.

3. The method according to claim 2, characterized in that, respectively calculating the minimum distance value corresponding to each pixel point in the to-be-converted scene image includes: taking the main body to be collided as the obstacle area of the to-be-converted scene image, and respectively calculating the minimum distance value of each pixel point in the image area except the main body to be collided in the to-be-converted scene image from the obstacle area; taking the image area except the main body to be collided in the to-be-converted scene image as the obstacle area, and respectively calculating the minimum distance value of each pixel point of the main body to be collided from the obstacle area.

4. The method according to claim 3, characterized in that, the taking the main body to be collided as the obstacle area of the to-be-converted scene image and respectively calculating the minimum distance value corresponding to each pixel point in the image area except the main body to be collided in the to-be-converted scene image includes: Set the pixel coordinates of each pixel point in the to-be-collided object as the coordinates of the pixel point itself. For the pixel points in the image area other than the to-be-collided object in the to-be-converted scene image, regard them as to-be-updated pixel points. Take the pixel coordinates of the boundary pixel point closest to the to-be-collided object among the to-be-updated pixel points as the to-be-updated coordinates, and set the to-be-updated coordinates to infinity; For each to-be-updated pixel point in the to-be-converted scene image, iteratively update the to-be-updated pixel coordinates of the to-be-updated pixel point according to the to-be-updated pixel coordinates corresponding to the neighboring pixel points of the to-be-updated pixel point, so as to obtain the target pixel coordinates of the to-be-updated pixel point; Calculate the minimum distance value of each pixel point in the image area other than the to-be-collided object in the to-be-converted scene image from the boundary of the to-be-collided object according to the target pixel coordinates of each pixel point.

5. The method according to claim 4, wherein, The iteratively updating the to-be-updated pixel coordinates of the to-be-updated pixel point according to the pixel point coordinates of the neighboring pixel points corresponding to the to-be-updated pixel point to obtain the target pixel coordinates of the to-be-updated pixel point includes: In each iteration process, calculate the closest distance from each neighboring pixel point corresponding to the to-be-updated pixel point to the obstacle area and the closest distance from the to-be-updated pixel point to the obstacle area respectively, and update the pixel point coordinates of the pixel point corresponding to the minimum value among the calculated closest distances as the to-be-updated pixel coordinates.

6. The method according to claim 4, wherein, Before the iteratively updating the to-be-updated pixel coordinates according to the pixel point coordinates of the neighboring pixel points corresponding to the to-be-updated pixel point, it further includes: Determine the target number of iterations of the to-be-updated pixel coordinates, so as to iteratively update the to-be-updated pixel coordinates according to the target number of iterations.

7. The method according to claim 6, wherein, The determining the target number of iterations of the to-be-updated pixel coordinates includes: Determine the target number of iterations of the to-be-updated pixel coordinates according to the spacing between two adjacent pixel points in the to-be-converted scene image and the number of pixel points.

8. The method according to claim 4, wherein, Before the iteratively updating the to-be-updated pixel coordinates of the to-be-updated pixel point according to the to-be-updated pixel coordinates corresponding to the neighboring pixel points of the to-be-updated pixel point, it further includes: For each iterative update of the pixel point coordinates of the to-be-updated pixel point, determine the neighboring pixel points corresponding to the to-be-updated pixel point at each iteration according to the pixel point coordinates of the to-be-updated pixel point and the preset spacing adjustment step size respectively.

9. The method according to claim 1, wherein, The generating the directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point includes: For each pixel point, perform normalization processing on the minimum distance value corresponding to the pixel point according to a preset distance threshold, a preset adjustment parameter, and the minimum distance value corresponding to the pixel point to obtain the target distance value corresponding to the pixel point; Generate a directed distance field image corresponding to the target scene image according to the target distance value corresponding to each pixel point.

10. The method according to claim 1, wherein, the detecting whether the fluid particle collides with the object to be collided according to the directed distance field image includes: determine the first position information of the fluid particle in the target scene image, and determine the target distance value corresponding to the first position information in the directed distance field image; detect whether the fluid particle collides with the object to be collided according to the target distance value and a preset distance threshold.

11. The method according to claim 1, wherein, the determining the target display information of the fluid particle according to the detection result and the initial display information of the fluid particle includes: if the fluid particle collides with the object to be collided, obtain the previous frame image adjacent to the target scene image, and determine the target display information of the fluid particle according to the position information of the fluid particle in the previous frame image and the position information in the target scene image; if the fluid particle collides with the object to be collided, determine the target display information of the fluid particle by using the initial display information of the fluid particle.

12. An image processing apparatus, wherein, comprises: an image acquisition module, configured to acquire a target scene image to be processed, and determine a directed distance field image corresponding to the target scene image, wherein the target scene image includes at least one object to be collided; a collision detection module, configured to detect whether the fluid particle collides with the object to be collided according to the directed distance field image when the target scene image includes an object to be collided and a fluid particle; a particle display module, configured to determine the target display information of the fluid particle according to the detection result, and display the fluid particle based on the target display information; a directed distance field image acquisition module, configured to: perform binarization processing on the target scene image according to the object to be collided in the target scene image, to obtain a to-be-converted scene image corresponding to the target scene image; regard the pixel points in the image area other than the object to be collided in the to-be-converted scene image as to-be-updated pixel points, and regard the pixel coordinates of the boundary pixel point closest to the object to be collided of the to-be-updated pixel points as to-be-updated coordinates; for each to-be-updated pixel point in the to-be-converted scene image, gradually update the to-be-updated pixel coordinates of the to-be-updated pixel point to the coordinates of the boundary point of the obstacle area closest to the to-be-updated pixel point, to obtain the target pixel coordinates of the to-be-updated pixel point; calculate the minimum distance value of each pixel point in the image area other than the object to be collided in the to-be-converted scene image from the boundary of the object to be collided according to the target pixel coordinates of each pixel point; generate a directed distance field image corresponding to the target scene image according to the minimum distance value corresponding to each pixel point.

13. An electronic device, wherein, the electronic device includes: one or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method according to any one of claims 1-11.

14. A computer-readable storage medium having a computer program stored thereon, Characterized in that, When the program is executed by a processor, the image processing method according to any one of claims 1-11 is implemented.

Citation Information

Patent Citations

  • Interface display method, device, terminal and storage medium

    CN109241465A

  • Element display method and device, electronic equipment and storage medium

    CN114253647A