Map reconstruction method and device, computer readable medium and electronic device
Through the method of panoramic image segmentation and feature point screening, the distortion problem of panoramic images in three-dimensional reconstruction is solved, the positioning accuracy and the comprehensiveness of the three-dimensional point cloud map are improved, and a wider scope of application and a higher success rate are achieved. .
Patent Information
- Application Number
- CN202110373156.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-07
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-04-07
AI Technical Summary
In the prior art, panoramic images have large distortion during three-dimensional reconstruction, resulting in poor positioning accuracy, and the matching effect between ordinary images and panoramic images is poor, resulting in poor three-dimensional reconstruction results.
By segmenting the panoramic image, multiple target images are obtained, and their feature point pairs are matched, the target feature point pairs are screened out, and a three-dimensional point cloud map is reconstructed based on the relative pose relationship.
It improves the success rate and positioning accuracy of 3D reconstruction, avoids inefficiency problems caused by panoramic image distortion, enhances the comprehensiveness of the 3D point cloud map, reduces blind spots, and improves the positioning success rate.
Smart Images

Figure CN112927362B
Abstract
Description
Background Art
[0002] As people's living standards continue to improve, augmented reality (AR) technology has attracted more and more attention. AR map navigation refers to the technology of building a virtual three-dimensional map based on the collected scene images and realizing visual positioning based on the built three-dimensional map.
[0003] In the related art, when three-dimensional reconstruction is performed through panoramic images, since the panoramic image is a spherical imaging model, the image distortion is too large, resulting in poor three-dimensional reconstruction effect. At the same time, the stability of most three-dimensional reconstruction systems for panoramic images is far less than that for ordinary images. Secondly, the terminal devices used for user positioning are usually mobile phones, and AR glasses and other terminal devices are equipped with pinhole cameras or fisheye cameras, which leads to poor matching effect between ordinary images and panoramic images and poor positioning accuracy. Summary of the invention
[0004] The purpose of the present disclosure is to provide a map reconstruction method, a map reconstruction device, a computer-readable medium and an electronic device, thereby avoiding the problem of poor positioning accuracy of three-dimensional maps constructed by panoramic images in the related art at least to a certain extent.
[0005] According to a first aspect of the present disclosure, a map reconstruction method is provided, comprising:
[0006] Get a panoramic image of the current scene;
[0007] Performing image segmentation on the panoramic image to obtain a plurality of target images; wherein there is a relative position relationship between the plurality of target images;
[0008] Matching feature point pairs between the multiple target images, and selecting target feature point pairs from the feature point pairs;
[0009] Reconstruct the three-dimensional point cloud map of the current scene based on the target feature point pair and the relative position relationship
[0010] According to a second aspect of the present disclosure, a map reconstruction device is provided, comprising:
[0011] A panoramic image acquisition module is used to acquire a panoramic image of the current scene;
[0012] A panoramic image segmentation module, used to perform image segmentation on the panoramic image to obtain a plurality of target images; wherein there is a relative position relationship between the plurality of target images;
[0013] A feature point pair screening module, used for matching the feature point pairs between the plurality of target images, and screening the target feature point pairs from the feature point pairs;
[0014] A map reconstruction module is used to reconstruct a three-dimensional point cloud map of the current scene based on the target feature point pairs and the relative position and posture relationship.
[0015] According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.
[0016] According to a fourth aspect of the present disclosure, there is provided an electronic device, characterized in that it includes:
[0017] Processor; and
[0018] The memory is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the above method.
[0019] A map reconstruction method provided by an embodiment of the present disclosure obtains a panoramic image corresponding to the current scene, then performs image segmentation on the panoramic image to obtain multiple target images with relative posture relationships, determines feature point pairs corresponding to the multiple target images, and selects target feature point pairs from the feature point pairs; and reconstructs a three-dimensional point cloud map corresponding to the current scene according to the target feature point pairs and the relative posture relationship. On the one hand, by cutting the panoramic image and performing three-dimensional reconstruction on multiple target images with relative posture relationships obtained by cutting, the problem of low reconstruction success rate and poor three-dimensional reconstruction effect caused by large distortion of the panoramic image can be avoided; on the other hand, by performing three-dimensional reconstruction on multiple target images with relative posture relationships obtained by cutting the panoramic image, the three-dimensional point cloud map obtained by three-dimensional reconstruction has a wider application range, and effectively improves the positioning accuracy of positioning images collected by different terminal devices in the three-dimensional point cloud map; on the other hand, by constructing a three-dimensional map through a panoramic image, the comprehensiveness of the constructed three-dimensional point cloud map can be effectively improved, and the problem of blind spots in the three-dimensional point cloud map constructed by ordinary images can be avoided, and the success rate of positioning can be effectively improved.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0022] Figure 1A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
[0023] Figure 2 A schematic diagram showing an electronic device to which the embodiments of the present disclosure can be applied;
[0024] Figure 3 A flowchart schematically illustrates a map reconstruction method in an exemplary embodiment of the present disclosure;
[0025] Figure 4 Schematically showing a flow chart of segmenting a panoramic image in an exemplary embodiment of the present disclosure;
[0026] Figure 5 A flowchart of generating a target image based on a pixel mapping relationship in an exemplary embodiment of the present disclosure is schematically shown;
[0027] Figure 6 A schematic diagram schematically illustrates a principle diagram of a cutting model based on a regular hexahedron in an exemplary embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram schematically illustrates a principle of segmenting a panoramic image to generate a target image in an exemplary embodiment of the present disclosure;
[0029] Figure 8 A flowchart for determining a pair of feature points corresponding to a target image in an exemplary embodiment of the present disclosure is schematically shown;
[0030] Fig. 9 A flowchart of reconstructing a target image to generate a three-dimensional point cloud map in an exemplary embodiment of the present disclosure is schematically shown;
[0031] Fig.10 The figure schematically shows the composition of a map reconstruction device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0033] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0034] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which a map reconstruction method and apparatus according to an embodiment of the present disclosure can be applied is shown.
[0035] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with image processing functions, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0036] The map reconstruction method provided in the embodiment of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and accordingly, the map reconstruction device is generally set in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the map reconstruction method provided in the embodiment of the present disclosure can also be executed by the server 105, and accordingly, the map reconstruction device can also be set in the server 105, which is not particularly limited in the present exemplary embodiment. For example, in an exemplary embodiment, the user can collect a panoramic image corresponding to the current scene through the terminal devices 101, 102, and 103, and then upload the panoramic image to the server 105. After the server generates a three-dimensional point cloud map through the map reconstruction method provided in the embodiment of the present disclosure, the three-dimensional point cloud map is transmitted to the terminal devices 101, 102, 103, etc.
[0037] An exemplary embodiment of the present disclosure provides an electronic device for implementing a map reconstruction method, which may be Figure 1The terminal device 101, 102, 103 or the server 105 in the embodiment of the present invention comprises at least a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the map reconstruction method by executing the executable instructions.
[0038] Below Figure 2 Taking the mobile terminal 200 in FIG. 1 as an example, the structure of the electronic device is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 2 The structure in the figure can also be applied to fixed type devices. In other embodiments, the mobile terminal 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the components is only shown schematically and does not constitute a structural limitation of the mobile terminal 200. In other embodiments, the mobile terminal 200 may also adopt the same Figure 2 Different interface connection methods, or a combination of multiple interface connection methods.
[0039] like Figure 2 As shown, the mobile terminal 200 may specifically include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a depth sensor 2801, a pressure sensor 2802, a gyroscope sensor 2803, etc.
[0040] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processor (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0041] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the mobile terminal 200 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0042] The processor 210 is provided with a memory. The memory can store instructions for implementing six modular functions: detection instructions, connection instructions, information management instructions, analysis instructions, data transmission instructions and notification instructions, and the execution is controlled by the processor 210.
[0043] The charging management module 240 is used to receive charging input from the charger. The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power the processor 210, the internal memory 221, the display screen 290, the camera module 291 and the wireless communication module 260.
[0044] The wireless communication function of the mobile terminal 200 can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modulation and demodulation processor and baseband processor. Among them, antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals; mobile communication module 250 can provide solutions for wireless communication including 2G / 3G / 4G / 5G applied on mobile terminal 200; modulation and demodulation processor can include modulator and demodulator; wireless communication module 260 can provide solutions for wireless communication including wireless local area network (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT) and the like applied on mobile terminal 200. In some embodiments, antenna 1 of mobile terminal 200 is coupled with mobile communication module 250, and antenna 2 is coupled with wireless communication module 260, so that mobile terminal 200 can communicate with network and other devices through wireless communication technology.
[0045] The mobile terminal 200 implements the display function through a GPU, a display screen 290, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 290 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
[0046] The mobile terminal 200 can realize the shooting function through the ISP, the camera module 291, the video codec, the GPU, the display screen 290 and the application processor, etc. Among them, the ISP is used to process the data fed back by the camera module 291; the camera module 291 is used to capture static images or videos; the digital signal processor is used to process digital signals, and can process other digital signals in addition to digital image signals; the video codec is used to compress or decompress digital videos, and the mobile terminal 200 can also support one or more video codecs.
[0047] The external memory interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile terminal 200. The external memory card communicates with the processor 210 through the external memory interface 222 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0048] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile terminal 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (Universal Flash Storage, UFS), etc. The processor 210 executes various functional applications and data processing of the mobile terminal 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.
[0049] The mobile terminal 200 can implement audio functions such as music playing and recording through the audio module 270 , the speaker 271 , the receiver 272 , the microphone 273 , the earphone interface 274 and the application processor.
[0050] The depth sensor 2801 is used to obtain the depth information of the scene. In some embodiments, the depth sensor can be arranged in the camera module 291.
[0051] The pressure sensor 2802 is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 2802 can be arranged on the display screen 290. There are many types of pressure sensors 2802, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
[0052] The gyro sensor 2803 can be used to determine the motion posture of the mobile terminal 200. In some embodiments, the angular velocity of the mobile terminal 200 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 2803. The gyro sensor 2803 can be used for shooting anti-shake, navigation, somatosensory game scenes, etc.
[0053] In addition, sensors with other functions may be set in the sensor module 280 according to actual needs, such as an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0054] The mobile terminal 200 may also include other devices that provide auxiliary functions. For example, the key 294 includes a power key, a volume key, etc., and the user can input through the key to generate key signal input related to the user settings and function control of the mobile terminal 200. Another example is the indicator 292, the motor 293, the SIM card interface 295, etc.
[0055] In applications such as visual positioning and AR navigation, it is first necessary to reconstruct the real scene in three dimensions and generate a three-dimensional point cloud map. Due to the small viewing angle coverage of ordinary pinhole cameras, the reconstructed scene will have blind spots in certain viewing directions. The positioning picture and the atlas picture cannot produce enough matching relationships, resulting in positioning failure. On the other hand, the advantage of panoramic cameras is that all visual information of the surrounding 360 degrees can be collected at one exposure point, which greatly avoids the positioning failure problem caused by the single coverage of the mapping perspective. However, panoramic pictures are spherical imaging models, and the picture distortion is too large. There are two defects in the following aspects: first, the existing three-dimensional reconstruction system is far less stable than ordinary cameras for the reconstruction of panoramic pictures. Second, the terminal devices used for user positioning are usually mobile phones, AR glasses, etc., which are equipped with pinhole cameras or fisheye cameras. The matching effect between ordinary pictures and panoramic pictures is poor, and it is difficult to improve the positioning accuracy.
[0056] Generally speaking, the panorama image cutting method is usually used for data stream transmission. A panorama image with too high resolution is cut into several images with smaller resolution. The two-dimensional pixel points of the panorama image are projected into space and then back-projected onto the distortion-free pinhole camera plane to determine the pixel information of the cut two-dimensional image. In related schemes, three-dimensional reconstruction based on panoramic images usually adds structured light, laser and other modules to assist in obtaining information about three-dimensional points in space. However, due to the characteristics of the panoramic imaging model, the panoramic three-dimensional reconstruction based on pure vision has poor stability and is difficult to generate stable three-dimensional point information. In addition, the constructed map is not suitable for the positioning needs of mobile phones, AR glasses and other devices.
[0057] In one technical solution, the coordinate value of each pixel of the output image in the three-dimensional coordinate system is determined, the corresponding matrix is constructed, and then the coordinate value is reversely mapped to the panoramic image to achieve efficient and fast image cutting. However, this solution does not take into account the relative position between the cutting model and the cut image for the cutting of the panoramic image, and is only applicable to the transmission of the image data stream.
[0058] In another technical solution, the panoramic three-dimensional modeling device includes a structured light projection module, a shooting module, and a rotating platform module. Structured light is used to conveniently and accurately obtain the structural information of the scene space, but the visual imaging problem of panoramic images is avoided. At the same time, the use of structured light, laser and other hardware equipment has complex operation and high equipment cost, and is not suitable for the reconstruction of large scenes.
[0059] In another technical solution, a panoramic three-dimensional reconstruction system based on laser scanning is proposed, including a control turntable, a camera, a laser transmitter and other devices. Similar to the above-mentioned structured light device, it uses laser to obtain the three-dimensional structure of the scene, but does not fundamentally solve the problem of visual reconstruction of panoramic pictures. It only uses a rotating platform device to achieve a panoramic effect and is not suitable for three-dimensional map construction in visual positioning and AR navigation.
[0060] The map reconstruction method and the map reconstruction device according to the exemplary embodiments of the present disclosure are described in detail below.
[0061] Figure 3 The flowchart of a map reconstruction method in this exemplary embodiment includes the following steps S310 to S340:
[0062] In step S310, a panoramic image of the current scene is acquired.
[0063] In an exemplary embodiment, the current scene refers to a scene for which a three-dimensional point cloud map needs to be constructed. For example, the current scene may be a scene corresponding to an indoor environment or a scene corresponding to a supermarket environment. This exemplary embodiment does not specifically limit this.
[0064] A panoramic image can be a scene image of 360-degree viewing information corresponding to the current scene acquired by a panoramic acquisition unit. Compared with ordinary acquisition units, such as pinhole cameras or fisheye cameras, the panoramic acquisition unit is a spherical imaging model, and the visual information of the current scene acquired is more comprehensive, which can avoid the problem of blind spots in certain viewing directions of three-dimensional scenes reconstructed from ordinary images.
[0065] In step S320, the panoramic image is segmented to obtain a plurality of target images; wherein a relative position relationship exists between the plurality of target images.
[0066] In an exemplary embodiment, the target image refers to an ordinary image obtained by cutting a panoramic image. For example, the target image may be an ordinary image corresponding to the front, back, left, right, top, or bottom of the current scene obtained by cutting the panoramic image. Of course, this is only an example and should not impose any special limitation on this exemplary embodiment.
[0067] In step S330, the feature point pairs between the multiple target images are matched, and target feature point pairs are obtained by screening out from the feature point pairs.
[0068] In an exemplary embodiment, a feature point pair refers to a point with the same name obtained by matching the extracted feature points in the two target images, that is, a feature point pair can refer to the feature points with the closest feature descriptors on the two target images as a matching pair, and a feature point pair can be considered as the projection of the same object point in three-dimensional space at different positions and angles. However, since the adjacent scenes of a panoramic image are distributed on the left and right sides of the image, the consistency of the matching is no longer satisfied, so it is necessary to filter and select the obtained feature point pairs to obtain the target feature point pairs, that is, the target feature point pairs are the matching inliers obtained after filtering all the feature point pairs, and their consistency satisfies the geometric constraints.
[0069] In step S340, a three-dimensional point cloud map of the current scene is reconstructed based on the target feature point pairs and the relative posture relationship.
[0070] In an exemplary embodiment, the relative posture relationship may refer to a constraint relationship that exists when a panoramic image is cut. For example, the relative position relationship may be a constraint relationship of a regular hexahedron. Assume that after the panoramic image is cut, six target images can be obtained. The constraint relationship between the six target images, that is, based on the positive direction, the relative posture relationship of each target image can be divided into directly in front, directly behind, directly to the left, directly to the right, directly above, and directly below. Of course, this is only a schematic example and should not impose any special limitations on this exemplary embodiment.
[0071] Steps S310 to S340 are described in detail below.
[0072] In an exemplary embodiment, in order to cut a panoramic image into a plurality of target images having a relative posture relationship, a preset cutting model may be obtained, and the panoramic image may be segmented based on the cutting model to obtain the plurality of target images.
[0073] Among them, the cutting model can refer to an image segmentation model that is pre-set and used to cut a panoramic image into ordinary images without distortion and overlap. For example, the cutting model can be an image segmentation model without cutting overlap based on a regular hexahedron, or an image segmentation model without cutting overlap based on a regular tetrahedron. Of course, it can also be an image segmentation model without cutting overlap of any other arbitrary shape, and this example embodiment does not specifically limit this. The cutting model can include a relative posture relationship. By segmenting the panoramic image through the cutting model, the segmentation efficiency of the panoramic image can be effectively improved, so that the multiple target images obtained have a constraint relationship, that is, a relative posture relationship.
[0074] In an exemplary embodiment, the panoramic image can be segmented by using the rotation matrix corresponding to the cutting model, referring to Figure 4 As shown, it may specifically include:
[0075] Step S410, determining a rotation matrix corresponding to the cutting model;
[0076] Step S420, determining a virtual camera viewing angle according to the rotation matrix, and performing image segmentation on the panoramic image based on the virtual camera viewing angle to obtain a plurality of target images.
[0077] Among them, the rotation matrix refers to a matrix that changes the direction of a vector but does not change the magnitude of the vector and maintains the chirality when multiplied by a vector. Cutting models with different structures correspond to different rotation matrices. By determining the rotation matrix corresponding to the cutting model, image segmentation of the panoramic image is achieved.
[0078] The virtual camera perspective refers to the virtual perspective obtained based on the virtual camera optical center position and the rotation matrix corresponding to the cutting model. The virtual perspective obtained by the virtual camera optical center position and the rotation matrix is used to divide the pixels in the panoramic image and segment the panoramic image into a target image that conforms to the structure of the cutting model. For example, for a cutting model based on a regular hexahedron, the center of the regular hexahedron cutting model is used as the virtual camera optical center position, and the perspective formed by the vertex of each face in the regular hexahedron cutting model to the virtual camera optical center position is the virtual camera perspective. The regular hexahedron cutting model has a total of six virtual camera perspectives in different directions. Of course, this is only a schematic example and should not impose any special limitations on this example embodiment.
[0079] Specifically, the pixels in the panoramic image can be transformed through the virtual camera perspective to achieve image segmentation. Figure 5 As shown, it may specifically include:
[0080] Step S510, dividing the panoramic image into a plurality of image areas without overlap based on the virtual camera viewing angle;
[0081] Step S520, determining a pixel mapping relationship according to the rotation matrix;
[0082] Step S530: converting the pixels in the image area according to the pixel mapping relationship, and generating a target image according to the converted pixels.
[0083] Among them, the image area refers to the area where the virtual camera perspective corresponding to the cutting model is projected onto the panoramic image when the panoramic image is cut by the cutting model. For example, for the virtual camera perspectives in different directions corresponding to the cutting model based on the regular hexahedron, the panoramic image is divided into six non-overlapping image areas in different directions.
[0084] The pixel mapping relationship refers to the mapping relationship between the pixel points in each image area obtained by segmenting the panoramic image and the pixel points of the target image. The pixel mapping relationship between the pixel points in each image area and the pixel points of the target image is determined by the rotation matrix, which can accurately convert the panoramic image into multiple target images and effectively improve the accuracy of the three-dimensional point cloud map reconstructed by multiple target images.
[0085] Figure 6 The schematic diagram schematically shows a principle diagram of a cutting model based on a regular hexahedron in an exemplary embodiment of the present disclosure.
[0086] refer to Figure 6 As shown, the center point O of the regular hexahedron cutting model 601 can be used as the optical center position of the virtual camera. The optical centers of all the target images after cutting are at the same position O. Taking the virtual camera perspective 602 in front as the reference, the Y axis of the virtual camera perspective 602 in front is rotated by 90 degrees, 180 degrees, and 270 degrees respectively to obtain the right-view virtual camera perspective, the rear-view virtual camera perspective, and the left-view virtual camera perspective. The X axis of the virtual camera perspective 602 in front is rotated by 90 degrees and negative 90 degrees respectively to obtain the upper-view virtual camera perspective and the lower-view virtual camera perspective. Where f is the focal length of the target image obtained after cutting. The resolution, focal length, and principal point of the six target images are the same. The mapping relationship between the image size and relative position coordinates and the original panoramic image can be expressed as equations (1), (2), and (3):
[0087]
[0088]
[0089]
[0090] Among them, W cube ,H cube They can represent the width and height of the target image after cutting, W spherical ,H spherical They can represent the width and height of the panoramic image respectively. In the panoramic image imaging model, the width of the panoramic image will be fixed to twice the height. cube It can represent the focal length of the target image after cutting, C x ,C y They can respectively represent the principal point coordinates of the target image after cutting.
[0091] After the regular hexahedron cutting model 601 is fixed at point O(u, v, w), the mapping relationship between the pixel points of the target image after cutting and the pixel points in the image area corresponding to each virtual camera perspective in the panoramic image can be expressed by equations (4), (5), and (6):
[0092]
[0093]
[0094]
[0095] Among them, x cube ,y cube They can represent the pixel coordinates of the target image after cutting, x spherical ,y spherical They can represent the pixel coordinates of the panoramic image, f cube It can represent the focal length of the target image after cutting, C x ,C y They can respectively represent the principal point coordinates of the target image after cutting, and R can represent the rotation matrix of the front virtual camera perspective 602 of the regular hexahedron cutting model 601. The front virtual camera perspective 602 is a unit matrix, and the perspectives in other directions are rotated 90 degrees around their respective directions.
[0096] Figure 7 A schematic diagram schematically illustrates a principle of segmenting a panoramic image to generate a target image in an exemplary embodiment of the present disclosure.
[0097] refer to Figure 7 As shown, the panoramic image 701 is segmented based on the regular hexahedron cutting model 601 to obtain the front virtual camera perspective 702, the rear virtual camera perspective 703, the left virtual camera perspective 704 and the right virtual camera perspective 705. Since the upward virtual camera perspective and the downward virtual camera perspective usually correspond to the sky and the ground, there are fewer feature points, which are not very helpful for reconstruction and are not shown here.
[0098] In an exemplary embodiment, the feature point pairs corresponding to the target image can be determined by the following steps: Figure 8 As shown, it may specifically include:
[0099] Step S810, performing feature extraction on the multiple target images to determine feature points corresponding to each of the multiple target images;
[0100] Step S820: performing feature matching on the multiple target images based on the feature points to obtain feature point pairs between the target images.
[0101] Among them, feature extraction refers to the process of detecting and identifying points of interest in the target image through a feature extraction algorithm. For example, the feature extraction algorithm may include a scale-invariant feature transform feature extraction algorithm (SIFT), a speeded up robust feature extraction algorithm (SURF), an oriented fast and rotated brief (ORB), and a learning-type SuperPoint feature, an R2D2 feature, etc. After the panoramic image is segmented, the target image is obtained. The feature extraction method for the target image is consistent with the feature extraction method for the ordinary image, and this exemplary embodiment does not specifically limit this. The main purpose of extracting feature points is to obtain points of interest in the target image, such as corner points, boundaries, and other pixels with large gradient changes in the target image, and the learned feature points can also include high-level semantic information of the pixel points, etc. Each feature point will have a corresponding feature descriptor to describe it. For example, the feature descriptor may include but is not limited to a Brief feature descriptor, a HOG feature descriptor, a SIFT feature descriptor, etc., and this exemplary embodiment is not limited to this.
[0102] Feature point matching refers to taking the feature points with the most similar feature descriptors on the two target images as a matching point pair. The matched feature point pairs can be considered as the projections of the same object point in three-dimensional space at different positions and angles, which are called points of the same name. Traditional feature point matching methods include brute force matching, KNN matching, etc. When K=2, both the matching efficiency and matching accuracy can meet the requirements. The learning-based matching methods may include Superglue, etc., which are used to adapt the matching of SuperPoint features. Since feature matching is performed based on the distance of feature point descriptors (such as Euclidean distance, etc.), there is no difference in feature point matching between the target image corresponding to the panoramic image and the ordinary image, and this example embodiment does not make any special limitations on this.
[0103] Furthermore, the feature point pairs can be randomly sampled and the fundamental matrix can be estimated. Then, the feature point pairs can be verified based on the fundamental matrix to obtain the target feature point pairs. Specifically, the geometric constraint verification can be performed based on the fundamental matrix. Under ideal conditions, if the two target images match each other, the same points of the feature points in the left target image will be on the corresponding epipolar line of the right image, as shown in equation (7):
[0104]
[0105] Among them, F can represent the basic matrix, [xy 1] and [x′ y′ 1] can represent the coordinates of a pair of matching feature points. The RANdom SAmple Consensus (RANSAC) method can be used to estimate the most suitable basic matrix and feature point matching pair, and filter out the wrong matching feature point pairs. Since the adjacent scenes of the panoramic image will be distributed on the left and right sides of the image, the matching consistency is no longer satisfied. The random consistency sampling method will filter out the correctly matched inner points, while the pinhole camera model does not have this problem, which is another advantage of cutting the panoramic image into the target image.
[0106] In an exemplary embodiment, the three-dimensional point cloud map corresponding to the current scene can be reconstructed by the following steps: Fig. 9 As shown, it may specifically include:
[0107] Step S910, determining an initial image matching pair from the multiple target images, and performing three-dimensional reconstruction through the target feature point pairs included in the initial image matching pair to obtain an initial three-dimensional point cloud map;
[0108] Step S920, obtain the next frame of the target image to be reconstructed, and use the relative pose relationship as a constraint item to adjust the camera pose of the target image to be reconstructed in the initial three-dimensional point cloud map, so as to reconstruct the target image to be reconstructed into the initial three-dimensional point cloud map to obtain the three-dimensional point cloud map of the current scene.
[0109] Among them, the initial image matching pair (Initial Image Pair) refers to the basic image initially used for 3D reconstruction. The initial image matching pair needs to meet the following requirements: first, the number of matching feature point pairs in the initial image matching pair is sufficient; second, the baseline length of the initial image matching pair is long enough; third, the quality of the 3D points used for triangulation in the initial image matching pair is stable enough.
[0110] After determining the initial image matching pair, the initial image matching pair can be reconstructed. Specifically, the relative pose between the two target images can be estimated based on the matching relationship of the feature point pairs between the initial image matching pairs, and then the feature point matching pairs can be triangulated to obtain an initial three-dimensional point cloud map. Finally, the initial three-dimensional point cloud map is optimized and filtered through conditions such as polar constraints and viewing angle constraints, and the feature points of other target images can be updated and integrated into the initial three-dimensional point cloud map, and finally a three-dimensional point cloud map corresponding to the current scene is obtained.
[0111] Specifically, the next frame of target image to be reconstructed is continuously obtained from the remaining target images, that is, one frame of target image to be reconstructed is fused into the initial 3D point cloud map to obtain an updated initial 3D point cloud map, and then the next frame of target image to be reconstructed is continuously obtained, and the 3D reconstruction is continuously performed in the updated initial 3D point cloud map of the target image to be reconstructed, until all target images are 3D reconstructed and updated to the initial 3D point cloud map to obtain the 3D point cloud map corresponding to the current scene.
[0112] When performing 3D reconstruction on the next frame of the target image to be reconstructed, first determine the 2D-3D matching pair between the target image to be reconstructed and the initial 3D point cloud map, and then use the PNP algorithm to solve the camera pose of the target image to be reconstructed in the current initial 3D point cloud map. After determining the camera pose, the newly added 2D-2D feature point matching pairs can be triangulated to generate new 3D points. If the next frame of the target image to be reconstructed that will participate in the 3D reconstruction and the target image that has participated in the reconstruction are cut from the same panoramic image, then a constraint item with a relative rotation of 90 degrees and no relative translation can be added during the 3D reconstruction to adjust the overall camera pose of the reconstructed camera.
[0113] Specifically, an image among multiple target images that meets preset conditions can be used as the next frame of target image to be reconstructed. The preset conditions met by the target image to be reconstructed include one or more combinations of the following conditions: first, the target image has not participated in reconstruction; second, the visible points of the target image in the initial three-dimensional point cloud map are greater than or equal to the visible point threshold; third, the number of times the target image is attempted to be reconstructed during the reconstruction process is less than the reconstruction number threshold. The reconstruction number threshold can be 3, of course, it can also be other thresholds, and this example embodiment does not make any special limitations on this.
[0114] In an exemplary embodiment, after each frame of the target image is reconstructed, a local bundle adjustment (BA) optimization is required. When the number of target images involved in the reconstruction exceeds a fixed number, or the number of 3D points involved in the reconstruction increases by a fixed number, a global BA optimization is performed on all previous reconstructions. In the BA optimization, the relative pose and camera intrinsic parameters of the target images cut out from the same panoramic image can be fixed to reduce the variables that need to be optimized, achieve the best optimization effect, and finally obtain a complete 3D point cloud map.
[0115] In summary, in this exemplary embodiment, a panoramic image corresponding to the current scene is obtained, and then the panoramic image is segmented to obtain multiple target images with relative posture relationships, feature point pairs corresponding to the multiple target images are determined, and target feature point pairs are screened from the feature point pairs; based on the target feature point pairs and the relative posture relationship, a three-dimensional point cloud map corresponding to the current scene is reconstructed. On the one hand, by cutting the panoramic image and performing three-dimensional reconstruction on multiple target images with relative posture relationships obtained by cutting, the problem of low reconstruction success rate and poor three-dimensional reconstruction effect caused by large distortion of the panoramic image can be avoided; on the other hand, by performing three-dimensional reconstruction on multiple target images with relative posture relationships obtained by cutting the panoramic image, the three-dimensional point cloud map obtained by three-dimensional reconstruction has a wider application range, and the positioning accuracy of positioning images collected by different terminal devices in the three-dimensional point cloud map is effectively improved; on the other hand, by constructing a three-dimensional map through a panoramic image, the comprehensiveness of the constructed three-dimensional point cloud map can be effectively improved, the problem of blind spots in the three-dimensional point cloud map constructed by ordinary images can be avoided, and the success rate of positioning can be effectively improved.
[0116] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0117] For further reference, Fig.10 As shown, in the embodiment of this example, a map reconstruction device 1000 is also provided, which may include a panoramic image acquisition module 1010, a panoramic image segmentation module 1020, a feature point pair screening module 1030 and a map reconstruction module 1040. Among them:
[0118] The panoramic image acquisition module 1010 is used to acquire a panoramic image of the current scene;
[0119] The panoramic image segmentation module 1020 is used to perform image segmentation on the panoramic image to obtain a plurality of target images; wherein there is a relative position relationship between the plurality of target images;
[0120] The feature point pair screening module 1030 is used to match the feature point pairs between the multiple target images, and screen the target feature point pairs from the feature point pairs;
[0121] The map reconstruction module 1040 is used to reconstruct the three-dimensional point cloud map of the current scene according to the target feature point pairs and the relative posture relationship.
[0122] In an exemplary embodiment, the panoramic image segmentation module 1020 may also be used to:
[0123] Acquire a preset cutting model, wherein the cutting model includes the relative posture relationship;
[0124] The panoramic image is segmented based on the cutting model to obtain a plurality of target images.
[0125] In an exemplary embodiment, the panoramic image segmentation module 1020 may include:
[0126] A rotation matrix determining unit, used to determine the rotation matrix corresponding to the cutting model;
[0127] The target image generating unit is used to determine the virtual camera viewing angle according to the rotation matrix, and perform image segmentation on the panoramic image based on the virtual camera viewing angle to obtain a plurality of target images.
[0128] In an exemplary embodiment, the target image generation unit may also be configured to:
[0129] Based on the virtual camera viewing angle, the panoramic image is divided into a plurality of image areas without overlap;
[0130] Determine a pixel mapping relationship according to the rotation matrix;
[0131] The pixel points in the image area are converted according to the pixel mapping relationship, and a target image is generated according to the converted pixel points.
[0132] In an exemplary embodiment, the feature point pair screening module 1030 may be used to:
[0133] Extracting features from the plurality of target images to determine feature points corresponding to the plurality of target images;
[0134] Feature matching is performed on the multiple target images based on the feature points to obtain feature point pairs corresponding to the target images.
[0135] In an exemplary embodiment, the map reconstruction module 1040 may be used to:
[0136] Determining an initial image matching pair from the multiple target images, and reconstructing an initial three-dimensional point cloud map based on the target feature point pairs included in the initial image matching pair;
[0137] Acquire the next frame of the target image to be reconstructed, and use the relative pose relationship as a constraint item to adjust the camera pose of the target image to be reconstructed in the initial three-dimensional point cloud map, so as to reconstruct the target image to be reconstructed into the initial three-dimensional point cloud map to obtain the three-dimensional point cloud map of the current scene.
[0138] In an exemplary embodiment, the map reconstruction module 1040 may further include a target image to be reconstructed screening unit, and the target image to be reconstructed screening unit may be used to:
[0139] Using an image that meets a preset condition among the multiple target images as a target image to be reconstructed;
[0140] The preset conditions include one or more of the following conditions:
[0141] The image has not been reconstructed;
[0142] The visible point of the image in the initial three-dimensional point cloud map is greater than or equal to the visible point threshold;
[0143] The number of times the image is attempted to be reconstructed during the reconstruction process is less than a reconstruction number threshold.
[0144] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0145] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0146] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification, for example, it can execute Figures 3 to 9 Any one or more steps in .
[0147] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0148] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0149] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0150] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0151] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A map reconstruction method, characterized in that: include: Get a panoramic image of the current scene; Performing image segmentation on the panoramic image to obtain a plurality of target images; wherein a relative position and posture relationship exists between the plurality of target images; the relative position and posture relationship is a constraint relationship between the plurality of target images; Matching feature point pairs between the multiple target images, and selecting target feature point pairs from the feature point pairs; Reconstruct a three-dimensional point cloud map of the current scene based on the target feature point pairs and the relative position and posture relationship.
2. The method according to claim 1, characterized in that Perform image segmentation on the panoramic image to obtain multiple target images, including: Acquire a preset cutting model, wherein the cutting model includes the relative posture relationship; The panoramic image is segmented based on the cutting model to obtain a plurality of target images.
3. The method according to claim 2, characterized in that The performing image segmentation on the panoramic image based on the cutting model to obtain a plurality of target images includes: Determine the rotation matrix corresponding to the cutting model; A virtual camera viewing angle is determined according to the rotation matrix, and image segmentation is performed on the panoramic image based on the virtual camera viewing angle to obtain a plurality of target images.
4. The method according to claim 3, characterized in that The performing image segmentation on the panoramic image based on the virtual camera viewing angle to obtain a plurality of target images includes: Based on the virtual camera viewing angle, the panoramic image is divided into a plurality of image areas without overlap; Determine a pixel mapping relationship according to the rotation matrix; The pixel points in the image area are converted according to the pixel mapping relationship, and the target image is generated by the converted pixel points.
5. The method according to any one of claims 2 to 4, characterized in that: The cutting model includes a regular hexahedron cutting model.
6. The method according to claim 1, characterized in that The matching of feature point pairs between the multiple target images includes: Extracting features from the plurality of target images to determine feature points corresponding to the plurality of target images; Feature matching is performed on the multiple target images based on the feature points to obtain feature point pairs between the multiple target images.
7. The method according to claim 1, characterized in that The step of reconstructing the three-dimensional point cloud map of the current scene according to the target feature point pair and the relative position and posture relationship includes: Determine an initial image matching pair from the multiple target images, and perform three-dimensional reconstruction through the target feature point pairs included in the initial image matching pair to obtain an initial three-dimensional point cloud map; Acquire the next frame of the target image to be reconstructed, and use the relative pose relationship as a constraint item to adjust the camera pose of the target image to be reconstructed in the initial three-dimensional point cloud map, so as to reconstruct the target image to be reconstructed into the initial three-dimensional point cloud map to obtain the three-dimensional point cloud map of the current scene.
8. The method according to claim 7, characterized in that The step of obtaining the next frame of the target image to be reconstructed further includes: Using an image that meets a preset condition among the multiple target images as a target image to be reconstructed; The preset conditions include one or more of the following conditions: The image has not been reconstructed; The visible point of the image in the initial three-dimensional point cloud map is greater than or equal to the visible point threshold; The number of times the image is attempted to be reconstructed during the reconstruction process is less than a reconstruction number threshold.
9. A map reconstruction device, characterized in that: include: A panoramic image acquisition module is used to acquire a panoramic image of the current scene; A panoramic image segmentation module, used to perform image segmentation on the panoramic image to obtain a plurality of target images; wherein a relative position and posture relationship exists between the plurality of target images; the relative position and posture relationship is a constraint relationship between the plurality of target images; A feature point pair screening module, used for matching the feature point pairs between the plurality of target images, and screening the target feature point pairs from the feature point pairs; A map reconstruction module is used to reconstruct a three-dimensional point cloud map of the current scene based on the target feature point pairs and the relative posture relationship.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.
