Method for automatically modeling object
Through multi-angle video data collection and model detection and segmentation, combined with the 3D Gaussian algorithm and XGBoost classification model, the problem of multi-step manual intervention and blurring required for object modeling in the existing technology is solved, and the effect of automated 3D modeling and high fidelity is achieved. .
Patent Information
- Application Number
- CN202410738078.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-03
AI Technical Summary
The existing technology requires multi-step manual intervention and supplementary camera parameters in the object modeling process, and the traditional mesh model is not blurry enough and lacks effective solutions.
By collecting video data from multiple angles, using the GroundingDino model and SAM model for detection and segmentation, combined with the 3D Gaussian algorithm and XGBoost two-classification model, the Gaussian model is automatically constructed, Gaussian points are screened and optimized, and automated 3D modeling of objects is realized.
It realizes automatic completion of 3D modeling without camera parameters and redundant operations, improves modeling efficiency and model quality, and the generated model is more realistic than traditional mesh models.
Smart Images

Figure CN118587358A
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of automatic modeling, and in particular to a method for automatic modeling of an object. Background Art
[0002] In the prior art, generally, in the modeling process, NERF is used to model the entire scene containing the object, and then a single object is segmented from the entire scene to generate a 3D model of the object.
[0003] The above methods require additional camera parameters and multiple steps of manual intervention to complete the modeling. In addition, the traditional mesh model is not realistic enough due to blur.
[0004] To address the above problems, no effective solution has been proposed yet.
[0005] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present invention and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because these solutions are described in the background technology section of the present invention. Summary of the invention
[0006] The purpose of this application is to provide a method for automatic object modeling to solve the above problems.
[0007] The present application provides a method for automatic modeling of an object, comprising the following steps:
[0008] S1, collecting video data from multiple angles for the object to be modeled, and there is no object with the same name as the object to be modeled in the first frame;
[0009] S2, extracting frames from the video data to obtain batch image data of the object to be modeled;
[0010] S3, detecting the objects to be modeled in the batch image data, and segmenting the detected batch image data to obtain a segmentation result of the batch image data;
[0011] S4, taking the segmentation result as input, and performing modeling by a 3D Gaussian algorithm to obtain an original Gaussian model;
[0012] S5. Input the 11-dimensional features in the Gaussian points in the original Gaussian model into the binary classification model of the classifier training set to output the Gaussian point classification result; if the output Gaussian point is a positive sample, it is saved in the original Gaussian model; if the output Gaussian point is a negative sample, it is deleted from the original Gaussian model.
[0013] Preferably, the objects to be modeled in the video data are detected by the GroundingDino model, and the detected objects to be modeled are segmented by the SAM model.
[0014] Preferably, when processing the video data in S3, the name of the object to be modeled is input as a prompt, the object to be modeled in the first frame is detected to obtain a detection frame, the detected detection frame is used as a detection result, and the detection result is segmented to obtain and save a first segmentation result.
[0015] Preferably, when the video data is processed in S3, after processing the first frame, each frame after the first frame is detected and segmented in turn. If there are multiple objects with the same name in any frame, the detection frame in the single image data with multiple objects with the same name is compared with the detection frame in the previous frame, and the detection frame with the largest IOU is selected as the detection result in the single image data with multiple objects with the same name, and the detection result is segmented to obtain a second segmentation result and save it.
[0016] Preferably, the frame rate of frame extraction is set to 2 during S2.
[0017] Preferably, the 11-dimensional features include spherical harmonics (f_dc_0 / f_dc_1 / f_dc_2), transparency (opacity), scaling (scale_0 / scale_1 / scale_2), and rotation (rot_0 / rot_1 / rot_2 / rot_3).
[0018] Preferably, in the process of preparing the classifier training set, the positive sample data is added with a label column value of 0, and the negative sample data is added with a label column value of 1.
[0019] Preferably, XGBoost is selected as the binary classification model.
[0020] Preferably, in S2, FFmpeg is used to extract frames of the video data.
[0021] Preferably, the classifier is trained by constructing a data set to automatically screen the Gaussian points to distinguish positive samples from negative samples.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] 1. The present invention collects video data from multiple angles and processes the video data using the GroundingDino model and the SAM model, thereby accurately obtaining the segmentation results of batch image data.
[0024] 2. The present invention uses the segmentation result as input and models it using a 3D Gaussian algorithm, thereby quickly obtaining the original Gaussian model.
[0025] 3. The present invention sets XGBoost as a binary classification model, thereby accurately distinguishing positive samples from negative samples of Gaussian points, and thus effectively optimizing the original Gaussian model.
[0026] 4. The present invention associates the next frame in the video data with the previous frame by setting the IOU threshold. It only needs to ensure that there are no similar objects in the first frame to accurately obtain the segmentation result of each frame, and then stably perform modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0028] Figure 1 It is a flow chart of a method for automatic object modeling provided in an embodiment of this application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be described clearly and completely below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0030] In the description of the present invention, it should be noted that the orientations or positional relationships indicated by the terms "upper", "middle", "lower", "inner", "outer", "front", "back", etc. are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. The terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. The following describes an implementation method of the present invention based on its overall structure.
[0031] Reference Figure 1As shown, the embodiment of the present application provides a method for automatic modeling of an object, comprising the following steps:
[0032] S1, collecting video data from multiple angles of the object to be modeled, and there is no object with the same name as the object to be modeled in the first frame;
[0033] S2, extracting frames from the video data to obtain batch image data of the object to be modeled;
[0034] S3, detecting the objects to be modeled in the batch image data, and segmenting the detected batch image data to obtain a segmentation result of the batch image data;
[0035] S4, taking the segmentation result as input, modeling is performed through a 3D Gaussian algorithm to obtain an original Gaussian model;
[0036] S5. Input the 11-dimensional features of the Gaussian points in the original Gaussian model into the binary classification model of the classifier training set to output the Gaussian point classification result; if the output Gaussian point is a positive sample, it is saved in the original Gaussian model; if the output Gaussian point is a negative sample, it is deleted from the original Gaussian model.
[0037] In the existing modeling process, those skilled in the art will use NERF to model the entire scene of the object to be modeled, and then segment the individual objects to be modeled from the entire scene, and finally produce a 3D model of the object to be modeled. Among them, the existing implementation method cannot automatically complete the modeling after shooting, and the fidelity of the mesh model used in the modeling process is poor.
[0038] In the embodiment of the present application, the use of a Gaussian model for modeling can achieve the effect of automatically completing 3D modeling by simply providing a video of the object and the name of the object.
[0039] Specifically, those skilled in the art can select an object to be modeled and collect video data of the object to be modeled. It is worth noting that when collecting video data of the object to be modeled, the data can be collected from multiple angles with the object to be modeled as the center. Those skilled in the art can choose to use a mobile phone, a camera or other video acquisition equipment to perform the above process.
[0040] In one implementation, those skilled in the art may use a mobile phone, a camera, or other video acquisition equipment to shoot at multiple angles around the object to be modeled.
[0041] In the above acquisition process, it is understandable that those skilled in the art can acquire video data of the object to be modeled from as many angles as possible, so that the subsequent modeling process can be more accurate and stable.
[0042] After collecting the video data of the object to be modeled, the video can be framed. Preferably, the frame rate of the frame is set to 2 during the frame extraction process. More preferably, FFmpeg can be used to extract frames from the video data. Or, the video data can be framed through code. Then, the video data can be converted into image data for storage.
[0043] In the above frame extraction process, those skilled in the art can extract the collected video data and then continue to process it. Furthermore, the video data can be processed using the GroundingDino model and the SAM model.
[0044] Specifically, in the process of processing video data, preferably, the name of the object to be modeled is input as a prompt, the object to be modeled in the first frame is detected by the GroundingDino model to obtain a detection frame, the detected detection frame is used as the detection result, and the detection result is segmented to obtain and save the first segmentation result.
[0045] Through the above process, the object to be modeled in the first frame can be accurately identified. That is, in this embodiment, the GroundingDino model can be used to detect and identify the object to be modeled in the first frame, and then the SAM model can be used to segment it. Then, the object to be modeled in the first frame can be segmented according to the prompt to obtain the first segmentation result and save it.
[0046] In the above-mentioned implementation, those skilled in the art set that there is no object with the same name as the object to be modeled in the first frame. In this implementation, the name of the object to be modeled is input as a prompt. That is, in the first frame, when the name of the object to be modeled is input as a prompt, a situation where multiple different objects are detected will not occur. This can effectively improve the accuracy of detection.
[0047] In this embodiment, the video data continues to be processed. Preferably, after processing the first frame, each frame after the first frame is detected and segmented in turn. If there are multiple objects with the same name in any frame, the detection frame in the single image data with multiple objects with the same name is compared with the detection frame in the previous frame. In the single image data with multiple objects with the same name, the detection frame with the largest IOU is selected as the detection result, and the detection result is segmented to obtain and save the second segmentation result.
[0048] That is, in this embodiment, the GroundingDino model can be used to detect and identify the object to be modeled in each frame in turn, and then segmented by the SAM model. Furthermore, in the process of detecting the object to be modeled in each frame of video data through the GroundingDino model according to the prompt, if it is detected that there are multiple objects with the same name as the object to be modeled in a frame, all detection frames in the frame can be compared with the detection frames in the previous frame. The detection frame with the largest IOU is selected, and the object to be modeled in the image data where there are multiple objects with the same name as the object to be modeled can be effectively detected. Among them, IOU is a term in the field of images, which refers to the intersection of two rectangular detection frames / the union of two rectangular detection frames.
[0049] Through the above process, the first segmentation result and the second segmentation result can be obtained. In the overall processing process, the first segmentation result and the second segmentation result can be recorded together as the segmentation result. It can be understood that the first segmentation result and the second segmentation result are recorded together as the segmentation result as a step operation record. In the implementation process, the first segmentation result and the second segmentation result can still be kept independently.
[0050] In the above process, preferably, only the object to be modeled exists in the first frame of the video data. That is, when the video data is collected by a mobile phone, camera or other video collection device, in this embodiment, it can be set that only the object to be modeled exists in the first frame of the collected video data.
[0051] It can be understood that by setting the first frame to have only the object to be modeled, the accuracy of the first segmentation result can be effectively improved, that is, there is no ambiguity in the detection and segmentation process of the first frame.
[0052] There is no ambiguity in the processing of the first frame. If there is no ambiguity in the processing of the second frame, the detection and segmentation of the subsequent frames will be performed in sequence. If an ambiguous frame of image data is detected during the recognition process, its detection frame is compared with the detection frame of the previous frame that has been detected, and the detection frame with the largest IOU in the ambiguous frame of image data is selected.
[0053] For example, it is detected that there are multiple objects with the same name as the object to be modeled in the tenth frame. That is, multiple detection frames will appear in the tenth frame. The multiple detection frames in the tenth frame are compared with the detection frames in the ninth frame, and the detection frame with the highest overlap with the detection frame in the ninth frame is selected in the tenth frame, so as to complete the detection of the object to be modeled in the tenth frame. The detection frame with the highest overlap is taken as the detection result, and the detection result is segmented. In this way, the object to be modeled in the tenth frame can be separated.
[0054] By analogy, the above operation is performed on each frame, and the objects to be modeled in the batch image data can be segmented, and the segmentation results are saved and the modeling operation is continued.
[0055] In summary, those skilled in the art can use the GroundingDino model to identify and detect the objects to be modeled in the video data, and then segment the detected objects to be modeled through the SAM model.
[0056] The above settings can significantly improve the recognition accuracy and efficiency of the GroundingDino model by detecting and recognizing the object to be modeled in the first frame.
[0057] Preferably, multiple objects to be modeled are detected in any frame except the first frame. It is understandable that, in the process of detecting each frame of video data through the GroundingDino model, multiple objects to be modeled can be detected in any frame except the first frame.
[0058] In the above implementation, those skilled in the art can obtain the corresponding segmentation results. Further, the segmentation results can be used as input to perform modeling through a 3D Gaussian algorithm to obtain an original Gaussian model.
[0059] In one embodiment, since the detected object to be modeled may contain a small amount of other objects during segmentation by the SAM model, or the segmentation of some angle edges may be inaccurate during the segmentation process, the original Gaussian model may contain some black spots.
[0060] It is understandable that the original Gaussian model contains multiple Gaussian points. Further, the original Gaussian model can be divided into positive samples and negative samples. It is understandable that, according to the above implementation, the negative sample here can be a part containing a black point set or other parts that affect modeling.
[0061] Furthermore, those skilled in the art can set and select 11-dimensional features of Gaussian points in the 3D Gaussian algorithm modeling results. More preferably, the 11-dimensional features can be set to include spherical harmonics (f_dc_0 / f_dc_1 / f_dc_2), transparency (opacity), scaling (scale_0 / scale_1 / scale_2), and rotation (rot_0 / rot_1 / rot_2 / rot_3).
[0062] In this embodiment, the classifier is trained by constructing a data set to automatically screen Gaussian points to distinguish positive samples from negative samples. That is, a large amount of data can be provided through manual training, and during the training process, the label column value added to the positive sample data is set to 0, and the label column value added to the negative sample is set to 1, so that a classifier training set can be prepared. When preparing the classifier training set, XGBoost can be selected as a binary classification model.
[0063] The 11-dimensional features of the Gaussian points in the original Gaussian model are input into the binary classification model of the classifier, and then the Gaussian points can be classified and output. If the output Gaussian point is a positive sample, it is saved in the original Gaussian model; if the output Gaussian point is a negative sample, it is deleted from the original Gaussian model.
[0064] According to the above settings, those skilled in the art can use XGBoost as a binary classification model, and input and output the Gaussian points in the original Gaussian model through the binary classification model, thereby completing the detection. The output Gaussian points can be divided into positive samples and negative samples. When the output Gaussian point is a positive sample, the Gaussian point can be saved; when the output Gaussian point is a negative sample, the Gaussian point of the negative sample can be deleted.
[0065] According to the above embodiment, the negative sample may be a set of black spots or other parts that affect modeling. The negative samples output in the binary classification model are deleted, and the original Gaussian model can be optimized. The parts that affect the modeling effect in the original Gaussian model can be effectively removed.
[0066] In summary, the above method can automatically complete 3D modeling by providing only the video and the name of the object to be modeled, without the need for camera parameters and other redundant operations, thereby simplifying the object 3D modeling process, reducing labor costs, improving modeling efficiency, and improving model quality. Moreover, the high fidelity of the 3D Gaussian model makes the built model more realistic than the traditional mesh model.
[0067] Although different specific embodiments are mentioned in the content of this application, this application is not limited to the situations described in the industry standards or embodiments, etc. Some industry standards or slightly modified implementation plans based on the implementation of the custom methods or embodiments can also achieve the same, equivalent or similar, or predictable implementation effects after deformation of the above embodiments. The embodiments of data acquisition, processing, output, judgment methods, etc. after these modifications or deformations can still fall within the scope of the optional implementation plans of this application.
[0068] Although the present application has been described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present application without departing from the spirit of the present application. It is intended that the attached embodiments include these modifications and changes without departing from the present application.
Claims
1. A method for automatic object modeling, characterized in that: The following steps are involved: S1, collecting video data from multiple angles for the object to be modeled, and there is no object with the same name as the object to be modeled in the first frame; S2, extracting frames from the video data to obtain batch image data of the object to be modeled; S3, detecting the objects to be modeled in the batch image data, and segmenting the detected batch image data to obtain a segmentation result of the batch image data; S4, taking the segmentation result as input, and performing modeling by a 3D Gaussian algorithm to obtain an original Gaussian model; S5. Input the 11-dimensional features in the Gaussian points in the original Gaussian model into the binary classification model of the classifier to output the Gaussian point classification result; if the output Gaussian point is a positive sample, it is saved in the original Gaussian model; if the output Gaussian point is a negative sample, it is deleted from the original Gaussian model.
2. The method for automatic object modeling according to claim 1, characterized in that: The GroundingDino model is used to detect the objects to be modeled in the video data, and the SAM model is used to segment the detected objects to be modeled.
3. The method for automatic object modeling according to claim 1, characterized in that: When processing the video data in S3, the name of the object to be modeled is input as a prompt, the object to be modeled in the first frame is detected to obtain a detection frame, the detected detection frame is used as a detection result, and the detection result is segmented to obtain and save a first segmentation result.
4. The method for automatic object modeling according to claim 3, characterized in that: When the video data is processed in S3, after processing the first frame, each frame after the first frame is detected and segmented in turn. If there are multiple objects with the same name in any frame, the detection frame in the single image data with multiple objects with the same name is compared with the detection frame in the previous frame, and the detection frame with the largest IOU is selected as the detection result in the single image data with multiple objects with the same name, and the detection result is segmented to obtain and save the second segmentation result.
5. The method for automatic object modeling according to claim 1, characterized in that: In the process of S2, the frame rate of frame extraction is set to 2.
6. The method for automatic object modeling according to claim 1, characterized in that: The 11-dimensional features include spherical harmonics (f_dc_0 / f_dc_1 / f_dc_2), transparency (opacity), scaling (scale_0 / scale_1 / scale_2), and rotation (rot_0 / rot_1 / rot_2 / rot_3).
7. The method for automatic object modeling according to claim 1, characterized in that: In the process of making the classifier training set, the positive sample data is added with a label column value of 0, and the negative sample data is added with a label column value of 1.
8. The method for automatic object modeling according to claim 1, characterized in that: XGBoost is selected as the binary classification model.
9. The method for automatic object modeling according to claim 1, characterized in that: In S2, FFmpeg is used to extract frames from the video data, or, codes are used to extract frames from the video data.
10. The method for automatic object modeling according to claim 1, characterized in that: The classifier is trained by constructing a data set to automatically screen the Gaussian points to distinguish positive samples from negative samples.
