Three-dimensional model construction method, device, electronic equipment and storage medium
Through the method of dividing depth images and constructing cone, the problem of low efficiency of existing three-dimensional model construction methods is solved, and the data volume is reduced and the construction efficiency is improved.
Patent Information
- Application Number
- CN202210406098.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-04-18
AI Technical Summary
The existing three-dimensional model construction methods are less efficient, resulting in large amounts of data processed and low construction efficiency.
By obtaining the depth image of the target object, the image division process is performed to obtain multiple sub-images. For each subimage, cones are constructed based on their near and far focal planes, and a three-dimensional model is constructed from these cones.
The amount of data required to build a three-dimensional model is reduced and the efficiency of three-dimensional model construction is improved.
Smart Images

Figure CN114708387B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet information processing technology, and more specifically, to a method, device, electronic device and storage medium for constructing a three-dimensional model. Background Art
[0002] A three-dimensional (3D) model is a model of the three-dimensional data corresponding to a real object in a virtual three-dimensional space, constructed using computer technology. Due to the intuitiveness of its data, the three-dimensional model has become a research hotspot in the field of computer vision, such as virtual reality (VR), robot navigation, and 3D printing.
[0003] At present, a commonly used method for constructing a three-dimensional model is to construct a visual cone using a depth image, and then build a three-dimensional model of the object through the constructed visual cone. However, the efficiency of constructing a three-dimensional model using the existing three-dimensional model construction method is low. Summary of the invention
[0004] In view of this, the embodiments of the present application propose a method, device, electronic device and storage medium for constructing a three-dimensional model to improve the above-mentioned problems.
[0005] In a first aspect, an embodiment of the present application provides a method for constructing a three-dimensional model, the method comprising: acquiring a depth image of a target object; performing image segmentation processing on the depth image to obtain a plurality of sub-images; for each of the sub-images, constructing a viewing cone of the sub-image according to a near focal plane and a far focal plane of the sub-image; and constructing a three-dimensional model corresponding to the target object according to the viewing cone of each of the sub-images.
[0006] In a second aspect, an embodiment of the present application provides a device for constructing a three-dimensional model, the device comprising: an acquisition module for acquiring a depth image of a target object; a division module for performing image division processing on the depth image to obtain a plurality of sub-images; a cone construction module for constructing a cone of the sub-image for each sub-image according to a near focal plane and a far focal plane of the sub-image; and a model construction module for constructing a three-dimensional model corresponding to the target object according to the cone of each sub-image.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is executed by a processor.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above method.
[0010] The embodiments of the present application provide a method, device, electronic device and storage medium for constructing a three-dimensional model. The method divides a depth image into multiple sub-images, and constructs a viewing cone corresponding to each sub-image according to the near focal plane and the far focal plane of each sub-image itself, so that the volume of the viewing cone of each sub-image is smaller than the partial volume corresponding to the sub-image in the viewing cone of the entire depth image, and further makes the sum of the viewing cone volumes of the various sub-images smaller than the volume of the viewing cone of the entire depth image, thereby greatly reducing the amount of data that needs to be processed to construct the three-dimensional model, thereby improving the efficiency of constructing the three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A flowchart of a method for constructing a three-dimensional model proposed in one embodiment of the present application is shown;
[0013] Figure 2 A schematic diagram of a viewing cone of a sub-image in an embodiment of the present application is shown;
[0014] Figure 3 Shows this application Figure 1 A schematic flow chart of step S140 in the method shown;
[0015] Figure 4 A schematic diagram of collision detection in an embodiment of the present application is shown;
[0016] Figure 5 Shows this application Figure 3 A schematic flow chart of step S250 in the method shown;
[0017] Figure 6 Shows this application Figure 5 A schematic flow chart of step S340 in the method shown;
[0018] Figure 7 Shows this application Figure 5Another schematic flow chart of step S340 in the method shown;
[0019] Figure 8 Shows this application Figure 1 A schematic flow chart of step S130 in the method shown;
[0020] Fig. 9 A block diagram of a three-dimensional model construction device proposed in an embodiment of the present application is shown;
[0021] Fig.10 A structural block diagram of an electronic device for executing a method for constructing a three-dimensional model according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. According to the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0025] In the related art, a viewing cone is constructed according to a depth image of a target object. The viewing cone is based on a near focal plane and a far focal plane corresponding to the entire depth image, resulting in a larger volume of the constructed viewing cone. This requires a larger amount of data to be processed when constructing a three-dimensional model, resulting in lower efficiency in constructing the three-dimensional model.
[0026] Therefore, the inventor proposes a method, device, electronic device and storage medium for constructing a three-dimensional model. By acquiring a depth image of a target object; performing image segmentation processing on the depth image to obtain a plurality of sub-images; for each of the sub-images, constructing a view cone of the sub-image according to the near focal plane and the far focal plane of the sub-image; and constructing a three-dimensional model corresponding to the target object according to the view cone of each sub-image. The view cone corresponding to each sub-image is based on the near focal plane and the far focal plane of each sub-image itself, so that the volume of the view cone of each sub-image is smaller than the corresponding partial volume of the sub-image in the view cone of the entire depth image, and thus the sum of the view cone volumes of each sub-image is smaller than the view cone volume of the entire depth image, thereby reducing the amount of data required to be processed to construct a three-dimensional model, thereby improving the efficiency of constructing a three-dimensional model.
[0027] See also Figure 1 , Figure 1 A flowchart of a method for constructing a three-dimensional model proposed in an embodiment of the present application is shown. The method can be applied to electronic devices. The method includes:
[0028] S110: Acquire a depth image of the target object.
[0029] The target object can be placed somewhere in the space, and the depth camera can be used to take a photo of the target object to obtain a depth image. The depth image can include the target object and some areas outside the target object. For example, the target object, a mouse, is placed on the desktop, and the mouse is photographed to obtain a depth image of the mouse. The depth image includes the mouse and part of the desktop. The depth image can also include part of the target object. For example, the target object, a water cup, is placed on the desktop, and the water cup is photographed to obtain a depth image of the water cup. The depth image includes the lower half of the water cup and part of the desktop, wherein the upper half of the water cup is outside the field of view of the depth camera and is not captured.
[0030] The target object may be scanned by a depth camera, and the depth camera may be moved so that the depth camera can capture depth images of the target object at different angles. At different scanning moments, the target object is photographed to obtain different depth images of the target object, and for each depth image, the method of the present application is executed to obtain a three-dimensional model of the target object.
[0031] In one implementation, the electronic device may be connected to a depth camera, and the depth camera photographs a target object to obtain a depth image, and sends the depth image to the electronic device.
[0032] In another embodiment, the electronic device is integrated with a depth camera, and the electronic device controls the depth camera to photograph the target object to obtain a depth image.
[0033] In yet another embodiment, the electronic device is connected to a server, the server receives a depth image sent by a depth camera or other electronic device, and the electronic device obtains the depth image from the server.
[0034] S120: Perform image segmentation processing on the depth image to obtain a plurality of sub-images.
[0035] The depth image may be a rectangular image, and the depth image may be divided to obtain a plurality of sub-images after division, each of which is a part of the depth image. Specifically, the depth image may be evenly divided to obtain a plurality of sub-images of the same shape and size. For example, if the size of the depth image is 1280*960, the depth image may be divided into four sub-images of 640*320 each.
[0036] Since the target object photographed by the depth camera is usually placed at the center of the depth camera's field of view, in other embodiments, the central area can be determined in the depth image, and then the central area is evenly divided, and the area around the central area is divided into multiple rectangles. For example, the size of the depth image is 1280*960, and the size of the determined central area is 800*500. There are 240 columns of pixels remaining on the left and right sides of the central area, and 180 rows of pixels remaining on the upper and lower sides of the central area. The central area is then divided into four sub-images with a size of 400*250, and the surrounding area is divided into four sub-images with sizes of 1280*180, 1280*180, 500*240, and 500*240, respectively, to obtain a total of four sub-images. Among them, the method of dividing the surrounding area can be other methods, which are not limited in this application.
[0037] S130 . For each of the sub-images, construct a viewing cone of the sub-image according to a near focal plane and a far focal plane of the sub-image.
[0038] For each sub-image, the corresponding near focal plane and far focal plane are determined, and the viewing cone of the sub-image is constructed according to the near focal plane and the far focal plane; all sub-images are traversed to obtain the viewing cones of all sub-images.
[0039] In a possible implementation, the far focal plane may be determined according to the maximum depth in the sub-image, and the near focal plane of the sub-image may be determined according to the minimum depth of the sub-image.
[0040] The field of view of the depth camera includes the horizontal field of view angle and the vertical field of view angle. The observation area corresponding to the horizontal field of view angle and the vertical field of view angle is a quadrangular pyramid-shaped space area, and the viewpoint of the depth camera is the pyramid vertex of the quadrangular pyramid-shaped space area. For each sub-image, the quadrangular pyramid-shaped space area is intercepted according to the near focal plane and the far focal plane, and the part between the near focal plane and the far focal plane is used as the virtual cone of the sub-image; then, the partial space area corresponding to the sub-image is determined in the virtual cone of the sub-image as the cone of view of the sub-image.
[0041] See also Figure 2 , Figure 2 A schematic diagram of a sub-image cone in an embodiment of the present application is shown. X0, Y0 and Z0 are the three positive directions of the camera coordinate system of the depth camera, and the viewpoint of the depth camera is used as the origin of the camera coordinate system. The viewpoint of the depth camera used to capture the depth image is used as the origin of the camera coordinate system, and the field of view angle ( Figure 2 The spatial angle between the thick dotted lines emitted by the middle viewpoint) intersects with the near focal plane of sub-image 1, and a dark rectangular area is obtained as the observation area corresponding to the near focal plane of sub-image 1. The field of view angle of the depth camera intersects with the far focal plane of sub-image 1, and a dark rectangular area is obtained as the observation area corresponding to the far focal plane of sub-image 1. The spatial area between the two observation areas and within the field of view angle is taken as the virtual cone of the sub-image 1.
[0042] Then, according to the field of view and sub-image 1, the effective viewing angle corresponding to sub-image 1 is determined ( Figure 2 The spatial angle between the thin dotted lines triggered from the viewpoint in the image) and the part of the virtual vertebra within the effective viewing angle is used as the viewing cone of the sub-image; Figure 2 In the figure, the space area between the dotted rectangular box in the observation area corresponding to the far focal plane of sub-image 1 and the dotted rectangular box in the observation area corresponding to the near focal plane of sub-image 1 and within the effective viewing angle is the viewing cone of sub-image 1. The effective viewing angle of a sub-image refers to the field of view angle when only the sub-image is observed from the viewpoint, and the effective viewing angle is a part of the field of view angle of the depth camera.
[0043] S140: construct a three-dimensional model corresponding to the target object according to the viewing cone of each sub-image.
[0044] For the viewing cone of each sub-image, a 3D model construction operation is performed to obtain a partial 3D model corresponding to the sub-image, and the 3D model of the final target object is obtained based on the 3D models of all the sub-images.
[0045] Optionally, constructing the three-dimensional model corresponding to the target object according to the view cone of each of the sub-images includes: performing parallel processing on the view cone of each of the sub-images according to a parallel instruction set to construct the three-dimensional model corresponding to the target object. The parallel instruction set may include multiple parallel instructions, and the view cones of multiple sub-images are processed in parallel through the instructions in the parallel instruction set to obtain the three-dimensional models of the multiple sub-images respectively, and then the three-dimensional model of the target object is obtained according to the three-dimensional models of the multiple sub-images respectively.
[0046] The processing of the view cones of the sub-images may be performed by processing the view cones of two sub-images in parallel each time, or the view cones of all sub-images may be processed in parallel.
[0047] This embodiment proposes a method for constructing a three-dimensional model. The method comprises acquiring a depth image of a target object; performing image segmentation processing on the depth image to obtain a plurality of sub-images; for each sub-image, constructing a view cone of the sub-image according to the near focal plane and the far focal plane of the sub-image; and constructing a three-dimensional model corresponding to the target object according to the view cone of each sub-image. The view cone corresponding to each sub-image is based on the near focal plane and the far focal plane of each sub-image itself, so that the volume of the view cone of each sub-image is smaller than the corresponding partial volume of the sub-image in the view cone of the entire depth image, and further, the sum of the view cone volumes of each sub-image is smaller than the volume of the view cone of the entire depth image, which greatly reduces the amount of data that needs to be processed to construct a three-dimensional model, thereby improving the efficiency of constructing a three-dimensional model.
[0048] See also Figure 3 , Figure 3 Shows this application Figure 1 The flowchart of S140 in the three-dimensional model building method shown in FIG. 1 is a flowchart of S140 in the three-dimensional model building method shown in FIG. 1 . The method can be used in an electronic device. In this embodiment, step S140 may include:
[0049] S210: Construct a hexahedron including a viewing cone of each of the sub-images.
[0050] The maximum coordinate value and the minimum coordinate value of each sub-image can be determined, wherein the maximum coordinate value includes the maximum value in the three directions of X, Y and Z, and the minimum coordinate value includes the minimum value in the three directions of X, Y and Z. The coordinates of each sub-image can refer to the coordinates in the world coordinate system, and the three directions of X, Y and Z are the three positive directions in the world coordinate system. According to the maximum coordinate value and the minimum coordinate value in the X direction, two planes parallel to the YOZ plane are constructed, according to the maximum coordinate value and the minimum coordinate value in the Y direction, two planes parallel to the XOZ plane are constructed, according to the maximum coordinate value and the minimum coordinate value in the Z direction, two planes parallel to the XOY plane are constructed, and then the hexahedron generated by the intersection of the six planes is used as the hexahedron of the sub-image. Since the hexahedron is based on the maximum value and the minimum value of the three directions of X, Y and Z of the sub-image, the hexahedron also includes the viewing cone of the sub-image.
[0051] For example, the maximum values of sub-image A in the X, Y and Z directions are 100, 150 and 200 respectively, and the minimum values of sub-image A in the X, Y and Z directions are 10, 15 and 20 respectively. According to the maximum and minimum values in the X, Y and Z directions, six planes are constructed, and the hexahedron generated by the six plane bananas is used as the hexahedron of the sub-image, where the eight vertices of the hexahedron are (10, 15, 20), (100, 15, 20), (10, 150, 20), (100, 150, 20), (10, 15, 200), (100, 15, 200), (10, 150, 200) and (100, 150, 200).
[0052] S220, dividing each of the hexahedrons to obtain a plurality of blocks corresponding to each of the viewing cones.
[0053] For each sub-image hexahedron, it is divided into a plurality of uniform small cubes, and the divided small cubes are used as the blocks of the sub-image cone, wherein the volume of the small cube can be 0.4*0.4*0.4, and the unit can be m. The volume and unit of each small cube can be determined based on different accuracy requirements and the size of the target object.
[0054] For example, the volume of a hexahedron corresponding to a sub-image B is 12*10*8, and the size of each cube is 0.4*0.4*0.4, then the hexahedron is divided into 30*25*20=15000 cubes, and the 15000 cubes serve as 15000 blocks of the viewing cone of sub-image B.
[0055] S230. According to each of the viewing cones, collision detection is performed on multiple blocks of each of the viewing cones.
[0056] S240: Use the blocks that pass the collision detection as the valid blocks of each of the viewing cones.
[0057] A sub-image corresponds to a viewing cone, and the sub-image corresponds to a hexahedron, and the viewing cone of the sub-image also corresponds to the hexahedron of the sub-image. For a sub-image, the viewing cone of the sub-image is collided with the hexahedron of the sub-image, and the blocks in the hexahedron that overlap with the viewing cone are regarded as valid blocks of the viewing cone of the sub-image.
[0058] See also Figure 4 , Figure 4 FIG. 2 shows a schematic diagram of collision detection in an embodiment of the present application. Figure 4 The thin solid line in the middle is the border of the hexahedron) is divided into multiple blocks ( Figure 4 The border of the block in the figure is a thin dotted line), the viewing cone and the hexahedron are placed in the same space, and the block overlapping with the viewing cone is regarded as a valid block.
[0059] S250: construct a three-dimensional model corresponding to the target object according to the valid blocks of each of the viewing cones.
[0060] After determining the valid blocks of each viewing cone, a partial three-dimensional model corresponding to the sub-image corresponding to the viewing cone is constructed based on the valid blocks of the viewing cone, and the valid blocks of all viewing cones are traversed to obtain the three-dimensional models corresponding to all the sub-images. Based on the three-dimensional models of all the sub-images, the three-dimensional model of the target object is obtained.
[0061] In this embodiment, valid blocks are determined for the viewing cone of each sub-image. Compared with determining the valid blocks of the entire depth image, the number of valid blocks in the present application is smaller, so that the amount of data processed for building the three-dimensional model is smaller, thereby improving the efficiency of building the three-dimensional model.
[0062] See also Figure 5 , Figure 5 Shows this application Figure 3 The flowchart of S250 in the method shown is shown. The method can be used in an electronic device. In this embodiment, step S250 may include:
[0063] S310 . For each valid volume block of each of the viewing cones, determine a voxel offset of each voxel in the valid volume block relative to a starting point of the valid volume block.
[0064] Each block may include multiple voxels, and the size of the voxel may be 0.05*0.05*0.05, with the unit being m. When the size of the block is 0.4*0.4*0.4, with the unit being m, each block includes 512 voxels. Similarly, each valid block also includes multiple voxels.
[0065] For each valid block, a point on the valid block can be selected as the starting point. The starting point can be the point with the smallest coordinate values in the X, Y and Z directions in the block, or the point in the block closest to the horizontal plane. This application does not limit this.
[0066] The relative coordinates of the starting point of each voxel and the starting point of the block to which it belongs are used as the voxel offset of the voxel relative to the starting point of the block to which it belongs, wherein the selection of the starting point of each voxel is similar to the selection of the starting point of the block. For example, when a block C includes 512 voxels, for the block, the voxel offsets of the 512 voxels and the starting point of the block C are determined to obtain 512 voxel offsets.
[0067] S320: Determine a current valid block from the valid blocks of each of the viewing cones.
[0068] In the specific implementation of the present application, each block may have an index value, and different blocks may have different index values. Different valid blocks in the same viewing cone may have different index values, and valid blocks in different viewing cones may also have different index values.
[0069] For each view cone, a different valid block is selected as the current valid block according to the index value each time. For example, a view cone D corresponds to 200 valid blocks, and the index values are 1-200. The valid blocks are determined in order from small to large index values. The valid block determined for the first time is the valid block with an index value of 1, which is used as the current valid block. The valid block determined for the 100th time is the valid block with an index value of 100, which is used as the current valid block.
[0070] In some implementations, the current valid block may be randomly determined according to the index value of the valid block, and whether the valid block has been processed may be determined according to the index value of the valid block to avoid repeated processing of the valid block.
[0071] S320: Determine the starting point position information of the starting point of the current valid block.
[0072] The coordinates of the starting point of the current valid block are used as the starting point position information of the starting point of the current valid block.
[0073] S330 , obtaining a truncated signed distance function value and a weight of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block.
[0074] For each valid block, a truncated signed distance function (TSDF) value of each voxel in the valid block can be determined based on the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block according to the projecting mapping method, and a weight of the voxel is determined according to the determined truncated signed distance function value. For each valid block, the truncated signed distance function value and weight of each voxel are obtained. For example, if the valid block E includes 512 voxels, 512 truncated signed distance function values and 512 weights are obtained.
[0075] The depth camera can be modeled to obtain the noise parameters of the depth camera, and the threshold is determined according to the noise parameters. When the truncated signed distance function value of the voxel does not exceed the threshold, the weight of the voxel is assigned to 1, and when the truncated signed distance function value of the voxel exceeds the threshold, the weight of the voxel is assigned to 0.
[0076] S340, return to execute the step of determining the current valid block among the valid blocks in each of the viewing cones, until all the valid blocks of each of the viewing cones are traversed to obtain the truncated signed distance function value set and weight set corresponding to each of the viewing cones.
[0077] After determining the truncated signed distance function value and weight of each voxel in a valid block, a current valid block is re-determined according to the index value of the valid block, and the above calculation steps are repeated to obtain the truncated signed distance function value and weight of each voxel in the current valid block. Traverse all valid blocks of the cone to obtain the truncated signed distance function value and weight of each voxel in all valid blocks. The set of truncated signed distance function values of each voxel in all valid blocks of a cone is used as the truncated signed distance function value set, and the set of weights of each voxel in all valid blocks of a cone is used as the weight set. One cone corresponds to a truncated signed distance function value set and a weight set.
[0078] For example, a viewing cone F corresponds to 100 valid blocks, each valid block includes 512 voxels, then the obtained truncated signed distance function value set includes the respective truncated signed distance function values of 51200 voxels, and the obtained weight set includes the respective weights of 51200 voxels.
[0079] S360: construct a three-dimensional model corresponding to the target object according to the truncated signed distance function value set and the weight set of each of the view cones.
[0080] For each sub-image's viewing cone, obtain the truncated signed distance function value set and the weight set of the viewing cone, construct the three-dimensional model of each sub-image corresponding to the viewing cone based on the truncated signed distance function value set and the weight set of the viewing cone, traverse the viewing cones of all sub-images to obtain the three-dimensional models of all sub-images, and obtain the three-dimensional model of the target object based on the three-dimensional models of all sub-images.
[0081] In this embodiment, each effective volume block corresponds to a plurality of voxels, and the size of each voxel is small, so that the data processing accuracy of the constructed three-dimensional model is high, thereby improving the accuracy of the constructed three-dimensional model.
[0082] At the same time, for the valid blocks in the viewing cone of each sub-image, one valid block is selected each time, and all the voxels in the block are traversed to obtain the truncated signed distance function values and weights of all the voxels in the valid block, and then other valid blocks are traversed. Compared with multiple traversals of the same block in the related art, the method of the present application reduces the number of traversals, improves the traversal efficiency, and thus improves the model building efficiency.
[0083] See also Figure 6 , Figure 6 Shows this application Figure 5 A flow chart of S340 in the method shown is shown. The method can be used in an electronic device. In this embodiment, step S340 may include:
[0084] S410 , obtaining position information of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block.
[0085] For each voxel in the current valid block, the coordinate value of each voxel relative to the origin of the camera coordinate system is calculated according to the voxel offset and the starting point position information as the position information of each voxel. The position information of each voxel can be obtained by summing the voxel offset of each voxel and the starting point position information of the corresponding valid block. The voxel offset corresponding to each voxel and the starting point position information corresponding to the current valid block are both in the camera coordinate system.
[0086] S420: Project the center of each voxel in the current valid volume block onto the depth image to obtain a projected result.
[0087] S430: Read the depth value of each voxel in the current valid block from the projected result.
[0088] The center of each voxel is projected onto the depth image to obtain a projected result. Specifically, the center of each voxel may be projected onto the depth image according to a pinhole camera model to obtain a projected result.
[0089] S440 , obtaining a truncated signed distance function value and a weight of each voxel in the current valid block according to the position information and the depth value of each voxel in the current valid block.
[0090] For each voxel in the current valid volume block, the truncated signed distance function value of each voxel is calculated according to the Z value in the voxel's position information and the depth value of the voxel obtained in the projection result, and when the truncated signed distance function value does not exceed the threshold, the weight of the voxel is assigned to 1, and when the truncated signed distance function value exceeds the threshold, the weight of the voxel is assigned to 0.
[0091] See also Figure 7 , Figure 7 Shows this application Figure 5 Another flow chart of S340 in the three-dimensional model building method shown in FIG. 1 is a flow chart of S340 in the three-dimensional model building method shown in FIG. 1 . The method can be used in an electronic device. In this embodiment, step S340 may include:
[0092] S510, obtaining a camera pose of the depth image, wherein the camera pose is the pose of the depth camera that captures the depth image; for each valid block of each of the viewing cones, determining an initial voxel offset of each voxel in the valid block relative to the starting point of the valid block, wherein the initial voxel offset is in a world coordinate system; and obtaining a voxel offset of the starting point of each of the valid blocks according to the camera pose and the initial voxel offset, wherein the voxel offset is in a camera coordinate system of the depth camera.
[0093] The camera pose may refer to the rotation matrix and translation matrix of the depth camera relative to the world coordinate system when taking a depth image. When scanning the target object by moving the depth camera, the camera pose at different scanning moments may be different. The camera pose at each moment is the real-time camera pose of the depth camera relative to the world coordinate system at that moment.
[0094] The initial voxel offset of each voxel refers to the relative coordinates of the voxel relative to the starting point of the block in the world coordinate system; the initial voxel offset is converted through the camera posture to obtain the relative coordinates of the voxel relative to the starting point of the block in the camera coordinate system as the voxel offset of the voxel.
[0095] S520: Determine a current valid block from the valid blocks of each of the viewing cones.
[0096] The description of S520 refers to the description of S420 and will not be repeated here.
[0097] S530. Determine the initial starting point position information of the starting point of the current valid block, wherein the initial starting point position information is in the world coordinate system; obtain the starting point position information of the current valid block according to the camera posture and the initial starting point position information, wherein the starting point position information is in the camera coordinate system of the depth camera.
[0098] For each valid block, the coordinates of the valid block in the world coordinate system are determined as the initial starting point position information, and then the initial starting point position information is transformed according to the camera posture to obtain the coordinates of the valid block in the camera coordinate system as the starting point position information.
[0099] S540 , obtaining a truncated signed distance function value and a weight of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block.
[0100] S550, return to the step of determining the current valid block among the valid blocks in each of the viewing cones, until all the valid blocks in each of the viewing cones are traversed to obtain a set of truncated signed distance function values and a set of weights corresponding to each of the viewing cones.
[0101] S560: construct a three-dimensional model corresponding to the target object according to the truncated signed distance function value set and the weight set of each of the viewing cones.
[0102] Among them, the description of S540-S560 refers to the description of S340-S360 above and will not be repeated here.
[0103] See also Figure 8 , Figure 8 Shows this application Figure 1 The flowchart of S130 in the three-dimensional model building method shown in FIG. 1 is a flowchart of S130 in the three-dimensional model building method shown in FIG. 1 . The method can be used in an electronic device. In this embodiment, step S130 may include:
[0104] S610: Determine a camera pose, a field of view, and a viewpoint of a depth camera, where the depth camera is a depth camera that captures the depth image.
[0105] S620: construct a virtual cone of each sub-image according to the near focal plane, the far focal plane, the field of view, and the viewpoint of each sub-image.
[0106] S630: Obtain a viewing cone of each sub-image according to each sub-image, a virtual cone of each sub-image, and the viewpoint.
[0107] For each sub-image, the virtual cone of the sub-image can be obtained according to the far focal plane of the sub-image, the near focal plane, the viewpoint of the depth camera, and the field of view of the depth camera, and then the corresponding effective viewing angle of the sub-image is determined according to the viewpoint of the depth camera and the sub-image. The viewpoint is taken as the starting point of the effective viewing angle, and the part of the virtual cone of the sub-image that is within the effective viewing angle is taken as the viewing cone of the sub-image.
[0108] like Figure 2 , the viewpoint of the depth camera used to capture the depth image is used as the origin of the camera coordinate system, and the field of view of the depth camera ( Figure 2 The spatial angle between the thick dotted lines emitted by the middle viewpoint) intersects with the near focal plane of sub-image 1, and a dark rectangular area is obtained as the observation area corresponding to the near focal plane of sub-image 1. The field of view angle of the depth camera intersects with the far focal plane of sub-image 1, and a dark rectangular area is obtained as the observation area corresponding to the far focal plane of sub-image 1. The spatial area between the two observation areas and within the field of view angle is taken as a virtual cone.
[0109] Then, according to the field of view and sub-image 1, the effective viewing angle corresponding to sub-image 1 is determined ( Figure 2 The spatial angle between the thin dotted lines triggered from the viewpoint in the image) and the part of the virtual vertebra within the effective viewing angle is used as the viewing cone of the sub-image; Figure 2 In the figure, the space area between the dotted rectangular box in the observation area corresponding to the far focal plane of sub-image 1 and the dotted rectangular box in the observation area corresponding to the near focal plane of sub-image 1 and within the effective viewing angle is taken as the viewing cone of sub-image 1.
[0110] In a possible implementation, the depth image may include multiple depth images, which are arranged in the order of shooting time. The depth image processing is performed according to the arrangement order of the depth images. For the first depth image, the following processing is performed:
[0111] For each depth image, the depth image is divided and processed to obtain multiple sub-images; according to the near focal plane, far focal plane, field of view angle of the depth camera and viewpoint of each sub-image, a virtual cone of each sub-image is constructed; according to each sub-image, the virtual cone of each sub-image and the viewpoint, the viewing cone of each sub-image is obtained; then, a hexahedron including the viewing cone of each sub-image is constructed; each hexahedron is divided and processed to obtain multiple blocks corresponding to each viewing cone; according to each viewing cone, collision detection is performed on the multiple blocks of each viewing cone; the blocks that pass the collision detection are used as the valid blocks of each viewing cone.
[0112] For each valid block of each viewing cone, determine the initial voxel offset of each voxel in the valid block relative to the starting point of the valid block, and the initial voxel offset is in the world coordinate system; according to the camera pose and the initial voxel offset, obtain the voxel offset of the starting point of each valid block, and the voxel offset is in the camera coordinate system of the depth camera.
[0113] The current valid block is determined in the valid blocks of each viewing cone, and the initial starting point position information of the starting point of the current valid block is determined, and the initial starting point position information is in the world coordinate system; according to the camera posture and the initial starting point position information, the starting point position information of the current valid block is obtained, and the starting point position information is in the camera coordinate system of the depth camera.
[0114] According to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block, the position information of each voxel in the current valid block is obtained; the center of each voxel in the current valid block is projected onto the depth image to obtain the projected result; the depth value of each voxel in the current valid block is read in the projected result; according to the position information and depth value of each voxel in the current valid block, the truncated signed distance function value and weight of each voxel in the current valid block are obtained. Among them, for the first processed depth image, the initial weight of a voxel is 0. When the truncated signed distance function value does not exceed the threshold, the truncated signed distance function value is determined to be valid, and the weight of the voxel is increased by 1 based on the initial value. When the truncated signed distance function value exceeds the threshold, the truncated signed distance function value is determined to be invalid, and the weight of the voxel is kept at the initial value.
[0115] Return to the step of determining the current valid block among the valid blocks in each viewing cone until all valid blocks in each viewing cone are traversed to obtain the truncated signed distance function value set and weight set corresponding to each viewing cone; construct a three-dimensional model of the corresponding target object according to the truncated signed distance function value set and weight set of each viewing cone.
[0116] For the Nth depth image after the first image, where N is an integer greater than 1, the following processing is performed:
[0117] According to the same processing method as the first depth image, the truncated signed distance function value and weight of the voxels of each valid volume block corresponding to the Nth depth image are obtained. For each voxel of the Nth depth image, if a voxel corresponds to a valid truncated signed distance function value in the current depth image, the weight of the voxel is added by 1, and the truncated signed distance function value of the voxel is the truncated signed distance function value corresponding to the voxel in the Nth depth image; if a voxel corresponds to an invalid truncated signed distance function value in the current depth image, the weight of the voxel remains unchanged and is the same as the weight of the voxel in the previous depth image, and the truncated signed distance function value of the voxel is the truncated signed distance function value corresponding to the voxel in the Nth depth image.
[0118] For example, for a voxel H1, when the second depth image of the target object is processed, the truncated signed distance function value J1 of the voxel H1 does not exceed the preset threshold, and the corresponding truncated signed distance function value J2 of the voxel H1 in the first depth image does not exceed the preset threshold. At this time, the weight corresponding to the voxel H1 is 0+1+1=2, and the truncated signed distance function value is J1; if when the second depth image of the target object is processed, the truncated signed distance function value J3 of the voxel H1 does not exceed the preset threshold, and the corresponding truncated signed distance function value J4 of the voxel H1 in the first depth image exceeds the preset threshold, at this time, the weight corresponding to the voxel H1 is 0+0+1=1, and the truncated signed distance function value is J3.
[0119] Afterwards, return to the step of determining the current valid block among the valid blocks in each viewing cone until all valid blocks in each viewing cone are traversed to obtain the truncated signed distance function value set and weight set corresponding to each viewing cone; according to the truncated signed distance function value set and weight set of each viewing cone in the Nth depth image, construct the three-dimensional model of the corresponding target object.
[0120] After traversing all the depth images, the construction of the three-dimensional model is completed.
[0121] See also Fig. 9 , Fig. 9 A block diagram of a three-dimensional model construction device proposed in one embodiment of the present application is shown, and the device 1100 includes:
[0122] An acquisition module 1110 is used to acquire a depth image of a target object;
[0123] A division module 1120, configured to perform image division processing on the depth image to obtain a plurality of sub-images;
[0124] A view cone construction module 1130, configured to construct, for each of the sub-images, a view cone of the sub-image according to a near focal plane and a far focal plane of the sub-image;
[0125] The model building module 1140 is used to build a three-dimensional model corresponding to the target object according to the viewing cone of each sub-image.
[0126] Optionally, the model construction module 1140 is also used to construct a hexahedron including the viewing cone of each of the sub-images; divide each of the hexahedrons to obtain multiple blocks corresponding to each of the viewing cones; perform collision detection on the multiple blocks of each of the viewing cones according to each of the viewing cones; use the blocks that pass the collision detection as valid blocks of each of the viewing cones; and construct a three-dimensional model corresponding to the target object according to the valid blocks of each of the viewing cones.
[0127] Optionally, each of the valid blocks includes multiple voxels; the model building module 1140 is also used to determine, for each valid block of each of the visual cones, the voxel offset of each voxel in the valid block relative to the starting point of the valid block; determine the current valid block in the valid blocks of each of the visual cones; determine the starting point position information of the starting point of the current valid block; obtain the truncated signed distance function value and weight of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block; return to execute the step of determining the current valid block in the valid blocks in each of the visual cones until all the valid blocks of each of the visual cones are traversed to obtain the truncated signed distance function value set and weight set corresponding to each of the visual cones; and construct a three-dimensional model corresponding to the target object according to the truncated signed distance function value set and weight set of each of the visual cones.
[0128] Optionally, the model building module 1140 is also used to obtain the position information of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block; project the center of each voxel in the current valid block onto the depth image to obtain the projected result; read the depth value of each voxel in the current valid block in the projected result; and obtain the truncated signed distance function value and weight of each voxel in the current valid block according to the position information and depth value of each voxel in the current valid block.
[0129] Optionally, the model building module 1140 is also used to obtain the camera pose of the depth image, where the camera pose is the pose of the depth camera that takes the depth image; for each valid block of each of the visual cones, determine the initial voxel offset of each voxel in the valid block relative to the starting point of the valid block, and the initial voxel offset is in the world coordinate system; based on the camera pose and the initial voxel offset, obtain the voxel offset of the starting point of each of the valid blocks, and the voxel offset is in the camera coordinate system of the depth camera; determine the initial starting point position information of the starting point of the current valid block, and the initial starting point position information is in the world coordinate system; based on the camera pose and the initial starting point position information, obtain the starting point position information of the current valid block, and the starting point position information is in the camera coordinate system of the depth camera.
[0130] Optionally, the model building module 1140 is further used to perform parallel processing on the viewing cone of each sub-image according to a parallel instruction set to build a three-dimensional model corresponding to the target object.
[0131] Optionally, the cone construction module 1130 is also used to determine the camera pose, field of view angle and viewpoint of a depth camera, wherein the depth camera is a depth camera that captures the depth image; construct a virtual cone of each sub-image according to the near focal plane, far focal plane, field of view angle and viewpoint of each sub-image; and obtain the cone of each sub-image according to each sub-image, the virtual cone of each sub-image and the viewpoint.
[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0133] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0134] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0135] Fig.10 The structure block diagram of an electronic device for executing the method for constructing a three-dimensional model according to an embodiment of the present application is shown. It should be noted that: Fig.10 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0136] like Fig.10 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method in the above embodiment. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0137] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0138] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0139] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0140] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0141] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0142] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries computer-readable instructions, and when the computer-readable storage instructions are executed by a processor, the method in any of the above embodiments is implemented.
[0143] According to one aspect of the present application, an electronic device is also provided, which includes: a processor; a memory, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the method in any of the above embodiments is implemented.
[0144] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in any of the above embodiments.
[0145] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0146] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0147] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. It should be understood that the present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for constructing a three-dimensional model, characterized in that: The method comprises: Obtain a depth image of the target object; Performing image division processing on the depth image to obtain a plurality of sub-images; For each of the sub-images, constructing a viewing cone of the sub-image according to a near focal plane and a far focal plane of the sub-image; Constructing a three-dimensional model corresponding to the target object according to the viewing cone of each sub-image; Wherein, constructing the three-dimensional model corresponding to the target object according to the viewing cone of each sub-image specifically comprises the following steps: constructing a hexahedron including a viewing cone of each of said sub-images; Dividing each of the hexahedrons to obtain a plurality of blocks corresponding to each of the viewing cones; According to each of the visual cones, collision detection is performed on a plurality of blocks of each of the visual cones; Taking the blocks that pass the collision detection as the valid blocks of each of the viewing cones; A three-dimensional model corresponding to the target object is constructed according to the valid blocks of each of the viewing cones.
2. The method according to claim 1, characterized in that Each of the valid blocks includes a plurality of voxels; and constructing a three-dimensional model corresponding to the target object according to the valid blocks of each of the view cones includes: For each valid volume block of each of the view cones, determining a voxel offset of each voxel in the valid volume block relative to a starting point of the valid volume block; Determine a current valid block among the valid blocks of each of the viewing cones; Determine the starting point position information of the starting point of the current valid block; Obtaining a truncated signed distance function value and a weight of each voxel in the current valid block according to a voxel offset corresponding to each voxel in the current valid block and starting point position information corresponding to the current valid block; Return to the step of determining the current valid block from the valid blocks in each of the viewing cones until all valid blocks in each of the viewing cones are traversed to obtain a set of truncated signed distance function values and a set of weights corresponding to each of the viewing cones; A three-dimensional model corresponding to the target object is constructed according to the truncated signed distance function value set and the weight set of each of the viewing cones.
3. The method according to claim 2, characterized in that The step of obtaining the truncated signed distance function value and the weight of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block includes: Obtaining position information of each voxel in the current valid block according to the voxel offset corresponding to each voxel in the current valid block and the starting point position information corresponding to the current valid block; Projecting the center of each voxel in the current valid volume block onto the depth image to obtain a projected result; Reading the depth value of each voxel in the current valid block from the projected result; According to the position information and the depth value of each voxel in the current valid block, the truncated signed distance function value and the weight of each voxel in the current valid block are obtained.
4. The method according to claim 2, characterized in that: The step of determining, for each valid block of each of the view cones, a voxel offset of each voxel in the valid block relative to a starting point of the valid block comprises: Acquire a camera pose of the depth image, where the camera pose is a pose of a depth camera that captures the depth image; For each valid volume block of each of the view cones, determine an initial voxel offset of each voxel in the valid volume block relative to a starting point of the valid volume block, wherein the initial voxel offset is in a world coordinate system; According to the camera pose and the initial voxel offset, a voxel offset of a starting point of each valid block is obtained, wherein the voxel offset is in a camera coordinate system of the depth camera; The determining of the starting point position information of the starting point of the current valid block includes: Determine the initial starting point position information of the starting point of the current valid block, wherein the initial starting point position information is in the world coordinate system; The starting point position information of the current valid block is obtained according to the camera pose and the initial starting point position information, wherein the starting point position information is in the camera coordinate system of the depth camera.
5. The method according to claim 1, characterized in that The step of constructing a three-dimensional model corresponding to the target object according to the view cone of each sub-image comprises: According to the parallel instruction set, the viewing cone of each sub-image is processed in parallel to construct a three-dimensional model corresponding to the target object.
6. The method according to claim 1, characterized in that The step of constructing a viewing cone of each sub-image according to a near focal plane and a far focal plane of the sub-image comprises: Determine a camera pose, a field of view, and a viewpoint of a depth camera, wherein the depth camera is a depth camera that captures the depth image; Constructing a virtual cone of each sub-image according to the near focal plane, the far focal plane, the field of view and the viewpoint of each sub-image; The viewing cone of each sub-image is obtained according to each sub-image, the virtual cone of each sub-image and the viewpoint.
7. A three-dimensional model construction device, characterized in that: The device comprises: An acquisition module, used to acquire a depth image of a target object; A division module, used to perform image division processing on the depth image to obtain multiple sub-images; A cone construction module, used for constructing a cone of the sub-image according to a near focal plane and a far focal plane of the sub-image for each sub-image; A model building module, used for building a three-dimensional model corresponding to the target object according to the viewing cone of each sub-image; Among them, the model construction module is specifically used to: construct a hexahedron including the viewing cone of each sub-image; divide each of the hexahedron to obtain multiple blocks corresponding to each of the viewing cones; according to each of the viewing cones, perform collision detection on the multiple blocks of each of the viewing cones; use the blocks that pass the collision detection as the valid blocks of each of the viewing cones; and construct a three-dimensional model corresponding to the target object based on the valid blocks of each of the viewing cones.
8. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Super-high-resolution three dimensional reconstruction method based on global variation technology
CN105046743A
Method and apparatus for identifying foreground target obejct
CN105225230A