Three-dimensional reconstruction method, device and equipment based on target recognition and model matching
Through a method based on target recognition and model matching, the pixel coordinates in an image and the preset model library are used to directly construct a 3D scene model, which solves the problem of low efficiency of existing 3D reconstruction technology and achieves fast and efficient 3D reconstruction. and high-precision results.
Patent Information
- Application Number
- CN202310731172.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-06-19
AI Technical Summary
Existing 3D reconstruction technology is inefficient, especially in indoor and outdoor 3D reconstruction, which requires a large number of pictures and time to complete the model construction, resulting in low computational efficiency and the inability to achieve model singulation.
Using a method based on target recognition and model matching, the real geographical coordinates are determined through the pixel coordinates in a collected image, and the target model samples are matched from the preset model sample library to build a three-dimensional scene model, reducing feature extraction and matching steps, and improving Computational efficiency.
It greatly improves the efficiency of 3D reconstruction, reduces the amount of calculation, realizes the rapid construction of 3D models, and improves the accuracy of reconstruction results.
Smart Images

Figure CN117057086B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional modeling, and provides a three-dimensional reconstruction method, device and equipment based on target recognition and model matching. Background Art
[0002] In recent years, immersive experience has become the future development direction. Among them, 3D reconstruction that migrates the real environment to the virtual network environment is an indispensable foundation for immersive experience. Specifically, 3D reconstruction can be divided into indoor 3D reconstruction and outdoor 3D reconstruction according to the reconstruction target.
[0003] At present, there are two ways to reconstruct indoor three-dimensional modeling: manual modeling and automatic modeling. Manual modeling can be done through common modeling software on the market, which is time-consuming and labor-intensive; while automatic modeling can automatically generate a three-dimensional model by combining software and hardware and using a computer to process the corresponding data. Furthermore, automatic modeling can be specifically divided into two methods: active measurement and passive measurement. Active measurement can transmit a controllable signal to the target object, calculate the depth information of the target based on the transmitted information signal and the return signal, and further perform modeling and measurement, such as laser ranging, etc. However, since the required instruments are mostly expensive and not easy to carry, their application occasions are limited. Passive measurement can obtain the three-dimensional information of the target through images. Common passive measurements are multi-view. Figure 3 The essence of 3D reconstruction is the focal length method, which is similar to the principle of laser ranging. The focal length method can measure the distance of different positions of the target from the camera by adjusting the focal length of the camera, that is, the depth of the measured point is calculated using the lens imaging formula. When measuring the distance of different areas, it is necessary to constantly change the focus position to obtain the depth information of different positions. Multiple images need to be obtained at the same position, so the data collection work is cumbersome and the entire calculation process is cumbersome and complicated. In addition, as the amount of data increases, the efficiency will also be reduced exponentially.
[0004] Outdoor 3D reconstruction can fully perceive complex scenes in a wide range. The data generated by 3D reconstruction data acquisition equipment and professional 3D reconstruction systems can intuitively reflect the appearance texture, position, height and other attributes of the objects, providing a guarantee for the real effect and surveying and mapping level accuracy. At present, UAV oblique photogrammetry technology is the most widely used in the field of outdoor 3D reconstruction. This oblique photography technology uses multiple sensors on the flight platform to collect images from different angles such as a vertical and four side views at the same time, so as to obtain richer side texture information. Its principle is: given the external parameters such as the position and posture of the camera and the internal parameters such as the horizontal and vertical viewing angles, the principal point, and the focal length, the spatial position of the target is calculated according to the principle of rear intersection, thereby realizing outdoor 3D reconstruction. Its images have high overlap, large redundancy, low calculation efficiency, and cannot achieve model monomerization.
[0005] In summary, whether it is indoor 3D reconstruction or outdoor 3D reconstruction, currently 3D reconstruction is basically performed through a large number of images and a lot of time, resulting in low 3D reconstruction efficiency. Therefore, how to improve the efficiency of 3D reconstruction is an urgent problem to be solved. Summary of the invention
[0006] The present application provides a three-dimensional reconstruction method, device and equipment based on target recognition and model matching, which are used to solve the problem of low three-dimensional reconstruction efficiency.
[0007] On the one hand, a three-dimensional reconstruction method based on target recognition and model matching is provided, the method comprising:
[0008] Determine the corrected real geographic coordinates of the multiple pixel points only based on the pixel coordinates of the multiple pixel points corresponding to each image target in a captured image; wherein the captured image is an image containing depth information captured for the target area, and the multiple pixel points include centroids and boundary corners;
[0009] Determine the target model samples corresponding to the respective image targets that meet the preset similarity conditions from a preset model sample library; wherein the model sample library includes a plurality of facility model samples and sample information of the plurality of facility model samples;
[0010] A three-dimensional scene model of the target area is constructed according to the corrected real geographic coordinates of the multiple pixel points and the various target model samples.
[0011] In one aspect, a three-dimensional reconstruction device based on target recognition and model matching is provided, the device comprising:
[0012] A real geographic coordinate determination unit, configured to determine the corrected real geographic coordinates of a plurality of pixel points based only on the pixel coordinates of the plurality of pixel points corresponding to each image target in a captured image; wherein the captured image is an image containing depth information captured for a target area, and the plurality of pixel points include centroids and boundary corner points;
[0013] A target model sample determination unit, used to determine target model samples corresponding to each of the image targets that meet a preset similarity condition from a preset model sample library; wherein the model sample library includes a plurality of facility model samples and sample information of the plurality of facility model samples;
[0014] The three-dimensional scene model construction unit is used to construct a three-dimensional scene model of the target area according to the corrected real geographic coordinates of the multiple pixel points and the various target model samples.
[0015] Optionally, the device further includes a sample information determining unit, and the sample information determining unit includes:
[0016] Performing feature extraction on the one acquired image to determine color information and texture information corresponding to each image target in the one acquired image;
[0017] Performing feature recognition on the one collected image to determine shape information corresponding to each image target in the one collected image;
[0018] Then, determining the target model samples corresponding to the respective image targets that meet the preset similarity conditions from the preset model sample library includes:
[0019] According to the color information, the texture information and the shape information, target model samples corresponding to the respective image targets meeting preset similarity conditions are respectively determined from a preset model sample library.
[0020] Optionally, the target model sample determination unit is further used to:
[0021] For any image target among the image targets, according to the semantic category of the image target, a target model set matching the semantic category of the image target is determined from the preset model sample library;
[0022] According to the color information, texture information and shape information of any image target, a target model sample corresponding to any image target that meets a preset similarity condition is determined from the target model set.
[0023] Optionally, the device further includes a semantic category determination unit, and the semantic category determination unit includes:
[0024] According to a preset neural network model, semantic recognition is performed on each image target in the captured image to determine the semantic category corresponding to each image target.
[0025] Optionally, the device further includes a model sample library construction unit, and the model sample library construction unit includes:
[0026] Using a preset 3D modeling software, 3D modeling is performed on various outdoor facilities and various outdoor facilities in the real world to obtain 3D model samples corresponding to the various outdoor facilities and the various outdoor facilities;
[0027] The model sample library is constructed according to the various outdoor facilities and the three-dimensional model samples corresponding to the various outdoor facilities.
[0028] Optionally, the real geographic coordinate determination unit is further used to:
[0029] Determine the first world geographic coordinates of the plurality of pixel points according to the depth information of the plurality of pixel points, the pixel coordinates of the plurality of pixel points, the focal length of the image acquisition device when acquiring the one acquired image, and the length and width of the one acquired image;
[0030] According to the device geographic coordinates of the image acquisition device when acquiring the one acquired image, a translation operation is performed on the first world geographic coordinates of the plurality of pixel points to determine the second world geographic coordinates of the plurality of pixel points;
[0031] According to the posture information of the image acquisition device when acquiring the one acquired image, a rotation operation is performed on the second world geographic coordinates of the multiple pixel points to determine the corrected real geographic coordinates of the multiple pixel points.
[0032] Optionally, the three-dimensional scene model construction unit is further used to:
[0033] For any image target among the image targets, according to the corrected real geographic coordinates of each boundary corner point corresponding to the image target, obtain the rotation angle and size of the target model sample corresponding to the image target;
[0034] According to the rotation angle, the size and the real geographic coordinates corrected by the center of mass corresponding to any image target, an affine transformation is performed on the target model sample corresponding to any image target to construct a three-dimensional monomer model corresponding to any image target;
[0035] A three-dimensional scene model of the target area is constructed according to the three-dimensional monomer models corresponding to the respective image targets.
[0036] On the one hand, a device for three-dimensional reconstruction based on target recognition and model matching is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.
[0037] In one aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the steps of any of the above methods are implemented.
[0038] In the embodiment of the present application, firstly, the real geographic coordinates of the centroid and boundary corner points of each image target after correction can be determined only based on the pixel coordinates of the centroid and boundary corner points of each image target in a captured image collected for the target area; then, the target model samples corresponding to each image target that meets the preset similarity condition can be determined from the preset model sample library; finally, the three-dimensional scene model of the target area can be constructed according to the real geographic coordinates of the centroid and boundary corner points of each image target and each target model sample after correction. Therefore, in the embodiment of the present application, since only one captured image is used for three-dimensional reconstruction, it is not necessary to collect a large number of repeated images of the same target at different perspectives, and then, it is not necessary to extract a large number of features, feature matching and generate point clouds, which saves a huge amount of calculation and greatly improves the efficiency of three-dimensional reconstruction. In addition, since the target model samples matching the image target are directly obtained from the preset model sample library, and the three-dimensional scene model is established based on these target model samples, the efficiency of three-dimensional reconstruction is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a process flow of a three-dimensional reconstruction method based on target recognition and model matching provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of determining real geographic coordinates provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of obtaining a rotation angle provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of a three-dimensional reconstruction device based on target recognition and model matching provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0046] At present, 3D reconstruction can be divided into indoor 3D reconstruction and outdoor 3D reconstruction according to the reconstruction target. Among them, when performing indoor 3D reconstruction, if manual modeling is used, it is very time-consuming and labor-intensive, the required instruments are expensive, not easy to carry, and the application occasions are limited; if automatic modeling is used, it is necessary to obtain multiple images of the same target, and the data collection work is cumbersome. The entire calculation process is cumbersome and complicated, and as the amount of data increases, the efficiency will also be reduced exponentially. When performing outdoor 3D reconstruction, the images taken have a high degree of overlap, large redundancy, low calculation efficiency, and it is impossible to achieve model monomerization.
[0047] Based on this, the embodiment of the present application provides a three-dimensional reconstruction method based on target recognition and model matching. In the method, first, the centroid and boundary corner point corrected real geographic coordinates of each image target can be determined only based on the pixel coordinates of the centroid and boundary corner point of each image target in a captured image collected for the target area; then, the target model samples corresponding to each image target that meets the preset similarity condition can be determined from the preset model sample library; finally, the three-dimensional scene model of the target area can be constructed according to the centroid and boundary corner point corrected real geographic coordinates of each image target and each target model sample. Therefore, in the embodiment of the present application, since only one captured image is used to perform three-dimensional reconstruction, it is not necessary to collect a large number of repeated images of the same target at different perspectives, and then, it is not necessary to extract a large number of features, feature matching and generate point clouds, which saves a huge amount of calculation and greatly improves the efficiency of three-dimensional reconstruction. In addition, since the target model samples matching the image target are directly obtained from the preset model sample library, and the three-dimensional scene model is established based on these target model samples, the efficiency of three-dimensional reconstruction is further improved.
[0048] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0049] like Figure 1 FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. The application scenario may include a three-dimensional reconstruction device 10 and an image acquisition device 20 .
[0050] The image acquisition device 20 can be used to acquire images of a target area in the real world, for example, it can be a camera and a mobile phone with an image acquisition function. The three-dimensional reconstruction device 10 can be used to perform three-dimensional reconstruction on the acquired images, for example, it can be a personal computer (PC). The three-dimensional reconstruction device 10 can include one or more processors 101, a memory 102, an I / O interface 103, and a database 104. Specifically, the processor 101 can be a central processing unit (CPU), or a digital processing unit, etc. The memory 102 can be a volatile memory, such as a random-access memory (RAM); the memory 102 can also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 102 can be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 102 may be a combination of the above memories. The memory 102 may store program instructions of the three-dimensional reconstruction method based on target recognition and model matching provided in the embodiment of the present application. When these program instructions are executed by the processor 101, they can be used to implement the steps of the three-dimensional reconstruction method based on target recognition and model matching provided in the embodiment of the present application to solve the problem of low efficiency of three-dimensional reconstruction. The database 104 may be used to store data such as several facility model samples and sample information of several facility model samples involved in the solution provided in the embodiment of the present application.
[0051] In the embodiment of the present application, when the target area needs to be reconstructed in three dimensions, the image acquisition device 20 can firstly acquire images of the target area, and then the three-dimensional reconstruction device 10 can obtain a captured image acquired by the image acquisition device 20 through the I / O interface 103, and transmit the captured image to the memory 102, and then the processor 101 performs three-dimensional scene reconstruction according to the program instructions of the three-dimensional reconstruction method based on target recognition and model matching provided in the embodiment of the present application for the captured image package in the memory 102. In addition, data such as several facility model samples and sample information of several facility model samples involved in the entire three-dimensional scene reconstruction process can also be stored in the database 104.
[0052] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1 The functions that can be realized by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here. Below, the method of the embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0053] like Figure 2 As shown in FIG. 1 , a flow chart of a three-dimensional reconstruction method based on target recognition and model matching provided in an embodiment of the present application is provided. The method can be performed by Figure 1 The three-dimensional reconstruction device 10 is used to perform the method. Specifically, the process of the method is described as follows.
[0054] Step 201: determining the corrected real geographic coordinates of the plurality of pixel points based only on the pixel coordinates of the plurality of pixel points corresponding to the respective image targets in a captured image.
[0055] In an embodiment of the present application, the captured image may be an image containing depth information captured for a target area, and the multiple pixel points may include a centroid and boundary corner points.
[0056] Specifically, in order to reduce the amount of calculation, in an embodiment of the present application, when determining the corrected real geographic coordinates of each image target in the captured image, only the center of mass and boundary corner points corresponding to each image target may be determined, wherein, when modeling a three-dimensional scene, the center of mass can be used to determine the position of the image target in the real world, and the boundary corner points can be used to determine the size of the image target in the real world.
[0057] In a possible implementation, in order to make the three-dimensional scene model more accurate, the internal and external parameters of the image acquisition device 20 can be used to calculate the corrected real geographic coordinates of multiple pixel points corresponding to each image target in the acquired image. Figure 3As shown, it is a schematic diagram of determining the real geographic coordinates provided in an embodiment of the present application, and the specific determination process is as follows:
[0058] Step 301: Determine the first world geographic coordinates of the plurality of pixels according to the depth information of the plurality of pixels, the pixel coordinates of the plurality of pixels, the focal length of the image acquisition device when acquiring a captured image, and the length and width of a captured image.
[0059] In the embodiment of the present application, assuming that the device geographic coordinates of the image acquisition device 20 are (0, 0, 0), the following formula (1) can be used to determine the first world geographic coordinates (Xc, Yc, Zc) of multiple pixel points:
[0060]
[0061] It is assumed that the upper left corner of the captured image is the origin (0, 0), x and y are the pixel coordinates of the pixel point in the captured image; Xc is the longitude of the pixel point in the captured image, Yc is the latitude of the pixel point in the captured image, and Zc is the depth information of the pixel point in the captured image (the distance between the image capture device 20 and each pixel point in the real world); (u 0 , v 0 ) is the coordinate of the main pixel point of the captured image, which is generally the center point of the captured image. For example, for a 640*480 image, the coordinate of the main pixel point is (320, 240); fx and fy are the horizontal focal length and vertical focal length of the image acquisition device 20, respectively. Specifically, fx and fy can be determined by deriving from the following formulas (2)-(5):
[0062] width=2*f*tan(FovX) (2)
[0063] height=2*f*tan(FovY) (3)
[0064] Among them, width and hh are the length and width of the imaging plane inside the image acquisition device 20 respectively, which can be viewed in the picture properties, for example, 640*480 pixels, that is, the picture length is 640 and the width is 480; f is the focal length of the image acquisition device 20, which can be directly obtained from the manufacturer of the production or sale of imaging devices; FovX is the horizontal viewing angle, and FovY is the vertical viewing angle.
[0065] Furthermore, the corresponding relationship between the length and width of the imaging plane inside the image acquisition device 20 and the length and width of the acquired image can be determined by using the following formulas (4) and (5):
[0066] f / fx=width / pixelX→fx=f*pixelX / width (4)
[0067] f / fy=height / pixelY→fy=f*pixelY / height (5)
[0068] Where pixelX and pixelY are the length and width of the captured image, respectively. Then, the horizontal focal length fx and the vertical focal length fy can be derived according to formulas (2)-(5). Further, the focal lengths fx and fy, the coordinates of the main pixel point in the captured image (u 0 , v 0 ), the pixel coordinates (x, y) of the center of mass and boundary corner points corresponding to each image target and the depth information Zc of the center of mass and boundary corner points corresponding to each image target, to determine the first world geographic coordinates (Xc, Yc, Zc) of the center of mass and boundary corner points corresponding to each image target.
[0069] In a possible implementation, the following methods may be used to obtain the depth information Zc of the centroid and boundary corner points corresponding to each image target:
[0070] (1) Directly use a depth camera (e.g., Microsoft Kinect camera) to capture images, thereby obtaining the depth information of each pixel in the captured image.
[0071] (2) Use a binocular camera to capture images and directly obtain the depth information of each pixel in the captured image.
[0072] (3) Parameter learning method: Use the Markov Random Field (MRF) model to model the input training image data set (known depth information) to invert the unknown parameters. Then use the calculated parameters to forward calculate the depth information of the collected image.
[0073] (4) Non-parametric learning method: Based on the input training image dataset (with known depth information), the depth information of the captured image is predicted on the premise that similar images have similar depths.
[0074] (5) Use artificial neural network to estimate the depth of a single image.
[0075] A. Use a complex multi-layer convolutional neural network (CNN) structure to fit the relationship between image and depth information.
[0076] B. Convolutional neural network CNN is combined with conditional random field (CRF), and the CRF model is used to constrain the training of CNN to make its prediction more accurate.
[0077] Step 302: According to the device geographic coordinates of the image acquisition device when acquiring a captured image, a translation operation is performed on the first world geographic coordinates of the plurality of pixel points to determine the second world geographic coordinates of the plurality of pixel points.
[0078] In the embodiment of the present application, the first world geographic coordinates obtained according to the above formulas (1)-(5) are calculated under the premise that the real geographic coordinates of the image acquisition device 20 are (0, 0, 0). Therefore, in order to obtain the center of mass and boundary corner coordinates of each image target in the real world, it is also necessary to translate the first world geographic coordinates of the multiple pixel points according to the device geographic coordinates of the image acquisition device 20 when acquiring a captured image, thereby determining the second world geographic coordinates of the multiple pixel points. Among them, the device geographic coordinates can be directly obtained in the real world according to the positioning device in the image acquisition device 20. For example, when using a mobile phone for image acquisition, the device geographic coordinates of the mobile phone when acquiring the image can be directly obtained according to the gyroscope of the mobile phone.
[0079] Specifically, the second world geographic coordinates (X 0 , Y 0 , Z 0 ) can be determined by using the following formula (6):
[0080] (X 0 , Y 0 , Z 0 ) = (X C +longitude, Y c +latitude, Z c +height) (6)
[0081] Among them, longitude, latitude, and hh are respectively the geographic coordinates of the image acquisition device 20 in the real world.
[0082] Step 303: performing a rotation operation on the second world geographic coordinates of the plurality of pixel points according to the posture information of the image acquisition device when acquiring a captured image, and determining the corrected real geographic coordinates of the plurality of pixel points.
[0083] In the embodiment of the present application, since the transformation from the camera coordinate system to the world coordinate system is a rigid body transformation, that is, the object will not be deformed, and only translation and rotation operations need to be performed. Therefore, after obtaining the second world geographic coordinates through the translation operation, it is also necessary to perform a rotation operation on the second world geographic coordinates of multiple pixel points according to the posture information of the image acquisition device 20 when acquiring a captured image. In other words, the above-mentioned second world geographic coordinates (X 0 , Y 0, Z 0 ) to perform Euler transformation to obtain the corrected real world geographic coordinates (X T , Y T , Z T ). Specifically, the second world geographic coordinates (X 0 , Y 0 , Z 0 ) can be determined by using the following formulas (7)-(10):
[0084]
[0085]
[0086]
[0087]
[0088] Among them, α is the heading angle, β is the roll angle, and γ is the pitch angle.
[0089] Then, according to the corrected real geographic coordinates of the multiple pixels corresponding to each image target, the real position and size of each image target can be determined. Furthermore, the relative position relationship between each image target can be analyzed.
[0090] Step 202: Determine target model samples corresponding to each image target that meets preset similarity conditions from a preset model sample library.
[0091] In the embodiment of the present application, the model sample library includes a number of facility model samples and sample information of the facility model samples. The sample information may include color information, texture information, and shape information.
[0092] In actual application, the color information, texture information and shape information of the image target can be used to find out whether there is a matching target model sample from the preset model sample library. The preset similarity condition can be "the similarity between the color information of the image target and the color information of the facility model sample is greater than the first similarity, the similarity between the texture information of the image target and the texture information of the facility model sample is greater than the second similarity, and the similarity between the shape information of the image target and the shape information of the facility model sample is greater than the third similarity". In this case, for an image target, more than one model sample may be selected, so one model sample can be selected from these selected model samples as the target model sample of the image target. The first similarity, the second similarity and the third similarity here can be set according to user needs.
[0093] Of course, the preset similarity condition may also be only any one or a combination of any two of the above three sub-conditions. For example, the target model sample corresponding to each image target may be determined from the preset model sample library based only on the sub-condition that "the similarity between the texture information of the image target and the texture information of the facility model sample is greater than the second similarity". In addition, the model sample with the highest similarity to the image target may be directly selected as the target model sample of the image target.
[0094] In the embodiment of the present application, the similarity between the image target and the model sample can be calculated in the following ways:
[0095] (1) Cosine similarity calculation: The image is represented as a vector, and the similarity between two images is represented by calculating the cosine distance between the vectors.
[0096] (2) Hash algorithm similarity calculation: The hash algorithm is used to extract image fingerprints, and the image similarity is measured based on the difference between image fingerprints. The smaller the difference, the higher the similarity.
[0097] (3) Histogram similarity calculation: The closer the histogram distribution between images is, the higher the similarity is.
[0098] (4) Structural Similarity (SSIM) calculation: measure image similarity from three aspects: brightness, contrast, and structure.
[0099] In a possible implementation, the color information and texture information corresponding to each image target in the captured image can be determined by performing feature extraction on the captured image, and the shape information corresponding to each image target in the captured image can be determined by performing feature recognition on the captured image. Furthermore, based on the color information, texture information, and shape information corresponding to each image target, the target model samples corresponding to each image target that meets the preset similarity conditions can be determined from the preset model sample library. In the embodiment of the present application,
[0100] Specifically, the color distribution and texture information of the image target can be obtained by analyzing the RGB (Red, Green, Blue) color value of each pixel of the image target and then performing color histogram statistics. In addition, when performing feature extraction, the boundary features of each image target in the acquired image can also be extracted. Specifically, the following methods can be used to perform edge detection on the acquired image to determine the boundary features corresponding to each image target in the acquired image:
[0101] (1) Sobel operator Sobel algorithm: The weighted difference of the grayscale values of the four areas of the top, bottom, left, and right of each pixel in the image reaches an extreme value at the edge to detect the edge. It is a discrete difference operator used to calculate the approximate value of the gradient of the image brightness function. Using this operator at any point in the image will generate the corresponding gradient vector or its normal vector.
[0102] (2) Prewitt algorithm: It is an edge detection algorithm based on a first-order differential operator. It uses the grayscale difference between the upper and lower and left and right neighboring points of a pixel to detect the edge when it reaches the extreme value at the edge, removes some pseudo edges, and has a smoothing effect on noise. Its principle is to use two directional templates in the image space to perform neighborhood convolution with the image. One of the two directional templates detects horizontal edges and the other detects vertical edges.
[0103] (3) Canny algorithm: Use non-maximum suppression to determine whether it is an edge point. Non-maximum suppression is to find the local maximum of the pixel point. If the pixel point is the local maximum, it will be retained;
[0104] Otherwise it is deleted (the value is set to 0).
[0105] In addition, when performing feature recognition, convolutional neural network CNN or computer vision technology can be used to perform artificial intelligence (AI) recognition on the extracted image targets through machine deep learning. For example, the recognized shapes are the shape of a desk, bookshelf, sofa, car, truck, and house.
[0106] Specifically, the following methods can be used to perform feature recognition on image targets:
[0107] (1) Faster Regions with CNN features (Faster RCNN) algorithm: It can use two-stage calculation based on CNN. The first stage aims to find the location where the image target appears, and the second stage classifies and refines the location identified by the first stage. It has high recognition accuracy.
[0108] (2) You Only Look Once (YOLO) series (v1-v4) algorithms: can use first-order calculations based on CNN. It combines the second-order algorithms into one and completes the prediction of the location and shape of the object in one stage. This method is simple and faster.
[0109] In a possible implementation, in order to further improve the efficiency of three-dimensional scene reconstruction, when determining the target model sample, it is also possible to first perform a preliminary screening based on the semantic category of the image target, and then determine the target model sample based on the sample information to reduce the amount of calculation. In an embodiment of the present application, semantic recognition can be performed on each image target in the captured image according to a preset neural network model, thereby determining the semantic category corresponding to each image target. Specifically, the above-mentioned (Faster RCNN algorithm and YOLO) series (v1-v4) algorithms can also be used to perform semantic category recognition on image targets.
[0110] On this basis, when determining the target model samples, for any image target among the various image targets, we can first determine the target model set that matches the semantic category of any image target from the preset model sample library based on the semantic category of any image target. Furthermore, based on the color information, texture information and shape information of any image target, we can determine the target model sample corresponding to any image target that meets the preset similarity condition from the target model set. That is, we can find the target model samples corresponding to each image target from the preset model sample library, thus realizing the individualization of the model.
[0111] Step 203: construct a three-dimensional scene model of the target area according to the real geographic coordinates of the multiple pixel points corresponding to each image target and each target model sample.
[0112] In an embodiment of the present application, after determining the real geographic coordinates of multiple pixel points corresponding to each image target and each target model sample, in order to make the constructed three-dimensional scene model more consistent with the target area, for any image target among the image targets, the rotation angle and size of the target model sample corresponding to any image target can be obtained according to the real geographic coordinates after correction of the boundary corner points corresponding to any image target, and then, according to the rotation angle, size and the real geographic coordinates after correction of the center of mass corresponding to any image target, the target model sample corresponding to any image target is affine transformed, so that the target model sample is rotated according to the rotation angle, scaled according to the size, and translated and placed according to the real position determined by the real geographic coordinates after correction of the center of mass of the image target, so as to construct a three-dimensional monomer model corresponding to any image target, and then, according to the three-dimensional monomer models corresponding to each image target, a three-dimensional scene model of the target area can be constructed.
[0113] Specifically, when reconstructing a three-dimensional scene, since the specific orientation of the target model sample needs to be considered, the rotation angle of the target model sample needs to be calculated. Assume that the north direction is 0° and a clockwise rotation is 360°. Figure 4 As shown, a schematic diagram of obtaining the rotation angle provided by an embodiment of the present application can be used to extract the leftmost boundary intersection point 3 and the rightmost boundary corner point 2 as representative points based on the real geographic coordinates of the boundary corner points, and then calculate the angle between the line connecting the boundary intersection point 3 and the boundary corner point 2 and the true north direction, which is the rotation angle of the target model sample. Then, since the coordinates of the boundary intersection point 3 are (116, 30) and the coordinates of the boundary intersection point 2 are (117, 31), the rotation angle can be calculated to be 225°, and then, during the affine transformation, the target model sample needs to be rotated 225°.
[0114] In one possible implementation, in order to make the constructed three-dimensional scene model more accurate, in an embodiment of the present application, before determining the target model samples corresponding to each image target that meets the preset similarity conditions from the preset model sample library, a preset three-dimensional modeling software can also be used to perform three-dimensional modeling of various outdoor facilities in the real world to obtain three-dimensional model samples corresponding to various outdoor facilities, and then, a model sample library is constructed based on the three-dimensional model samples corresponding to various outdoor facilities.
[0115] In practical applications, we can collect the color, texture and shape information of common outdoor facilities such as buildings, vehicles and roads, and indoor facilities such as tables, chairs, furniture and floors, and use modeling software such as 3DS Max, Maya and Rhino to perform 3D modeling, thereby establishing a model sample library with rich model samples. Furthermore, since the model samples in the model sample library are all fine models, the 3D reconstruction results can be more accurate.
[0116] In a possible implementation, in order to improve the accuracy of the 3D reconstruction result, the captured image may be preprocessed before model matching. Specifically, the preprocessing may include operations such as denoising, filtering, and enhancement to improve the efficiency and accuracy of subsequent target recognition and feature extraction.
[0117] In summary, in the embodiments of the present application, since three-dimensional reconstruction is performed by only one captured image, there is no need to collect a large number of repeated images of the same target at different viewing angles, and thus, there is no need for a large number of feature extraction, feature matching, and point cloud generation steps, which requires lower raw data, saves a huge amount of calculation, and greatly improves the efficiency of three-dimensional reconstruction. In addition, since target model samples matching the image target are directly obtained from a preset model sample library, and a three-dimensional scene model is established based on these target model samples, the efficiency of three-dimensional reconstruction is further improved. Moreover, since the model samples in the model sample library are all fine models, the accuracy of the three-dimensional reconstruction result can be made higher.
[0118] Based on the same inventive concept, the embodiment of the present application provides a 3D reconstruction device 50 based on target recognition and model matching, such as Figure 5 As shown, the device comprises:
[0119] The real geographic coordinate determination unit 501 is used to determine the corrected real geographic coordinates of the plurality of pixel points only based on the pixel coordinates of the plurality of pixel points corresponding to each image target in a captured image; wherein the captured image is an image containing depth information captured for the target area, and the plurality of pixel points include centroids and boundary corner points;
[0120] The target model sample determination unit 502 is used to determine the target model samples corresponding to each image target that meets the preset similarity condition from a preset model sample library; wherein the model sample library includes a plurality of facility model samples and sample information of the plurality of facility model samples;
[0121] The three-dimensional scene model construction unit 503 is used to construct a three-dimensional scene model of the target area according to the corrected real geographic coordinates of the multiple pixel points and each target model sample.
[0122] Optionally, the apparatus 50 further includes a sample information determining unit 504, wherein the sample information determining unit 504 includes:
[0123] Extract features from a captured image to determine the color information and texture information corresponding to each image target in the captured image;
[0124] Perform feature recognition on a captured image to determine the shape information corresponding to each image target in the captured image;
[0125] Then, target model samples corresponding to each image target meeting the preset similarity condition are determined from the preset model sample library, including:
[0126] According to the color information, texture information and shape information, target model samples corresponding to each image target meeting the preset similarity condition are determined from a preset model sample library.
[0127] Optionally, the target model sample determination unit 502 is further configured to:
[0128] For any image target among the image targets, according to the semantic category of any image target, a target model set matching the semantic category of any image target is determined from a preset model sample library;
[0129] According to the color information, texture information and shape information of any image target, a target model sample corresponding to any image target that meets the preset similarity condition is determined from the target model set.
[0130] Optionally, the apparatus further includes a semantic category determination unit 505, wherein the semantic category determination unit 505 includes:
[0131] According to the preset neural network model, semantic recognition is performed on each image target in a captured image to determine the semantic category corresponding to each image target.
[0132] Optionally, the device further includes a model sample library construction unit 506, and the model sample library construction unit 506 includes:
[0133] Using preset 3D modeling software, various outdoor facilities in the real world are 3D modeled to obtain 3D model samples corresponding to various outdoor facilities;
[0134] A model sample library is constructed based on various outdoor facilities and their corresponding three-dimensional model samples.
[0135] Optionally, the real geographic coordinate determining unit 501 is further used for:
[0136] Determine the first world geographic coordinates of the plurality of pixels according to the depth information of the plurality of pixels, the pixel coordinates of the plurality of pixels, the focal length of the image acquisition device when acquiring a captured image, and the length and width of the captured image;
[0137] According to the device geographic coordinates of the image acquisition device when acquiring a captured image, a translation operation is performed on the first world geographic coordinates of the plurality of pixel points to determine the second world geographic coordinates of the plurality of pixel points;
[0138] According to the posture information of the image acquisition device when acquiring a captured image, the second world geographic coordinates of multiple pixel points are rotated to determine the corrected real geographic coordinates of the multiple pixel points.
[0139] Optionally, the 3D scene model building unit 503 is further used for:
[0140] For any image target among the image targets, according to the corrected real geographic coordinates of each boundary corner point corresponding to the image target, the rotation angle and size of the target model sample corresponding to the image target are obtained;
[0141] According to the rotation angle, size and the real geographic coordinates corrected by the center of mass of any image target, an affine transformation is performed on the target model sample corresponding to any image target to construct a three-dimensional monomer model corresponding to any image target;
[0142] According to the three-dimensional monomer models corresponding to each image target, a three-dimensional scene model of the target area is constructed.
[0143] The device can be used to perform Figure 2 to Figure 4 The method executed by the video processing device in the embodiment shown in the figure is as follows. Therefore, for the functions that can be realized by each functional module of the device, reference can be made to Figure 2 to Figure 4 The description of the illustrated embodiment is not repeated in detail.
[0144] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2 to Figure 4 The method executed by the video processing device in the illustrated embodiment.
[0145] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiment are executed; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks. Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0146] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0147] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A 3D reconstruction method based on target recognition and model matching, It is characterized in that The method comprises: Determine the corrected real geographic coordinates of the multiple pixel points only based on the pixel coordinates of the multiple pixel points corresponding to each image target in a captured image; wherein the captured image is an image containing depth information captured for the target area, and the multiple pixel points include centroids and boundary corners; Determine the target model samples corresponding to the respective image targets that meet the preset similarity conditions from a preset model sample library; wherein the model sample library includes a plurality of facility model samples and sample information of the plurality of facility model samples; A three-dimensional scene model of the target area is constructed based on the real geographic coordinates of the multiple pixel points after correction and each target model sample; wherein, the three-dimensional scene model of the target area is constructed based on the real geographic coordinates of the multiple pixel points after correction and each target model sample, including: for any image target among the various image targets, according to the real geographic coordinates of the boundary corner points corresponding to the any image target after correction, the rotation angle and size of the target model sample corresponding to the any image target are obtained; according to the rotation angle, the size and the real geographic coordinates of the center of mass corrected corresponding to the any image target, an affine transformation is performed on the target model sample corresponding to the any image target to construct a three-dimensional monomer model corresponding to the any image target; according to the three-dimensional monomer models corresponding to each of the image targets, a three-dimensional scene model of the target area is constructed.
2. The method according to claim 1, It is characterized in that Before respectively determining the target model samples corresponding to the respective image targets meeting the preset similarity condition from the preset model sample library, the method further includes: Performing feature extraction on the one acquired image to determine color information and texture information corresponding to each image target in the one acquired image; Performing feature recognition on the one collected image to determine shape information corresponding to each image target in the one collected image; Then, determining the target model samples corresponding to the respective image targets that meet the preset similarity conditions from the preset model sample library includes: According to the color information, the texture information and the shape information, target model samples corresponding to the respective image targets meeting preset similarity conditions are respectively determined from a preset model sample library.
3. The method according to claim 2, It is characterized in that The step of determining target model samples corresponding to each of the image targets that meets a preset similarity condition from a preset model sample library according to the color information, the texture information, and the shape information includes: For any image target among the image targets, according to the semantic category of the image target, a target model set matching the semantic category of the image target is determined from the preset model sample library; According to the color information, texture information and shape information of any image target, a target model sample corresponding to any image target that meets a preset similarity condition is determined from the target model set.
4. The method according to claim 3, It is characterized in that Before respectively determining target model samples of each image target that meets a preset similarity condition from a preset model sample library, the method further includes: According to a preset neural network model, semantic recognition is performed on each image target in the captured image to determine the semantic category corresponding to each image target.
5. The method according to claim 1, It is characterized in that Before respectively determining the target model samples corresponding to the respective image targets meeting the preset similarity condition from the preset model sample library, the method further includes: Using a preset 3D modeling software, 3D modeling is performed on various outdoor facilities and various outdoor facilities in the real world to obtain 3D model samples corresponding to the various outdoor facilities and the various outdoor facilities; The model sample library is constructed according to the various outdoor facilities and the three-dimensional model samples corresponding to the various outdoor facilities.
6. The method according to claim 1, It is characterized in that The method of determining the corrected real geographic coordinates of the plurality of pixel points based only on the pixel coordinates of the plurality of pixel points corresponding to the respective image targets in one collected image comprises: Determine the first world geographic coordinates of the plurality of pixel points according to the depth information of the plurality of pixel points, the pixel coordinates of the plurality of pixel points, the focal length of the image acquisition device when acquiring the one acquired image, and the length and width of the one acquired image; According to the device geographic coordinates of the image acquisition device when acquiring the one acquired image, a translation operation is performed on the first world geographic coordinates of the plurality of pixel points to determine the second world geographic coordinates of the plurality of pixel points; According to the posture information of the image acquisition device when acquiring the one acquired image, a rotation operation is performed on the second world geographic coordinates of the multiple pixel points to determine the corrected real geographic coordinates of the multiple pixel points.
7. A 3D reconstruction device based on target recognition and model matching, It is characterized in that The device comprises: A real geographic coordinate determination unit, configured to determine the corrected real geographic coordinates of a plurality of pixel points based only on the pixel coordinates of the plurality of pixel points corresponding to each image target in a captured image; wherein the captured image is an image containing depth information captured for a target area, and the plurality of pixel points include centroids and boundary corner points; A target model sample determination unit, used to determine target model samples corresponding to each of the image targets that meet a preset similarity condition from a preset model sample library; wherein the model sample library includes a plurality of facility model samples and sample information of the plurality of facility model samples; A three-dimensional scene model construction unit is used to construct a three-dimensional scene model of the target area based on the real geographic coordinates of the multiple pixel points after correction and each target model sample; wherein, the construction of the three-dimensional scene model of the target area based on the real geographic coordinates of the multiple pixel points after correction and each target model sample includes: for any image target among the various image targets, according to the real geographic coordinates of the boundary corner points corresponding to the any image target after correction, obtaining the rotation angle and size of the target model sample corresponding to the any image target; according to the rotation angle, the size and the real geographic coordinates of the center of mass corrected corresponding to the any image target, performing affine transformation on the target model sample corresponding to the any image target to construct a three-dimensional monomer model corresponding to the any image target; and constructing the three-dimensional scene model of the target area based on the three-dimensional monomer models corresponding to each of the image targets.
8. An electronic device, It is characterized in that The device comprises: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods described in claims 1-6 according to the obtained program instructions.
9. A storage medium, It is characterized in that The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the steps included in any one of the methods of claims 1-6.
