A cloth collision simulation enhanced presentation method and device based on depth image
By acquiring the depth image of the fabric and combining the bounding box and collision detection model, the problem of poor simulation effect of flexible fabrics in real scenes is solved, and more intuitive fabric enhancement presentation is achieved, improving the simulation effect of the augmented reality environment.
Patent Information
- Application Number
- CN202111271781.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-10-29
AI Technical Summary
The simulation effect of flexible fabrics in real scenes in the prior art is poor, affecting the intuitiveness of the augmented reality environment.
By obtaining the depth image of the fabric, using the bounding box of the pre-constructed model area of interest to locate the target area, determine the two-dimensional image characteristics of the fabric, and identify the natural feature maps according to the mechanism, and import them into the flexible cloth collision detection model for collision simulation. The flexible cloth three-dimensional model created by the elastic mechanical equation is used, and combined with the collision detection structure tree and collision response algorithm of the AABB and Sphere bounding boxes, the enhanced presentation of the fabric is achieved.
Improves the simulation effect in the augmented reality environment, making the fabric presentation more intuitive and enhancing the user experience.
Smart Images

Figure CN113962979B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of image processing technology and virtual reality technology, and in particular to a method and device for enhancing the presentation of cloth collision simulation based on depth images. Background Art
[0002] With the development of 5G commercialization and the virtual reality industry, augmented reality presents enhanced scenes that integrate virtual and real space, organically unifies virtual models with real scenes, and combines multimedia technology, real-time tracking and registration, three-dimensional reconstruction, virtual and real scene fusion and other technologies. It is widely used in education and teaching, game entertainment, medical training, industrial diagnosis, military training and other fields. For example, in the field of education and teaching, augmented reality technology is used to render static information such as text and pictures in books into three-dimensional space in a virtual space, giving readers a different visual experience and guiding them through multimodal information, which is more conducive to readers' understanding of knowledge. For example, in the field of game entertainment, augmented reality technology connects players, real-world environments, and virtual objects in games, giving players novel and unique gaming experiences and new means of interaction. For example, in the field of medical training, augmented reality has become an emerging technology in the field of medical training with its advantages such as better virtual-real integration technology, real-time interaction capabilities, and the ability to add virtual objects in three-dimensional space. For example, in the field of industrial diagnosis, combined with technologies such as machine vision and machine learning, it can assist staff in repairing equipment and even provide auxiliary operation prompts for equipment operation. For example, in the field of military training, the training model system constructed using augmented reality technology can not only reflect the basic characteristics of the real world, but also virtually superimpose various elements that do not exist in the real world onto the real world, thereby constructing a simulated training environment that goes beyond reality.
[0003] The main form of augmented reality technology is to display virtual models and information in real spatial scenes. The first thing to do is to call the camera equipment (traditional cameras or infrared radar cameras, etc.) to collect digital images and videos, and then accurately identify and locate the identification code or natural features, project the real-world scene onto the camera plane, and finally use graphic modeling technology to drive the display of virtual model information.
[0004] Currently, many augmented reality applications focus on the natural features of objects, complementing the poor visual experience associated with traditional identification codes. Real-time computer graphics simulation technology can simulate the collision detection and response between virtual and real objects, driving the development of augmented reality technology into a wider range of applications. Growing user interaction needs are driving the development of this technology in complex scenarios.
[0005] The development of augmented reality applications is bringing new innovative development ideas to traditional manufacturing and display industries, such as clothing, footwear, and decorative displays. Applications such as virtual fitting, AR makeup, and shoe sizing with radar photography are offering consumers a completely new technological experience. The rise of online shopping, the Internet of Things, and 5G high-speed network transmission are also bringing novel lifestyle changes to consumers.
[0006] However, the existing flexible cloth simulation effect in real scenes is not good. Therefore, it is necessary to improve the existing flexible cloth simulation effect in real scenes, make it more intuitive in augmented reality environment, and obtain better simulation effect through cloth augmentation presentation. Summary of the Invention
[0007] The technical problem to be solved by the embodiments of the present invention is to provide a method and device for cloth collision simulation enhancement presentation based on depth images, so that the augmented reality environment is more intuitive and better simulation effects are obtained through cloth enhanced presentation.
[0008] In order to solve the above technical problems, an embodiment of the present invention provides a method for enhancing the presentation of cloth collision simulation based on a depth image, the method comprising the following steps:
[0009] Obtain a depth map of the fabric, and locate the target area space in the depth map of the fabric using a bounding box of a pre-built model area of interest;
[0010] Determining the two-dimensional image features of the cloth in the target area space, and randomly constructing a template recognition natural feature map oriented to feature points or textures based on the two-dimensional image features of the cloth;
[0011] The template recognition natural feature map is imported into a predefined flexible cloth collision detection model to perform collision simulation, so as to obtain a visual image presented by cloth enhancement.
[0012] The depth map of the cloth is calculated by collecting depth images of a target scene containing the cloth using a camera or multiple cameras at fixed positions, and combining the calibration information and disparity information of the camera or multiple cameras during depth image collection.
[0013] The bounding box of the model region of interest is an AABB bounding box.
[0014] The natural feature map for template recognition oriented to feature points or textures is a simple geometric shape image randomly constructed according to the color or texture features of the two-dimensional image of the cloth in the target area space.
[0015] The flexible cloth collision detection model is a flexible cloth three-dimensional model created using elastic mechanics equations, and the flexible cloth three-dimensional model is designed with a parallel processing shader, a collision processing architecture, and a collision response algorithm.
[0016] The flexible cloth three-dimensional model is expressed by the following formulas (1) to (5):
[0017]
[0018]
[0019]
[0020]
[0021]
[0022] In formula (1), f out (X, t) represents the sum of the external forces acting on the particle at time t, f int (X, t) represents the sum of the forces between the internal particles of the cloth at time t; the internal forces between the particles are the elastic deformation force and damping force generated by the spring; the external forces are gravity G and the set constant external force f external ;
[0023] In formula (2), c e , indicating that the particles P0 and P i The elastic deformation coefficient of the spring between two points, Represents the time t between the particle P0 and P i The distance between Represents particles P0 and P at time zero i The initially set distance, Indicates P i The unit vector pointing to P0;
[0024] In formula (3), f damp Represents the spring damping force; C d represents the damping coefficient;
[0025] In formula (4), f evey Indicates the gravity acting on the mass point;
[0026] In formula (5), represents the time step; represents the net force acting on the particle [i, j] at time t; represents the acceleration of particle [i, j] at time t; represents the velocity of particle [i, j] at time t; Represents the position of particle [i, j] at time t.
[0027] Among them, the collision processing architecture designed for the flexible cloth three-dimensional model is a structure tree that uses a combination of AABB and Sphere bounding boxes to construct hierarchical collision detection of collision areas; among them, the leaf nodes of the structure tree use Sphere bounding boxes, and the root node uses AABB bounding boxes.
[0028] The collision response algorithm designed for the flexible cloth three-dimensional model is specifically:
[0029] If a collision is detected between the particle and the sphere, that is, a collision response is required when the distance between the particle and the center of the sphere is less than the radius of the sphere, the position of the particle needs to be adjusted to the first point where the particle collides with the sphere along the velocity direction, and the velocity of the particle needs to be corrected to only retain the tangential velocity with the sphere.
[0030] An embodiment of the present invention further provides a cloth collision simulation enhanced presentation device based on a depth image, comprising:
[0031] A target region image segmentation unit is used to obtain a depth map of the cloth and locate the target region space in the depth map of the cloth using a bounding box of a pre-constructed model region of interest;
[0032] A natural feature image generation unit is used to determine the two-dimensional image features of the cloth in the target area space, and randomly construct a template recognition natural feature map oriented to feature points or textures based on the two-dimensional image features of the cloth;
[0033] The collision simulation enhanced image presentation unit is used to import the template recognition natural feature map into a predefined flexible cloth collision detection model to perform collision simulation, so as to obtain a visual image enhanced by the cloth.
[0034] The flexible cloth collision detection model is a flexible cloth three-dimensional model created using elastic mechanics equations, and the flexible cloth three-dimensional model is designed with a parallel processing shader, a collision processing architecture, and a collision response algorithm.
[0035] The implementation of the embodiments of the present invention has the following beneficial effects:
[0036] The present invention uses image target feature areas for augmented reality image matching, adopts real-time flexible cloth simulation enhanced presentation, and adopts efficient collision detection and response methods, thereby combining the positioning and feature matching of the deep image feature space to drive the collision response between the cloth and the real target area, making the augmented reality environment more intuitive and obtaining better simulation effects through cloth enhanced presentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, without paying any creative work, other drawings obtained based on these drawings still fall within the scope of the present invention.
[0038] Figure 1 A flowchart of a method for enhancing cloth collision simulation based on depth images provided by an embodiment of the present invention;
[0039] Figure 2 A diagram showing the traversal process of mass points and a hierarchical bounding box tree within a collision processing architecture of a flexible cloth collision detection model in a depth image-based cloth collision simulation enhanced presentation method provided in an embodiment of the present invention;
[0040] Figure 3 A collision response graph of particles in a collision response algorithm of a flexible cloth collision detection model in a depth image-based cloth collision simulation enhancement presentation method provided in an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the structure of a depth image-based cloth collision simulation and enhanced presentation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be described in further detail below with reference to the accompanying drawings.
[0043] like Figure 1 As shown in the figure, a method for enhancing the presentation of cloth collision simulation based on a depth image is provided in an embodiment of the present invention. The method comprises the following steps:
[0044] Step S1: obtaining a depth map of the cloth, and locating a target area space in the depth map of the cloth using a bounding box of a pre-constructed model area of interest;
[0045] Step S2: determining the two-dimensional image features of the cloth in the target area space, and randomly constructing a template recognition natural feature map oriented to feature points or textures based on the two-dimensional image features of the cloth;
[0046] Step S3: importing the template recognition natural feature map into a predefined flexible cloth collision detection model to perform collision simulation, so as to obtain a visual image presented by cloth enhancement.
[0047] The specific process is that before step S1, the bounding box of the model area of interest is pre-constructed as an AABB bounding box and a flexible cloth collision detection model is pre-defined.
[0048] First, given that bounding boxes are the most flexible method, and their purpose is to enhance the positioning of simulated targets, rather than requiring precise polygon collision detection, AABBs can be used to improve the real-time presentation of subsequent collision responses. It should be noted that AABBs offer more efficient collision detection than OBBs, further improving the real-time presentation of subsequent collision responses.
[0049] In the second step, the flexible cloth collision detection model is a flexible cloth three-dimensional model created using elastic mechanics equations, and the flexible cloth three-dimensional model is designed with a parallel processing shader, collision processing architecture and collision response algorithm.
[0050] (I) The mass-spring model is one of the most widely used models and is also the method used in this paper to model the physical properties of flexible fabrics. Based on a quadrilateral mesh, the mass-spring model categorizes springs into structural springs, bending springs, and shear springs, depending on the connection between the mass points. Structural springs maintain the basic shape of the fabric mesh; bending springs prevent excessive bending; and shear springs prevent excessive diagonal distortion of the mesh. All springs are ideal linear springs.
[0051] The design of the mechanical model is based on the consideration of high real-time performance and realism. The mechanical model is established by mechanical method, and the activity law of the particle can be expressed by formula (1).
[0052]
[0053] In formula (1), f out (X, t) represents the sum of the external forces acting on the particle at time t, f int (X, t) represents the sum of the forces between the internal particles of the cloth that the particle experiences at time t. These two forces are determined by the position of the particles and time. In the particle-spring model, the internal forces between the particles are the elastic deformation force and the damping force generated by the spring; the external forces are the gravity G and the set constant external force f. external .
[0054] Since the present invention adopts an ideal mass-spring model, the elastic deformation force of the spring can be calculated using Hooke's law.
[0055] Assuming that the set of adjacent mass points of mass point P0 is R, the elastic deformation force on P0 is expressed as formula (2).
[0056]
[0057] In formula (2), c e Represents the mass points P0 and P i The elastic deformation coefficient of the spring between two points, Represents the time t between the particle P0 and P i The distance between Represents particles P0 and P at time zero i The initially set distance, Indicates P i The unit vector pointing to P0. P0 and P i The connection direction and the number of intermediate particles determine whether it is a structural spring, shear spring or bending spring, and then the magnitude of the response force is calculated.
[0058] The change of deformation force may cause the vibration of the cloth mass point. In order to prevent the mass point from excessively vibrating and thus reducing the authenticity of the simulation, a spring damping force f is added. damp , the force is a linear function of the velocity of the particle, as shown in formula (3).
[0059]
[0060] In formula (3), C d is the damping coefficient. The damping force is positively correlated with the mass velocity, effectively preventing unrealistic stretching and deformation of the fabric caused by rapid mass oscillation, thereby improving the realism of the simulation.
[0061] The model uses an ideal mass-spring model. The mass points on the flexible fabric are evenly distributed and have the same mass. If the total mass of the fabric is M, then the gravity on the fabric is G = Mg. Therefore, the gravity on each mass point in the model is shown in Equation (4). external It can simulate wind-like effects, with the magnitude of the force being set by the simulation system.
[0062]
[0063] Combining the above mass-spring model, the mechanical equation can be established. In the model, the acceleration, velocity, and displacement of mass [i, j] over time are expressed as shown in Equation (5).
[0064]
[0065] In formula (5), represents the time step; represents the net force acting on the particle [i, j] at time t; represents the acceleration of particle [i, j] at time t; represents the velocity of particle [i, j] at time t; Represents the position of particle [i, j] at time t.
[0066] Furthermore, the present invention adopts the Runge-Kutta method to solve the time integral. Compared with the Euler method o(h 2 ) truncation error, median method o(h 3 ) truncation error, the Runge-Kutta method can obtain a higher truncation error. The idea is to n , x n+1 ) to predict the slopes of multiple points, thereby constructing a more refined time integral formula. The fourth-order Runge-Kutta integration method predicts four slopes in each time step, and its truncation error is
[0067] k1=f(x n ,y n )
[0068]
[0069]
[0070] k4=f(x n +h,y n +hk3))
[0071]
[0072] As can be seen from the above formula, the fourth-order Runge-Kutta integration method requires more calculations and occupies more memory space than the Euler method, but its advantage is that it can improve the accuracy and stability of the simulation and is very suitable for simulations with large time steps.
[0073] (II) The flexible cloth 3D model is designed with parallel processing shaders.
[0074] A compute shader is a shader that can be used at any shading stage. It provides parallelism for general tasks. To improve real-time performance, this paper uses compute shaders to parallelize the collision handling algorithm for the spring-mass model. The number of compute shader calls is controlled by a user-defined compute space, which can be defined as a one-, two-, or three-dimensional space. The compute space is further divided into several groups, each of which contains many calls to the compute shader.
[0075] For each different compute shader, different global spaces and local spaces can be defined. The present invention uses three compute shaders to accelerate the simulation process. The following Table 1 shows the name, function, and global space and local space used by each compute shader.
[0076] Table 1
[0077]
[0078] Compute shaders do not have any direct user-defined inputs or outputs. Compute shaders retrieve data directly from memory through image access functions or by using Shader Storage Buffer Objects (SSBOs). Shader Buffer Objects are a special type of buffer object that can be written to and read from within a GLSL shader. Their size is limited by the amount of available GPU memory and can be up to 16KB.
[0079] The present invention creates multiple SSBOs to facilitate information access. Table 2 below shows the SSBOs defined for each shader.
[0080] Table 2
[0081]
[0082] The NodeUpdate compute shader uses the same number of threads as the soft body particles. Each thread is assigned a global ID, which it uses to retrieve information about the particle's coordinates, velocity, and so on. It also has a matrix that transforms the model's local coordinate system into the world coordinate system. This shader updates the particle's position and velocity in both the local coordinate system and the world coordinate system.
[0083] The threads enabled by the compute shader CollisionDectionWithBVH are the same as those of the shader NodeUpdate, with the same number of soft body particles. Each thread first obtains its own global ID, and then uses this global ID to obtain the particle information it needs to process, and then uses this particle to traverse the BVH of the model in a non-recursive depth-first method. If the particle collides with the sphere collider, a collision response is performed to update the position and velocity of the particle.
[0084] The number of threads enabled in the compute shader normalShader is the same as the number of particles. Each thread first obtains its own ID in the global world, reads the coordinates of the particle, the overall number of rows and columns, and then uses the shader to calculate the normal vectors of all faces connected to this particle, normalizes the vectors, and finds the normal line of the particle.
[0085] (III) The flexible cloth 3D model is designed with a collision processing architecture, specifically a structure tree that uses a combination of AABB and Sphere bounding boxes to construct a hierarchical collision detection structure for the collision area; wherein the leaf nodes of the structure tree use Sphere bounding boxes, and the root node uses AABB bounding boxes.
[0086] In flexible body simulation, collision types between objects can be divided into flexible-rigid body collision and flexible-flexible body self-collision. The present invention mainly focuses on the collision between flexible body and rigid body.
[0087] (a) Preprocessing of rigid body model
[0088] Compared with the previous method of constructing a bounding box for each triangular face of the model to ensure the authenticity of the simulation process, the present invention proposes a method to simplify the model by constructing a set of BVH structure colliders. The method first constructs an AABB for the entire model, and then divides the AABB into multiple voxels as required. A spherical collider is calculated for each voxel. The collider can enclose all the vertices contained in the voxel. The spherical collider is a leaf node in the BVH (bounding box hierarchy) structure tree, representing the part of the rigid body model that actually participates in the collision. The AABB collider is a non-leaf node. The soft body particles no longer need to perform collision detection with each face of the model, and are used to quickly eliminate collision-free areas.
[0089] (b) Bounding box selection and parallel construction of BVH
[0090] The Sphere bounding box is simple in construction, but its tightness is very poor, and it is suitable for scenes with large rotation amounts. OBB is much stronger than AABB and Sphere in terms of tightness, but the complicated construction method will reduce real-time performance. K-DOP is very important for the selection of K value, and multiple tests are required to select the best K value, which is relatively troublesome. Although the tightness of AABB is not as good as OBB, the construction method is simple, so the present invention chooses to use AABB and Sphere bounding boxes to construct BVH. The present invention uses a top-down method based on Morton code to construct a BVH tree. The top-down method refers to the collision process in which a bounding box is first constructed for the entire target collision object as the root node, and the target collision object is subdivided into small geometric bodies according to certain rules, and bounding boxes are constructed for the geometric bodies. These geometric bodies can also be subdivided into smaller geometric bodies. The construction method of subdividing in this way is similar to a tree structure, and the leaf nodes constitute the smallest geometric units of the target collision object.
[0091] First, the Morton code of each primitive is calculated based on its center point. The BVH constructed by the present invention is a full binary tree structure, that is, if there are N leaf nodes, there will be N-1 non-leaf nodes. Each non-leaf node is processed in parallel, and the bounding box hierarchy is divided according to the maximum difference bit of the Morton code. This method only needs to allocate an array consisting of N-1 non-leaf nodes, and then process all non-leaf nodes in parallel. Each thread first needs to determine the object range corresponding to its node, and then continue to divide this range in the same way. Finally, a subnode is selected for the node based on the node's respective subrange. If there is only one object in the subrange, it must be a leaf node. Otherwise, another non-leaf node in the array is referenced.
[0092] (c) Traversal of hierarchical bounding boxes
[0093] The particle traverses the BVH of the model in a non-recursive depth-first method. When the particle traverses the BVH of the rigid body model, the particle performs an intersection test on all nodes of a certain layer of the BVH. If none of them intersect, then the particle does not intersect with the model. The traversal process is as follows: Figure 2 shown.
[0094] (IV) The flexible cloth 3D model is designed with a collision response algorithm.
[0095] The specific algorithm is as follows: if a collision is detected between the particle and the sphere, that is, a collision response is required when the distance between the particle and the center of the sphere is less than the radius of the sphere, the position of the particle needs to be adjusted to the first point where the particle collides with the sphere along the velocity direction, and the velocity of the particle is corrected to retain only the tangential velocity with the sphere.
[0096] like Figure 3 As shown in the figure, the particle's position at time t0 is P0 and its velocity is V0. After a time integration of one step, its position at time t1 is P1 and its velocity is V1. At this time, the distance between the particle and the center of the sphere is less than the radius of the sphere, and the particle collides with the sphere. The point P′1 where the particle collides with the sphere is found. The particle's position is modified to P′1, and its velocity is then modified to the original velocity's tangential velocity along the spherical shell. This completes the collision response.
[0097] In step S1, a depth image of a target scene containing cloth is captured by a camera device (such as a depth camera) or multiple cameras at a fixed position, and a depth map of the cloth is calculated by combining the calibration information and disparity information of the camera device or multiple cameras during depth image capture. The target area space is located in the depth map of the cloth through the AABB bounding box of the model area of interest pre-constructed above.
[0098] It should be noted that because depth cameras can directly obtain depth information of target objects through the combined action of monocular RGB cameras and infrared cameras, multiple cameras are more flexible. They are also applicable to multi-camera conditions. The purpose is to obtain initial camera calibration internal and external parameter data and disparity values, so the selection is based on the implementation scenario conditions.
[0099] In step S2, the two-dimensional image features of the fabric in the target area are determined, and based on these two-dimensional image features, a template recognition natural feature map oriented towards feature points or textures is randomly constructed to identify, match, and locate the virtual model for enhanced presentation during the subsequent interactive process. Directly using the two-dimensional image features in the target area for template matching can affect the real-time efficiency of the subsequent enhanced presentation. Therefore, randomly using simple geometric shapes as recognition based on the color or texture features of the two-dimensional image of the target area allows for efficient identification, matching, and positioning of the enhanced presentation model. Specifically, the template recognition natural feature map oriented towards feature points or textures is a simple geometric shape image randomly constructed based on the color or texture features of the two-dimensional image of the fabric in the target area.
[0100] In step S3, the template recognition natural feature map is imported into the above-defined flexible cloth collision detection model to perform collision simulation, so as to obtain a visual image presented by cloth enhancement.
[0101] like Figure 4 FIG. 1 is a diagram showing a cloth collision simulation enhancement and presentation device based on a depth image in an embodiment of the present invention, comprising:
[0102] The target region image segmentation unit 110 is configured to obtain a depth map of the cloth and locate the target region space in the depth map of the cloth using a bounding box of a pre-constructed model region of interest;
[0103] The natural feature image generation unit 120 is used to determine the two-dimensional image features of the cloth in the target area space, and randomly construct a template recognition natural feature map oriented to feature points or textures based on the two-dimensional image features of the cloth;
[0104] The collision simulation enhanced image presentation unit 130 is configured to import the template recognition natural feature map into a predefined flexible cloth collision detection model to perform collision simulation, so as to obtain a cloth-enhanced visual image.
[0105] The flexible cloth collision detection model is a flexible cloth three-dimensional model created using elastic mechanics equations, and the flexible cloth three-dimensional model is designed with a parallel processing shader, a collision processing architecture, and a collision response algorithm.
[0106] The implementation of the embodiments of the present invention has the following beneficial effects:
[0107] The present invention uses image target feature areas for augmented reality image matching, adopts real-time flexible cloth simulation enhanced presentation, and adopts efficient collision detection and response methods, thereby combining the positioning and feature matching of the deep image feature space to drive the collision response between the cloth and the real target area, making the augmented reality environment more intuitive and obtaining better simulation effects through cloth enhanced presentation.
[0108] It is worth noting that in the above-mentioned device embodiment, the various units included are only divided according to functional logic, but are not limited to the above-mentioned 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 distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0109] Those skilled in the art will understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc.
[0110] The above disclosure is merely a preferred embodiment of the present invention and certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A cloth collision simulation enhanced presentation method based on depth image, characterized in that: The method comprises the following steps: Obtain a depth map of the fabric, and locate the target area space in the depth map of the fabric using a bounding box of a pre-built model area of interest; Determining the two-dimensional image features of the cloth in the target area space, and randomly constructing a template recognition natural feature map oriented to feature points or textures based on the two-dimensional image features of the cloth; Importing the template recognition natural feature map into a predefined flexible cloth collision detection model to perform collision simulation to obtain a visual image of cloth enhancement; The bounding box of the model area of interest is an AABB bounding box; The flexible cloth collision detection model is a flexible cloth three-dimensional model created using elastic mechanics equations, and the flexible cloth three-dimensional model is designed with a parallel processing shader, a collision processing architecture, and a collision response algorithm; The flexible cloth three-dimensional model is expressed by the following formulas (1) to (5): (1); (2); (3); (4); (5) In formula (1), Represents a point mass at time t The sum of the external forces, Represents a point mass at time t The sum of the forces acting on the internal mass points of the cloth, where X represents the position of the mass points. The internal forces between the mass points are the elastic deformation force and damping force generated by the springs. The external forces are gravity G and the set constant external force. ; In formula (2), Represents a point mass P 0 and P i The elastic deformation coefficient of the spring between two points, Indicates time t particle P 0 and P i The distance between Represents the particle at time zero P 0 and P i The initially set distance, express P i point to P 0 The unit vector of , R represents the set of particle P0 and its adjacent particles; In formula (3), represents the spring damping force; C d represents the damping coefficient; In formula (4), Represents the gravity acting on the mass point; In formula (5), represents the time step; Represents a point mass[ i, j ]At the moment t the net force applied; Represents a point mass[ i, j ]At the moment t acceleration; Represents a point mass[ i, j ]At the moment t speed; Represents a point mass[ i, j ]At the moment t location; The collision processing architecture designed for the flexible cloth 3D model is a structure tree that uses a combination of AABB and Sphere bounding boxes to construct a hierarchical collision detection structure for the collision area; wherein the leaf nodes of the structure tree use Sphere bounding boxes, and the root node uses AABB bounding boxes; The collision response algorithm designed for the flexible cloth 3D model is specifically: If a collision is detected between the particle and the sphere, that is, a collision response is required when the distance between the particle and the center of the sphere is less than the radius of the sphere, the position of the particle needs to be adjusted to the first point where the particle collides with the sphere along the velocity direction, and the velocity of the particle needs to be corrected to only retain the tangential velocity with the sphere.
2. The cloth collision simulation enhanced presentation method based on depth image according to claim 1, characterized in that: The depth map of the cloth is calculated by collecting depth images of a target scene containing the cloth using a camera device or multiple cameras at fixed positions, and combining calibration information and disparity information of the camera device or multiple cameras during depth image collection.
3. The cloth collision simulation enhanced presentation method based on depth image according to claim 1, characterized in that: The natural feature map for template recognition oriented to feature points or textures is a simple geometric shape image randomly constructed according to the color or texture features of the two-dimensional image of the cloth in the target area space.
4. A cloth collision simulation enhanced presentation device based on depth image, characterized in that: include: A target region image segmentation unit is used to obtain a depth map of the cloth and locate the target region space in the depth map of the cloth using a bounding box of a pre-constructed model region of interest; A natural feature image generation unit is used to determine the two-dimensional image features of the cloth in the target area space, and randomly construct a template recognition natural feature map oriented to feature points or textures based on the two-dimensional image features of the cloth; a collision simulation enhanced image presentation unit, configured to import the template recognition natural feature map into a predefined flexible cloth collision detection model to perform collision simulation, so as to obtain a cloth-enhanced visual image; The bounding box of the model area of interest is an AABB bounding box; The flexible cloth collision detection model is a flexible cloth three-dimensional model created using elastic mechanics equations, and the flexible cloth three-dimensional model is designed with a parallel processing shader, a collision processing architecture, and a collision response algorithm; The flexible cloth three-dimensional model is expressed by the following formulas (1) to (5): (1); (2); (3); (4); (5) In formula (1), Represents a point mass at time t The sum of the external forces, Represents a point mass at time t The sum of the forces acting on the internal mass points of the cloth, where X represents the position of the mass points. The internal forces between the mass points are the elastic deformation force and damping force generated by the springs. The external forces are gravity G and the set constant external force. ; In formula (2), Represents a point mass P 0 and P i The elastic deformation coefficient of the spring between two points, Indicates time t particle P 0 and P i The distance between Represents the particle at time zero P 0 and P i The initially set distance, express P i point to P 0 The unit vector of , R represents the set of particle P0 and its adjacent particles; In formula (3), represents the spring damping force; C d represents the damping coefficient; In formula (4), Represents the gravity acting on the mass point; In formula (5), represents the time step; Represents a point mass[ i, j ]At the moment t the net force applied; Represents a point mass[ i, j ]At the moment t acceleration; Represents a point mass[ i, j ]At the moment t speed; Represents a point mass[ i, j ]At the moment t location; The collision processing architecture designed for the flexible cloth 3D model is a structure tree that uses a combination of AABB and Sphere bounding boxes to construct a hierarchical collision detection structure for the collision area; wherein the leaf nodes of the structure tree use Sphere bounding boxes, and the root node uses AABB bounding boxes; The collision response algorithm designed for the flexible cloth 3D model is specifically: If a collision is detected between the particle and the sphere, that is, a collision response is required when the distance between the particle and the center of the sphere is less than the radius of the sphere, the position of the particle needs to be adjusted to the first point where the particle collides with the sphere along the velocity direction, and the velocity of the particle needs to be corrected to only retain the tangential velocity with the sphere.
Citation Information
Patent Citations
Non-coplanar elimination based detecting method for continuous collision of flexible scene
CN102393825A
Classified strain limiting-based dynamic cloth simulation method
CN102592304A