Scene reconstruction method based on optical communication device and corresponding electronic device
Through a method based on optical communication devices, camera pose information and internal parameter information are used to filter matching feature points, which solves the problem of feature point extraction and matching errors in 3D scene reconstruction in the existing technology, and achieves more accurate 3D scene model reconstruction. structure.
Patent Information
- Application Number
- CN201910237503.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-27
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-03-27
AI Technical Summary
Existing 3D scene reconstruction methods are prone to feature point extraction and matching errors when the shooting angles or displacements of two 2D images are greatly different, resulting in large deviations between the reconstructed 3D scene model and the real scene.
Through a method based on optical communication devices, images taken at different locations are obtained and the pose information of the camera is calculated. Matching feature point pairs are screened to improve matching accuracy. Relative pose information and internal parameter information are used to match and filter feature points to reduce errors. match.
It improves the accuracy of 3D scene reconstruction, avoids errors in feature point extraction and matching, and achieves more accurate 3D model reconstruction.
Smart Images

Figure CN111754449B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information technology, and in particular relates to a scene reconstruction method based on an optical communication device and corresponding electronic equipment. Background Art
[0002] The statements in this section are merely intended to provide background information related to the present invention to help understanding the present invention. Such background information does not necessarily constitute prior art.
[0003] Three-dimensional scene reconstruction refers to the establishment of a mathematical model suitable for computer representation and processing of three-dimensional objects. It is the basis for processing, operating and analyzing its properties in a computer environment, and is also a key technology for establishing virtual reality in computers to express the objective world.
[0004] A three-dimensional scene reconstruction method in computer vision reconstructs the three-dimensional information of the scene based on multiple two-dimensional images of the same scene (similar to human binocular positioning), and the multiple two-dimensional images are images taken at at least two different positions. In this scene reconstruction method, it is usually necessary to perform feature point extraction, feature point matching, three-dimensional reconstruction and other steps on two two-dimensional images to reconstruct the three-dimensional model of the scene. However, in many cases, there are errors in the feature point extraction and feature point matching operations on the two two-dimensional images (especially when the angles or displacements of the two images are greatly different), which will result in obtaining incorrect matching feature point pairs, and ultimately cause the reconstructed three-dimensional scene model to deviate greatly from the real scene.
[0005] Therefore, an improved scene reconstruction method is needed. Summary of the invention
[0006] One aspect of the present invention relates to a scene reconstruction method based on an optical communication device, comprising: (a) obtaining a first image and a second image including the same optical communication device taken at different positions; (b) obtaining first pose information of the camera when taking the first image and second pose information of the camera when taking the second image; (c) obtaining relative pose information between the camera taking the first image and the camera taking the second image based on the first pose information and the second pose information; (d) performing feature point extraction and feature point matching on the first image and the second image to obtain a set of matching feature point pairs; and (e) screening the matching feature point pairs based on the relative pose information for scene reconstruction.
[0007] Optionally, step (a) includes: receiving the first image or the second image from a device for identifying an optical communication apparatus.
[0008] Optionally, the first posture information and the second posture information are posture information of the camera in a world coordinate system established according to the optical communication device.
[0009] Optionally, step (b) includes: determining the posture information of the camera in the world coordinate system when taking the image based on the coordinates of some points on the optical communication device in the world coordinate system and the imaging positions of these points in the image, and combining the intrinsic parameter information of the camera.
[0010] Optionally, the coordinates of some points on the optical communication device in the world coordinate system are determined according to physical size information and / or physical shape information of the optical communication device.
[0011] Optionally, the filtering of the matching feature point pairs according to the relative pose information includes: (f) selecting some matching feature point pairs from a set of matching feature point pairs; (g) using the selected matching feature point pairs and combining the internal reference information of the camera that took the first image and the camera that took the second image to obtain the relative pose information between the camera that took the first image and the camera that took the second image; (h) comparing the relative pose information obtained in step (g) with the relative pose information obtained in step (c); and (i) evaluating the selected matching feature point pairs based on the results of the comparison.
[0012] Optionally, step (h) includes: comparing the degree of closeness between the relative posture information obtained in step (g) and the relative posture information obtained in step (c).
[0013] Optionally, the screening of the matching feature point pairs according to the relative pose information includes: selecting a pair of matching feature points from a set of matching feature point pairs; and judging the consistency of the pair of matching feature points with the relative pose information obtained in step (c) based on epipolar geometry constraints.
[0014] Optionally, the scene reconstruction method further includes: obtaining internal parameter information of a camera that shoots the first image and internal parameter information of a camera that shoots the second image.
[0015] Optionally, the shooting time of the first image and the shooting time of the second image meet a predetermined standard.
[0016] Another aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, which can be used for the above method when the computer program is executed by a processor.
[0017] Yet another aspect of the present invention relates to an electronic device, comprising a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the computer program can be used to implement the above method.
[0018] The present invention provides an improved scene reconstruction scheme, which can avoid errors in feature point extraction or feature point matching operations on two two-dimensional images (especially when the two images are shot at a large angle or displacement difference), thereby avoiding obtaining erroneous matching feature point pairs, and thus facilitating a more accurate three-dimensional scene model reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0020] Figure 1 An exemplary light tag is shown;
[0021] Figure 2 An exemplary optical tag network is shown;
[0022] Figure 3 A scene reconstruction method based on light tags according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail by specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0024] Optical communication devices are also called optical tags, and these two terms can be used interchangeably in this article. Optical tags can transmit information by emitting different lights. They have the advantages of long recognition distance, loose visible light conditions, and strong directionality. The information transmitted by the optical tags can change over time, thereby providing large information capacity and flexible configuration capabilities. Compared with traditional QR codes, optical tags have a longer recognition distance and stronger information interaction capabilities, which can provide great convenience for users. Some types of optical tags are described in PCT patent application PCT / CN2017 / 099642, Chinese patent application CN201711374915.9, Chinese patent application CN201811119052.5, etc. The entire contents of the above patent applications are incorporated herein by reference. However, it can be understood that the optical tags in the above patent applications are only used as examples, and the scheme of the present invention is not limited to the optical tags described in these patent applications.
[0025] An optical tag generally includes a controller and at least one light source. The controller can drive the light source through different driving modes to transmit different information to the outside. Figure 1 An exemplary optical tag 100 is shown, which includes three light sources (a first light source 101, a second light source 102, and a third light source 103). The optical tag 100 also includes a controller (in Figure 1 The controller may be used to select a corresponding driving mode for each light source according to the information to be transmitted. For example, in different driving modes, the controller may use different driving signals to control the light emission mode of the light source, so that when the light tag 100 is photographed using a device with an imaging function, the image of the light source therein may present a different appearance (e.g., different colors, patterns, brightness, etc.). By analyzing the imaging of the light sources in the light tag 100, the driving mode of each light source at the moment can be parsed, thereby parsing the information transmitted by the light tag 100 at the moment.
[0026] In order to provide users with corresponding services based on light tags, each light tag can be assigned an identification information (ID), which is used to uniquely identify or identify the light tag by the manufacturer, manager or user of the light tag. Generally, the controller in the light tag can drive the light source to transmit the identification information to the outside, and the user can use the device to capture images of the light tag to obtain the identification information transmitted by the light tag, so that the corresponding service can be accessed based on the identification information, for example, accessing the web page associated with the identification information of the light tag, obtaining other information associated with the identification information (for example, the location information of the light tag corresponding to the identification information), etc. The device mentioned in this article can be, for example, a mobile device carried by the user (for example, a mobile phone with a camera, a tablet computer, smart glasses, a smart helmet, a smart watch, etc.), or a machine that can move autonomously (for example, a drone, an unmanned car, a robot, etc.). The device can continuously capture images of the light tag through the camera on it to obtain multiple images containing the light tag, and analyze the imaging of the light tag (or each light source in the light tag) in each image through the built-in application to identify the information transmitted by the light tag.
[0027] The information related to each optical tag can be stored in the server. In reality, a large number of optical tags can also be constructed into an optical tag network. Figure 2An exemplary optical tag network is shown, which includes multiple optical tags and at least one server. The identification information (ID) of each optical tag or any other information, such as service information related to the optical tag, description information or attributes related to the optical tag, such as the location information, physical size information, physical shape information, orientation information, etc. of the optical tag can be saved on the server. The optical tag can also have uniform or default physical size information and physical shape information, etc. The device can use the identification information of the identified optical tag to query and obtain other information related to the optical tag from the server. The location information of the optical tag can refer to the actual location of the optical tag in the physical world, which can be indicated by geographic coordinate information. The server can be a software program running on a computing device, a computing device, or a cluster composed of multiple computing devices. The optical tag can be offline, that is, the optical tag does not need to communicate with the server. Of course, it can be understood that online optical tags that can communicate with the server are also feasible.
[0028] Light tags can be arranged or installed in real-world scenes. For example, light tags can be arranged on the walls of buildings, on the facades of shops, in squares, etc. When a device recognizes a light tag, it can capture an image containing the light tag and upload the image and the identification information of the light tag to a server. Since different devices usually recognize light tags and capture images containing light tags at different locations, multiple images containing the same light tag captured at different locations can be obtained at the server, and these images can be used to achieve three-dimensional scene reconstruction of the scene around the light tag.
[0029] Figure 3 A scene reconstruction method based on light tags according to an embodiment of the present invention is shown, which can be executed at a device that captures an image, or at another entity (e.g., a server) that can directly or indirectly obtain information such as images from the device. The method includes the following steps:
[0030] Step 301: Obtain a first image and a second image taken at different positions and containing the same light tag.
[0031] Different methods can be used to obtain two images containing the same light tag taken at different positions. In one embodiment, the device can obtain multiple images containing the light tag by using its camera to shoot at different positions to achieve scene reconstruction through these images. The camera of the device can have corresponding internal reference information and can be obtained by the device. In one embodiment, the device can use its camera to shoot an image containing the light tag when identifying the identification information of the light tag (for example, before, after or during the identification information of the light tag is identified), and upload the identification information of the light tag and the image to the server. The server can store the image in association with the identification information so that the light tag in each image can be determined. When uploading the image, the device can also upload the internal reference information of its camera; or, the device can upload its camera model information, and the server can obtain its internal reference information based on the camera model information. After multiple images containing the same light tag are stored in the server, two images taken at different positions can be selected as the first image and the second image. The first image and the second image are not necessarily taken by the same device.
[0032] Step 302: Obtain the position and posture information (R1, t1) of the camera when taking the first image and the position and posture information (R2, t2) of the camera when taking the second image.
[0033] A coordinate system can be established based on the light tag, which can be called a world coordinate system or a light tag coordinate system. Some points on the light tag can be determined as some spatial points in the world coordinate system, and the coordinates of these spatial points in the world coordinate system can be determined based on the physical size information and / or physical shape information of the light tag. Some points on the light tag can be, for example, the corners of the outer shell of the light tag, the ends of the light source in the light tag, some identification points in the light tag, and so on. According to the object structure features or geometric structure features of the light tag, image points corresponding to these spatial points can be found in the image, and the positions of each image point in the image can be determined. According to the coordinates of each spatial point in the world coordinate system and the corresponding positions of each image point in the image, combined with the intrinsic parameter information of the camera, the pose information (R, t) of the camera in the world coordinate system when shooting the image can be calculated, where R is a rotation matrix, which represents the pose information (also called orientation information) of the camera in the world coordinate system, and t is a displacement vector, which represents the position information of the camera in the world coordinate system. The method of calculating R and t is known in the prior art. For example, the 3D-2D PnP (Perspective-n-Point) method can be used to calculate R and t. In order not to confuse the present invention, it will not be described in detail here. The rotation matrix R and the displacement vector t can actually describe how to convert the coordinates of a certain point between the world coordinate system and the camera coordinate system. For example, through the rotation matrix R and the displacement vector t, the coordinates of a certain spatial point in the world coordinate system can be converted to the coordinates in the camera coordinate system, and can be further converted to the position of the image point in the image.
[0034] For the first image of the two images, the position information (R1, t1) of the camera in the world coordinate system when the first image was taken can be obtained, and for the second image of the two images, the position information (R2, t2) of the camera in the world coordinate system when the second image was taken can be obtained.
[0035] Step 303: According to the position information of the cameras of the two images, obtain the relative position information (R 12 , t 12 ).
[0036] Since the pose information (R1, t1) of the camera in the world coordinate system when the first image is taken and the pose information (R2, t2) of the camera in the world coordinate system when the second image is taken have been obtained in step 302, the relative pose information (R1, t1) between the two cameras can be obtained based on (R1, t1) and (R2, t2). 12 , t 12 ), where R 12 is the rotation matrix, t 12 is the displacement vector, the relative posture information (R12 , t 12 ) is used to represent the attitude and position information of one camera relative to another camera. The rotation matrix R 12 and displacement vector t 12 Actually describes how to transform points from one camera coordinate system to another, for example, by the rotation matrix R 12 and displacement vector t 12 , you can transform the coordinates of a point in one camera coordinate system into the coordinates of another camera coordinate system.
[0037] Step 304: extracting and matching feature points for the first image and the second image to obtain a set of matching feature point pairs.
[0038] For feature point extraction, various feature point extraction methods may be used, for example, Harris corner detection, multi-scale feature detector (SIFT) based on LoG or DoG, fast feature point detection method, and the like.
[0039] After extracting feature points from the first image and the second image, you can try to find the matching feature points between the two images. Matching feature points refer to the image points of a spatial point in different images. The depth information of the image points can be calculated using the matching feature points. For feature point matching, various feature point matching methods can be used to achieve it. For example, the distance metric can be first specified in the matching method, including Euclidean distance, Mahalanobis distance, normalized cross-correlation, Hamming distance, etc. The matching strategy used can be nearest neighbor search, nearest neighbor distance search, fast nearest neighbor search, and so on.
[0040] After feature point extraction and feature point matching are performed, a set of matching feature point pairs can be obtained, each matching feature point pair includes two points, which are respectively located in the first image and the second image.
[0041] Step 305: Based on the relative posture information (R 12 , t 12 ), filter matching feature point pairs for scene reconstruction.
[0042] There are various ways to calculate the relative pose information (R 12 , t 12 )Filter matching feature point pairs.
[0043] In one embodiment, when screening the matching feature point pairs, several pairs of matching feature points (for example, at least 5 pairs of matching feature points) may be selected from the set of matching feature point pairs each time, and the selected matching feature point pairs may be combined with the intrinsic parameter information of the two cameras to calculate the relative pose information (R ) between the two cameras when taking the two images. 12',t 12 '). Various methods in the art can be used to calculate (R 12 ',t 12 '), for example, in a common existing method, the essential matrix is solved by 2D-2D epipolar geometry, and then (R, t) is obtained by decomposing the essential matrix. After obtaining the relative pose information (R 12 ',t 12 '), it can be compared with the relative posture information (R 12 , t 12 ) are compared. If the degree of proximity between the two meets the standard, the currently selected pairs of matching feature points can be put into the set S, otherwise, they are not put into the set S. Afterwards, several pairs of matching feature points can be selected from the set of matching feature point pairs again, and the above process is repeated. The several pairs of matching feature points selected again can be completely different or partially different from the several pairs of matching feature points selected previously. The above process can be stopped after all the matching feature point pairs have been traversed, or the above process can be stopped when other preset conditions are met. The matching feature point pairs in the set S finally obtained are the screened matching feature point pairs.
[0044] In another embodiment, when screening the matching feature point pairs, several pairs of matching feature points (for example, at least 5 pairs of matching feature points) may be selected from the set of matching feature point pairs each time, and the selected matching feature point pairs may be combined with the intrinsic parameter information of the two cameras to calculate the relative pose information (R ) between the two cameras when taking the two images. 12 ',t 12 '). After obtaining the relative pose information (R 12 ',t 12 '), it can be compared with the relative posture information (R 12 , t 12 ) to compare and determine the degree of proximity between the two. According to the degree of proximity, a weight can be assigned to each of the currently selected matching feature point pairs. The higher the degree of proximity, the higher the weight that can be assigned. Afterwards, several pairs of matching feature points can be selected from the set of matching feature point pairs again, and the above process can be repeated. The several pairs of matching feature points selected again can be completely different or partially different from the several pairs of matching feature points selected previously. The above process can be stopped after all matching feature point pairs have been traversed, or it can be stopped when other preset conditions are met. Finally, the assigned weight or its average value of each matching feature point pair can be evaluated, and some matching feature point pairs with higher weights or their average values can be selected as the screened matching feature point pairs.
[0045] In yet another embodiment, for each pair of matching feature points, the pair of points and (R 12 , t 12 ). For example, for a pair of matching feature points a1 and a2 (where a1 is on the first image and a2 is on the second image), we can use (R 12 , t 12 ) Based on the epipolar geometry constraint, a1 on the first image is transformed into a straight line l2 on the second image, and the distance between a2 on the second image and l2 is calculated. If the distance between the two is smaller (ideally, a2 should be on l2), it means that the pair of matching feature points a1 and a2 is closer to (R 12 , t 12 ) is more consistent. Some matching feature point pairs with good consistency can be selected as the selected matching feature point pairs. This method based on epipolar geometry constraints is compared with the above-mentioned method of obtaining (R 12 ',t 12 ') method has a slightly lower accuracy, but is faster and more efficient.
[0046] The selected matching feature point pairs can be used for scene reconstruction based on the first image and the second image, which can be achieved by various methods in the art. The method of the embodiment of the present invention uses relative pose information (R 12 , t 12 ) is used to screen the matching feature point pairs, which can filter out the feature point pairs that may be mismatched, thus helping to achieve more accurate scene reconstruction.
[0047] In one embodiment of the present invention, in order to achieve a better scene reconstruction effect or to obtain three-dimensional scene information that changes with time, after obtaining a first image and a second image ( Figure 3In step 301 in the above method, the shooting time information of each image can be further considered so that the shooting time of the first image and the second image meets the predetermined standard. For example, the first image and the second image can be shot at approximately the same time on the same day; the first image and the second image can be shot at approximately the same time on different days; the first image and the second image can be shot at approximately the same time on different days in the same season; and so on. The shooting time information of the image can be obtained from the device that shoots the image, or the time when the image is received from the device can be determined as the approximate shooting time of the image. Selecting the first image and the second image in this way can make it possible to have approximately the same scene when shooting the first image and the second image, thereby helping to achieve a better scene reconstruction effect. In addition, by considering the shooting time information of each image, different scenes corresponding to different times can be reconstructed for the same scene in the real world, such as daytime scenes, night scenes, scenes in various seasons, scenes in each year, and so on, so that three-dimensional scene information that changes with time can be obtained.
[0048] The device mentioned in this article can be a device carried by a user (for example, a mobile phone, a tablet computer, smart glasses, a smart helmet, a smart watch, etc.), but it can be understood that the device can also be a machine that can move autonomously, such as a drone, a driverless car, a robot, etc., which is equipped with an image acquisition device, such as a camera.
[0049] In one embodiment of the present invention, the present invention may be implemented in the form of a computer program. The computer program may be stored in various storage media (e.g., a hard disk, an optical disk, a flash memory, etc.), and when the computer program is executed by a processor, it can be used to implement the method of the present invention.
[0050] In another embodiment of the present invention, the present invention may be implemented in the form of an electronic device. The electronic device includes a processor and a memory, in which a computer program is stored. When the computer program is executed by the processor, the method of the present invention can be implemented.
[0051] References to "various embodiments", "some embodiments", "one embodiment", or "an embodiment" herein refer to specific features, structures, or properties described in conjunction with the embodiments being included in at least one embodiment. Therefore, the phrases "in various embodiments", "in some embodiments", "in one embodiment", or "in an embodiment" throughout the present invention do not necessarily refer to the same embodiment. In addition, specific features, structures, or properties may be combined in any suitable manner in one or more embodiments. Therefore, specific features, structures, or properties shown or described in conjunction with one embodiment may be combined in whole or in part with features, structures, or properties of one or more other embodiments without restriction, as long as the combination is not illogical or inoperable. Expressions similar to "according to A" or "based on A" appearing herein are intended to be non-exclusive, that is, "according to A" may cover "according to A only" or "according to A and B", unless otherwise stated or it is clear from the context that its meaning is "according to A only". The various steps described in a certain order in the method flow do not have to be performed in that order. On the contrary, the execution order of some of the steps may be changed, and some steps may be performed concurrently, as long as the implementation of the scheme is not affected. In addition, the various elements in the drawings of the present application are only for illustrative purposes and are not drawn to scale.
[0052] Having thus described several aspects of at least one embodiment of the present invention, it will be appreciated that various changes, modifications and improvements will readily occur to those skilled in the art. Such changes, modifications and improvements are intended to be within the spirit and scope of the present invention. Although the present invention has been described by preferred embodiments, the present invention is not limited to the embodiments described herein, and also includes various changes and variations made without departing from the scope of the present invention.
Claims
1. A scene reconstruction method based on an optical communication device, comprising: (a) obtaining a first image and a second image captured at different positions and including the same optical communication device; (b) obtaining first pose information of the camera when taking the first image and second pose information of the camera when taking the second image; (c) obtaining relative posture information between a camera that shoots the first image and a camera that shoots the second image according to the first posture information and the second posture information; (d) extracting and matching feature points on the first image and the second image to obtain a set of matching feature point pairs; as well as (f) selecting some matching feature point pairs from the set of matching feature point pairs; (g) using the selected matching feature point pairs and combining the intrinsic parameter information of the camera that takes the first image and the camera that takes the second image to obtain second relative pose information between the camera that takes the first image and the camera that takes the second image; (h) comparing the relative posture information obtained in step (g) with the relative posture information obtained in step (c); (i) evaluating the selected matching feature point pairs according to the degree of proximity, and using the selected matching feature point pairs that meet the criteria as screened matching feature point pairs for scene reconstruction.
2. The scene reconstruction method according to claim 1, wherein: Step (a) comprises: The first image or the second image is received from an apparatus for identifying an optical communication device.
3. The scene reconstruction method according to claim 1, wherein: The first posture information and the second posture information are posture information of the camera in a world coordinate system established according to the optical communication device.
4. The scene reconstruction method according to claim 3, wherein: Step (b) comprises: According to the coordinates of some points on the optical communication device in the world coordinate system and the imaging positions of these points in the image, and in combination with the intrinsic reference information of the camera, the position information of the camera in the world coordinate system when shooting the image is determined.
5. The scene reconstruction method according to claim 4, wherein: The coordinates of some points on the optical communication device in the world coordinate system are determined according to the physical size information and / or the physical shape information of the optical communication device.
6. The scene reconstruction method according to claim 1, wherein: Also includes: Select a pair of matching feature points from the set of matching feature point pairs; as well as Based on the epipolar geometry constraint, the consistency of the pair of matching feature points with the relative pose information obtained in step (c) is determined.
7. The scene reconstruction method according to claim 1, further comprising: The internal reference information of the camera that shoots the first image and the internal reference information of the camera that shoots the second image are obtained.
8. The scene reconstruction method according to claim 1, wherein: The shooting time of the first image and the shooting time of the second image meet a predetermined standard.
9. A computer-readable storage medium having a computer program stored thereon, which can be used to implement the method according to any one of claims 1 to 8 when the computer program is executed by a processor.
10. An electronic device comprising a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it can be used to implement the method according to any one of claims 1 to 8.
