Three-dimensional modeling method, device, system and computer-readable storage medium
By obtaining a two-dimensional top-down view and a top edge contour map of the modeling object, determining the set of points to be measured and constructing a three-dimensional model, the problem of low efficiency in the existing technology is solved and efficient three-dimensional modeling is achieved.
Patent Information
- Application Number
- CN202210386817.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-04-11
AI Technical Summary
Existing 3D modeling methods require real-scene modeling through aerial photography and rely on professional software and server computing, resulting in low efficiency.
By obtaining a two-dimensional top view and a top edge contour map of the modeling object, determining the set of points to be measured in the top two-dimensional map, and using the elevation information set to construct a three-dimensional model, the modeling process is simplified.
Improve the efficiency of 3D modeling and reduce time consumption.
Smart Images

Figure CN114863015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a three-dimensional modeling method, device, system and computer-readable storage medium. Background Art
[0002] With the growing demand for 3D modeling, people have put forward higher requirements for the efficiency of 3D modeling. The existing 3D modeling method requires real-scene modeling through aerial photography, and the processing process is complicated and relies on professional software and servers for calculation, which takes too long and leads to low efficiency of 3D modeling. Therefore, how to improve the efficiency of 3D modeling is an urgent problem to be solved. Summary of the Invention
[0003] The main purpose of the present invention is to propose a three-dimensional modeling method, device, system and computer-readable storage medium, aiming to solve the problem of how to improve the efficiency of three-dimensional modeling.
[0004] To achieve the above object, the present invention provides a three-dimensional modeling method, which includes the following steps:
[0005] When a modeling instruction is detected, a modeling object is determined, and a top-view two-dimensional image and a top edge contour image of the modeling object are obtained;
[0006] Determine a top two-dimensional map according to the top two-dimensional map and the top edge contour map, and determine a set of points to be measured in the top two-dimensional map;
[0007] The set of points to be measured is measured to determine an elevation information set corresponding to the set of points to be measured, and a three-dimensional model corresponding to the modeling object is constructed based on the top two-dimensional map and the elevation information set.
[0008] Preferably, the step of obtaining a top-view two-dimensional image and a top edge contour image of the modeled object comprises:
[0009] photographing the modeled object to obtain a top image of the modeled object, and performing noise processing and edge detection on the top image to generate a top-view two-dimensional image;
[0010] The modeled object is measured to determine a top edge corner point coordinate set of the modeled object, and a top edge contour map is generated according to the top image and the top edge corner point coordinate set.
[0011] Preferably, the step of determining the top two-dimensional image according to the top two-dimensional image and the top edge contour image comprises:
[0012] Obtaining first size information of the top-view two-dimensional image and second size information of the top edge contour image, and performing a scaling operation on the top-view two-dimensional image according to the first size information and the second size information so that the first size information is equal to the second size information;
[0013] The top two-dimensional image after the scaling operation is subjected to contour correction according to the top edge contour image to obtain a top two-dimensional image.
[0014] Preferably, the step of determining a set of points to be measured in the top two-dimensional map includes:
[0015] Partitioning the top two-dimensional graph according to a preset partitioning rule, and shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph;
[0016] According to a preset selection rule, the points to be measured corresponding to each partition are selected on the contour line of each partition in the contracted top two-dimensional image to determine a set of points to be measured in the top two-dimensional image.
[0017] Preferably, the step of shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph comprises:
[0018] Obtaining the length and center point of each line segment in the contour line of each partition in the top two-dimensional image, and determining the shrunk length of each line segment according to a preset shrinkage factor and the length;
[0019] Each line segment is shrunk according to the center point and the length after shrinkage of each line segment, and the center point of each partition is determined. Each partition is shrunk according to the center point of each partition and each shrunk line segment in each partition to obtain a shrunk top two-dimensional graph.
[0020] Preferably, according to a preset selection rule, the step of selecting the points to be measured corresponding to each partition on the contour line of each partition in the collapsed top two-dimensional map to determine the set of points to be measured in the top two-dimensional map includes:
[0021] Determining the interval length and the starting point position on the contour line of each partition in the two-dimensional image of the contracted top according to a preset selection rule;
[0022] Based on the starting point and the interval length, the contour lines of each partition in the contracted top two-dimensional map are traversed to determine the points to be measured corresponding to each partition, and the set of points to be measured in the top two-dimensional map is determined according to the points to be measured corresponding to each partition.
[0023] Preferably, the step of constructing a three-dimensional model corresponding to the modeling object according to the top two-dimensional map and the elevation information set includes:
[0024] The elevation information set is imported into the top two-dimensional map to generate a three-dimensional image of the modeling object, and a three-dimensional model corresponding to the modeling object is constructed based on the three-dimensional image.
[0025] In addition, to achieve the above-mentioned purpose, the present invention further provides a three-dimensional modeling device, comprising:
[0026] an acquisition module, configured to determine a modeling object when a modeling instruction is detected, and acquire a top-view two-dimensional image and a top edge contour image of the modeling object;
[0027] a determination module, configured to determine a top two-dimensional image based on the top two-dimensional image and the top edge contour image, and determine a set of points to be measured in the top two-dimensional image;
[0028] A construction module is used to measure the set of points to be measured, determine the elevation information set corresponding to the set of points to be measured, and construct a three-dimensional model corresponding to the modeling object based on the top two-dimensional map and the elevation information set.
[0029] Furthermore, the acquisition module further includes a generation module, and the generation module is used to:
[0030] photographing the modeled object to obtain a top image of the modeled object, and performing noise processing and edge detection on the top image to generate a top-view two-dimensional image;
[0031] The modeled object is measured to determine a top edge corner point coordinate set of the modeled object, and a top edge contour map is generated according to the top image and the top edge corner point coordinate set.
[0032] Furthermore, the determining module is further configured to:
[0033] Obtaining first size information of the top-view two-dimensional image and second size information of the top edge contour image, and performing a scaling operation on the top-view two-dimensional image according to the first size information and the second size information so that the first size information is equal to the second size information;
[0034] The top two-dimensional image after the scaling operation is subjected to contour correction according to the top edge contour image to obtain a top two-dimensional image.
[0035] Furthermore, the determining module is further configured to:
[0036] Partitioning the top two-dimensional graph according to a preset partitioning rule, and shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph;
[0037] According to a preset selection rule, the points to be measured corresponding to each partition are selected on the contour line of each partition in the contracted top two-dimensional image to determine a set of points to be measured in the top two-dimensional image.
[0038] Furthermore, the determining module is further configured to:
[0039] Obtaining the length and center point of each line segment in the contour line of each partition in the top two-dimensional image, and determining the shrunk length of each line segment according to a preset shrinkage factor and the length;
[0040] Each line segment is shrunk according to the center point and the length after shrinkage of each line segment, and the center point of each partition is determined. Each partition is shrunk according to the center point of each partition and each shrunk line segment in each partition to obtain a shrunk top two-dimensional graph.
[0041] Furthermore, the determining module is further configured to:
[0042] Determining the interval length and the starting point position on the contour line of each partition in the two-dimensional image of the contracted top according to a preset selection rule;
[0043] Based on the starting point and the interval length, the contour lines of each partition in the contracted top two-dimensional map are traversed to determine the points to be measured corresponding to each partition, and the set of points to be measured in the top two-dimensional map is determined according to the points to be measured corresponding to each partition.
[0044] Furthermore, the building block is also used to:
[0045] The elevation information set is imported into the top two-dimensional map to generate a three-dimensional image of the modeling object, and a three-dimensional model corresponding to the modeling object is constructed based on the three-dimensional image.
[0046] In addition, to achieve the above-mentioned purpose, the present invention also provides a three-dimensional modeling system, which includes: a memory, a processor, and a three-dimensional modeling program stored in the memory and runnable on the processor. When the three-dimensional modeling program is executed by the processor, the steps of the three-dimensional modeling method described above are implemented.
[0047] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a three-dimensional modeling program is stored. When the three-dimensional modeling program is executed by a processor, the steps of the three-dimensional modeling method described above are implemented.
[0048] The three-dimensional modeling method proposed in the present invention determines the modeling object and obtains a top-view two-dimensional map and a top edge contour map of the modeling object when a modeling instruction is detected; determines a top two-dimensional map based on the top-view two-dimensional map and the top edge contour map, and determines a set of points to be measured in the top two-dimensional map; measures the set of points to be measured, determines an elevation information set corresponding to the set of points to be measured, and constructs a three-dimensional model corresponding to the modeling object based on the top two-dimensional map and the elevation information set. The present invention determines the top two-dimensional map based on the top-view two-dimensional map and the top edge contour map of the modeling object, determines an elevation information set corresponding to the set of points to be measured in the top two-dimensional map, and constructs a three-dimensional model of the modeling object in combination with the top two-dimensional map and the elevation information set, thereby simplifying the process of three-dimensional modeling, reducing time consumption, and thereby improving the efficiency of three-dimensional modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0050] Figure 2 This is a flow chart of a first embodiment of a three-dimensional modeling method according to the present invention;
[0051] Figure 3 It is a schematic diagram of a two-dimensional top view of the present invention;
[0052] Figure 4 This is a schematic diagram of the top edge profile of the present invention;
[0053] Figure 5 A schematic diagram of a process for generating a top edge contour map for the present invention;
[0054] Figure 6 This is a schematic diagram of the partitioning of the top two-dimensional graph of the present invention;
[0055] Figure 7 This is a schematic diagram of the process of shrinking partitions in the top two-dimensional graph according to the present invention.
[0056] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0057] 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.
[0058] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0059] The device in the embodiment of the present invention may be a PC or a server device.
[0060] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0061] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0062] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a three-dimensional modeling program.
[0063] Among them, the operating system is a program that manages and controls portable storage devices and software resources, and supports the operation of network communication modules, user interface modules, three-dimensional modeling programs and other programs or software; the network communication module is used to manage and control the network interface 1002; the user interface module is used to manage and control the user interface 1003.
[0064] exist Figure 1 In the storage device shown, the storage device calls the three-dimensional modeling program stored in the memory 1005 through the processor 1001, and executes the operations in each embodiment of the following three-dimensional modeling method.
[0065] Based on the above hardware structure, an embodiment of the three-dimensional modeling method of the present invention is proposed.
[0066] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a three-dimensional modeling method according to the present invention, wherein the method comprises:
[0067] Step S10: when a modeling instruction is detected, determining a modeling object, and obtaining a top-view two-dimensional image and a top edge contour image of the modeling object;
[0068] Step S20, determining a top two-dimensional map according to the top two-dimensional map and the top edge contour map, and determining a set of points to be measured in the top two-dimensional map;
[0069] Step S30 , measuring the set of points to be measured, determining an elevation information set corresponding to the set of points to be measured, and constructing a three-dimensional model corresponding to the modeling object based on the top two-dimensional map and the elevation information set.
[0070] The 3D modeling method of the present embodiment is applied to a 3D modeling system, which can be carried on a drone or other terminal device to perform 3D modeling of a modeling object; for convenience of description, the 3D modeling system is taken as an example; when the 3D modeling system detects a modeling instruction, it determines the modeling object according to the modeling instruction, shoots the modeling object, obtains a top image of the modeling object, performs noise processing and edge detection on the top image, generates a top-view two-dimensional image, measures the modeling object, determines the top edge corner point coordinate set of the modeling object, and generates a top edge contour map based on the top image and the top edge corner point coordinate set; the 3D modeling system obtains first size information of the top-view two-dimensional image and second size information of the top edge contour map, and generates a top edge contour map based on the first size information and the second size information The three-dimensional modeling system partitions the top two-dimensional image according to a preset partitioning rule, shrinks each partition in the top two-dimensional image according to a preset shrinkage factor to obtain a shrunken top two-dimensional image, selects the corresponding measured points of each partition on the contour line of each partition in the shrunken top two-dimensional image according to a preset selection rule, so as to determine the set of measured points in the top two-dimensional image; the three-dimensional modeling system measures the set of measured points, determines the set of elevation information corresponding to the set of measured points, and constructs a three-dimensional model corresponding to the modeling object according to the top two-dimensional image and the elevation information set.
[0071] The three-dimensional modeling method of this embodiment, when a modeling instruction is detected, determines the modeling object and obtains a top-view two-dimensional map and a top edge contour map of the modeling object; determines a top two-dimensional map based on the top-view two-dimensional map and the top edge contour map, and determines a set of points to be measured in the top two-dimensional map; measures the set of points to be measured, determines an elevation information set corresponding to the set of points to be measured, and constructs a three-dimensional model corresponding to the modeling object based on the top two-dimensional map and the elevation information set. By determining the top two-dimensional map based on the top-view two-dimensional map and the top edge contour map of the modeling object, and determining an elevation information set corresponding to the set of points to be measured in the top two-dimensional map, and combining the top two-dimensional map and the elevation information set to construct a three-dimensional model of the modeling object, the three-dimensional modeling process is simplified, time consumption is reduced, and the efficiency of three-dimensional modeling is thereby improved.
[0072] The following describes each step in detail:
[0073] Step S10: when a modeling instruction is detected, determining a modeling object, and obtaining a top-view two-dimensional image and a top edge contour image of the modeling object;
[0074] In this embodiment, when a relevant person needs to perform three-dimensional modeling on a modeling object, he sends a modeling instruction to the three-dimensional modeling system. The modeling instruction includes but is not limited to information about the modeling object. The three-dimensional modeling system determines the modeling object according to the modeling instruction, and photographs and measures the modeling object to obtain a top-down two-dimensional image and a top edge contour image of the modeling object. It should be noted that the top-down two-dimensional image refers to a top view of the modeling object, such as Figure 3 As shown, Figure 3 It is a two-dimensional top view diagram, which can express the top contour information and internal contour information of the modeling object; the top edge contour diagram refers to the schematic diagram of the top edge contour of the modeling object, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the top edge contour diagram. The top edge contour diagram only expresses the contour information of the top of the modeled object, and does not express the internal information of the contour.
[0075] Specifically, the step of obtaining a top-view two-dimensional image and a top edge contour image of the modeled object includes:
[0076] Step a: photographing the modeled object to obtain a top image of the modeled object, and performing noise processing and edge detection on the top image to generate a top-view two-dimensional image;
[0077] In this step, the three-dimensional modeling system uses a shooting device to shoot the modeling object to obtain a top image of the modeling object, and obtains the shooting height and shooting angle of the top image, adjusts the top image so that the top image is adjusted to a top image from a bird's-eye view, performs noise processing and edge detection on the top image from a bird's-eye view, and generates a two-dimensional top-view image. It should be noted that the shooting device can be selected according to the specific modeling object. When the modeling object is a large object such as a building, a drone can be selected as the shooting device. When the modeling object is other smaller objects, a handheld camera can be selected. When the top image of the modeling object obtained by shooting is a top image from a bird's-eye view, there is no need to adjust the top image according to the shooting height and shooting angle of the top image.
[0078] Step b: measuring the modeled object, determining a top edge corner point coordinate set of the modeled object, and generating a top edge contour map based on the top image and the top edge corner point coordinate set.
[0079] In this step, the 3D modeling system measures the actual coordinates of the top edge contour line of the modeling object through a geographic location measurement device (such as a total station) to determine the top edge corner point coordinate set of the modeling object, imports the top edge corner point coordinate set of the modeling object and the top image into a geographic information tool (such as AutoCAD, ArcGIS), and generates a top edge contour map based on the top image and the top edge corner point coordinate set, such as Figure 5 As shown, Figure 5 Schematic diagram of the process of generating the top edge contour map, Figure 5 The left side is the top edge corner point coordinate set, and the right side is the top edge contour map. The 3D modeling system imports the top edge corner point coordinate set and the top image of the modeling object into the geographic information tool, and connects the top edge corner point coordinate set according to the top image to generate the top edge contour map.
[0080] Step S20, determining a top two-dimensional map according to the top two-dimensional map and the top edge contour map, and determining a set of points to be measured in the top two-dimensional map;
[0081] In this embodiment, the three-dimensional modeling system uses the optical imaging principle to perform contour correction on the top-view two-dimensional image based on the top edge contour image, so that the outer edge contour of the top-view two-dimensional image is consistent with the outer edge contour of the top edge contour image, and then determines the top two-dimensional image and determines the set of points to be measured in the top two-dimensional image.
[0082] Specifically, the step of determining the top two-dimensional image according to the top two-dimensional image and the top edge contour image includes:
[0083] Step c: obtaining first size information of the top-view two-dimensional image and second size information of the top edge contour image, and performing a scaling operation on the top-view two-dimensional image based on the first size information and the second size information so that the first size information is equal to the second size information;
[0084] In this step, the three-dimensional modeling system obtains the first size information of the top-view two-dimensional image and the second size information of the top edge contour image, and performs a scaling operation on the top-view two-dimensional image based on the first size information and the second size information so that the first size information is equal to the second size information. It can be understood that the top-view two-dimensional image is generated based on the top image obtained by photographing the modeling object, so the first size information of the top-view two-dimensional image is different from the actual size of the top of the modeling object, and the top edge contour image is obtained by measuring the modeling object through a geographic location measurement device (such as a total station), so the second size information of the top edge contour image is the same as the actual size of the top of the modeling object. If the three-dimensional modeling system determines that the first size information is greater than the second size information, the top-view two-dimensional image is scaled down. If it is determined that the first size information is smaller than the second size information, the top-view two-dimensional image is scaled up so that the first size information is equal to the second size information, so that the outline of the top-view two-dimensional image and the top edge contour image can overlap.
[0085] Step d: performing contour correction on the top-view two-dimensional image after the scaling operation according to the top edge contour image to obtain a top two-dimensional image.
[0086] In this step, the three-dimensional modeling system performs contour correction on the top-view two-dimensional image that has undergone the scaling operation according to the top edge contour map to obtain a top two-dimensional image. It can be understood that the top edge contour map is obtained by measuring the modeling object using a geographic location measurement device (such as a total station). Therefore, the top edge contour information expressed in the top edge contour map is consistent with the top edge contour information of the modeling object. Therefore, after making the first size information of the top-view two-dimensional image equal to the second size information of the top edge contour map, the top edge contour in the top-view two-dimensional image is replaced with the top edge contour in the top edge contour map to generate a top two-dimensional image.
[0087] Specifically, the step of determining a set of points to be measured in the top two-dimensional map includes:
[0088] Step e: partitioning the top two-dimensional graph according to a preset partitioning rule, and shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph;
[0089] In this step, the 3D modeling system first identifies each closed contour curve in the top 2D image according to the preset partitioning rules, and after determining all the closed contour curves contained in the top 2D image, such as Figure 6 As shown, Figure 6This is a schematic diagram of the partitioning of the top two-dimensional image, with each closed contour curve as a partition, namely partition A to partition G; after determining each partition of the top two-dimensional image, the three-dimensional modeling system shrinks each partition in the top two-dimensional image according to a preset shrinkage factor, and splices each shrunk partition according to the top two-dimensional image to obtain a shrunken top two-dimensional image; it should be noted that the preset shrinkage factors of all partitions can be the same or different; preferably, the three-dimensional modeling system can determine the preset shrinkage factor that is most suitable for each partition based on the shape, area, contour and other information of each partition.
[0090] Step f: selecting the points to be measured corresponding to each partition on the contour line of each partition in the contracted top two-dimensional image according to a preset selection rule, so as to determine a set of points to be measured in the top two-dimensional image.
[0091] In this step, the three-dimensional modeling system traverses the contour lines of each partition in the shrunken top two-dimensional map according to the preset selection rules, selects the points to be measured corresponding to each partition on the contour lines of each partition in the shrunken top two-dimensional map, and then determines the set of points to be measured in the top two-dimensional map. It can be understood that the set of points to be measured are all located on the contour lines of each partition in the shrunken top two-dimensional map.
[0092] Step S30 , measuring the set of points to be measured, determining an elevation information set corresponding to the set of points to be measured, and constructing a three-dimensional model corresponding to the modeling object based on the top two-dimensional map and the elevation information set.
[0093] In this embodiment, after determining the set of points to be measured, the 3D modeling system enters the set of points to be measured into an elevation measurement device. The elevation measurement device locates each point in the set of points to be measured within the modeling object, and measures the elevation information corresponding to each point to be measured in combination with the modeling object. After determining the elevation information corresponding to each point to be measured, the 3D modeling system determines the elevation information combination and constructs a 3D model corresponding to the modeling object based on the top two-dimensional map and the elevation information set. It is understandable that since the set of points to be measured are all located on the contour lines of each partition in the collapsed top two-dimensional map, when the set of points to be measured is located within the modeling object, the set of points to be measured is located within each partition of the top two-dimensional map of the modeling object. It should be noted that the elevation information refers to the distance from the point to be measured to the geoid. When the modeling object is a large object such as a building, the set of points to be measured can be measured using an elevation measurement device mounted on a drone. When the modeling object is a smaller object, a handheld elevation measurement device can be used to measure the set of points to be measured.
[0094] Specifically, the step of constructing a three-dimensional model corresponding to the modeling object according to the top two-dimensional map and the elevation information set includes:
[0095] Step g: importing the elevation information set into the top two-dimensional map to generate a three-dimensional image of the modeling object, and constructing a three-dimensional model corresponding to the modeling object based on the three-dimensional image.
[0096] In this step, the three-dimensional modeling system imports the elevation information set into the top two-dimensional map, determines the elevation information of each partition in the top two-dimensional map, and then generates a three-dimensional image of the modeling object, and constructs a three-dimensional model corresponding to the modeling object based on the three-dimensional image.
[0097] When a modeling instruction is detected, the three-dimensional modeling system of this embodiment determines a modeling object according to the modeling instruction, photographs the modeling object, obtains a top image of the modeling object, performs noise processing and edge detection on the top image, generates a top-view two-dimensional image, measures the modeling object, determines a top edge corner point coordinate set of the modeling object, and generates a top edge contour map based on the top image and the top edge corner point coordinate set; the three-dimensional modeling system obtains first size information of the top-view two-dimensional image and second size information of the top edge contour map, scales the top-view two-dimensional image based on the first size information and the second size information so that the first size information is equal to the second size information, and performs contour correction on the scaled top-view two-dimensional image based on the top edge contour map to obtain a top two-dimensional image; the three-dimensional modeling system aligns the top two-dimensional image based on preset partitioning rules. Partitioning is performed, and each partition in the top two-dimensional map is shrunk according to a preset shrinkage factor to obtain a shrunk top two-dimensional map. According to a preset selection rule, the points to be measured corresponding to each partition are selected on the contour line of each partition in the shrunk top two-dimensional map to determine the set of points to be measured in the top two-dimensional map; the three-dimensional modeling system measures the set of points to be measured, determines the elevation information set corresponding to the set of points to be measured, and constructs a three-dimensional model corresponding to the modeling object according to the top two-dimensional map and the elevation information set; the top two-dimensional map is determined according to the top two-dimensional map and the top edge contour map of the modeling object, and the elevation information set corresponding to the set of points to be measured in the top two-dimensional map is determined, and the three-dimensional model of the modeling object is constructed in combination with the top two-dimensional map and the elevation information set, which simplifies the process of three-dimensional modeling, reduces time consumption, and thus improves the efficiency of three-dimensional modeling.
[0098] Furthermore, based on the first embodiment of the three-dimensional modeling method of the present invention, a second embodiment of the three-dimensional modeling method of the present invention is proposed.
[0099] The difference between the second embodiment of the three-dimensional modeling method of the present invention and the first embodiment is that the step of shrinking each partition in the top two-dimensional image according to a preset shrinkage factor to obtain a shrunken top two-dimensional image includes:
[0100] Step h, obtaining the length and center point of each line segment in the contour line of each partition in the top two-dimensional image, and determining the contracted length of each line segment according to a preset contraction factor and the length;
[0101] In step i, each line segment is shrunk according to the center point and the length after shrinkage of each line segment, and the center point of each partition is determined. Each partition is shrunk according to the center point of each partition and each shrunk line segment in each partition to obtain a shrunk top two-dimensional graph.
[0102] In this embodiment, after determining all the partitions in the top two-dimensional image, the three-dimensional modeling system obtains the length and center point of each line segment in the contour line of each partition in the top two-dimensional image, and calculates the shrunk length of each line segment based on the preset shrinkage factor and the length of each line segment, and then uses the center point of each line segment as the shrinkage center to shrink the two ends of each line segment toward the center point until each line segment shrinks to the corresponding shrunk length; after shrinking each line segment, the three-dimensional modeling system determines the center point of each partition, uses the center point of each partition as the shrinkage center, shrinks each shrunk line segment in each partition toward the shrinkage center, shrinks each partition, and then splices each shrunk partition according to the top two-dimensional image to obtain a shrunk top two-dimensional image; Figure 7 As shown, Figure 7 This is a schematic diagram of the process of shrinking the partition in the top two-dimensional figure. Taking partition D as an example, the preset shrinkage factor is 0.7. The long side length of partition D is 122.69, and the short side length is 78.7. The calculated length of the long side after shrinkage is 85.89, and the length of the short side after shrinkage is 55.09. The 3D modeling system first shrinks the long side and short side of partition D respectively, then determines the center point of partition D and shrinks partition D to obtain the shrunken partition D ( Figure 7 As shown in c); it can be understood that the shrunken top two-dimensional image is only a change in size compared to the top two-dimensional image, and other information is the same as the top two-dimensional image.
[0103] It should be noted that the preset shrinkage factors of all partitions can be the same or different; preferably, the three-dimensional modeling system can determine the preset shrinkage factor that is most suitable for each partition based on the shape, area, outline and other information of each partition.
[0104] In this embodiment, the three-dimensional modeling system shrinks each line segment and each partition based on the length and center point of each line segment in the contour line of each partition in the top two-dimensional map, combined with a preset shrinkage factor, and then shrinks the top two-dimensional map to obtain a shrunken top two-dimensional map, which helps to subsequently determine the set of points to be measured and improve the efficiency of three-dimensional modeling.
[0105] Furthermore, based on the first and second embodiments of the three-dimensional modeling method of the present invention, a third embodiment of the three-dimensional modeling method of the present invention is proposed.
[0106] The third embodiment of the three-dimensional modeling method of the present invention differs from the first and second embodiments in that, according to a preset selection rule, the step of selecting the points to be measured corresponding to each partition on the contour line of each partition in the collapsed top two-dimensional image to determine the set of points to be measured in the top two-dimensional image includes:
[0107] Step j, determining the interval length and the starting point on the contour line of each partition in the two-dimensional image of the contracted top according to a preset selection rule;
[0108] Step k: based on the starting point and the interval length, traverse the contour lines of each partition in the contracted top two-dimensional map to determine the points to be measured corresponding to each partition, and determine the set of points to be measured in the top two-dimensional map according to the points to be measured corresponding to each partition.
[0109] In this embodiment, after obtaining the shrunken top two-dimensional map, the three-dimensional modeling system determines the interval length and the starting point on the contour line of each partition in the shrunken top two-dimensional map according to the preset selection rules. Based on the starting point and the interval length, the contour line of each partition in the shrunken top two-dimensional map is traversed to determine the points to be measured corresponding to each partition, and the set of points to be measured in the top two-dimensional map is determined according to the points to be measured corresponding to each partition. By determining the points to be measured on the contour line of each partition in the shrunken top two-dimensional map, the efficiency of determining the points to be measured is improved, which in turn helps to improve the efficiency of three-dimensional modeling.
[0110] The present invention also provides a three-dimensional modeling device. The three-dimensional modeling device of the present invention comprises:
[0111] an acquisition module, configured to determine a modeling object when a modeling instruction is detected, and acquire a top-view two-dimensional image and a top edge contour image of the modeling object;
[0112] a determination module, configured to determine a top two-dimensional image based on the top two-dimensional image and the top edge contour image, and determine a set of points to be measured in the top two-dimensional image;
[0113] A construction module is used to measure the set of points to be measured, determine the elevation information set corresponding to the set of points to be measured, and construct a three-dimensional model corresponding to the modeling object based on the top two-dimensional map and the elevation information set.
[0114] Furthermore, the acquisition module further includes a generation module, and the generation module is used to:
[0115] photographing the modeled object to obtain a top image of the modeled object, and performing noise processing and edge detection on the top image to generate a top-view two-dimensional image;
[0116] The modeled object is measured to determine a top edge corner point coordinate set of the modeled object, and a top edge contour map is generated according to the top image and the top edge corner point coordinate set.
[0117] Furthermore, the determining module is further configured to:
[0118] Obtaining first size information of the top-view two-dimensional image and second size information of the top edge contour image, and performing a scaling operation on the top-view two-dimensional image according to the first size information and the second size information so that the first size information is equal to the second size information;
[0119] The top two-dimensional image after the scaling operation is subjected to contour correction according to the top edge contour image to obtain a top two-dimensional image.
[0120] Furthermore, the determining module is further configured to:
[0121] Partitioning the top two-dimensional graph according to a preset partitioning rule, and shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph;
[0122] According to a preset selection rule, the points to be measured corresponding to each partition are selected on the contour line of each partition in the contracted top two-dimensional image to determine a set of points to be measured in the top two-dimensional image.
[0123] Furthermore, the determining module is further configured to:
[0124] Obtaining the length and center point of each line segment in the contour line of each partition in the top two-dimensional image, and determining the shrunk length of each line segment according to a preset shrinkage factor and the length;
[0125] Each line segment is shrunk according to the center point and the length after shrinkage of each line segment, and the center point of each partition is determined. Each partition is shrunk according to the center point of each partition and each shrunk line segment in each partition to obtain a shrunk top two-dimensional graph.
[0126] Furthermore, the determining module is further configured to:
[0127] Determining the interval length and the starting point position on the contour line of each partition in the two-dimensional image of the contracted top according to a preset selection rule;
[0128] Based on the starting point and the interval length, the contour lines of each partition in the contracted top two-dimensional map are traversed to determine the points to be measured corresponding to each partition, and the set of points to be measured in the top two-dimensional map is determined according to the points to be measured corresponding to each partition.
[0129] Furthermore, the building block is also used to:
[0130] The elevation information set is imported into the top two-dimensional map to generate a three-dimensional image of the modeling object, and a three-dimensional model corresponding to the modeling object is constructed based on the three-dimensional image.
[0131] The invention also provides a three-dimensional modeling system.
[0132] The three-dimensional modeling system includes: a memory, a processor, and a three-dimensional modeling program stored in the memory and operable on the processor. When the three-dimensional modeling program is executed by the processor, the steps of the three-dimensional modeling method described above are implemented.
[0133] The method implemented when the three-dimensional modeling program running on the processor is executed can refer to the various embodiments of the three-dimensional modeling method of the present invention, and will not be described in detail here.
[0134] The present invention also provides a computer-readable storage medium.
[0135] The computer-readable storage medium stores a three-dimensional modeling program, and when the three-dimensional modeling program is executed by the processor, the steps of the three-dimensional modeling method described above are implemented.
[0136] The method implemented when the three-dimensional modeling program running on the processor is executed can refer to the various embodiments of the three-dimensional modeling method of the present invention, and will not be described in detail here.
[0137] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0138] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0139] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0140] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A three-dimensional modeling method, characterized in that: The three-dimensional modeling method comprises the following steps: When a modeling instruction is detected, a modeling object is determined, and a top-view two-dimensional image and a top edge contour image of the modeling object are obtained, wherein the top-view two-dimensional image includes contour information and contour internal information of the top of the modeling object; Determine a top two-dimensional map according to the top two-dimensional map and the top edge contour map, and determine a set of points to be measured in the top two-dimensional map; Measuring the set of points to be measured to determine a set of elevation information corresponding to the set of points to be measured; Importing the elevation information set into the top two-dimensional map, and determining the partition elevation information of each partition in the top two-dimensional map; generating a three-dimensional image of the modeled object according to the partition elevation information; constructing a three-dimensional model corresponding to the modeling object according to the three-dimensional image; The step of determining a set of points to be measured in the top two-dimensional map comprises: Partitioning the top two-dimensional graph according to a preset partitioning rule, and shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph; According to a preset selection rule, the points to be measured corresponding to each partition are selected on the contour line of each partition in the contracted top two-dimensional image to determine a set of points to be measured in the top two-dimensional image.
2. The three-dimensional modeling method according to claim 1, wherein: The step of obtaining a top-view two-dimensional image and a top edge contour image of the modeled object comprises: photographing the modeled object to obtain a top image of the modeled object, and performing noise processing and edge detection on the top image to generate a top-view two-dimensional image; The modeled object is measured to determine a top edge corner point coordinate set of the modeled object, and a top edge contour map is generated according to the top image and the top edge corner point coordinate set.
3. The three-dimensional modeling method according to claim 1, wherein: The step of determining the top two-dimensional image according to the top two-dimensional image and the top edge contour image comprises: Obtaining first size information of the top-view two-dimensional image and second size information of the top edge contour image, and performing a scaling operation on the top-view two-dimensional image according to the first size information and the second size information so that the first size information is equal to the second size information; The top two-dimensional image after the scaling operation is subjected to contour correction according to the top edge contour image to obtain a top two-dimensional image.
4. The three-dimensional modeling method according to claim 1, wherein: The step of shrinking each partition in the top two-dimensional graph according to a preset shrinkage factor to obtain a shrunken top two-dimensional graph comprises: Obtaining the length and center point of each line segment in the contour line of each partition in the top two-dimensional image, and determining the shrunk length of each line segment according to a preset shrinkage factor and the length; Each line segment is shrunk according to the center point and the length after shrinkage of each line segment, and the center point of each partition is determined. Each partition is shrunk according to the center point of each partition and each shrunk line segment in each partition to obtain a shrunk top two-dimensional graph.
5. The three-dimensional modeling method according to claim 1, wherein: The step of selecting the points to be measured corresponding to each partition on the contour line of each partition in the collapsed top two-dimensional image according to a preset selection rule to determine the set of points to be measured in the top two-dimensional image includes: Determining the interval length and the starting point position on the contour line of each partition in the two-dimensional image of the contracted top according to a preset selection rule; Based on the starting point and the interval length, the contour lines of each partition in the contracted top two-dimensional map are traversed to determine the points to be measured corresponding to each partition, and the set of points to be measured in the top two-dimensional map is determined according to the points to be measured corresponding to each partition.
6. A three-dimensional modeling device, characterized in that: The three-dimensional modeling device comprises: an acquisition module, configured to, when a modeling instruction is detected, determine a modeling object and acquire a top-view two-dimensional image and a top edge contour image of the modeling object, wherein the top-view two-dimensional image includes contour information and contour internal information of the top of the modeling object; a determination module, configured to determine a top two-dimensional image based on the top two-dimensional image and the top edge contour image, and determine a set of points to be measured in the top two-dimensional image; A construction module is configured to measure the set of points to be measured and determine a set of elevation information corresponding to the set of points to be measured; import the set of elevation information into the top two-dimensional map and determine the elevation information of each partition in the top two-dimensional map; generate a three-dimensional image of the modeled object based on the partition elevation information; and construct a three-dimensional model corresponding to the modeled object based on the three-dimensional image; The determination module is also used to partition the top two-dimensional map according to preset partitioning rules, and shrink each partition in the top two-dimensional map according to a preset shrinkage factor to obtain a shrunken top two-dimensional map; according to preset selection rules, select the points to be measured corresponding to each partition on the contour line of each partition in the shrunken top two-dimensional map to determine the set of points to be measured in the top two-dimensional map.
7. A three-dimensional modeling system, characterized in that: The three-dimensional modeling system includes: a memory, a processor, and a three-dimensional modeling program stored in the memory and executable on the processor. When the three-dimensional modeling program is executed by the processor, the steps of the three-dimensional modeling method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a three-dimensional modeling program, which, when executed by a processor, implements the steps of the three-dimensional modeling method according to any one of claims 1 to 5.