A steel bar instance segmentation synthetic dataset generation method, system and electronic equipment
By generating a synthetic dataset through parametric modeling of steel bars and virtual scene rendering, the problem of time-consuming and labor-intensive collection of steel bar datasets and high learning costs in existing technologies is solved, achieving efficient and accurate dataset creation and improved recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI UNIV
- Filing Date
- 2023-02-20
- Publication Date
- 2026-05-29
Smart Images

Figure CN116129431B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, system, and electronic device for generating a composite dataset by segmenting and synthesizing steel bar instances. Background Technology
[0002] Smart construction aims to replace tedious and repetitive manual labor with automated operations using intelligent construction machinery, thereby reducing costs and increasing efficiency. Taking rebar engineering as an example, to use intelligent machinery to achieve rebar tying and construction quality inspection, it is necessary to rely on deep learning image recognition algorithms to segment and identify rebar instances, so as to quickly and accurately obtain the number, spacing, and diameter of rebars.
[0003] The recognition effect of deep learning algorithms largely depends on the size and quality of the training set. In addition to manual collection and annotation, 3D software can also be used to generate images with near-realistic effects and achieve automatic annotation. Currently, researchers have used Unreal Engine to create synthetic datasets for construction machinery. For example, the literature "Deep Learning Image Dataset Synthesis Method for Construction Machinery" [J]. Lu Yujie, Liu Bo, Liu Jinshan, Zhao Xianzong. Journal of Building Science and Engineering, 2022, 39(04):100-107+4. NVIDIA and Unity have also launched synthetic dataset generation plugins based on Unreal Engine and Unity3D, respectively. For example, the literature "Falling Things-ASynthetic Dataset for 3D Object Detection and Pose Estimation" [C] / / . In IEEE / CVF Conference on Computer Vision and Pattern Recognition Workshops. 2018. and the literature "Anthony Navarro, James Fort. Supercharge your computer vision models with synthetic datasets built by Unity" [EB / OL]. Based on the above description, the current methods for collecting and acquiring rebar datasets have the following problems:
[0004] 1) There are many types and materials of steel bars, and manually collecting photos and labeling data is time-consuming, labor-intensive, and has low labeling accuracy.
[0005] 2) Using Unreal Engine and Unity Engine to generate synthetic datasets has a high learning cost and involves cumbersome steps.
[0006] Therefore, how to efficiently and accurately create synthetic datasets suitable for instance segmentation tasks has become a pressing technical problem in this field. Summary of the Invention
[0007] The purpose of this invention is to provide a method, system, and electronic device for generating synthetic datasets for rebar instance segmentation, which can efficiently and accurately create synthetic datasets suitable for instance segmentation tasks.
[0008] To achieve the above objectives, the present invention provides the following solution:
[0009] A method for generating a composite dataset by segmenting rebar instances includes:
[0010] Parametric modeling of the reinforcing bars yields the reinforcing bar model;
[0011] A steel mesh model is constructed based on the steel bar model;
[0012] The scene model is obtained by virtually arranging the steel mesh model.
[0013] The scene model is rendered to obtain a composite image and a material ID map;
[0014] The material ID image is processed to obtain an annotation image;
[0015] Generate text labels based on the labeled map;
[0016] A synthetic dataset is constructed based on the synthesized image, the labeled image, and the text labels.
[0017] Optionally, 3D rendering software can be used to set up a virtual scene.
[0018] Optionally, the scene model is rendered to obtain a composite image and a material ID map, specifically including:
[0019] A virtual camera lens is panned in multiple directions to create a translational motion picture;
[0020] The translation animation is output as a sequence of image frames, and the resulting JPG format image is used as the composite image.
[0021] Copy the scene clip from the rendered composite image, and hide all models in the scene clip except for the target object in edit mode;
[0022] Using the virtual camera lens, the material ID image is obtained by outputting a PNG format image through the material channel.
[0023] Optionally, the virtual camera lens is perpendicular to the plane of the steel mesh model, and the edges of the image captured by the virtual camera lens are parallel or perpendicular to the steel bars in the steel mesh model, and the number of steel bars in the field of view of the virtual camera lens is not greater than a set number.
[0024] The virtual camera lens has a shooting rate of no less than 1 frame per second, an output resolution of 1280x720, and a lens focal length of 24mm.
[0025] Optionally, image processing is performed on the material ID map to obtain an annotation map, specifically including:
[0026] Transition color pixels are obtained by filtering from the material ID image;
[0027] The color values of the transition color pixels are converted into set annotation color values to obtain standard color pixels;
[0028] The standard color pixels are filtered using the mode filtering method to obtain the labeled image.
[0029] Optionally, converting the color value of the transition color pixel into a set annotation color value to obtain a standard color pixel specifically includes:
[0030] Obtain a standard color value, and determine the color distance between the color value of the transition color pixel and the standard color value based on the standard color value;
[0031] The standard color pixel is obtained by converting the color value of the transition color pixel to the annotation color value that has the smallest distance from its color.
[0032] Optionally, the standard color pixels are filtered using a mode filtering method to obtain the annotation map, specifically including:
[0033] The annotation map is obtained by sequentially applying mode filtering to the specified pixels in all standard color pixels, once in an n×n range and once in an m×m range; n and m are both odd numbers; the mode filtering is used to define the color value of the specified pixel as the color value that appears most frequently, excluding black, among all pixel color values within the set range.
[0034] Optionally, a synthetic dataset is constructed based on the synthesized image, the labeled image, and the text labels, specifically including:
[0035] Place the synthesized image into a folder named "imgs", the labeled image into a folder named "mask", and the text label into a folder named "yaml" to complete the creation of the synthesized dataset.
[0036] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0037] The method for generating synthetic datasets for rebar instance segmentation provided by this invention creates a 3D model of the target object and a virtual environment layout, renders an image close to a real photograph, and distinguishes different rebar instances through material channels, thereby achieving automatic annotation of rebars. It can efficiently and accurately create synthetic datasets suitable for instance segmentation tasks.
[0038] In addition, the present invention also provides the following embodiments:
[0039] A system for generating synthetic datasets by segmenting rebar instances, applied to the aforementioned method for generating synthetic datasets by segmenting rebar instances; the system includes:
[0040] The rebar model building module is used to perform parametric modeling of rebars to obtain rebar models;
[0041] A steel mesh model construction module is used to construct a steel mesh model based on the steel mesh model.
[0042] The scene model layout module is used to virtually arrange the steel mesh model to obtain a scene model.
[0043] The model rendering module is used to render the scene model to obtain a composite image and a material ID image;
[0044] The image processing module is used to perform image processing on the material ID image to obtain an annotation image;
[0045] The text label generation module is used to generate text labels based on the labeled image;
[0046] The dataset construction module is used to construct a synthetic dataset based on the synthetic image, the labeled image, and the text label.
[0047] An electronic device, comprising:
[0048] Memory, used to store computer programs;
[0049] A processor, connected to the memory, is used to retrieve and execute the computer program to implement the above-described method for generating a composite dataset by segmenting rebar instances.
[0050] Since the technical effects achieved by the two implementation structures provided by the present invention are the same as those achieved by the method for generating a composite dataset by segmenting and synthesizing steel bar instances provided by the present invention, they will not be described in detail here. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 A flowchart of the method for generating a composite dataset by segmenting rebar instances provided by the present invention;
[0053] Figure 2 The ribbed steel bar surface and cross-sectional shape provided in the embodiments of the present invention; wherein, Figure 2 (a) is the front view of the transverse rib of the steel bar; Figure 2 (b) is a cross-sectional view of the reinforcing steel. Figure 2 (c) is a side view of the transverse rib of the reinforcing bar; Figure 2 (d) is the cross-sectional view of the steel bar rib;
[0054] Figure 3 This is a schematic diagram of a steel mesh model provided in an embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram of the virtual scene layout according to an embodiment of the present invention;
[0056] Figure 5 This is a steel reinforcement material texture provided in an embodiment of the present invention; wherein, Figure 5 (a) is the Revit reinforcement material diagram; Figure 5 (b) is a material diagram of low-rust, non-gloss steel bars; Figure 5 (c) is a material diagram of rust-resistant high-gloss steel bars; Figure 5 (d) is a material diagram of rusty, dull steel bars; Figure 5 (e) is a material diagram of low-rust, high-gloss steel bars;
[0057] Figure 6 The composite image and the material ID image used as annotation are provided in the embodiments of the present invention; wherein, Figure 6 (a) is a schematic diagram of the composite image; Figure 6 (b) is the material ID map;
[0058] Figure 7 This is a schematic diagram of the transition color processing flow provided in an embodiment of the present invention;
[0059] Figure 8 This is a schematic diagram of the annotation diagram processing flow provided in an embodiment of the present invention;
[0060] Figure 9 This is a schematic diagram of a 5×5 mode filter provided in an embodiment of the present invention. Detailed Implementation
[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] The purpose of this invention is to provide a method, system, and electronic device for generating synthetic datasets for rebar instance segmentation, which can efficiently and accurately create synthetic datasets suitable for instance segmentation tasks.
[0063] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0064] like Figure 1 As shown, the method for generating a composite dataset by segmenting rebar instances provided by this invention includes:
[0065] Step 100: Perform parametric modeling of the reinforcing bars to obtain the reinforcing bar model. To ensure model accuracy, this step can use Revit software to perform parametric modeling of commonly used diameter threaded steel bars according to the standard "Steel for Reinforced Concrete - Part 2: Hot-rolled Ribbed Steel Bars" (GB / T 1499.2-2018). The aforementioned standard provides detailed specifications for the geometric shape of the reinforcing bars (e.g., ...). Figure 2 As shown, specific values are given for the inner diameter, transverse rib height, longitudinal rib height, transverse rib width, longitudinal rib width, thread spacing, and maximum spacing at the ends of transverse ribs for each diameter of reinforcing bar. The range of values for the diagonal angles of the transverse and longitudinal ribs is also given. Referring to the actual geometry of reinforcing bars, the angle between the transverse and longitudinal axes of the reinforcing bar model can be set to 60°, and the diagonal angle of the longitudinal ribs can be set to 10° for modeling. Figure 2 In the diagram, d1 is the inner diameter of the reinforcing bar, α is the oblique angle of the transverse rib, h is the height of the transverse rib, β is the angle between the transverse rib and the axis, h1 is the height of the longitudinal rib, θ is the oblique angle of the longitudinal rib, a is the top width of the longitudinal rib, l is the spacing between transverse ribs, b is the top width of the transverse rib, and f is the height of the longitudinal rib. i This refers to the gap at the end of the transverse rib.
[0066] Step 101: Construct a reinforcing mesh model based on the rebar model. After modeling individual rebars, a reinforcing mesh model can be constructed using rebar models of different diameters, such as... Figure 3 As shown. To enrich the data information and increase the realism of the final synthesized image, each steel bar in the steel mesh model should be randomly rotated around the longitudinal axis by a certain angle.
[0067] Step 102: Create a virtual scene model from the steel mesh model. After the steel mesh model is established in Step 101, it is imported into 3D rendering software for virtual scene arrangement. The purpose is to make the synthesized image as close as possible to the real photograph, thus containing more and more complex information. In this step, the virtual scene arrangement should be adjusted according to the actual application scenario of the recognition algorithm to make it as similar as possible to the actual scene.
[0068] The 3D rendering software used is Lumion, a commonly used software in the civil engineering industry. First, a blank scene is created using Lumion 11, and the steel mesh model is imported into the virtual scene and adjusted to a suitable position and size. To make the rendered image as similar as possible to the shooting environment of the actual photograph, a ground surface with similar materials to the real photo is placed in the virtual scene. Background interference commonly encountered in engineering projects is also considered, such as white lines, yellow and black warning lines on the ground, and the bottom frame of the steel mesh support. Figure 4 As shown.
[0069] Furthermore, to ensure the authenticity and diversity of the synthesized data, the rebar texture map used one rebar texture built into Revit software and four textures created from real-life rebar photographs (such as...). Figure 5 As shown in the figure, they are randomly assigned to each steel bar.
[0070] Step 103: Render the scene model to obtain a composite image and material ID map. After the scene is set up, use the animation recording function in Lumion software to render the composite image and the material ID map used as a label image for automatic annotation. The annotation map of the composite image should have a black background, with each rebar area marked by a different solid color mask. The rendering software can output the corresponding material ID map based on the model's materials. Each material in the composite image corresponds to a unique color in the material ID map. Therefore, by assigning each rebar a different material name and then outputting the material ID map, automatic annotation of the rebar areas in the composite image can be achieved, such as... Figure 6 As shown.
[0071] The rendering method for the composite image is as follows: First, the virtual camera lens is positioned vertically downwards, perpendicular to the steel mesh plane, ensuring that the image edges are parallel or perpendicular to the steel bars and that the number of steel bars in the field of view is appropriate (approximately 10). Then, translational motion images are created in six directions: forward, backward, left, right, up, and down. Finally, the composite image is output as a sequence of image frames in JPG format. The rendering speed is approximately 1 frame per second, but the specific speed depends on the hardware configuration. Here, the highest rendering quality is selected, and the output resolution is set to 1280x720. To make the image effect similar to what the human eye sees, the lens focal length is adjusted to 24mm, and filters and effects that cause distortion are not used. To increase data complexity, image attributes such as shadows, lighting color temperature, and brightness can be adjusted appropriately.
[0072] When outputting material ID images, first copy the footage from the rendered composite image. In edit mode, hide all models except the target object (only keep the steel reinforcement model and hide the rest). Then, using the same camera settings as when outputting the composite image, output a PNG image using the material channel. This will give you the material ID image for each image. Since the output material ID images will have a filename extension, you need to use a program to batch rename them so that they are identical to the corresponding composite image filenames except for the file type extension.
[0073] Step 104: Perform image processing on the material ID map to obtain the annotation map. Because each color in the annotation map should correspond to an instance target object, if transitional colors exist, the network will incorrectly identify it as an annotation of another instance. The material ID map output by Lumion software will inevitably have transitional colors at the edges of color blocks (e.g., ...). Figure 7 As shown in the image, the images must be processed before they can be used as labeled images for training in a neural network model, such as the Mask R-CNN network. The training set for the Mask R-CNN network should consist of three parts: an image containing the target, a single-channel PNG labeled image corresponding to the image, and a YAML text label corresponding to the labeled image.
[0074] Based on this, the process of handling transition colors and generating YAML tags is as follows: Figure 8 As shown, the process includes five steps: specifying a list of annotation colors, merging transition colors into annotation colors, filtering noise using mode filtering, saving as a single-channel P-mode PNG image, and generating YAML tags.
[0075] The first step, specifying the annotation color list, refers to rendering a material ID map that includes all target objects (rendering one map that includes all targets or rendering multiple maps that cover all targets), determining the RGB color values of the annotation colors using Photoshop or similar software tools, and entering them into the program.
[0076] The second step, merging transition colors into label colors, means first filtering out pixels whose color values are not the label colors, which are called transition color pixels. Then, the RGB color values (each channel value range 0-255) of each transition color pixel and the color values of each label color are calculated using formula (1) to transform the color values of the transition color pixels to the label color with the smallest color distance.
[0077]
[0078] In the formula, D is the color distance, and T is the color distance. i For this transition color pixel, the i-channel color value, L i The color value of the i-channel is used to annotate the color.
[0079] The third step, mode filtering, refers to defining the color value of a given pixel as the most frequently occurring color value (excluding black) among pixels within a given square area around it (e.g., ...). Figure 9 This refers to the mode filtering of the central pixel in the image. Because some pixels were transformed to incorrect labeled colors after the color value merging step in the previous step, a small amount of dot-like or line-like noise appeared in the image, requiring mode filtering to eliminate this noise. This invention sequentially applied mode filtering of an n×n (e.g., 5x5) range and an m×m (e.g., 3x3) range to all the transition color pixels selected in the second step, achieving good results and effectively eliminating noise. Here, n and m are both odd numbers, such as 3, 5, 7, etc.
[0080] The fourth step is image format conversion. The labeled image, after the above three steps, is still a three-channel color image. To meet the input requirements of the Mask R-CNN network, it needs to be converted to a single-channel image. Furthermore, the color values of the masked areas of each object in the image should be consecutive integers starting from 1, and the background color value should be 0. For ease of inspection, the image is converted to a P-mode single-channel PNG image with a color palette file, allowing it to be presented in color. This generates a labeled image that meets the requirements.
[0081] Step 105: Generate text labels based on the annotation map. Generate a YAML text label file with the same name based on the completed annotation map. In the YAML text label file, the first line is "label_names:", the second line is "-_background_", the third line is "-rebar1", and the subsequent lines are "-rebar2", "-rebar3", and so on. The specific number of lines is determined by the number of rebars in the annotation.
[0082] Step 106: Construct a synthetic dataset based on the synthesized images, labeled images, and text labels. This involves obtaining the synthesized images, corresponding labeled images, and text labels. Place these into folders named `imgs`, `mask`, and `yaml` respectively to complete the creation of the synthetic dataset.
[0083] Based on the above description, in practical applications, the method for generating a synthetic rebar instance segmentation dataset provided by this invention first involves rebar modeling using 3D modeling software according to rebar specifications. The second step is to import the rebar model into 3D rendering software, adjust materials, arrange the scene, and render images and their corresponding material ID maps. The third step is to process the material ID maps using a program to make them conform to the label maps of the Mask R-CNN network input standard. The final step yields the synthetic dataset, which consists of three parts: the rendered synthetic images, the labeled images of the synthetic images, and the corresponding YAML format text labels for the labeled images.
[0084] Furthermore, multiple datasets were constructed using varying proportions of real and synthetic data. These datasets were then used to train the same Mask R-CNN network model, and comparative experiments were conducted to evaluate the model's recognition results. The experimental results show that adding synthetic data to the real dataset improves the model's prediction performance, with an average increase of approximately 3% in accuracy, intersection-over-union (IoU), and F1 score. With the total dataset size unchanged, replacing some real data with synthetic data outperformed the network model trained on the entire real dataset, with an average increase of approximately 3% in accuracy, IoU, and F1 score. In other words, synthetic datasets can improve the prediction accuracy of the Mask R-CNN instance segmentation algorithm.
[0085] Based on this, the method for generating a composite dataset by segmenting rebar instances provided by the present invention has the following advantages compared with the prior art:
[0086] 1) The program enables the rapid and efficient creation of a composite dataset for rebar instance segmentation, avoiding tedious manual annotation. The average time to process a 1280x720 resolution image containing 11 rebars and generate YAML tags using the above program is 23 seconds. Manually annotating a photo containing 11 rebars takes approximately 2 minutes, 5.2 times longer. Furthermore, the program's automated processing significantly reduces manual work and saves time.
[0087] 2) Compared to methods for generating composite datasets using software such as Unity3D and Unreal Engine, this method requires no programming experience and no other plugins, making it simpler and easier to use.
[0088] In addition, the present invention also provides the following embodiments:
[0089] A system for generating synthetic datasets by segmenting rebar instances is provided, applicable to the aforementioned method for generating synthetic datasets by segmenting rebar instances. The system includes:
[0090] The rebar model building module is used to parametrically model rebar to obtain a rebar model.
[0091] The reinforcement mesh model building module is used to build reinforcement mesh models based on reinforcement models.
[0092] The scene model layout module is used to virtually arrange the steel mesh model to obtain the scene model.
[0093] The model rendering module is used to render scene models to obtain composite images and material ID maps.
[0094] The image processing module is used to process the material ID map to obtain the annotation map.
[0095] The text label generation module is used to generate text labels based on the labeled image.
[0096] The dataset building module is used to construct synthetic datasets based on synthetic images, labeled images, and text labels.
[0097] An electronic device, comprising:
[0098] Memory is used to store computer programs.
[0099] A processor, connected to memory, is used to retrieve and execute a computer program to implement the above-described method for generating synthetic datasets by segmenting rebar instances.
[0100] Furthermore, when the aforementioned computer program stored in the memory is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0101] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0102] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for generating a composite dataset by segmenting and synthesizing steel reinforcement instances, characterized in that, include: Parametric modeling of the reinforcing bars yields the reinforcing bar model; A steel mesh model is constructed based on the steel bar model; each steel bar in the steel mesh model is randomly rotated around the longitudinal axis by a certain angle; The scene model is obtained by virtual scene arrangement of the steel mesh model; wherein, the steel material texture uses one steel texture built into Revit software and four textures made from real steel photos, which are randomly assigned to each steel bar; The scene model is rendered to obtain a composite image and a material ID map; Image processing of the material ID image to obtain an annotation image includes: filtering transition color pixels from the material ID image; converting the color values of the transition color pixels to set annotation color values to obtain standard color pixels; and filtering the standard color pixels using a mode filter to obtain the annotation image. Specifically, converting the color values of the transition color pixels to set annotation color values to obtain standard color pixels includes: obtaining a standard color value; determining the color distance between the color value of the transition color pixel and the standard color value based on the standard color value; and converting the color value of the transition color pixel to the annotation color value with the smallest color distance to obtain the standard color pixel. Generate text labels based on the labeled map; A synthetic dataset is constructed based on the synthesized image, the labeled image, and the text labels.
2. The method for generating a composite dataset by segmenting rebar instances according to claim 1, characterized in that, Virtual scene setup is achieved using 3D rendering software.
3. The method for generating a composite dataset by segmenting and synthesizing steel reinforcement instances according to claim 1, characterized in that, The scene model is rendered to obtain a composite image and a material ID image, specifically including: A virtual camera lens is panned in multiple directions to create a translational motion picture; The translation animation is output as a sequence of image frames, and the resulting JPG format image is used as the composite image. Copy the scene clip from the rendered composite image, and hide all models in the scene clip except for the target object in edit mode; Using the virtual camera lens, the material ID image is obtained by outputting a PNG format image through the material channel.
4. The method for generating a composite dataset by segmenting rebar instances according to claim 3, characterized in that, The virtual camera lens is perpendicular to the plane of the steel mesh model, and the edges of the image captured by the virtual camera lens are parallel or perpendicular to the steel bars in the steel mesh model, and the number of steel bars in the field of view of the virtual camera lens is not greater than a set number. The virtual camera lens has a shooting rate of no less than 1 frame per second, an output resolution of 1280x720, and a lens focal length of 24mm.
5. The method for generating a composite dataset by segmenting rebar instances according to claim 1, characterized in that, The annotation image is obtained by filtering the standard color pixels using the mode filtering method, specifically including: The annotation map is obtained by sequentially applying mode filtering to the specified pixels in all standard color pixels, once in an n×n range and once in an m×m range; n and m are both odd numbers; the mode filtering is used to define the color value of the specified pixel as the color value that appears most frequently, excluding black, among all pixel color values within the set range.
6. The method for generating a composite dataset by segmenting rebar instances according to claim 1, characterized in that, A synthetic dataset is constructed based on the synthesized image, the labeled image, and the text labels, specifically including: Place the synthesized image into a folder named "imgs", the labeled image into a folder named "mask", and the text label into a folder named "yaml" to complete the creation of the synthesized dataset.
7. A system for generating a composite dataset by segmenting and synthesizing steel reinforcement instances, characterized in that, The system is applied to the method for generating a composite dataset by segmenting rebar instances as described in any one of claims 1-6; the system comprises: The rebar model building module is used to perform parametric modeling of rebars to obtain rebar models; A steel mesh model construction module is used to construct a steel mesh model based on the steel mesh model. The scene model layout module is used to virtually arrange the steel mesh model to obtain a scene model. The model rendering module is used to render the scene model to obtain a composite image and a material ID image; The image processing module is used to perform image processing on the material ID image to obtain an annotation image; The text label generation module is used to generate text labels based on the labeled image; The dataset construction module is used to construct a synthetic dataset based on the synthetic image, the labeled image, and the text label.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, connected to the memory, is configured to retrieve and execute the computer program to implement the method for generating a composite dataset by segmenting rebar instances as described in any one of claims 1-6.