A FBX file segmentation export method, device and computer equipment
By determining the target skeleton and its subordinate covering and maps in the FBX file, sub-files are generated, and the existing FBX files do not support online collaborative editing is solved, and the effect of reducing file processing time and reducing the burden on the working environment is achieved.
Patent Information
- Application Number
- CN202411261895.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-09-10
AI Technical Summary
Existing FBX files do not support online collaborative editing by multiple people, resulting in staggered processing during division of labor and collaboration, resulting in long time and large burden on the work environment, increasing development costs.
The target skeleton is determined by user selection and the maps and components subordinate to the target skeleton are determined according to the assembly relationship. The target skeleton and its subordinate coverings, maps and components are used as the target body, and the coordinate system of each detection point is determined in each frame screen. And integrate, generate a second coordinate system, correspond it to a given coordinate system in the preset three-dimensional space, exclude contents of non-target subjects, and export sub-files that only contain the target subjects.
Split the total file into several sub-files, allowing processing at the same time, reducing file processing time, reducing the data volume and working environment requirements of the sub-files, solving the development costs caused by the long time and large working environment burden during FBX file processing. Added questions.
Smart Images

Figure CN118799465B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of file segmentation, and in particular to a FBX file segmentation export method, device and computer equipment. Background Art
[0002] FBX (File Binary X) is a 3D model file format developed by Autodesk. It is widely used in 3D animation, game development, visual effects and 3D printing. Currently, 3D motion capture systems capture the interactive state of multiple people in multi-person scenes and generate FBX file output.
[0003] For the FBX files generated by the 3D motion capture system, since the FBX files do not support online collaborative editing by multiple people, when dividing the work and collaborating, the general method is to process the same file in staggered times.
[0004] In this way, the subsequent work can only be processed after the previous work is completed, which prolongs the time process; and the amount of data displayed in the file is large, which puts a heavy burden on the file's working environment. This will cause the development cost to increase significantly due to the lengthy time and heavy burden on the working environment during the FBX file processing. Summary of the invention
[0005] Based on this, it is necessary to provide a FBX file segmentation export method, device and computer equipment to address the above problems.
[0006] The embodiment of the present invention is implemented as follows: a method for splitting and exporting an FBX file, the method comprising:
[0007] S101, determining a target skeleton according to a user selection, and determining a subordinate envelope of the target skeleton by scanning the target skeleton;
[0008] S102, determining the textures and components subordinate to the target skeleton according to the assembly relationship;
[0009] S103, taking the target skeleton and its subordinate wrappings, textures and components as the target subject;
[0010] S104, in each frame of the target subject, determining the coordinate system of each detection point and integrating them to obtain a first coordinate system;
[0011] S105, integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and mapping the second coordinate system to a given coordinate system in a preset three-dimensional space;
[0012] S106, excluding the non-target subject content in the total file, and exporting a sub-file containing only the target subject.
[0013] In one embodiment, the present invention provides a device for splitting and exporting a FBX file, and the device for splitting and exporting a FBX file includes:
[0014] A first subordinate module, used to determine a target skeleton according to a user selection, and determine a subordinate envelope of the target skeleton by sweeping the target skeleton;
[0015] The second subordinate module is used to determine the maps and components subordinate to the target skeleton according to the assembly relationship;
[0016] A subject determination module, for taking a target skeleton and its subordinate wraps, textures and components as a target subject;
[0017] A first coordinate module, used to determine the coordinate system of each detection point in each frame of the target subject and integrate them to obtain a first coordinate system;
[0018] A second coordinate module, used for integrating the first coordinate systems of all picture frames of the target subject to obtain a second coordinate system, and corresponding the second coordinate system to a given coordinate system in a preset three-dimensional space;
[0019] The file generation module is used to exclude the non-target subject content in the total file and export a sub-file containing only the target subject.
[0020] In one embodiment, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned FBX file splitting and exporting method.
[0021] An FBX file segmentation and export method provided by an embodiment of the present invention determines a target skeleton according to a user's selection, determines subordinate packages of the target skeleton by scanning the target skeleton; determines maps and components subordinate to the target skeleton according to an assembly relationship; uses the target skeleton and its subordinate packages, maps and components as a target subject; determines the coordinate system of each detection point in each frame of the target subject and integrates to obtain a first coordinate system; integrates the first coordinate system of all frames of the target subject to obtain a second coordinate system, and corresponds the second coordinate system to a given coordinate system of a preset three-dimensional space; excludes the content of the non-target subject in the total file, and exports a sub-file containing only the target subject. In this way, a sub-file to be processed can be obtained from the total file, and the sub-file includes the target subject and the coordinate system corresponding to the target subject in the given coordinate system of the preset three-dimensional space. In this way, the total file can be divided into several sub-files so that they can be processed simultaneously to reduce the file processing time; because the amount of data that needs to be displayed in the sub-file is reduced, the working environment requirements for running the file are reduced, and the problem of a large increase in development costs due to lengthy time and heavy burden on the working environment during the FBX file processing process is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A flowchart of a method for splitting and exporting an FBX file in an embodiment;
[0023] Figure 2 This is a diagram showing the contents of the FBX file;
[0024] Figure 3 Schematic diagram of the skeleton selection in the FBX file;
[0025] Figure 4 It is a display diagram of the contents of the FBX sub-file;
[0026] Figure 5 It is a structural block diagram of a device for splitting and exporting FBX files in one embodiment;
[0027] Figure 6 FIG. 4 is a block diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0029] It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script without departing from the scope of the present invention.
[0030] like Figure 1 As shown, in one embodiment, a method for splitting and exporting an FBX file is proposed, which may specifically include the following steps:
[0031] S101, determining a target skeleton according to a user selection, and determining a subordinate envelope of the target skeleton by scanning the target skeleton;
[0032] S102, determining the textures and components subordinate to the target skeleton according to the assembly relationship;
[0033] S103, taking the target skeleton and its subordinate wrappings, textures and components as the target subject;
[0034] S104, in each frame of the target subject, determining the coordinate system of each detection point and integrating them to obtain a first coordinate system;
[0035] S105, integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and mapping the second coordinate system to a given coordinate system in a preset three-dimensional space;
[0036] S106, excluding the non-target subject content in the total file, and exporting a sub-file containing only the target subject.
[0037] In this embodiment, the number of target skeletons is not fixed, generally 1, so that a sub-file has only one skeleton corresponding to the target subject content. If two or more skeletons are highly related, the number of target skeletons can be two or more according to the user's selection, and the two or more target skeletons can be regarded as one.
[0038] In this embodiment, the skeleton of the FBX file includes a main skeleton and sub-skeletons. The main skeleton is generally the spine, and the sub-skeleton is generally the head, limbs, fingers, etc.
[0039] In this embodiment, wrapping refers to the entity model network of the character's body in the FBX file generated by the motion capture system. The entity module network is generally bound to the skeleton. In essence, each individual bone on the skeleton is bound to a entity model network. For example, the spine is bound to the entity model network representing the torso.
[0040] In this embodiment, since the entity model network generated by the motion capture system is a blank model, the color information or texture information is usually presented later through the map, so the map is imported later. During the import process, the map and the skeleton bones establish an assembly relationship, and the same applies to the components. The component can be a physical model network outside the package. For example, a character holds an object, and this object belongs to the component. A map can establish an assembly relationship with multiple skeletons, and the skeletons that establish an assembly relationship can belong to different skeletons, and the same applies to the components.
[0041] In this embodiment, the motion capture system captures the movements of the person through the marker points on the worker, so the detection points are essentially the marker points.
[0042] In this embodiment, the coordinate system of the detection point is essentially the positioning of the detection point in a three-dimensional space. Each detection point has a positioning in each frame. The three-dimensional spaces of different detection points are not necessarily the same, so the coordinate systems of the detection points may also be different. It is necessary to obtain a first coordinate system through integration. The first coordinate system obtained through integration is a collection of the positioning of all detection points in a frame, and the collection represents the positioning of the target subject in a frame.
[0043] In this embodiment, the second coordinate system obtained by integration is a set of positions of all detection points in all picture frames, and the set represents the positions of the target subject in all picture frames.
[0044] In this embodiment, the preset three-dimensional space given coordinate system refers to the three-dimensional space given coordinate system in the file generated by the motion capture system.
[0045] In this embodiment, the specific steps of S106 are: reversely select the target subject and the coordinate system corresponding to the target subject in a given coordinate system of a preset three-dimensional space in the total file to obtain the content of the non-target subject; convert the content of the non-target subject into a structure; establish a layer tree according to the structure corresponding to the non-target subject, and adjust the state of the established layer tree to hidden; generate a sub-file containing only the target subject according to the adjusted total file and export it.
[0046] In this embodiment, a sub-file containing only the target subject does not mean that the content of the non-target subject is deleted, but only hides the content of the non-target subject so that the content of the non-target subject is not displayed in the sub-file.
[0047] In this embodiment, the contents of the FBX file are shown in the figure below: Figure 2 As shown, Figure 2 You can see that there are multiple characters; the schematic diagram of skeleton selection in the FBX file is as follows Figure 3 As shown, Figure 3 For the person in the middle, the white skeleton can be a target skeleton, and the solid structure formed by the black lines surrounding the target skeleton is a subordinate package of the target skeleton; the content of the FBX sub-file is shown in the figure below. Figure 4 As shown, at this time, only the content of the target skeleton is displayed, that is, the target subject corresponding to the target skeleton and the coordinate system corresponding to the target subject in the given coordinate system of the preset three-dimensional space. Figure 4 The display mode has been changed in the Figure 2 The display mode of the characters in the game is different.
[0048] In this embodiment, the number of sub-files exported in S106 is 1, and multiple sub-files can be exported by repeating S101-S106 multiple times. The content of the sub-file is determined by the target skeleton selected by the user in S101.
[0049] An FBX file segmentation and export method provided by an embodiment of the present invention determines a target skeleton according to a user's selection, determines subordinate packages of the target skeleton by scanning the target skeleton; determines maps and components subordinate to the target skeleton according to an assembly relationship; uses the target skeleton and its subordinate packages, maps and components as a target subject; determines the coordinate system of each detection point in each frame of the target subject and integrates to obtain a first coordinate system; integrates the first coordinate system of all frames of the target subject to obtain a second coordinate system, and corresponds the second coordinate system to a given coordinate system of a preset three-dimensional space; excludes the content of the non-target subject in the total file, and exports a sub-file containing only the target subject. In this way, a sub-file to be processed can be obtained from the total file, and the sub-file includes the target subject and the coordinate system corresponding to the target subject in the given coordinate system of the preset three-dimensional space. In this way, the total file can be divided into several sub-files so that they can be processed simultaneously to reduce the file processing time; because the amount of data that needs to be displayed in the sub-file is reduced, the working environment requirements for running the file are reduced, and the problem of a large increase in development costs due to lengthy time and heavy burden on the working environment during the FBX file processing process is solved.
[0050] In one embodiment, determining the subordinate envelope of the target skeleton by sweeping the target skeleton comprises:
[0051] Divide the target skeleton into several bone segments based on the bone connection points;
[0052] For each bone segment, the plane perpendicular to the bone is scanned along the extension direction of the bone to obtain continuous cross sections;
[0053] The obtained continuous cross-sections constitute a solid structure and are determined as a subordinate package of the skeleton;
[0054] Determines the target skeleton's subordinate wrapping based on each bone's subordinate wrapping.
[0055] In this embodiment, for each bone segment, one end of the connection point between the bone segment and other bones can be taken as the starting point, and the direction from the starting point of the bone segment to the other end of the bone is recorded as the extension direction of the bone. It is worth noting that the other end of the starting point of the bone is not the end point of the scan. The end point of the scan should be the position point where the cross section cannot be connected. Normally, the covering on a bone segment of a character is continuous.
[0056] In one embodiment, determining the maps and components subordinate to the target skeleton according to the assembly relationship includes:
[0057] Get the textures and components that have assembly relationships with the bones in the target skeleton;
[0058] Determine the texture belonging to the target skeleton according to the obtained correlation value between the texture and the target skeleton;
[0059] The component subordinate to the target skeleton is determined according to the obtained connection value between the component and the target skeleton.
[0060] In this embodiment, the target skeleton includes multiple bones, so there may be multiple copies of the acquired textures. If a texture has an assembly relationship with a bone in the target skeleton, it can also be understood that the texture has an assembly relationship with the target skeleton. The same applies to components.
[0061] In this embodiment, if a texture has an assembly relationship with only one skeleton, that is, the texture has an assembly relationship with only one bone in a skeleton, then no matter it is with one end of the skeleton or multiple bones, the association value between the texture and the skeleton is 100%, that is, the texture is completely subordinate to the skeleton. If a texture has an assembly relationship with multiple skeletons, that is, the texture has an assembly relationship with multiple bones and the multiple bones do not belong to the same skeleton, then it is necessary to determine the association value between the texture and the skeleton to determine the subordinate range of the texture in the skeleton.
[0062] In this embodiment, a component can also have an assembly relationship with multiple skeletons. The difference is that there is a connection value between the component and the skeleton, which can be a rotation relationship, a stretching relationship, etc. The allocation method of each connection value is different. It is necessary to determine the connection value between the component and the skeleton to determine the subordinate range of the component in the skeleton. Unlike a map, a map is a pattern attached to the surface, while a component is a physical structure that is different from the target body.
[0063] In one embodiment, determining the texture belonging to the target skeleton according to the acquired correlation value between the texture and the target skeleton includes:
[0064] For each acquired texture, determine all bones that have an assembly relationship with the acquired texture, denoted as bones A;
[0065] The bone in the target skeleton that has an assembly relationship with the acquired texture is recorded as bone B;
[0066] Determine whether bone A is completely consistent with bone B. If so, record the correlation value between the acquired texture and the target skeleton as 100%;
[0067] If bone A is not completely consistent with bone B, the volume ratio of the subordinate package of bone B to the subordinate package of bone A is calculated, and the volume ratio is recorded as the association value between the acquired map and the target skeleton;
[0068] Starting from the side of the acquired texture closest to the skeleton B, the acquired texture is divided by area according to the associated value to obtain a partial texture of the acquired texture, and the obtained partial texture is determined as a texture belonging to the target skeleton.
[0069] In this embodiment, the case where bone A is completely consistent with bone B means that all bones that have an assembly relationship with the acquired texture are bones in the target skeleton, and the acquired texture in this case is completely subordinate to the target skeleton. In this case, bone A can be one segment or multiple segments.
[0070] In this embodiment, if skeleton A is not completely consistent with skeleton B, it means that a part of the acquired texture has an assembly relationship with the skeleton of the non-target skeleton, and the acquired texture needs to be divided.
[0071] In this embodiment, the acquired texture is divided by area according to the association value to obtain partial textures of the acquired texture. For example, if the association value is 50%, the left 50% of the acquired texture belongs to the left skeleton, and the right 50% of the acquired texture belongs to the right skeleton.
[0072] In this embodiment, the texture is attached to the subordinate package of the bone, so the associated value is represented by the volume ratio of the subordinate package of the bone.
[0073] In one embodiment, the step of determining the component subordinate to the target skeleton according to the acquired contact condition between the component and the target skeleton includes:
[0074] For each acquired component, determining whether the acquired component is in contact with only the target skeleton, and if so, determining the acquired component as a component subordinate to the target skeleton;
[0075] If the acquired component is not in contact with only the target skeleton, determining a first portion of the component that is in contact with the target skeleton and a second portion of the component that is in contact with the non-target skeleton;
[0076] Determine a third partial component between the first partial component and the second partial component according to the first partial component and the second partial component;
[0077] A reference line perpendicular to the third component passes through the center of the third component and equally divides the third component to obtain a fourth component;
[0078] The first partial component and a fourth partial component close to the first partial component are determined as components belonging to the target skeleton.
[0079] In this embodiment, there are many types of contacts, such as plane fitting, curved surface fitting, and embedding. For example, the target skeleton is on a step, and the step is the acquired component. If there is only one target skeleton, then the step is only in contact with the target skeleton, and the contact method is plane fitting. At this time, the step is determined as a component subordinate to the target skeleton. If there is a non-target skeleton on the right side of the target skeleton on the step, then the step needs to be divided into left and right parts. For a picture, the first part of the component can be represented by the first line segment on the picture where the target skeleton and the acquired component fit on the picture, and the second part of the component can be represented by the second line segment on the picture where the non-target skeleton and the acquired component fit on the picture. Therefore, the third line segment between the first line segment and the second line segment represents the third part of the component, and the third line segment is divided into two fourth line segments, which is the fourth part of the component. The first part of the component and the fourth part of the component close to the first part of the component are determined as components subordinate to the target skeleton. In essence, the midline of the part of the step between the target skeleton and the non-target skeleton is cut, and the part close to the target skeleton is determined as a component subordinate to the target skeleton.
[0080] In this embodiment, the reference line is a reference line in the stretching direction of the component during modeling.
[0081] In one embodiment, in each frame of the target subject, determining the coordinate system of each detection point and integrating it to obtain the first coordinate system includes:
[0082] For each frame, determine the position of each detection point on the target subject in the frame;
[0083] For each position, a monitoring point that monitors the position is obtained, and a coordinate system of the position is determined according to the monitoring point that monitors the position, thereby obtaining a coordinate system of a detection point corresponding to the position;
[0084] Determine a first transformation relationship between a coordinate system of the detection point corresponding to the position and a first basic coordinate system;
[0085] Mapping the coordinate system of the detection point corresponding to the position to the first basic coordinate system according to the first conversion relationship;
[0086] The first basic coordinate system to which the coordinate systems of all the detection points are mapped is recorded as the first coordinate system.
[0087] In this embodiment, monitoring devices are arranged at the monitoring points. In the motion capture system, the monitoring devices are evenly distributed in the motion capture room. The monitoring devices are used to capture the marking points on the person, that is, the detection points of the target subject. Since the orientation of the monitoring devices does not change, for a detection point, some monitoring devices do not capture the detection point, and the images captured by these monitoring devices are redundant data for the detection point. When a sub-file is established with the target subject as the main body, the redundant data can be excluded to reduce the amount of data that needs to be displayed in the sub-file, that is, only the monitoring points that monitor the position need to be acquired.
[0088] In this embodiment, the first basic coordinate system is a preset coordinate system, which can be a given coordinate system of a preset three-dimensional space, or a coordinate system in other ways, such as selecting a coordinate system of any detection point as the first basic coordinate system. The purpose of the first basic coordinate system is to aggregate the coordinate systems of all detection points into a unified coordinate system.
[0089] In this embodiment, the first conversion relationship includes positional relationships such as rotation, translation, and scaling.
[0090] In one embodiment, determining the coordinate system of the position according to the monitoring point monitoring the position so as to obtain the coordinate system of the detection point corresponding to the position includes:
[0091] For each monitoring point that monitors the location, obtain a monitoring picture of the monitoring point;
[0092] Determine the image coordinates of the position on the monitoring screen of the monitoring point, and determine the distance from the image coordinates of the position to the center point of the monitoring screen of the monitoring point;
[0093] Sort the distances from small to large, select the monitoring points corresponding to the preset number of distances at the top of the sort, and record them as control points;
[0094] For each control point, the image coordinates of the position on the monitoring screen of the control point are obtained;
[0095] Convert the image coordinates of the position at the reference point into three-dimensional homogeneous coordinates according to the internal parameters and depth information of the reference point;
[0096] Convert the three-dimensional homogeneous coordinates of the position at the reference point into the world coordinates of the position at the reference point according to the external parameters of the reference point;
[0097] Get the world coordinates of the position at all reference points;
[0098] The world coordinates of the position at all reference points are estimated using the least square method to obtain a world coordinate of the position;
[0099] The estimated world coordinates of the position are matched to a preset world coordinate system to obtain the coordinate system of the position.
[0100] In this embodiment, the internal parameters include focal length and principal point coordinates, and the external parameters include rotation matrix and translation vector.
[0101] In this embodiment, for one detection point, that is, for one position, there are multiple monitoring points whose monitoring images can be captured. In order to reduce the amount of data to be processed, only the monitoring images of a preset number of monitoring points need to be taken. Since the monitoring point is set as a monitoring device, the farther away from the center, the greater the distortion. Therefore, when selecting a monitoring point, try to select a monitoring point whose corresponding position is close to the center point of the monitoring image. The preset number can be 3 or more, and 3 is preferred.
[0102] In this embodiment, the control point is a screened monitoring point.
[0103] In this embodiment, the preset world coordinate system is a preset coordinate system, and generally a coordinate system consisting of three mutually perpendicular and intersecting coordinate axes X, Y, and Z can be selected. The world coordinates are coordinates existing in the world coordinate system. The preset world coordinate system may be a given coordinate system of a preset three-dimensional space, or it may not be.
[0104] In this embodiment, the world coordinates of the position at all control points may deviate due to the shooting angle of the monitoring point or other factors, so the least squares method is used to estimate the world coordinates of the position at all control points to obtain a world coordinate of the position. In essence, multiple world coordinates are used to estimate a specific coordinate to reduce the possibility of randomness in the data, that is, the data of multiple monitoring points are merged to improve the accuracy of the position corresponding to the determined detection point.
[0105] In one embodiment, the step of integrating the first coordinate systems of all the frames of the target subject to obtain the second coordinate system, and mapping the second coordinate system to a given coordinate system of a preset three-dimensional space includes:
[0106] For each frame of the target subject, determining a second conversion relationship between the first coordinate system of the frame and the second basic coordinate system;
[0107] Mapping the first coordinate system of the picture frame to the second basic coordinate system according to a second conversion relationship;
[0108] The second base coordinate system of the first coordinate system of all the picture frames having the target subject mapped thereon is recorded as the second coordinate system;
[0109] Determining a third transformation relationship between the second coordinate system and a given coordinate system of the preset three-dimensional space;
[0110] The second coordinate system is mapped to a given coordinate system of a preset three-dimensional space according to a third conversion relationship.
[0111] In this embodiment, the second basic coordinate system is similar to the first basic coordinate system, and the second basic coordinate system can be the same as the first basic coordinate system.
[0112] In this embodiment, the second conversion relationship includes positional relationships such as rotation, translation, and scaling.
[0113] In this embodiment, the third conversion relationship includes positional relationships such as rotation, translation, and scaling.
[0114] like Figure 5 As shown, in one embodiment, a device for splitting and exporting FBX files is provided, which may specifically include:
[0115] A first subordinate module, used to determine a target skeleton according to a user selection, and determine a subordinate envelope of the target skeleton by sweeping the target skeleton;
[0116] The second subordinate module is used to determine the maps and components subordinate to the target skeleton according to the assembly relationship;
[0117] A subject determination module, for taking a target skeleton and its subordinate wraps, textures and components as a target subject;
[0118] A first coordinate module, used to determine the coordinate system of each detection point in each frame of the target subject and integrate them to obtain a first coordinate system;
[0119] A second coordinate module, used for integrating the first coordinate systems of all picture frames of the target subject to obtain a second coordinate system, and corresponding the second coordinate system to a given coordinate system in a preset three-dimensional space;
[0120] The file generation module is used to exclude the non-target subject content in the total file and export a sub-file containing only the target subject.
[0121] In this embodiment, each module of the FBX file segmentation and exporting device is a modularization of the method part of the present invention. For the specific explanation of each module, please refer to the corresponding content of the method part of the present invention, and the embodiment of the present invention will not be repeated here.
[0122] Figure 6 FIG. 2 shows an internal structure diagram of a computer device in one embodiment. Figure 6As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement a FBX file segmentation and export method provided in an embodiment of the present invention. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute a FBX file segmentation and export method provided in an embodiment of the present invention. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0123] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0124] In one embodiment, the FBX file segmentation and exporting device provided by the embodiment of the present invention can be implemented in the form of a computer program. The computer program can be used in the following manner: Figure 6 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the FBX file segmentation and exporting device, for example, Figure 5 The first subordinate module, the second subordinate module, the main body determination module, the first coordinate module, the second coordinate module and the file generation module shown in the figure. The computer program composed of each program module enables the processor to execute the steps of the FBX file segmentation and export method of each embodiment of the present invention described in this specification.
[0125] For example, Figure 6 The computer device shown can be Figure 5 The first subordinate module in the FBX file segmentation and exporting device shown executes step S101; the computer device can execute step S102 through the second subordinate module; the computer device can execute step S103 through the subject determination module; the computer device can execute step S104 through the first coordinate module; the computer device can execute step S105 through the second coordinate module; the computer device can execute step S106 through the file generation module.
[0126] In one embodiment, a computer device is provided, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0127] S101, determining a target skeleton according to a user selection, and determining a subordinate envelope of the target skeleton by scanning the target skeleton;
[0128] S102, determining the textures and components subordinate to the target skeleton according to the assembly relationship;
[0129] S103, taking the target skeleton and its subordinate wrappings, textures and components as the target subject;
[0130] S104, in each frame of the target subject, determining the coordinate system of each detection point and integrating them to obtain a first coordinate system;
[0131] S105, integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and mapping the second coordinate system to a given coordinate system in a preset three-dimensional space;
[0132] S106, excluding the non-target subject content in the total file, and exporting a sub-file containing only the target subject.
[0133] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps:
[0134] S101, determining a target skeleton according to a user selection, and determining a subordinate envelope of the target skeleton by scanning the target skeleton;
[0135] S102, determining the textures and components subordinate to the target skeleton according to the assembly relationship;
[0136] S103, taking the target skeleton and its subordinate wrappings, textures and components as the target subject;
[0137] S104, in each frame of the target subject, determining the coordinate system of each detection point and integrating them to obtain a first coordinate system;
[0138] S105, integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and mapping the second coordinate system to a given coordinate system in a preset three-dimensional space;
[0139] S106, excluding the non-target subject content in the total file, and exporting a sub-file containing only the target subject.
[0140] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0141] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0142] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A method for splitting and exporting FBX files, characterized in that: The FBX file segmentation export method comprises: S101, determining a target skeleton according to a user selection, and determining a subordinate envelope of the target skeleton by scanning the target skeleton; S102, determining the textures and components subordinate to the target skeleton according to the assembly relationship; S103, taking the target skeleton and its subordinate wrappings, textures and components as the target subject; S104, in each frame of the target subject, determining the coordinate system of each detection point and integrating them to obtain a first coordinate system; S105, integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and mapping the second coordinate system to a given coordinate system in a preset three-dimensional space; S106, excluding the non-target subject content in the total file, and exporting a sub-file containing only the target subject; In each frame of the target subject, determining the coordinate system of each detection point and integrating it to obtain a first coordinate system includes: For each frame, determine the position of each detection point on the target subject in the frame; For each position, a monitoring point that monitors the position is obtained, and a coordinate system of the position is determined according to the monitoring point that monitors the position, thereby obtaining a coordinate system of a detection point corresponding to the position; Determine a first transformation relationship between a coordinate system of the detection point corresponding to the position and a first basic coordinate system; Mapping the coordinate system of the detection point corresponding to the position to the first basic coordinate system according to the first conversion relationship; The first basic coordinate system of the coordinate system in which all the detection points are mapped is recorded as the first coordinate system; The step of determining the coordinate system of the position according to the monitoring point monitoring the position so as to obtain the coordinate system of the detection point corresponding to the position includes: For each monitoring point that monitors the location, obtain a monitoring picture of the monitoring point; Determine the image coordinates of the position on the monitoring screen of the monitoring point, and determine the distance from the image coordinates of the position to the center point of the monitoring screen of the monitoring point; Sort the distances from small to large, select the monitoring points corresponding to the preset number of distances at the top of the sort, and record them as control points; For each control point, the image coordinates of the position on the monitoring screen of the control point are obtained; Convert the image coordinates of the position at the reference point into three-dimensional homogeneous coordinates according to the internal parameters and depth information of the reference point; Convert the three-dimensional homogeneous coordinates of the position at the reference point into the world coordinates of the position at the reference point according to the external parameters of the reference point; Get the world coordinates of the position at all reference points; The world coordinates of the position at all reference points are estimated using the least square method to obtain a world coordinate of the position; Corresponding the estimated world coordinates of the position to a preset world coordinate system to obtain a coordinate system of the position; The step of integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and corresponding the second coordinate system to a given coordinate system in a preset three-dimensional space includes: For each frame of the target subject, determining a second conversion relationship between the first coordinate system of the frame and the second basic coordinate system; Mapping the first coordinate system of the picture frame to the second basic coordinate system according to a second conversion relationship; The second base coordinate system of the first coordinate system of all the picture frames having the target subject mapped thereon is recorded as the second coordinate system; Determining a third transformation relationship between the second coordinate system and a given coordinate system of the preset three-dimensional space; The second coordinate system is mapped to a given coordinate system of a preset three-dimensional space according to a third conversion relationship.
2. The FBX file segmentation and exporting method according to claim 1, characterized in that: The determining the subordinate envelope of the target skeleton by sweeping the target skeleton comprises: Divide the target skeleton into several bone segments based on the bone connection points; For each bone segment, the plane perpendicular to the bone is scanned along the extension direction of the bone to obtain continuous cross sections; The obtained continuous cross-sections constitute a solid structure and are determined as a subordinate package of the skeleton; Determines the target skeleton's subordinate wrapping based on each bone's subordinate wrapping.
3. The FBX file segmentation and exporting method according to claim 1, characterized in that: The step of determining the maps and components subordinate to the target skeleton according to the assembly relationship includes: Get the textures and components that have assembly relationships with the bones in the target skeleton; Determine the texture belonging to the target skeleton according to the obtained correlation value between the texture and the target skeleton; The component subordinate to the target skeleton is determined according to the contact condition between the acquired component and the target skeleton.
4. The FBX file segmentation and exporting method according to claim 3, characterized in that: The step of determining the map belonging to the target skeleton according to the obtained association value between the map and the target skeleton comprises: For each acquired texture, determine all bones that have an assembly relationship with the acquired texture, denoted as bones A; The bone in the target skeleton that has an assembly relationship with the acquired texture is recorded as bone B; Determine whether bone A is completely consistent with bone B. If so, record the correlation value between the acquired texture and the target skeleton as 100%; If bone A is not completely consistent with bone B, the volume ratio of the subordinate package of bone B to the subordinate package of bone A is calculated, and the volume ratio is recorded as the association value between the acquired map and the target skeleton; Starting from the side of the acquired texture closest to the skeleton B, the acquired texture is divided by area according to the associated value to obtain a partial texture of the acquired texture, and the obtained partial texture is determined as a texture belonging to the target skeleton.
5. The FBX file segmentation and exporting method according to claim 3, characterized in that: The step of determining the component subordinate to the target skeleton according to the acquired contact condition between the component and the target skeleton comprises: For each acquired component, determining whether the acquired component is in contact with only the target skeleton, and if so, determining the acquired component as a component subordinate to the target skeleton; If the acquired component is not in contact with only the target skeleton, a first portion of the component in contact with the target skeleton is determined on the acquired component, and a second portion of the component in contact with the non-target skeleton is determined on the acquired component; Determine a third partial component between the first partial component and the second partial component according to the first partial component and the second partial component; A reference line perpendicular to the third component passes through the center of the third component and equally divides the third component to obtain a fourth component; The first partial component and a fourth partial component close to the first partial component are determined as components belonging to the target skeleton.
6. A device for splitting and exporting FBX files, characterized in that: The FBX file segmentation and exporting device comprises: A first subordinate module, used to determine a target skeleton according to a user selection, and determine a subordinate envelope of the target skeleton by sweeping the target skeleton; The second subordinate module is used to determine the maps and components subordinate to the target skeleton according to the assembly relationship; A subject determination module, for taking a target skeleton and its subordinate wraps, textures and components as a target subject; A first coordinate module, used to determine the coordinate system of each detection point in each frame of the target subject and integrate them to obtain a first coordinate system; A second coordinate module, used for integrating the first coordinate systems of all picture frames of the target subject to obtain a second coordinate system, and corresponding the second coordinate system to a given coordinate system in a preset three-dimensional space; A file generation module is used to exclude non-target subject contents from the total file and export a sub-file containing only the target subject; In each frame of the target subject, determining the coordinate system of each detection point and integrating it to obtain a first coordinate system includes: For each frame, determine the position of each detection point on the target subject in the frame; For each position, a monitoring point that monitors the position is obtained, and a coordinate system of the position is determined according to the monitoring point that monitors the position, thereby obtaining a coordinate system of a detection point corresponding to the position; Determine a first transformation relationship between a coordinate system of the detection point corresponding to the position and a first basic coordinate system; Mapping the coordinate system of the detection point corresponding to the position to the first basic coordinate system according to the first conversion relationship; The first basic coordinate system of the coordinate system in which all the detection points are mapped is recorded as the first coordinate system; The step of determining the coordinate system of the position according to the monitoring point monitoring the position so as to obtain the coordinate system of the detection point corresponding to the position includes: For each monitoring point that monitors the location, obtain a monitoring picture of the monitoring point; Determine the image coordinates of the position on the monitoring screen of the monitoring point, and determine the distance from the image coordinates of the position to the center point of the monitoring screen of the monitoring point; Sort the distances from small to large, select the monitoring points corresponding to the preset number of distances at the top of the sort, and record them as control points; For each control point, the image coordinates of the position on the monitoring screen of the control point are obtained; Convert the image coordinates of the position at the reference point into three-dimensional homogeneous coordinates according to the internal parameters and depth information of the reference point; Convert the three-dimensional homogeneous coordinates of the position at the reference point into the world coordinates of the position at the reference point according to the external parameters of the reference point; Get the world coordinates of the position at all reference points; The world coordinates of the position at all reference points are estimated using the least square method to obtain a world coordinate of the position; Corresponding the estimated world coordinates of the position to a preset world coordinate system to obtain a coordinate system of the position; The step of integrating the first coordinate systems of all the picture frames of the target subject to obtain a second coordinate system, and corresponding the second coordinate system to a given coordinate system in a preset three-dimensional space includes: For each frame of the target subject, determining a second conversion relationship between the first coordinate system of the frame and the second basic coordinate system; Mapping the first coordinate system of the picture frame to the second basic coordinate system according to a second conversion relationship; The second base coordinate system of the first coordinate system of all the picture frames having the target subject mapped thereon is recorded as the second coordinate system; Determining a third transformation relationship between the second coordinate system and a given coordinate system of the preset three-dimensional space; The second coordinate system is mapped to a given coordinate system of a preset three-dimensional space according to a third conversion relationship.
7. A computer device, characterized in that: The invention comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the FBX file splitting and exporting method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Image segmentation method, image segmentation device, image segmentation device and medium
CN110276768A
Security check image checking method and device
CN117495861A