WO2022016803A1 - Visual positioning method and apparatus, electronic device, and computer readable storage medium - Google Patents

Visual positioning method and apparatus, electronic device, and computer readable storage medium Download PDF

Info

Publication number
WO2022016803A1
WO2022016803A1 PCT/CN2020/139166 CN2020139166W WO2022016803A1 WO 2022016803 A1 WO2022016803 A1 WO 2022016803A1 CN 2020139166 W CN2020139166 W CN 2020139166W WO 2022016803 A1 WO2022016803 A1 WO 2022016803A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
feature points
feature
query image
points
Prior art date
Application number
PCT/CN2020/139166
Other languages
French (fr)
Chinese (zh)
Inventor
金诚
冯友计
章国锋
Original Assignee
浙江商汤科技开发有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浙江商汤科技开发有限公司 filed Critical 浙江商汤科技开发有限公司
Publication of WO2022016803A1 publication Critical patent/WO2022016803A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the embodiments of the present disclosure are based on a Chinese patent application with an application number of 202010710996.0 and an application date of July 22, 2020, and claim the priority of the Chinese patent application.
  • the entire content of the Chinese patent application is incorporated herein by reference.
  • the embodiments of the present disclosure relate to the technical field of computer vision, and in particular, to a visual positioning method and apparatus, an electronic device, and a computer-readable storage medium.
  • GPS Global Position System, global positioning system
  • positioning technology based on wireless local area network or Bluetooth
  • positioning technology based on ultra-wideband are technologies that all have certain limitations. Among them, the GPS signal penetration ability is poor, and it is difficult to achieve effective and accurate positioning in a densely built environment or an indoor environment. In addition, even in an open scene, in order to achieve high-precision positioning, professional GPS equipment with a high cost is required, so it is difficult to achieve consumer-level applications.
  • the positioning technology based on wireless local area network or Bluetooth needs to pre-arrange relevant devices in the to-be-located area, the layout process is cumbersome, the reliability and accuracy are poor, and the positioning range is small.
  • UWB-based positioning technology can achieve relatively high accuracy, but it requires at least three receivers, and the space between the transmitter and receiver needs to be kept open, which limits the application scenarios of UWB-based positioning technology .
  • the UWB-based positioning technology often needs to multiply the number of receivers, resulting in poor system reliability.
  • the above-mentioned positioning technology can usually only obtain position information, and it is difficult to obtain reliable attitude information.
  • the visual positioning technology not only has a simpler way of obtaining information, but also does not require much modification to the positioning scene.
  • the visual positioning technology can not only locate the position information, but also locate the attitude information, so that the positioning results can not only serve the needs of conventional position information acquisition, but also realize more intelligent applications, such as augmented reality.
  • the speed of visual localization is low.
  • the embodiments of the present disclosure provide a technical solution for visual positioning.
  • a visual positioning method including:
  • the feature vector of the feature points of the query image search for the database feature points matching the feature points of the query image, wherein the database feature points represent the feature points of the database image;
  • the visual positioning result of the query image is determined.
  • the extracting feature vectors of feature points of the query image includes:
  • Feature extraction is performed on at least two images of the query image and the at least one transformed image to obtain feature vectors of feature points of the query image.
  • the obtained feature vectors of the feature points of the query image can be It reflects the richer and more comprehensive information in the query image, and the extracted feature vector has strong robustness to environmental changes such as illumination, thereby helping to improve the accuracy of visual positioning.
  • performing feature extraction on at least two images in the query image and the at least one transformed image to obtain a feature vector of feature points of the query image including:
  • Feature fusion is performed on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
  • the deep features of the query image can be obtained, thereby improving the robustness of subsequent feature point matching and improving the reliability of visual positioning. sex.
  • the searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image includes:
  • a first group of database feature points that match the feature points of the query image is determined according to the database class centers that match a plurality of sub-feature vectors of the feature points of the query image.
  • the feature vector of the feature points of the query image is decomposed into lower-dimensional sub-feature vectors before matching, thereby improving the speed of determining the database feature points matching the feature points of the query image.
  • the method before the searching for a database class center matching a plurality of sub-feature vectors of the feature points of the query image, the method further includes:
  • the feature vector of the any database feature point is decomposed to obtain a plurality of sub-feature vectors of the any database feature point, wherein the any one The dimension of the sub-feature vector of the database feature point is less than the dimension of the feature vector of any of the database feature points;
  • a corresponding relationship between any of the database feature points and the database class center is established.
  • determining the first group of database feature points matching the feature points of the query image according to the database class centers matched with multiple sub-feature vectors of the feature points of the query image including :
  • Geometric verification is performed on the candidate database feature points, and a first group of database feature points matching the feature points of the query image is determined.
  • the candidate database feature points corresponding to the feature points of the query image are determined according to the database class centers that match with multiple sub-feature vectors of the feature points of the query image, and then the candidate database feature points are determined.
  • Geometric verification is performed to determine the first group of database feature points that match the feature points of the query image, so that the first group of database feature points that match the feature points of the query image can be quickly and accurately determined.
  • performing geometric verification on the candidate database feature points to determine the first group of database feature points matching the feature points of the query image including:
  • the first group of database feature points matching the feature points of the query image is determined.
  • geometric verification is performed by means of matrix interval voting, so that the feature points matching the feature points of the query image can be quickly determined, thereby improving the visual positioning speed.
  • determining the first group of database feature points matching the feature points of the query image according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval including:
  • the first group of database feature points is determined according to candidate database feature points in the database image whose candidate database feature points satisfy the second quantity condition.
  • the candidate database feature points can be filtered to obtain the first set of database feature points, thereby determining the visual positioning result of the query image based on the first set of database feature points, which helps to improve the accuracy of the determined visual positioning result. accuracy.
  • the searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image further includes:
  • the second group of database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates;
  • a visual positioning result of the query image is determined.
  • This implementation can increase the number of associated point pairs through reverse search, thereby improving the robustness of visual positioning.
  • a visual positioning device comprising:
  • a first extraction part configured to extract feature vectors of feature points of the query image
  • a search section configured to search for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image, wherein the database feature point represents the feature point of the database image;
  • the determining part is configured to determine the visual positioning result of the query image according to the matched database feature points.
  • the first extraction part is configured as:
  • Feature extraction is performed on at least two images of the query image and the at least one transformed image to obtain feature vectors of feature points of the query image.
  • the first extraction part is configured as:
  • Feature fusion is performed on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
  • the lookup section is configured as:
  • a first group of database feature points that match the feature points of the query image is determined according to the database class centers that match a plurality of sub-feature vectors of the feature points of the query image.
  • the apparatus further includes:
  • the second extraction part is configured to extract feature vectors of multiple database feature points
  • the decomposition part is configured to decompose the feature vector of any database feature point for any database feature point in the plurality of database feature points to obtain a plurality of sub-feature vectors of the any database feature point, wherein, the dimension of the sub-feature vector of the feature point of any database is less than the dimension of the feature vector of the feature point of any database;
  • the clustering part is configured to cluster the sub-feature vectors of the plurality of database feature points to obtain the database class center;
  • the establishing part is configured to establish the corresponding relationship between the feature point of any database and the database class center.
  • the lookup section is configured as:
  • Geometric verification is performed on the candidate database feature points, and a first group of database feature points matching the feature points of the query image is determined.
  • the lookup section is configured as:
  • the first group of database feature points matching the feature points of the query image is determined.
  • the lookup section is configured as:
  • the first group of database feature points is determined according to candidate database feature points in the database image whose candidate database feature points satisfy the second quantity condition.
  • the lookup section is configured as:
  • the second group of database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates;
  • a visual positioning result of the query image is determined.
  • an electronic device comprising: one or more processors; a memory configured to store executable instructions; wherein the one or more processors are configured to invoke the executable instructions stored in the memory to perform the above method.
  • a computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the above method when executed by a processor.
  • a computer program including computer-readable codes, and when the computer-readable codes are executed in an electronic device, the processor in the electronic device implements the above when executed. method.
  • the positioning process is more direct and effective, the memory consumption is lower, the time-consuming of visual positioning can be reduced, and the positioning process is more reliable.
  • FIG. 1 shows a flowchart of a visual positioning method provided by an embodiment of the present disclosure.
  • FIG. 2 shows an exemplary schematic diagram of performing transformation processing on a query image to obtain multiple transformed images corresponding to the query image provided by an embodiment of the present disclosure.
  • FIG. 3 is a schematic diagram illustrating an exemplary input of a query image and multiple transformed images into a vanilla CNN, and outputting feature maps of the query image and multiple transformed images via the vanilla CNN provided by an embodiment of the present disclosure.
  • FIG. 4 shows an exemplary embodiment of the present disclosure that performs grouped convolution on the feature points of a query image and multiple transformed images through two convolutional neural networks, and performs bilinear pooling on the grouped convolution results to obtain Schematic diagram of the eigenvectors of the feature points.
  • FIG. 5 shows a block diagram of a visual positioning apparatus provided by an embodiment of the present disclosure.
  • FIG. 6 shows a block diagram of an electronic device 800 provided by an embodiment of the present disclosure.
  • FIG. 7 shows a block diagram of an electronic device 1900 provided by an embodiment of the present disclosure.
  • the feature points related to the query image are searched for
  • the matched database feature points, and according to the matched database feature points, the visual positioning result of the query image is determined, so that there is no need to retrieve and obtain a local map in the visual positioning, and feature point matching is performed directly.
  • the point-matched database feature points determine the visual positioning result of the query image, so that the positioning process is more direct and effective, the memory consumption is lower, the time-consuming of visual positioning can be reduced, and the positioning process is more reliable.
  • FIG. 1 shows a flowchart of a visual positioning method provided by an embodiment of the present disclosure.
  • the execution subject of the visual positioning method may be a visual positioning device.
  • the visual positioning method may be executed by a terminal device or a cloud server or other processing device.
  • the terminal device may be a robot, a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device Or wearable devices, etc.
  • the visual positioning method may be implemented by a processor invoking computer-readable instructions stored in a memory. As shown in FIG. 1 , the visual positioning method includes steps S11 to S13.
  • step S11 feature vectors of feature points of the query image are extracted.
  • the feature points of the query image may correspond to the pixels of the query image, that is, the position of any feature point of the query image in the query image may be uniquely determined according to the pixel corresponding to the feature point.
  • the extracted feature vector of the feature points of the query image can provide pixel-level description information.
  • the number of feature points of the query image may be less than or equal to the number of pixels of the query image. In one example, the number of feature points of the query image may be less than the number of pixels of the query image. For example, the value range of the number of feature points of the query image may be 500-2500.
  • the extracting the feature vector of the feature points of the query image includes: transforming the query image to obtain at least one transformed image corresponding to the query image; Feature extraction is performed on at least two images in the at least one transformed image to obtain feature vectors of feature points of the query image.
  • the transformation processing may be at least one of rotation, scaling, mirroring, distortion, and the like.
  • FIG. 2 shows a schematic diagram of transforming a query image to obtain a plurality of transformed images corresponding to the query image.
  • a query image may be transformed to obtain multiple transformed images corresponding to the query image, and feature extraction is performed on the query image and multiple transformed images corresponding to the query image to obtain the query image.
  • the feature vector of the feature points of the query image may be transformed to obtain multiple transformed images corresponding to the query image, and feature extraction is performed on the query image and multiple transformed images corresponding to the query image to obtain the query image.
  • the obtained feature vectors of the feature points of the query image can be It reflects the richer and more comprehensive information in the query image, and the extracted feature vector has strong robustness to environmental changes such as illumination, thereby helping to improve the accuracy of visual positioning.
  • the performing feature extraction on at least two images in the query image and the at least one transformed image to obtain a feature vector of feature points of the query image includes: extracting the query image The image and at least two images in the at least one transformed image are respectively input into the first neural network, and the feature maps of the at least two images are output through the first neural network; the feature maps of the at least two images are Perform group convolution to obtain at least two grouped convolution results; perform feature fusion on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
  • the first neural network may be a convolutional neural network, such as vanilla CNN or the like.
  • FIG. 3 shows a schematic diagram of inputting a query image (not shown in FIG. 3 ) and a plurality of transformed images into a vanilla CNN, and outputting feature maps of the query image and the plurality of transformed images via the vanilla CNN.
  • dense image description features can be obtained, that is, feature vectors that can extract a large number of feature points (eg, 500-2500 feature points).
  • the feature vector of the feature points of the query image extracted by this example may be called a GIFT (Group Invariant Feature Transform, group invariant feature transform) feature.
  • GIFT Group Invariant Feature Transform, group invariant feature transform
  • the neural network usually only uses the information of a single image to extract features, which will There is a pooling process, which will cause the loss of a certain amount of image information, while GIFT uses multiple transformed images of the image to obtain the deep structure of the feature through grouping convolution, instead of the original pooling process. It is more comprehensive, so that the robustness of subsequent feature point matching can be improved, and the reliability of visual positioning can be improved.
  • performing grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results includes: dividing the feature maps of the at least two images into a first feature map group and the second feature map group; input the first feature map group into the second neural network, and output the grouped convolution result of the first feature map group through the second neural network; A third neural network is input, and the grouped convolution result of the second feature map group is output via the third neural network.
  • the first feature map group includes part of the feature maps in the feature maps of the at least two images
  • the second feature map group includes another part of the feature maps in the feature maps of the at least two images.
  • the second neural network and the third neural network may both be convolutional neural networks.
  • the grouped convolution results of the first feature map group and the second feature map group are respectively processed by the second neural network and the third neural network, so that the deep structure of the feature can be obtained, so that the obtained feature information It is more comprehensive and the overall matching effect is more robust.
  • the number of neural networks used for group convolution may also be more than three.
  • the performing feature fusion on the at least two items of grouped convolution results to obtain feature vectors of feature points of the query image includes: performing bilinear pooling on the at least two items of grouped convolution results The transformation operation is performed to obtain the feature vector of the feature points of the query image.
  • the fusion may also be performed in a manner such as concat, which is not limited in this embodiment of the present disclosure.
  • Figure 4 shows that the feature points of the query image and multiple transformed images are grouped by convolution through two convolutional neural networks, and bilinear pooling is performed on the grouped convolution results to obtain the feature vector of the feature points of the query image.
  • an activation function can be used for processing after each convolutional layer of the second neural network and the third neural network.
  • the activation function can be ReLU (Rectified Linear Unit, linear rectification unit).
  • step S12 a database feature point matching the feature point of the query image is searched according to the feature vector of the feature point of the query image, wherein the database feature point represents the feature point of the database image.
  • the database feature points matching the feature points of the query image may be determined according to the similarity between the feature vectors of the feature points.
  • the searching for the database feature points matching the feature points of the query image according to the feature vector of the feature points of the query image includes: The vector is decomposed to obtain a plurality of sub-feature vectors of the feature points of the query image, wherein the dimension of the sub-feature vectors of the feature points of the query image is less than the dimension of the feature vectors of the feature points of the query image; find A database class center matched with a plurality of sub-feature vectors of the feature points of the query image, wherein the database class center represents the class center of the sub-feature vectors of the database feature points; The database class center of the feature vector matching determines the first group of database feature points matching the feature points of the query image.
  • the feature vector of the feature points of the query image is [s 1 ,s 2 ,s 3 ,s 4 ,s 5 ,s 6 ,s 7 ,s 8 ,s 9 ], and the feature vector of the feature points of the query image is decomposed For 3 sub-eigenvectors, get [s 1 ,s 2 ,s 3 ], [s 4 ,s 5 ,s 6 ] and [s 7 ,s 8 ,s 9 ].
  • the dimension of the feature vector of the feature points of the query image can be much higher.
  • the embodiments of the present disclosure do not limit the dimension of the feature vector of the feature points of the query image, the number of sub-feature vectors of the feature points of the query image, and the dimension of the sub-feature vectors of the feature points of the query image.
  • the feature vector of the feature points of the query image is decomposed into lower-dimensional sub-feature vectors before matching, thereby improving the speed of determining the database feature points matching the feature points of the query image.
  • the method before the searching for a database class center matching a plurality of sub-feature vectors of the feature points of the query image, the method further includes: extracting feature vectors of a plurality of database feature points; Any database feature point in the plurality of database feature points, decompose the feature vector of the any database feature point, and obtain a plurality of sub-feature vectors of the any database feature point, wherein the any database feature
  • the dimension of the sub-feature vector of the point is less than the dimension of the feature vector of the feature point of any database
  • the sub-feature vector of the feature points of the multiple databases is clustered to obtain the database class center; the database of any one is established Correspondence between feature points and database class centers.
  • a plurality of database images may be included in the database, wherein the database images represent images in the database.
  • the feature vector of the database feature points in the database image can be extracted in a manner similar to the manner of extracting the feature vector of the feature points of the query image described above.
  • the value range of the number of database feature points extracted from each database image may be 500-2500.
  • the feature vector of any database feature point may be decomposed into a plurality of sub-feature vectors.
  • the feature vector of a feature point in a database is [1,3,2,3,4,5,3,2,1]
  • the feature vector of the feature point in the database can be decomposed into 3 sub-feature vectors [1,3 ,2], [3,4,5] and [3,2,1].
  • the dimension of the feature vector of the database feature point may be much higher, which is not limited in this embodiment of the present disclosure.
  • methods such as K-means, KD tree, or vocabulary tree can be used to cluster sub-feature vectors of multiple database feature points to obtain database class centers.
  • the correspondence between the database feature points and the database class center is recorded.
  • the correspondence between the database class center and the database feature points corresponding to all sub-feature vectors in the class to which the database class center belongs may be recorded. For example, if the sub-feature vectors of database feature point 5, database feature point 6, and database feature point 7 belong to the class to which database class center 1 belongs, then database class center 1 and database feature point 5, database feature point 6, and database feature point can be recorded.
  • the correspondence between 7, for example, can be recorded as (1:5,6,7).
  • database feature point 1 corresponds to database class center 2, database class center 5, and database class center 8
  • database class center 5 corresponds to database class center 2
  • database class center 5 corresponds to database class center 8
  • database class center 8 can be recorded , for example, it can be written as (1:2,5,8).
  • an indexer can be built from all database class centers.
  • the determining the first group of database feature points matching the feature points of the query image according to the database class centers matched with multiple sub-feature vectors of the feature points of the query image includes: Determine the candidate database feature points corresponding to the feature points of the query image according to the database class centers matching the multiple sub-feature vectors of the feature points of the query image; perform geometric verification on the candidate database feature points, and determine The first set of database feature points matching the feature points of the query image.
  • the corresponding feature points of the query image can be determined.
  • a Cartesian product method can be used to determine the candidate database feature points corresponding to the feature points of the query image.
  • the feature vector of the feature point A of the query image corresponds to 3 sub-feature vectors A1, A2 and A3
  • the database class center matching the sub-feature vector A1 is the database class center P1
  • the database class center matching the sub-feature vector A2 is The database class center P2
  • the database class center that matches the sub-feature vector A3 is the database class center P3
  • the database feature points corresponding to all the sub-feature vectors in the class to which the database class centers P1, P2, and P3 belong can be determined as The candidate database feature point corresponding to the feature point A of the query image.
  • database feature points corresponding to all sub-feature vectors in the class to which database class center P1 belongs include database feature points D1, D2, D5, and D6, and database feature points corresponding to all sub-feature vectors in the class to which database class center P2 belongs Including database feature points D1, D7, D8, D9, database feature points corresponding to all sub-feature vectors in the class to which database class center P3 belongs, including database feature points D3, D4, D10, D1-D10 can be determined as all The candidate database feature point corresponding to the feature point A of the query image.
  • the feature vector of the feature point A of the query image corresponds to 3 sub-feature vectors A1, A2 and A3, the database class center matching the sub-feature vector A1 is the database class center P1, and the database class center matching the sub-feature vector A2
  • the database class center is the database class center P2
  • the database class center matching the sub-feature vector A3 is the database class center P3
  • the database feature points corresponding to the database class centers P1, P2 and P3 can be determined as the query image
  • the feature point A corresponds to the candidate database feature point.
  • the database feature points corresponding to all sub-feature vectors in the class to which database class center P1 belongs include database feature points D1, D2, D3, D5, and D6, and the database corresponding to all sub-feature vectors in the class to which database class center P2 belongs
  • the feature points include database feature points D1, D2, D3, D7, D8, and D9.
  • the database feature points corresponding to all sub-feature vectors in the class to which the database class center P3 belongs include database feature points D1, D3, D4, and D10.
  • D1 and D3 are respectively determined as candidate database feature points corresponding to the feature point A of the query image.
  • the number of candidate database feature points corresponding to each feature point of the query image may be one or more, for example, 25 at most. That is, for any feature point of the query image, multiple database feature points closest to the feature point may be used as candidate database feature points corresponding to the feature point.
  • the candidate database feature points corresponding to the feature points of the query image are determined according to the database class centers that match with multiple sub-feature vectors of the feature points of the query image, and then the candidate database feature points are analyzed.
  • the geometric verification is to determine the first group of database feature points that match the feature points of the query image, so that the first group of database feature points that match the feature points of the query image can be quickly and accurately determined.
  • performing geometric verification on the candidate database feature points and determining a first group of database feature points matching the feature points of the query image includes: determining the candidate database feature points and the corresponding query image The similarity transformation matrix between the feature points; in a plurality of preset matrix intervals, determine the matrix interval to which the similarity transformation matrix belongs; The matrix interval is determined as the target matrix interval; according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval, the first group of database feature points matching the feature points of the query image is determined.
  • the feature point of any candidate database feature point corresponding to the query image represents the feature point of the query image that matches the candidate database feature point.
  • a similarity transformation matrix between the candidate database feature point and the corresponding query image feature point can be constructed according to the coordinates, scale and rotation angle of the candidate database feature point.
  • the similarity transformation matrix consists of 4 elements
  • the preset matrix interval includes the value range of each element in the similarity transformation matrix.
  • the preset matrix interval can be expressed as According to the value of each element in the similarity transformation matrix and the value range of each element in the preset matrix interval, the matrix interval to which each similarity transformation matrix belongs can be determined, so that the number of similar transformation matrices in each matrix interval can be determined. .
  • the first quantity condition may be that the number of similar transformation matrices is greater than or equal to the second preset value.
  • the matrix interval is determined as the target matrix interval.
  • the first quantity condition may be the M matrix intervals that belong to the largest number of similar transformation matrices, where M is a positive integer. According to the number of similar transformation matrices in each matrix interval, M matrix intervals with the largest number of similar transformation matrices can be determined, and the M matrix intervals with the largest number of similar transformation matrices can be respectively determined as target matrix intervals.
  • the first quantity condition may be that the number of similar transformation matrices is greater than or equal to the second preset value, and belongs to the M matrix intervals with the largest number of similar transformation matrices.
  • the matrix interval can be determined as the target matrix interval.
  • geometric verification is performed by means of matrix interval voting, so that the feature points matching the feature points of the query image can be quickly determined, thereby improving the visual positioning speed.
  • the determining the first group of database feature points matching the feature points of the query image according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval includes: determining a backup Select the database image to which the database feature point belongs, wherein the candidate database feature point represents the candidate database feature point corresponding to the similarity transformation matrix in the target matrix interval; the database image that satisfies the second quantity condition according to the candidate database feature point
  • the candidate database feature points in the first group of database feature points are determined. Accordingly, the candidate database feature points can be filtered to obtain the first set of database feature points, thereby determining the visual positioning result of the query image based on the first set of database feature points, which helps to improve the accuracy of the determined visual positioning result.
  • the second quantity condition may be greater than or equal to the first preset value, for example, the first preset value is equal to 12.
  • the candidate database feature points in any database image satisfy the second quantity condition, it may be determined that the candidate database feature points in any database image belong to the first group of database feature points.
  • the database image with the most feature points of the candidate database may be selected from the database images whose feature points of the candidate database satisfy the second quantity condition.
  • the first N database images, and the candidate database feature points in the N database images are determined as belonging to the first group of database feature points.
  • N is a positive integer, for example, N equals 30.
  • the candidate database feature points in all database images whose feature points of the candidate database meet the second quantity condition may be determined as the first group of database feature points.
  • the visual positioning result of the query image is a positioning failure.
  • RANSAC Random Sample Consensus
  • the searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image further includes: determining that the first group of database feature points corresponds to three-dimensional coordinates; determine the second group of database feature points corresponding to the three-dimensional coordinates; the second group of database feature points are those other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates database feature points; determining the visual positioning result of the query image according to the first group of database feature points and the second group of database feature points.
  • the three-dimensional coordinates corresponding to the first group of database feature points may be determined.
  • a three-dimensional coordinate can correspond to multiple database feature points.
  • all the database feature points corresponding to the three-dimensional coordinates can be determined, and the database feature points corresponding to the three-dimensional coordinates other than the first group of database feature points can be determined.
  • the database feature points of are determined as the second group of database feature points.
  • the 2D feature points in the database picture that match the 2D feature points in the query picture are determined, and then the 2D feature points in the query picture are obtained according to the correspondence between the 2D feature points and the 3D feature points of the database picture.
  • the corresponding relationship between points and 3D feature points compared with the related art, which only uses the matching of 2D feature points to 3D feature points for positioning, the embodiment of the present disclosure can increase the number of associated point pairs through reverse search, Thus, the robustness of visual positioning can be improved.
  • the associated point pair represents the database feature point and the corresponding three-dimensional coordinate.
  • step S13 the visual positioning result of the query image is determined according to the matched database feature points.
  • the visual positioning result of the query image may include pose information corresponding to the query image.
  • the pose information may include one or both of position information and attitude information.
  • the position information may be represented by coordinates, and the attitude information may be represented by angles.
  • the visual positioning result of the query image may include six degrees of freedom pose information of the query image.
  • a method such as Perspective-n-Point (PnP) may be used to determine the visual positioning result of the query image.
  • PnP Perspective-n-Point
  • an efficient perspective n-point Efficient Perspective-n-Point, EPnP
  • perspective 3-point Perspective-3-Point, P3P
  • direct least squares Direct Least-Squares, DLS
  • the third preset value may be equal to 12.
  • the pose information corresponding to the query image can be obtained.
  • the interior points can represent the feature points that are correctly matched in the case of solving the pose.
  • the inliers can be determined according to the inlier_mask of the RANSAC algorithm.
  • the pose information corresponding to the query image can also be optimized by a nonlinear optimizer to obtain the final visual positioning result.
  • a query image may be collected by the user equipment, and the user equipment sends a visual positioning request to the cloud server, where the visual positioning request carries the query image; the cloud server uses the visual positioning method provided by the embodiment of the present disclosure to perform processing, to obtain the visual positioning result of the query image, and return the visual positioning result of the query image to the user equipment.
  • the user equipment may be a device with a camera function, such as a mobile phone.
  • the visual positioning request may also include camera intrinsic parameter information of the user equipment, for example, may include the focal length and the position of the principal point.
  • the embodiments of the present disclosure can be applied to various application scenarios such as positioning and navigation systems, high-precision maps, and augmented reality products.
  • the embodiments of the present disclosure can be used to provide visual positioning and navigation services in large indoor scenes such as shopping malls, airports, and museums, and solve the problem that effective positioning cannot be performed in indoor scenes because there is no GPS signal.
  • high-precision maps can be enhanced to achieve higher-precision positioning combined with GPS signals, and visual positioning services can be provided in places with weak outdoor GPS signals.
  • the embodiments of the present disclosure can quickly obtain the six-degree-of-freedom position and attitude information of the user equipment, the embodiments of the present disclosure can be applied to augmented reality applications.
  • multiple photos of shopping malls can be taken first as database images.
  • transform the database image to obtain multiple transformed images corresponding to the database image; perform feature extraction on the database image and multiple transformed images corresponding to the database image to obtain the features of the database image
  • the feature vector of the point that is, the feature vector of the database feature point.
  • the feature vector of the database feature point can be decomposed to obtain multiple sub-feature vectors of the database feature point.
  • the sub-feature vectors of all database feature points are clustered to obtain multiple database class centers.
  • any database feature point establish the corresponding relationship between the database feature point and the database class center.
  • the robot can use the currently collected image as a query image. Transform the query image to obtain multiple transformed images corresponding to the query image; perform feature extraction on the query image and the multiple transformed images corresponding to the query image to obtain feature vectors of feature points of the query image.
  • the feature vector of the feature points of the query image is decomposed to obtain multiple sub-feature vectors of the feature points of the query image. Find the database class centers that match the multiple sub-feature vectors of the feature points of the query image, and determine the first set of database features that match the feature points of the query image according to the database class centers that match the multiple sub-feature vectors of the feature points of the query image. point.
  • the visual positioning result of the query image is determined, that is, the current position information of the robot in the shopping mall and the current posture information of the robot are determined.
  • the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the execution order of each step should be based on its function and possible intrinsic Logical OK.
  • embodiments of the present disclosure also provide visual positioning devices, electronic devices, computer-readable storage media, and programs, all of which can be used to implement any of the visual positioning methods provided by the embodiments of the present disclosure, and the corresponding technical solutions and descriptions and refer to the methods. Some of the corresponding records will not be repeated.
  • FIG. 5 shows a block diagram of a visual positioning apparatus provided by an embodiment of the present disclosure.
  • the visual positioning device includes: a first extraction part 51 configured to extract feature vectors of the feature points of the query image; a search part 52 configured to extract feature vectors of the feature points of the query image according to the feature vectors of the query image , searching for the database feature points matching the feature points of the query image, wherein the database feature points represent the feature points of the database image; the determining part 53 is configured to determine the query based on the matched database feature points The visual localization result of the image.
  • the first extraction part 51 is configured to: perform transformation processing on the query image to obtain at least one transformed image corresponding to the query image; Feature extraction is performed on at least two images in the images to obtain feature vectors of feature points of the query image.
  • the first extraction part 51 is configured to: input at least two images of the query image and the at least one transformed image into a first neural network respectively, A neural network outputs the feature maps of the at least two images; performs grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results; performs feature on the at least two grouped convolution results Fusion to obtain the feature vector of the feature points of the query image.
  • the searching part 52 is configured to: decompose the feature vector of the feature points of the query image to obtain multiple sub-feature vectors of the feature points of the query image, wherein the The dimension of the sub-feature vector of the feature point of the query image is less than the dimension of the feature vector of the feature point of the query image; find the database class center that matches the multiple sub-feature vectors of the feature point of the query image, wherein all the The database class center represents the class center of the sub-feature vector of the database feature point; according to the database class center matched with the multiple sub-feature vectors of the feature point of the query image, determine the first group matching the feature point of the query image. Database feature points.
  • the apparatus further includes: a second extraction part configured to extract feature vectors of multiple database feature points; a decomposition part configured to extract feature vectors for any of the multiple database feature points; A database feature point, decompose the feature vector of any database feature point to obtain a plurality of sub-feature vectors of any database feature point, wherein the dimension of the sub-feature vector of any database feature point is less than The dimension of the feature vector of the feature points of any database; the clustering part is configured to cluster the sub-feature vectors of the multiple database feature points to obtain the database class center; the establishment part is configured to establish all Describe the correspondence between any database feature point and the database class center.
  • the searching part 52 is configured to: determine the candidate database corresponding to the feature points of the query image according to the database class centers matching a plurality of sub-feature vectors of the feature points of the query image Feature points; perform geometric verification on the candidate database feature points, and determine a first group of database feature points matching the feature points of the query image.
  • the searching part 52 is configured to: determine the similarity transformation matrix between the feature points of the candidate database and the feature points of the corresponding query image; in a plurality of preset matrix intervals, Determine the matrix interval to which the similarity transformation matrix belongs; determine the matrix interval in which the number of similar transformation matrices in the plurality of matrix intervals satisfies the first quantity condition as the target matrix interval; according to the similarity transformation matrix in the target matrix interval For the corresponding candidate database feature points, the first group of database feature points matching the feature points of the query image is determined.
  • the searching part 52 is configured to: determine the database image to which the candidate database feature point belongs, wherein the candidate database feature point indicates that the similarity transformation matrix in the target matrix interval corresponds to The candidate database feature points of the candidate database; the first group of database feature points is determined according to the candidate database feature points in the database images whose candidate database feature points satisfy the second quantity condition.
  • the searching part 52 is configured to: determine three-dimensional coordinates corresponding to the first group of database feature points; determine a second group of database feature points corresponding to the three-dimensional coordinates;
  • the group database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates; according to the first group of database feature points and the second group of database feature points , and determine the visual positioning result of the query image.
  • the positioning process is more direct and effective, the memory consumption is lower, the time-consuming of visual positioning can be reduced, and the positioning process is more reliable.
  • the functions or included parts of the apparatus provided in the embodiments of the present disclosure may be configured to execute the methods described in the above method embodiments.
  • a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, a unit, a module or a non-modularity.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
  • Embodiments of the present disclosure also provide a computer program product, including computer-readable codes.
  • a processor in the device executes a method for implementing the visual positioning method provided by any of the above embodiments. instruction.
  • Embodiments of the present disclosure further provide another computer program product for storing computer-readable instructions, which, when executed, cause the computer to perform the operations of the visual positioning method provided by any of the foregoing embodiments.
  • Embodiments of the present disclosure further provide an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke executable instructions stored in the memory instruction to execute the above method.
  • the electronic device may be provided as a terminal, server or other form of device.
  • FIG. 6 shows a block diagram of an electronic device 800 provided by an embodiment of the present disclosure.
  • electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc. terminal.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816 .
  • the processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 806 provides power to various components of electronic device 800 .
  • Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
  • Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or transmitted via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 .
  • the sensor assembly 814 can detect the on/off state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 can also detect the electronic device 800 or one of the electronic device 800 Changes in the position of components, presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices.
  • the electronic device 800 may access wireless networks based on communication standards, such as Wi-Fi, 2G, 3G, 4G/LTE, 5G, or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmed gate array
  • controller microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • a non-volatile computer-readable storage medium such as a memory 804 comprising computer program instructions executable by the processor 820 of the electronic device 800 to perform the above method is also provided.
  • FIG. 7 shows a block diagram of an electronic device 1900 provided by an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource, represented by memory 1932, for storing instructions, such as applications, executable by the processing component 1922.
  • An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • Electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows or similar.
  • a non-volatile computer-readable storage medium such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
  • a computer program comprising computer readable code which, when executed in an electronic device, implements the above method when executed by a processor in the electronic device.
  • Embodiments of the present disclosure may be systems, methods and/or computer program products.
  • the computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Examples (a non-exhaustive list) of computer readable storage media may include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory) ), static random access memory (SRAM), portable compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards with instructions stored thereon Or the protruding structure in the groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory sticks floppy disks, mechanically encoded devices such as punch cards with instructions stored thereon Or the protruding structure in the groove, and any suitable combination of the above.
  • Computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
  • the computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • the computer program instructions for carrying out the operations of the disclosed embodiments may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or programmed in one or more Source or object code written in any combination of languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages.
  • the computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect).
  • LAN local area network
  • WAN wide area network
  • custom electronic circuits such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs)
  • FPGAs field programmable gate arrays
  • PDAs programmable logic arrays
  • Computer readable program instructions are executed to implement various aspects of the embodiments of the present disclosure.
  • These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the computer program product can be implemented in hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in other embodiments of the present disclosure, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
  • a software development kit Software Development Kit, SDK
  • Embodiments of the present disclosure relate to a visual positioning method and apparatus, an electronic device, and a computer-readable storage medium.
  • the method includes: extracting a feature vector of a feature point of a query image; searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image, wherein the database feature point represents feature points of the database image; determine the visual positioning result of the query image according to the matched database feature points.
  • the visual positioning result of the query image is described, so there is no need to retrieve and obtain a local map in the visual positioning, and feature point matching is performed directly, and the visual positioning result of the query image is determined according to the database feature points matching the feature points of the query image, so that the positioning process It is more direct and effective, with lower memory consumption, which can reduce the time-consuming of visual positioning, and the positioning process is more reliable.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Library & Information Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A visual positioning method and apparatus, an electronic device, and a storage medium. The method comprises: extracting a feature vector of a feature point of a query image (S11); searching, according to the feature vector of the feature point of the query image, for a database feature point that matches the feature point of the query image, the database feature point representing a feature point of a database image (S12); and determining a visual positioning result of the query image according to the matched database feature point (S13).

Description

视觉定位方法及装置、电子设备和计算机可读存储介质Visual positioning method and apparatus, electronic device and computer-readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开实施例基于申请号为202010710996.0、申请日为2020年07月22日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The embodiments of the present disclosure are based on a Chinese patent application with an application number of 202010710996.0 and an application date of July 22, 2020, and claim the priority of the Chinese patent application. The entire content of the Chinese patent application is incorporated herein by reference.
技术领域technical field
本公开实施例涉及计算机视觉技术领域,尤其涉及一种视觉定位方法及装置、电子设备和计算机可读存储介质。The embodiments of the present disclosure relate to the technical field of computer vision, and in particular, to a visual positioning method and apparatus, an electronic device, and a computer-readable storage medium.
背景技术Background technique
随着信息技术的不断发展,定位技术对人们的生活日趋重要。传统的定位技术主要包括基于GPS(Global Position System,全球定位系统)的定位技术、基于无线局域网络或者蓝牙的定位技术、基于超宽带的定位技术等。这些传统的定位技术均存在一定的局限性。其中,GPS信号穿透能力较差,在建筑物密集的环境或者室内环境中,较难实现有效和精准的定位。此外,即使是在空旷场景中,在要实现高精定位的情况下,也需要造价较高的专业GPS设备,因此较难实现消费级的应用。基于无线局域网或者蓝牙的定位技术需要预先在待定位区域布置相关设备,布置过程繁琐,可靠性和精度较差,并且定位范围较小。基于超宽带的定位技术相对来说可达到较高的精度,但其需要至少三个接收机,且发射机和接收机之间需要保持空旷,这导致基于超宽带的定位技术的应用场景受限。对于大场景而言,基于超宽带的定位技术往往需要成倍增加接收机数量,系统可靠性较差。另外,上述定位技术通常只能获得位置信息,较难获取可靠的姿态信息。With the continuous development of information technology, positioning technology is increasingly important to people's lives. Traditional positioning technologies mainly include positioning technology based on GPS (Global Position System, global positioning system), positioning technology based on wireless local area network or Bluetooth, and positioning technology based on ultra-wideband. These traditional positioning technologies all have certain limitations. Among them, the GPS signal penetration ability is poor, and it is difficult to achieve effective and accurate positioning in a densely built environment or an indoor environment. In addition, even in an open scene, in order to achieve high-precision positioning, professional GPS equipment with a high cost is required, so it is difficult to achieve consumer-level applications. The positioning technology based on wireless local area network or Bluetooth needs to pre-arrange relevant devices in the to-be-located area, the layout process is cumbersome, the reliability and accuracy are poor, and the positioning range is small. UWB-based positioning technology can achieve relatively high accuracy, but it requires at least three receivers, and the space between the transmitter and receiver needs to be kept open, which limits the application scenarios of UWB-based positioning technology . For large scenarios, the UWB-based positioning technology often needs to multiply the number of receivers, resulting in poor system reliability. In addition, the above-mentioned positioning technology can usually only obtain position information, and it is difficult to obtain reliable attitude information.
近年来,随着视觉定位技术的不断成熟,基于视觉的定位方法得到越来越多的应用。相比于传统的定位技术,视觉定位技术不仅信息获取方式较简单,也不需要对定位场景进行太大的改动。此外,视觉定位技术不仅能定位出位置信息,还能定位出姿态信息,使得定位结果不仅能服务于常规的位置信息获取的需求,还可实现更多的智能化应用,如增强现实等。然而,相关技术,视觉定位的速度较低。In recent years, with the continuous maturity of visual positioning technology, vision-based positioning methods have been used more and more. Compared with the traditional positioning technology, the visual positioning technology not only has a simpler way of obtaining information, but also does not require much modification to the positioning scene. In addition, the visual positioning technology can not only locate the position information, but also locate the attitude information, so that the positioning results can not only serve the needs of conventional position information acquisition, but also realize more intelligent applications, such as augmented reality. However, in the related art, the speed of visual localization is low.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供了一种视觉定位技术方案。The embodiments of the present disclosure provide a technical solution for visual positioning.
根据本公开实施例的一方面,提供了一种视觉定位方法,包括:According to an aspect of the embodiments of the present disclosure, a visual positioning method is provided, including:
提取查询图像的特征点的特征向量;Extract the feature vector of the feature points of the query image;
根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点;According to the feature vector of the feature points of the query image, search for the database feature points matching the feature points of the query image, wherein the database feature points represent the feature points of the database image;
根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。According to the matched database feature points, the visual positioning result of the query image is determined.
通过提取查询图像的特征点的特征向量,根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,并根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果,由此在视觉定位中无需检索获取局部地图,直接进行特征点匹配,根据与查询图像的特征点匹配的数据库特征点确定查询图像的视觉定位结果,从而使得定位过程更加直接有效,内存消耗更低,能够减少视觉定位的耗时,且定位过程更加可靠。By extracting the feature vectors of the feature points of the query image, searching for the database feature points matching the feature points of the query image according to the feature vectors of the feature points of the query image, and determining the database feature points according to the matched database feature points. The visual positioning result of the query image is described, so that there is no need to retrieve and obtain a local map in the visual positioning, feature point matching is performed directly, and the visual positioning result of the query image is determined according to the database feature points matching the feature points of the query image, so that the positioning process It is more direct and effective, with lower memory consumption, which can reduce the time-consuming of visual positioning, and the positioning process is more reliable.
在一种可能的实现方式中,所述提取查询图像的特征点的特征向量,包括:In a possible implementation manner, the extracting feature vectors of feature points of the query image includes:
对查询图像进行变换处理,得到所述查询图像对应的至少一个变换图像;Transforming the query image to obtain at least one transformed image corresponding to the query image;
对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量。Feature extraction is performed on at least two images of the query image and the at least one transformed image to obtain feature vectors of feature points of the query image.
在该实现方式中,通过对查询图像进行变换处理,再利用所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,由此得到的查询图像的特征点的特征向量能够反映查询图像中更丰富、全面的信息,且所提取的特征向量对于光照等环境变化具有较强的鲁棒性,从而有助于提高视觉定位的准确性。In this implementation manner, by performing transformation processing on the query image, and then using at least two images in the query image and the at least one transformed image to perform feature extraction, the obtained feature vectors of the feature points of the query image can be It reflects the richer and more comprehensive information in the query image, and the extracted feature vector has strong robustness to environmental changes such as illumination, thereby helping to improve the accuracy of visual positioning.
在一种可能的实现方式中,所述对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量,包括:In a possible implementation manner, performing feature extraction on at least two images in the query image and the at least one transformed image to obtain a feature vector of feature points of the query image, including:
将所述查询图像和所述至少一个变换图像中的至少两个图像分别输入第一神经网络中,经由所述第一神经网络输出所述至少两个图像的特征图;Inputting at least two images of the query image and the at least one transformed image into a first neural network respectively, and outputting feature maps of the at least two images via the first neural network;
对所述至少两个图像的特征图进行分组卷积,得到至少两项分组卷积结果;Performing grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results;
对所述至少两项分组卷积结果进行特征融合,得到所述查询图像的特征点的特征向量。Feature fusion is performed on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
在该实现方式中,通过对所述至少两个图像的特征图进行分组卷积,由此能够获得查询图像的深层特征,从而能够提高后续进行特征点匹配的鲁棒性,提高视觉定位的可靠性。In this implementation, by performing group convolution on the feature maps of the at least two images, the deep features of the query image can be obtained, thereby improving the robustness of subsequent feature point matching and improving the reliability of visual positioning. sex.
在一种可能的实现方式中,所述根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,包括:In a possible implementation manner, the searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image includes:
将所述查询图像的特征点的特征向量进行分解,得到所述查询图像的特征点的多个子特征向量,其中,所述查询图像的特征点的子特征向量的维数小于所述查询图像的特征点的特征向量的维数;Decompose the feature vector of the feature points of the query image to obtain a plurality of sub-feature vectors of the feature points of the query image, wherein the dimension of the sub-feature vectors of the feature points of the query image is smaller than the dimension of the query image. The dimension of the feature vector of the feature point;
查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,其中,所述数据库类中心表示数据库特征点的子特征向量的类中心;Finding a database class center that matches a plurality of sub-feature vectors of the feature points of the query image, wherein the database class center represents the class center of the sub-feature vectors of the database feature points;
根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点。A first group of database feature points that match the feature points of the query image is determined according to the database class centers that match a plurality of sub-feature vectors of the feature points of the query image.
该实现方式通过将查询图像的特征点的特征向量分解为较低维的子特征向量后再进行匹配,由此能够提高确定与查询图像的特征点匹配的数据库特征点的速度。In this implementation, the feature vector of the feature points of the query image is decomposed into lower-dimensional sub-feature vectors before matching, thereby improving the speed of determining the database feature points matching the feature points of the query image.
在一种可能的实现方式中,在所述查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心之前,所述方法还包括:In a possible implementation manner, before the searching for a database class center matching a plurality of sub-feature vectors of the feature points of the query image, the method further includes:
提取多个数据库特征点的特征向量;Extract feature vectors of multiple database feature points;
对于所述多个数据库特征点中的任一数据库特征点,将所述任一数据库特征点的特征向量进行分解,得到所述任一数据库特征点的多个子特征向量,其中,所述任一数据库特征点的子特征向量的维数小于所述任一数据库特征点的特征向量的维数;For any database feature point among the plurality of database feature points, the feature vector of the any database feature point is decomposed to obtain a plurality of sub-feature vectors of the any database feature point, wherein the any one The dimension of the sub-feature vector of the database feature point is less than the dimension of the feature vector of any of the database feature points;
对所述多个数据库特征点的子特征向量进行聚类,得到数据库类中心;Clustering the sub-feature vectors of the multiple database feature points to obtain a database class center;
建立所述任一数据库特征点与数据库类中心之间的对应关系。A corresponding relationship between any of the database feature points and the database class center is established.
在该实现方式中,只需存储数据库类中心和数据库特征点与数据库类中心的对应关系,无需存储数据库特征点的特征向量(高维向量),由此能够节省存储空间,节省计算内存,提高查找速度。In this implementation, only the database class center and the corresponding relationship between the database feature points and the database class center need to be stored, and the feature vector (high-dimensional vector) of the database feature point does not need to be stored, thereby saving storage space, saving computing memory, and improving Find speed.
在一种可能的实现方式中,所述根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:In a possible implementation manner, determining the first group of database feature points matching the feature points of the query image according to the database class centers matched with multiple sub-feature vectors of the feature points of the query image, including :
根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点;Determine the candidate database feature points corresponding to the feature points of the query image according to the database class centers matching the multiple sub-feature vectors of the feature points of the query image;
对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点。Geometric verification is performed on the candidate database feature points, and a first group of database feature points matching the feature points of the query image is determined.
在该实现方式中,通过根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点,再对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点,由此能够快 速、准确地确定与查询图像的特征点匹配的第一组数据库特征点。In this implementation, the candidate database feature points corresponding to the feature points of the query image are determined according to the database class centers that match with multiple sub-feature vectors of the feature points of the query image, and then the candidate database feature points are determined. Geometric verification is performed to determine the first group of database feature points that match the feature points of the query image, so that the first group of database feature points that match the feature points of the query image can be quickly and accurately determined.
在一种可能的实现方式中,所述对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:In a possible implementation manner, performing geometric verification on the candidate database feature points to determine the first group of database feature points matching the feature points of the query image, including:
确定所述候选数据库特征点与相应的查询图像的特征点之间的相似变换矩阵;determining the similarity transformation matrix between the feature points of the candidate database and the feature points of the corresponding query image;
在预设的多个矩阵区间中,确定所述相似变换矩阵所属的矩阵区间;In a plurality of preset matrix intervals, determine the matrix interval to which the similarity transformation matrix belongs;
将所述多个矩阵区间中相似变换矩阵的数量满足第一数量条件的矩阵区间,确定为目标矩阵区间;Determining a matrix interval where the number of similar transformation matrices in the plurality of matrix intervals satisfies the first quantity condition as a target matrix interval;
根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的所述第一组数据库特征点。According to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval, the first group of database feature points matching the feature points of the query image is determined.
该实现方式通过矩阵区间投票的方式进行几何验证,由此能够快速确定与查询图像的特征点匹配的特征点,从而能够提高视觉定位速度。In this implementation, geometric verification is performed by means of matrix interval voting, so that the feature points matching the feature points of the query image can be quickly determined, thereby improving the visual positioning speed.
在一种可能的实现方式中,所述根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的所述第一组数据库特征点,包括:In a possible implementation manner, determining the first group of database feature points matching the feature points of the query image according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval, including :
确定备选数据库特征点所属的数据库图像,其中,所述备选数据库特征点表示所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点;Determine the database image to which the candidate database feature point belongs, wherein the candidate database feature point represents the candidate database feature point corresponding to the similarity transformation matrix in the target matrix interval;
根据备选数据库特征点满足第二数量条件的数据库图像中的备选数据库特征点,确定所述第一组数据库特征点。The first group of database feature points is determined according to candidate database feature points in the database image whose candidate database feature points satisfy the second quantity condition.
根据该实现方式,可以对备选数据库特征点进行过滤得到第一组数据库特征点,由此基于第一组数据库特征点确定查询图像的视觉定位结果,有助于提高所确定的视觉定位结果的准确性。According to this implementation, the candidate database feature points can be filtered to obtain the first set of database feature points, thereby determining the visual positioning result of the query image based on the first set of database feature points, which helps to improve the accuracy of the determined visual positioning result. accuracy.
在一种可能的实现方式中,所述根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,还包括:In a possible implementation manner, the searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image, further includes:
确定所述第一组数据库特征点对应的三维坐标;determining the three-dimensional coordinates corresponding to the first group of database feature points;
确定所述三维坐标对应的第二组数据库特征点;所述第二组数据库特征点为与所述三维坐标对应的多组数据库特征点中所述第一组数据库特征点以外的数据库特征点;Determine the second group of database feature points corresponding to the three-dimensional coordinates; the second group of database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates;
根据所述第一组数据库特征点和所述第二组数据库特征点,确定所述查询图像的视觉定位结果。According to the first set of database feature points and the second set of database feature points, a visual positioning result of the query image is determined.
该实现方式通过反向搜索,能够增加关联点对的数量,从而能够提高视觉定位的鲁棒性。This implementation can increase the number of associated point pairs through reverse search, thereby improving the robustness of visual positioning.
根据本公开实施例的一方面,提供了一种视觉定位装置,包括:According to an aspect of the embodiments of the present disclosure, a visual positioning device is provided, comprising:
第一提取部分,被配置为提取查询图像的特征点的特征向量;a first extraction part configured to extract feature vectors of feature points of the query image;
查找部分,被配置为根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点;a search section configured to search for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image, wherein the database feature point represents the feature point of the database image;
确定部分,被配置为根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。The determining part is configured to determine the visual positioning result of the query image according to the matched database feature points.
在一种可能的实现方式中,所述第一提取部分被配置为:In a possible implementation manner, the first extraction part is configured as:
对查询图像进行变换处理,得到所述查询图像对应的至少一个变换图像;Transforming the query image to obtain at least one transformed image corresponding to the query image;
对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量。Feature extraction is performed on at least two images of the query image and the at least one transformed image to obtain feature vectors of feature points of the query image.
在一种可能的实现方式中,所述第一提取部分被配置为:In a possible implementation manner, the first extraction part is configured as:
将所述查询图像和所述至少一个变换图像中的至少两个图像分别输入第一神经网络中,经由所述第一神经网络输出所述至少两个图像的特征图;Inputting at least two images of the query image and the at least one transformed image into a first neural network respectively, and outputting feature maps of the at least two images via the first neural network;
对所述至少两个图像的特征图进行分组卷积,得到至少两项分组卷积结果;Performing grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results;
对所述至少两项分组卷积结果进行特征融合,得到所述查询图像的特征点的特征向量。Feature fusion is performed on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
在一种可能的实现方式中,所述查找部分被配置为:In a possible implementation, the lookup section is configured as:
将所述查询图像的特征点的特征向量进行分解,得到所述查询图像的特征点的多个子特征向量,其中,所述查询图像的特征点的子特征向量的维数小于所述查询图像的特征点的特征向量的维数;Decompose the feature vector of the feature points of the query image to obtain a plurality of sub-feature vectors of the feature points of the query image, wherein the dimension of the sub-feature vectors of the feature points of the query image is smaller than the dimension of the query image. The dimension of the feature vector of the feature point;
查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,其中,所述数据库类中心表示数据库特征点的子特征向量的类中心;Finding a database class center that matches a plurality of sub-feature vectors of the feature points of the query image, wherein the database class center represents the class center of the sub-feature vectors of the database feature points;
根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点。A first group of database feature points that match the feature points of the query image is determined according to the database class centers that match a plurality of sub-feature vectors of the feature points of the query image.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
第二提取部分,被配置为提取多个数据库特征点的特征向量;The second extraction part is configured to extract feature vectors of multiple database feature points;
分解部分,被配置为对于所述多个数据库特征点中的任一数据库特征点,将所述任一数据库特征点的特征向量进行分解,得到所述任一数据库特征点的多个子特征向量,其中,所述任一数据库特征点的子特征向量的维数小于所述任一数据库特征点的特征向量的维数;The decomposition part is configured to decompose the feature vector of any database feature point for any database feature point in the plurality of database feature points to obtain a plurality of sub-feature vectors of the any database feature point, Wherein, the dimension of the sub-feature vector of the feature point of any database is less than the dimension of the feature vector of the feature point of any database;
聚类部分,被配置为对所述多个数据库特征点的子特征向量进行聚类,得到数据库类中心;The clustering part is configured to cluster the sub-feature vectors of the plurality of database feature points to obtain the database class center;
建立部分,被配置为建立所述任一数据库特征点与数据库类中心之间的对应关系。The establishing part is configured to establish the corresponding relationship between the feature point of any database and the database class center.
在一种可能的实现方式中,所述查找部分被配置为:In a possible implementation, the lookup section is configured as:
根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点;Determine the candidate database feature points corresponding to the feature points of the query image according to the database class centers matching the multiple sub-feature vectors of the feature points of the query image;
对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点。Geometric verification is performed on the candidate database feature points, and a first group of database feature points matching the feature points of the query image is determined.
在一种可能的实现方式中,所述查找部分被配置为:In a possible implementation, the lookup section is configured as:
确定所述候选数据库特征点与相应的查询图像的特征点之间的相似变换矩阵;determining the similarity transformation matrix between the feature points of the candidate database and the feature points of the corresponding query image;
在预设的多个矩阵区间中,确定所述相似变换矩阵所属的矩阵区间;In a plurality of preset matrix intervals, determine the matrix interval to which the similarity transformation matrix belongs;
将所述多个矩阵区间中相似变换矩阵的数量满足第一数量条件的矩阵区间,确定为目标矩阵区间;Determining a matrix interval where the number of similar transformation matrices in the plurality of matrix intervals satisfies the first quantity condition as a target matrix interval;
根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的所述第一组数据库特征点。According to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval, the first group of database feature points matching the feature points of the query image is determined.
在一种可能的实现方式中,所述查找部分被配置为:In a possible implementation, the lookup section is configured as:
确定备选数据库特征点所属的数据库图像,其中,所述备选数据库特征点表示所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点;Determine the database image to which the candidate database feature point belongs, wherein the candidate database feature point represents the candidate database feature point corresponding to the similarity transformation matrix in the target matrix interval;
根据备选数据库特征点满足第二数量条件的数据库图像中的备选数据库特征点,确定所述第一组数据库特征点。The first group of database feature points is determined according to candidate database feature points in the database image whose candidate database feature points satisfy the second quantity condition.
在一种可能的实现方式中,所述查找部分被配置为:In a possible implementation, the lookup section is configured as:
确定所述第一组数据库特征点对应的三维坐标;determining the three-dimensional coordinates corresponding to the first group of database feature points;
确定所述三维坐标对应的第二组数据库特征点;所述第二组数据库特征点为与所述三维坐标对应的多组数据库特征点中所述第一组数据库特征点以外的数据库特征点;Determine the second group of database feature points corresponding to the three-dimensional coordinates; the second group of database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates;
根据所述第一组数据库特征点和所述第二组数据库特征点,确定所述查询图像的视觉定位结果。According to the first set of database feature points and the second set of database feature points, a visual positioning result of the query image is determined.
根据本公开实施例的一方面,提供了一种电子设备,包括:一个或多个处理器;被配置为存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。According to an aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising: one or more processors; a memory configured to store executable instructions; wherein the one or more processors are configured to invoke the executable instructions stored in the memory to perform the above method.
根据本公开实施例的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to an aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the above method when executed by a processor.
根据本公开实施例的一方面,提供了一种计算机程序,包括计算机可读代码,在所述 计算机可读代码在电子设备中运行的情况下,所述电子设备中的处理器执行时实现上述方法。According to an aspect of the embodiments of the present disclosure, a computer program is provided, including computer-readable codes, and when the computer-readable codes are executed in an electronic device, the processor in the electronic device implements the above when executed. method.
在本公开实施例中,通过提取查询图像的特征点的特征向量,根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,并根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果,由此在视觉定位中无需检索获取局部地图,直接进行特征点匹配,根据与查询图像的特征点匹配的数据库特征点确定查询图像的视觉定位结果,从而使得定位过程更加直接有效,内存消耗更低,能够减少视觉定位的耗时,且定位过程更加可靠。In the embodiment of the present disclosure, by extracting the feature vector of the feature points of the query image, searching for the database feature points matching the feature points of the query image according to the feature vector of the feature points of the query image, and according to the matching feature points The database feature points of the query image are determined, and the visual positioning result of the query image is determined, so that there is no need to retrieve and obtain a local map in the visual positioning, and feature point matching is performed directly. Therefore, the positioning process is more direct and effective, the memory consumption is lower, the time-consuming of visual positioning can be reduced, and the positioning process is more reliable.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开实施例。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the disclosed embodiments.
根据下面参考附图对示例性实施例的详细说明,本公开实施例的其它特征及方面将变得清楚。Other features and aspects of embodiments of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起被配置为说明本公开实施例的技术方案。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, are configured to illustrate the technical solutions of the embodiments of the present disclosure.
图1示出本公开实施例提供的视觉定位方法的流程图。FIG. 1 shows a flowchart of a visual positioning method provided by an embodiment of the present disclosure.
图2示出本公开实施例提供的示例性的对查询图像进行变换处理,得到查询图像对应的多个变换图像的示意图。FIG. 2 shows an exemplary schematic diagram of performing transformation processing on a query image to obtain multiple transformed images corresponding to the query image provided by an embodiment of the present disclosure.
图3示出本公开实施例提供的示例性的将查询图像和多个变换图像输入vanilla CNN,经由vanilla CNN输出查询图像和多个变换图像的特征图的示意图。FIG. 3 is a schematic diagram illustrating an exemplary input of a query image and multiple transformed images into a vanilla CNN, and outputting feature maps of the query image and multiple transformed images via the vanilla CNN provided by an embodiment of the present disclosure.
图4示出本公开实施例提供的示例性的过两个卷积神经网络对查询图像和多个变换图像的特征点进行分组卷积,并对分组卷积结果进行双线性池化,得到特征点的特征向量的示意图。FIG. 4 shows an exemplary embodiment of the present disclosure that performs grouped convolution on the feature points of a query image and multiple transformed images through two convolutional neural networks, and performs bilinear pooling on the grouped convolution results to obtain Schematic diagram of the eigenvectors of the feature points.
图5示出本公开实施例提供的视觉定位装置的框图。FIG. 5 shows a block diagram of a visual positioning apparatus provided by an embodiment of the present disclosure.
图6示出本公开实施例提供的一种电子设备800的框图。FIG. 6 shows a block diagram of an electronic device 800 provided by an embodiment of the present disclosure.
图7示出本公开实施例提供的一种电子设备1900的框图。FIG. 7 shows a block diagram of an electronic device 1900 provided by an embodiment of the present disclosure.
具体实施方式detailed description
以下将参考附图详细说明本公开实施例的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures denote elements that have the same or similar functions. While various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and A and B exist independently B these three cases. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
另外,为了更好地说明本公开实施例,在下文的具体实施方式中给出了众多的实施细节。本领域技术人员应当理解,没有某些细节,本公开实施例同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开实施例的主旨。In addition, in order to better illustrate the embodiments of the present disclosure, numerous implementation details are given in the following detailed description. It should be understood by those skilled in the art that embodiments of the present disclosure may be practiced without certain details. In some instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the embodiments of the present disclosure.
相关技术中,在进行视觉定位的情况下,查找与查询图像最接近的多张数据库图像, 得到局部地图,再在局部地图中将查询图像进行特征点匹配,得到查询图像的视觉定位结果。这种视觉定位方式的流程对计算内存的消耗较大,视觉定位速度较慢。In the related art, in the case of visual positioning, a plurality of database images closest to the query image are searched to obtain a local map, and then feature points of the query image are matched in the local map to obtain the visual positioning result of the query image. The process of this visual positioning method consumes a lot of computing memory, and the visual positioning speed is slow.
为了解决类似上文所述的技术问题,在本公开实施例中,通过提取查询图像的特征点的特征向量,根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,并根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果,由此在视觉定位中无需检索获取局部地图,直接进行特征点匹配,根据与查询图像的特征点匹配的数据库特征点确定查询图像的视觉定位结果,从而使得定位过程更加直接有效,内存消耗更低,能够减少视觉定位的耗时,且定位过程更加可靠。In order to solve the technical problem similar to the above, in the embodiment of the present disclosure, by extracting the feature vector of the feature points of the query image, and according to the feature vector of the feature points of the query image, the feature points related to the query image are searched for The matched database feature points, and according to the matched database feature points, the visual positioning result of the query image is determined, so that there is no need to retrieve and obtain a local map in the visual positioning, and feature point matching is performed directly. The point-matched database feature points determine the visual positioning result of the query image, so that the positioning process is more direct and effective, the memory consumption is lower, the time-consuming of visual positioning can be reduced, and the positioning process is more reliable.
图1示出本公开实施例提供的视觉定位方法的流程图。所述视觉定位方法的执行主体可以是视觉定位装置。例如,所述视觉定位方法可以由终端设备或云端服务器或其它处理设备执行。其中,终端设备可以是机器人、用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备或者可穿戴设备等。在一些可能的实现方式中,所述视觉定位方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。如图1所示,所述视觉定位方法包括步骤S11至步骤S13。FIG. 1 shows a flowchart of a visual positioning method provided by an embodiment of the present disclosure. The execution subject of the visual positioning method may be a visual positioning device. For example, the visual positioning method may be executed by a terminal device or a cloud server or other processing device. The terminal device may be a robot, a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device Or wearable devices, etc. In some possible implementations, the visual positioning method may be implemented by a processor invoking computer-readable instructions stored in a memory. As shown in FIG. 1 , the visual positioning method includes steps S11 to S13.
在步骤S11中,提取查询图像的特征点的特征向量。In step S11, feature vectors of feature points of the query image are extracted.
在本公开实施例中,查询图像的特征点可以与查询图像的像素相对应,即,查询图像的任一特征点在查询图像中的位置可以根据该特征点对应的像素唯一确定。从而,所提取的查询图像的特征点的特征向量能够提供像素级别的描述信息。查询图像的特征点的数量可以小于或等于查询图像的像素数。在一个例子中,查询图像的特征点的数量可以小于查询图像的像素数。例如,查询图像的特征点的数量的取值范围可以是500-2500个。In the embodiment of the present disclosure, the feature points of the query image may correspond to the pixels of the query image, that is, the position of any feature point of the query image in the query image may be uniquely determined according to the pixel corresponding to the feature point. Thus, the extracted feature vector of the feature points of the query image can provide pixel-level description information. The number of feature points of the query image may be less than or equal to the number of pixels of the query image. In one example, the number of feature points of the query image may be less than the number of pixels of the query image. For example, the value range of the number of feature points of the query image may be 500-2500.
在一种可能的实现方式中,所述提取查询图像的特征点的特征向量,包括:对查询图像进行变换处理,得到所述查询图像对应的至少一个变换图像;对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量。In a possible implementation manner, the extracting the feature vector of the feature points of the query image includes: transforming the query image to obtain at least one transformed image corresponding to the query image; Feature extraction is performed on at least two images in the at least one transformed image to obtain feature vectors of feature points of the query image.
作为该实现方式的一个示例,所述变换处理可以为旋转、缩放、镜像、扭曲变形等中的至少一种方式。图2示出对查询图像进行变换处理,得到查询图像对应的多个变换图像的示意图。As an example of this implementation manner, the transformation processing may be at least one of rotation, scaling, mirroring, distortion, and the like. FIG. 2 shows a schematic diagram of transforming a query image to obtain a plurality of transformed images corresponding to the query image.
作为该实现方式的一个示例,可以对查询图像进行变换处理,得到所述查询图像对应的多个变换图像,对所述查询图像和所述查询图像对应的多个变换图像进行特征提取,得到所述查询图像的特征点的特征向量。As an example of this implementation, a query image may be transformed to obtain multiple transformed images corresponding to the query image, and feature extraction is performed on the query image and multiple transformed images corresponding to the query image to obtain the query image. The feature vector of the feature points of the query image.
在该实现方式中,通过对查询图像进行变换处理,再利用所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,由此得到的查询图像的特征点的特征向量能够反映查询图像中更丰富、全面的信息,且所提取的特征向量对于光照等环境变化具有较强的鲁棒性,从而有助于提高视觉定位的准确性。In this implementation manner, by performing transformation processing on the query image, and then using at least two images in the query image and the at least one transformed image to perform feature extraction, the obtained feature vectors of the feature points of the query image can be It reflects the richer and more comprehensive information in the query image, and the extracted feature vector has strong robustness to environmental changes such as illumination, thereby helping to improve the accuracy of visual positioning.
作为该实现方式的一个示例,所述对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量,包括:将所述查询图像和所述至少一个变换图像中的至少两个图像分别输入第一神经网络中,经由所述第一神经网络输出所述至少两个图像的特征图;对所述至少两个图像的特征图进行分组卷积,得到至少两项分组卷积结果;对所述至少两项分组卷积结果进行特征融合,得到所述查询图像的特征点的特征向量。As an example of this implementation, the performing feature extraction on at least two images in the query image and the at least one transformed image to obtain a feature vector of feature points of the query image includes: extracting the query image The image and at least two images in the at least one transformed image are respectively input into the first neural network, and the feature maps of the at least two images are output through the first neural network; the feature maps of the at least two images are Perform group convolution to obtain at least two grouped convolution results; perform feature fusion on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
在该示例中,所述第一神经网络可以是卷积神经网络,例如可以是vanilla CNN等。图3示出将查询图像(图3中未示出)和多个变换图像输入vanilla CNN,经由vanilla CNN输出查询图像和多个变换图像的特征图的示意图。In this example, the first neural network may be a convolutional neural network, such as vanilla CNN or the like. FIG. 3 shows a schematic diagram of inputting a query image (not shown in FIG. 3 ) and a plurality of transformed images into a vanilla CNN, and outputting feature maps of the query image and the plurality of transformed images via the vanilla CNN.
根据该示例,能够获得密集的图像描述特征,即,能够提取大量特征点(例如500-2500个特征点)的特征向量。采用该示例提取的查询图像的特征点的特征向量可以称为GIFT (Group Invariant Feature Transform,群不变特征变换)特征。在该示例中,通过对所述至少两个图像的特征图进行分组卷积,由此能够获得查询图像的深层特征;而相关技术中,神经网络提取特征通常只利用了单个图片的信息,会有池化的过程,这个过程会造成一定量的图片信息的丧失,而GIFT利用了图片的多个变换图像,通过分组卷积获取特征的深层结构,代替了原来的池化过程,使得特征信息更加全面,从而能够提高后续进行特征点匹配的鲁棒性,提高视觉定位的可靠性。According to this example, dense image description features can be obtained, that is, feature vectors that can extract a large number of feature points (eg, 500-2500 feature points). The feature vector of the feature points of the query image extracted by this example may be called a GIFT (Group Invariant Feature Transform, group invariant feature transform) feature. In this example, by performing group convolution on the feature maps of the at least two images, the deep features of the query image can be obtained; while in the related art, the neural network usually only uses the information of a single image to extract features, which will There is a pooling process, which will cause the loss of a certain amount of image information, while GIFT uses multiple transformed images of the image to obtain the deep structure of the feature through grouping convolution, instead of the original pooling process. It is more comprehensive, so that the robustness of subsequent feature point matching can be improved, and the reliability of visual positioning can be improved.
在一个例子中,所述对所述至少两个图像的特征图进行分组卷积,得到至少两项分组卷积结果,包括:将所述至少两个图像的特征图划分为第一特征图组和第二特征图组;将所述第一特征图组输入第二神经网络,经由所述第二神经网络输出所述第一特征图组的分组卷积结果;将所述第二特征图组输入第三神经网络,经由所述第三神经网络输出所述第二特征图组的分组卷积结果。In an example, performing grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results includes: dividing the feature maps of the at least two images into a first feature map group and the second feature map group; input the first feature map group into the second neural network, and output the grouped convolution result of the first feature map group through the second neural network; A third neural network is input, and the grouped convolution result of the second feature map group is output via the third neural network.
其中,第一特征图组包括所述至少两个图像的特征图中的部分特征图,第二特征图组包括所述至少两个图像的特征图中的另一部分特征图。The first feature map group includes part of the feature maps in the feature maps of the at least two images, and the second feature map group includes another part of the feature maps in the feature maps of the at least two images.
在这个例子中,第二神经网络和第三神经网络可以均为卷积神经网络。在这个例子中,通过第二神经网络和第三神经网络分别处理得到第一特征图组和第二特征图组的分组卷积结果,由此能够获取特征的深层结构,使得所获取的特征信息更全面,整体匹配效果也更鲁棒。In this example, the second neural network and the third neural network may both be convolutional neural networks. In this example, the grouped convolution results of the first feature map group and the second feature map group are respectively processed by the second neural network and the third neural network, so that the deep structure of the feature can be obtained, so that the obtained feature information It is more comprehensive and the overall matching effect is more robust.
在该示例中,用于分组卷积的神经网络的数量还可以是三个以上。In this example, the number of neural networks used for group convolution may also be more than three.
在一个例子中,所述对所述至少两项分组卷积结果进行特征融合,得到所述查询图像的特征点的特征向量,包括:对所述至少两项分组卷积结果进行双线性池化操作,得到所述查询图像的特征点的特征向量。In an example, the performing feature fusion on the at least two items of grouped convolution results to obtain feature vectors of feature points of the query image includes: performing bilinear pooling on the at least two items of grouped convolution results The transformation operation is performed to obtain the feature vector of the feature points of the query image.
在其他例子中,还可以采用concat等方式进行融合,本公开实施例对此不作限定。In other examples, the fusion may also be performed in a manner such as concat, which is not limited in this embodiment of the present disclosure.
图4示出通过两个卷积神经网络对查询图像和多个变换图像的特征点进行分组卷积,并对分组卷积结果进行双线性池化,得到查询图像的特征点的特征向量的示意图。如图4所示,在第二神经网络和第三神经网络的每个卷积层后可以采用激活函数进行处理,例如,激活函数可以是ReLU(Rectified Linear Unit,线性整流单元)。Figure 4 shows that the feature points of the query image and multiple transformed images are grouped by convolution through two convolutional neural networks, and bilinear pooling is performed on the grouped convolution results to obtain the feature vector of the feature points of the query image. Schematic. As shown in FIG. 4 , an activation function can be used for processing after each convolutional layer of the second neural network and the third neural network. For example, the activation function can be ReLU (Rectified Linear Unit, linear rectification unit).
在步骤S12中,根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点。In step S12, a database feature point matching the feature point of the query image is searched according to the feature vector of the feature point of the query image, wherein the database feature point represents the feature point of the database image.
在一种可能的实现方式中,可以根据特征点的特征向量之间的相似度,确定与所述查询图像的特征点匹配的数据库特征点。In a possible implementation manner, the database feature points matching the feature points of the query image may be determined according to the similarity between the feature vectors of the feature points.
在一种可能的实现方式中,所述根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,包括:将所述查询图像的特征点的特征向量进行分解,得到所述查询图像的特征点的多个子特征向量,其中,所述查询图像的特征点的子特征向量的维数小于所述查询图像的特征点的特征向量的维数;查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,其中,所述数据库类中心表示数据库特征点的子特征向量的类中心;根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点。In a possible implementation manner, the searching for the database feature points matching the feature points of the query image according to the feature vector of the feature points of the query image includes: The vector is decomposed to obtain a plurality of sub-feature vectors of the feature points of the query image, wherein the dimension of the sub-feature vectors of the feature points of the query image is less than the dimension of the feature vectors of the feature points of the query image; find A database class center matched with a plurality of sub-feature vectors of the feature points of the query image, wherein the database class center represents the class center of the sub-feature vectors of the database feature points; The database class center of the feature vector matching determines the first group of database feature points matching the feature points of the query image.
例如,查询图像的特征点的特征向量为[s 1,s 2,s 3,s 4,s 5,s 6,s 7,s 8,s 9],将查询图像的特征点的特征向量分解为3个子特征向量,得到[s 1,s 2,s 3]、[s 4,s 5,s 6]和[s 7,s 8,s 9]。当然,在实际应用中,查询图像的特征点的特征向量的维数可以高得多。本公开实施例不对查询图像的特征点的特征向量的维数、查询图像的特征点的子特征向量的数量和查询图像的特征点的子特征向量的维数进行限定。在得到子特征向量[s 1,s 2,s 3]、[s 4,s 5,s 6]和[s 7,s 8,s 9]之后,分别查找与各个子特征向量最接近的数据库类中心,例如,与子特征向量[s 1,s 2,s 3]最接近的数据库类中心是数据库类中心2,与子特征向量[s 4,s 5,s 6]最接近的数据库类中心是数据 库类中心5,与子特征向量[s 7,s 8,s 9]最接近的数据库类中心是数据库类中心8。根据数据库特征点与数据库类中心之间的对应关系,可以确定与所述查询图像的特征点匹配的数据库特征点。 For example, the feature vector of the feature points of the query image is [s 1 ,s 2 ,s 3 ,s 4 ,s 5 ,s 6 ,s 7 ,s 8 ,s 9 ], and the feature vector of the feature points of the query image is decomposed For 3 sub-eigenvectors, get [s 1 ,s 2 ,s 3 ], [s 4 ,s 5 ,s 6 ] and [s 7 ,s 8 ,s 9 ]. Of course, in practical applications, the dimension of the feature vector of the feature points of the query image can be much higher. The embodiments of the present disclosure do not limit the dimension of the feature vector of the feature points of the query image, the number of sub-feature vectors of the feature points of the query image, and the dimension of the sub-feature vectors of the feature points of the query image. After obtaining the sub-feature vectors [s 1 , s 2 , s 3 ], [s 4 , s 5 , s 6 ] and [s 7 , s 8 , s 9 ], search for the database closest to each sub-feature vector respectively Class center, for example, the database class center closest to the sub-feature vector [s 1 ,s 2 ,s 3 ] is the database class center 2, and the database class closest to the sub-feature vector [s 4 ,s 5 ,s 6 ] The center is database class center 5, and the database class center closest to the sub-feature vector [s 7 ,s 8 ,s 9 ] is database class center 8. According to the correspondence between the database feature points and the database class centers, the database feature points matching the feature points of the query image can be determined.
该实现方式通过将查询图像的特征点的特征向量分解为较低维的子特征向量后再进行匹配,由此能够提高确定与查询图像的特征点匹配的数据库特征点的速度。In this implementation, the feature vector of the feature points of the query image is decomposed into lower-dimensional sub-feature vectors before matching, thereby improving the speed of determining the database feature points matching the feature points of the query image.
作为该实现方式的一个示例,在所述查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心之前,所述方法还包括:提取多个数据库特征点的特征向量;对于所述多个数据库特征点中的任一数据库特征点,将所述任一数据库特征点的特征向量进行分解,得到所述任一数据库特征点的多个子特征向量,其中,所述任一数据库特征点的子特征向量的维数小于所述任一数据库特征点的特征向量的维数;对所述多个数据库特征点的子特征向量进行聚类,得到数据库类中心;建立所述任一数据库特征点与数据库类中心之间的对应关系。As an example of this implementation, before the searching for a database class center matching a plurality of sub-feature vectors of the feature points of the query image, the method further includes: extracting feature vectors of a plurality of database feature points; Any database feature point in the plurality of database feature points, decompose the feature vector of the any database feature point, and obtain a plurality of sub-feature vectors of the any database feature point, wherein the any database feature The dimension of the sub-feature vector of the point is less than the dimension of the feature vector of the feature point of any database; the sub-feature vector of the feature points of the multiple databases is clustered to obtain the database class center; the database of any one is established Correspondence between feature points and database class centers.
在该示例中,数据库中可以包括多个数据库图像,其中,数据库图像表示数据库中的图像。对于每个数据库图像,可以采用与上文所述的提取查询图像的特征点的特征向量的方式类似的方式,提取所述数据库图像中的数据库特征点的特征向量。例如,对每个数据库图像提取的数据库特征点的数量的取值范围可以是500-2500个。In this example, a plurality of database images may be included in the database, wherein the database images represent images in the database. For each database image, the feature vector of the database feature points in the database image can be extracted in a manner similar to the manner of extracting the feature vector of the feature points of the query image described above. For example, the value range of the number of database feature points extracted from each database image may be 500-2500.
在该示例中,对于任一数据库特征点,可以将所述任一数据库特征点的特征向量分解为多个子特征向量。例如,某一数据库特征点的特征向量为[1,3,2,3,4,5,3,2,1],可以将该数据库特征点的特征向量分解为3个子特征向量[1,3,2]、[3,4,5]和[3,2,1]。当然,在实际应用中,数据库特征点的特征向量的维数可以高得多,本公开实施例在此不做限定。In this example, for any database feature point, the feature vector of any database feature point may be decomposed into a plurality of sub-feature vectors. For example, if the feature vector of a feature point in a database is [1,3,2,3,4,5,3,2,1], the feature vector of the feature point in the database can be decomposed into 3 sub-feature vectors [1,3 ,2], [3,4,5] and [3,2,1]. Of course, in practical applications, the dimension of the feature vector of the database feature point may be much higher, which is not limited in this embodiment of the present disclosure.
在该示例中,可以采用K-means、KD树或者词汇树等方法对多个数据库特征点的子特征向量进行聚类,得到数据库类中心。In this example, methods such as K-means, KD tree, or vocabulary tree can be used to cluster sub-feature vectors of multiple database feature points to obtain database class centers.
在该示例中,在得到数据库类中心后,记录数据库特征点与数据库类中心之间的对应关系。In this example, after the database class center is obtained, the correspondence between the database feature points and the database class center is recorded.
在一个例子中,可以记录数据库类中心与该数据库类中心所属的类中的所有子特征向量对应的数据库特征点之间的对应关系。例如,数据库特征点5、数据库特征点6、数据库特征点7的子特征向量属于数据库类中心1所属的类,则可以记录数据库类中心1与数据库特征点5、数据库特征点6、数据库特征点7之间的对应关系,例如可以记为(1:5,6,7)。In one example, the correspondence between the database class center and the database feature points corresponding to all sub-feature vectors in the class to which the database class center belongs may be recorded. For example, if the sub-feature vectors of database feature point 5, database feature point 6, and database feature point 7 belong to the class to which database class center 1 belongs, then database class center 1 and database feature point 5, database feature point 6, and database feature point can be recorded. The correspondence between 7, for example, can be recorded as (1:5,6,7).
在另一个例子中,可以记录数据库特征点与该数据库特征点对应的各个数据库类中心之间的对应关系。例如,数据库特征点1对应于数据库类中心2、数据库类中心5和数据库类中心8,则可以记录数据库特征点1与数据库类中心2、数据库类中心5和数据库类中心8之间的对应关系,例如可以记为(1:2,5,8)。In another example, the correspondence between a database feature point and each database class center corresponding to the database feature point may be recorded. For example, database feature point 1 corresponds to database class center 2, database class center 5, and database class center 8, then the correspondence between database feature point 1 and database class center 2, database class center 5, and database class center 8 can be recorded , for example, it can be written as (1:2,5,8).
在该示例中,只需存储数据库类中心和数据库特征点与数据库类中心的对应关系,无需存储数据库特征点的特征向量(高维向量),由此能够节省存储空间,节省计算内存,提高查找速度。In this example, it is only necessary to store the database class center and the correspondence between database feature points and database class centers, instead of storing the feature vector (high-dimensional vector) of the database feature point, which can save storage space, save computing memory, and improve search efficiency. speed.
在一个例子中,可以根据所有数据库类中心构建索引器。In one example, an indexer can be built from all database class centers.
作为该实现方式的一个示例,所述根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点;对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点。As an example of this implementation, the determining the first group of database feature points matching the feature points of the query image according to the database class centers matched with multiple sub-feature vectors of the feature points of the query image includes: Determine the candidate database feature points corresponding to the feature points of the query image according to the database class centers matching the multiple sub-feature vectors of the feature points of the query image; perform geometric verification on the candidate database feature points, and determine The first set of database feature points matching the feature points of the query image.
在该示例中,可以根据数据库特征点与数据库类中心之间的对应关系,以及与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点。In this example, according to the corresponding relationship between the database feature points and the database class centers, and the database class centers that match with multiple sub-feature vectors of the feature points of the query image, the corresponding feature points of the query image can be determined. Candidate database feature points.
在一个例子中,可以采用笛卡尔积的方式,确定所述查询图像的特征点对应的候选数 据库特征点。例如,查询图像的特征点A的特征向量对应于3个子特征向量A1、A2和A3,与子特征向量A1匹配的数据库类中心是数据库类中心P1,与子特征向量A2匹配的数据库类中心是数据库类中心P2,与子特征向量A3匹配的数据库类中心是数据库类中心P3,那么,可以将数据库类中心P1、P2、P3所属的类中的所有子特征向量对应的数据库特征点均确定为所述查询图像的特征点A对应的候选数据库特征点。例如,数据库类中心P1所属的类中的所有子特征向量对应的数据库特征点包括数据库特征点D1、D2、D5、D6,数据库类中心P2所属的类中的所有子特征向量对应的数据库特征点包括数据库特征点D1、D7、D8、D9,数据库类中心P3所属的类中的所有子特征向量对应的数据库特征点包括数据库特征点D3、D4、D10,则可以将D1-D10分别确定为所述查询图像的特征点A对应的候选数据库特征点。In an example, a Cartesian product method can be used to determine the candidate database feature points corresponding to the feature points of the query image. For example, the feature vector of the feature point A of the query image corresponds to 3 sub-feature vectors A1, A2 and A3, the database class center matching the sub-feature vector A1 is the database class center P1, and the database class center matching the sub-feature vector A2 is The database class center P2, the database class center that matches the sub-feature vector A3 is the database class center P3, then, the database feature points corresponding to all the sub-feature vectors in the class to which the database class centers P1, P2, and P3 belong can be determined as The candidate database feature point corresponding to the feature point A of the query image. For example, database feature points corresponding to all sub-feature vectors in the class to which database class center P1 belongs include database feature points D1, D2, D5, and D6, and database feature points corresponding to all sub-feature vectors in the class to which database class center P2 belongs Including database feature points D1, D7, D8, D9, database feature points corresponding to all sub-feature vectors in the class to which database class center P3 belongs, including database feature points D3, D4, D10, D1-D10 can be determined as all The candidate database feature point corresponding to the feature point A of the query image.
在另一个例子中,查询图像的特征点A的特征向量对应于3个子特征向量A1、A2和A3,与子特征向量A1匹配的数据库类中心是数据库类中心P1,与子特征向量A2匹配的数据库类中心是数据库类中心P2,与子特征向量A3匹配的数据库类中心是数据库类中心P3,那么,可以将与数据库类中心P1、P2和P3均对应的数据库特征点确定为所述查询图像的特征点A对应的候选数据库特征点。例如,数据库类中心P1所属的类中的所有子特征向量对应的数据库特征点包括数据库特征点D1、D2、D3、D5、D6,数据库类中心P2所属的类中的所有子特征向量对应的数据库特征点包括数据库特征点D1、D2、D3、D7、D8、D9,数据库类中心P3所属的类中的所有子特征向量对应的数据库特征点包括数据库特征点D1、D3、D4、D10,则可以将D1和D3分别确定为所述查询图像的特征点A对应的候选数据库特征点。In another example, the feature vector of the feature point A of the query image corresponds to 3 sub-feature vectors A1, A2 and A3, the database class center matching the sub-feature vector A1 is the database class center P1, and the database class center matching the sub-feature vector A2 The database class center is the database class center P2, and the database class center matching the sub-feature vector A3 is the database class center P3, then, the database feature points corresponding to the database class centers P1, P2 and P3 can be determined as the query image The feature point A corresponds to the candidate database feature point. For example, the database feature points corresponding to all sub-feature vectors in the class to which database class center P1 belongs include database feature points D1, D2, D3, D5, and D6, and the database corresponding to all sub-feature vectors in the class to which database class center P2 belongs The feature points include database feature points D1, D2, D3, D7, D8, and D9. The database feature points corresponding to all sub-feature vectors in the class to which the database class center P3 belongs include database feature points D1, D3, D4, and D10. D1 and D3 are respectively determined as candidate database feature points corresponding to the feature point A of the query image.
在该示例中,查询图像的每个特征点对应的候选数据库特征点的数量可以是一个或多个,例如,最多可以是25个。即,对于查询图像的任一特征点,可以将与该特征点最邻近的多个数据库特征点,作为该特征点对应的候选数据库特征点。In this example, the number of candidate database feature points corresponding to each feature point of the query image may be one or more, for example, 25 at most. That is, for any feature point of the query image, multiple database feature points closest to the feature point may be used as candidate database feature points corresponding to the feature point.
在该示例中,通过根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点,再对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点,由此能够快速、准确地确定与查询图像的特征点匹配的第一组数据库特征点。In this example, the candidate database feature points corresponding to the feature points of the query image are determined according to the database class centers that match with multiple sub-feature vectors of the feature points of the query image, and then the candidate database feature points are analyzed. The geometric verification is to determine the first group of database feature points that match the feature points of the query image, so that the first group of database feature points that match the feature points of the query image can be quickly and accurately determined.
在一个例子中,所述对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:确定所述候选数据库特征点与相应的查询图像的特征点之间的相似变换矩阵;在预设的多个矩阵区间中,确定所述相似变换矩阵所属的矩阵区间;将所述多个矩阵区间中相似变换矩阵的数量满足第一数量条件的矩阵区间,确定为目标矩阵区间;根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的第一组数据库特征点。In one example, performing geometric verification on the candidate database feature points and determining a first group of database feature points matching the feature points of the query image includes: determining the candidate database feature points and the corresponding query image The similarity transformation matrix between the feature points; in a plurality of preset matrix intervals, determine the matrix interval to which the similarity transformation matrix belongs; The matrix interval is determined as the target matrix interval; according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval, the first group of database feature points matching the feature points of the query image is determined.
在这个例子中,任一候选数据库特征点的相应的查询图像的特征点,表示与该候选数据库特征点匹配的查询图像的特征点。在这个例子中,对于任一候选数据库特征点,可以根据该候选数据库特征点与相应的查询图像的特征点的坐标、尺度和旋转角度,构建两者之间的相似变换矩阵。例如,相似变换矩阵包括4个元素
Figure PCTCN2020139166-appb-000001
In this example, the feature point of any candidate database feature point corresponding to the query image represents the feature point of the query image that matches the candidate database feature point. In this example, for any candidate database feature point, a similarity transformation matrix between the candidate database feature point and the corresponding query image feature point can be constructed according to the coordinates, scale and rotation angle of the candidate database feature point. For example, the similarity transformation matrix consists of 4 elements
Figure PCTCN2020139166-appb-000001
预设的矩阵区间包含相似变换矩阵中的各个元素的取值范围。例如,预设的矩阵区间可以表示为
Figure PCTCN2020139166-appb-000002
根据相似变换矩阵中的各个元素的值,以及预设的矩阵区间中的各个元素的取值范围,可以确定各个相似变换矩阵所属的矩阵区间,从而可以确定各个矩阵区间中的相似变换矩阵的数量。
The preset matrix interval includes the value range of each element in the similarity transformation matrix. For example, the preset matrix interval can be expressed as
Figure PCTCN2020139166-appb-000002
According to the value of each element in the similarity transformation matrix and the value range of each element in the preset matrix interval, the matrix interval to which each similarity transformation matrix belongs can be determined, so that the number of similar transformation matrices in each matrix interval can be determined. .
例如,第一数量条件可以为相似变换矩阵的数量大于或等于第二预设值,例如,在某一矩阵区间中相似变换矩阵的数量大于或等于第二预设值的情况下,可以将该矩阵区间确 定为目标矩阵区间。For example, the first quantity condition may be that the number of similar transformation matrices is greater than or equal to the second preset value. The matrix interval is determined as the target matrix interval.
又如,第一数量条件可以为属于相似变换矩阵的数量最多的M个矩阵区间,其中,M为正整数。根据各个矩阵区间中的相似变换矩阵的数量,可以确定相似变换矩阵的数量最多的M个矩阵区间,并可以将相似变换矩阵的数量最多的M个矩阵区间分别确定为目标矩阵区间。For another example, the first quantity condition may be the M matrix intervals that belong to the largest number of similar transformation matrices, where M is a positive integer. According to the number of similar transformation matrices in each matrix interval, M matrix intervals with the largest number of similar transformation matrices can be determined, and the M matrix intervals with the largest number of similar transformation matrices can be respectively determined as target matrix intervals.
又如,第一数量条件可以为相似变换矩阵的数量大于或等于第二预设值,且属于相似变换矩阵的数量最多的M个矩阵区间。例如,在某一矩阵区间中相似变换矩阵的数量大于或等于第二预设值,且该矩阵区间属于相似变换矩阵的数量最多的M个矩阵区间的情况下,可以将该矩阵区间确定为目标矩阵区间。For another example, the first quantity condition may be that the number of similar transformation matrices is greater than or equal to the second preset value, and belongs to the M matrix intervals with the largest number of similar transformation matrices. For example, when the number of similar transformation matrices in a certain matrix interval is greater than or equal to the second preset value, and the matrix interval belongs to the M matrix intervals with the largest number of similar transformation matrices, the matrix interval can be determined as the target matrix interval.
上述例子通过矩阵区间投票的方式进行几何验证,由此能够快速确定与查询图像的特征点匹配的特征点,从而能够提高视觉定位速度。In the above example, geometric verification is performed by means of matrix interval voting, so that the feature points matching the feature points of the query image can be quickly determined, thereby improving the visual positioning speed.
作为该实现方式的一个示例,所述根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:确定备选数据库特征点所属的数据库图像,其中,所述备选数据库特征点表示所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点;根据备选数据库特征点满足第二数量条件的数据库图像中的备选数据库特征点,确定所述第一组数据库特征点。据此,可以对备选数据库特征点进行过滤得到第一组数据库特征点,由此基于第一组数据库特征点确定查询图像的视觉定位结果,有助于提高所确定的视觉定位结果的准确性。As an example of this implementation, the determining the first group of database feature points matching the feature points of the query image according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval includes: determining a backup Select the database image to which the database feature point belongs, wherein the candidate database feature point represents the candidate database feature point corresponding to the similarity transformation matrix in the target matrix interval; the database image that satisfies the second quantity condition according to the candidate database feature point The candidate database feature points in the first group of database feature points are determined. Accordingly, the candidate database feature points can be filtered to obtain the first set of database feature points, thereby determining the visual positioning result of the query image based on the first set of database feature points, which helps to improve the accuracy of the determined visual positioning result. .
这里,第二数量条件可以为大于或等于第一预设值,例如,第一预设值等于12。Here, the second quantity condition may be greater than or equal to the first preset value, for example, the first preset value is equal to 12.
例如,在任一数据库图像中的备选数据库特征点满足第二数量条件的情况下,可以确定所述任一数据库图像中的备选数据库特征点属于所述第一组数据库特征点。For example, if the candidate database feature points in any database image satisfy the second quantity condition, it may be determined that the candidate database feature points in any database image belong to the first group of database feature points.
又如,在备选数据库特征点满足第二数量条件的数据库图像的数量大于N的情况下,可以从备选数据库特征点满足第二数量条件的数据库图像中,选择备选数据库特征点最多的前N个数据库图像,并将这N个数据库图像中的备选数据库特征点确定为属于所述第一组数据库特征点。其中,N为正整数,例如,N等于30。在备选数据库特征点满足第二数量条件的数据库图像的数量小于或等于N的情况下,可以将备选数据库特征点满足第二数量条件的所有数据库图像中的备选数据库特征点均确定为所述第一组数据库特征点。For another example, when the number of database images whose feature points of the candidate database meet the second quantity condition is greater than N, the database image with the most feature points of the candidate database may be selected from the database images whose feature points of the candidate database satisfy the second quantity condition. The first N database images, and the candidate database feature points in the N database images are determined as belonging to the first group of database feature points. where N is a positive integer, for example, N equals 30. In the case that the number of database images whose feature points of the candidate database meet the second quantity condition is less than or equal to N, the candidate database feature points in all database images whose feature points of the candidate database meet the second quantity condition may be determined as the first group of database feature points.
其中,在备选数据库特征点满足第二数量条件的数据库图像的数量为0的情况下,可以确定所述查询图像的视觉定位结果为定位失败。Wherein, when the number of database images whose feature points of the candidate database meet the second quantity condition is 0, it may be determined that the visual positioning result of the query image is a positioning failure.
作为该实现方式的另一个示例,可以采用随机抽样一致(RANdom Sample Consensus,RANSAC)等方法进行几何验证,即通过迭代采样的方式,对两张图片中的像素对应关系估计出最合理的基本矩阵,当满足此矩阵对应关系的内点数达到一定值的时候,几何验证通过,此种方式精度高,能够提高几何验证的准确率。As another example of this implementation, methods such as random sampling consensus (RANdom Sample Consensus, RANSAC) can be used for geometric verification, that is, by iterative sampling, the most reasonable basic matrix is estimated for the pixel correspondences in the two pictures. , when the number of interior points that satisfy the corresponding relationship of this matrix reaches a certain value, the geometric verification is passed. This method has high precision and can improve the accuracy of geometric verification.
作为该实现方式的一个示例,所述根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,还包括:确定所述第一组数据库特征点对应的三维坐标;确定所述三维坐标对应的第二组数据库特征点;所述第二组数据库特征点为与所述三维坐标对应的多组数据库特征点中所述第一组数据库特征点以外的数据库特征点;根据所述第一组数据库特征点和所述第二组数据库特征点,确定所述查询图像的视觉定位结果。As an example of this implementation, the searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image further includes: determining that the first group of database feature points corresponds to three-dimensional coordinates; determine the second group of database feature points corresponding to the three-dimensional coordinates; the second group of database feature points are those other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates database feature points; determining the visual positioning result of the query image according to the first group of database feature points and the second group of database feature points.
在该示例中,根据数据库特征点与三维坐标之间的对应关系,可以确定所述第一组数据库特征点对应的三维坐标。一个三维坐标可以对应于多个数据库特征点。根据三维坐标与数据库特征点之间的对应关系,可以确定与所述三维坐标对应的所有数据库特征点,并可以将与所述三维坐标对应的数据库特征点中所述第一组数据库特征点以外的数据库特征点确定为所述第二组数据库特征点。In this example, according to the correspondence between the database feature points and the three-dimensional coordinates, the three-dimensional coordinates corresponding to the first group of database feature points may be determined. A three-dimensional coordinate can correspond to multiple database feature points. According to the correspondence between the three-dimensional coordinates and the database feature points, all the database feature points corresponding to the three-dimensional coordinates can be determined, and the database feature points corresponding to the three-dimensional coordinates other than the first group of database feature points can be determined. The database feature points of are determined as the second group of database feature points.
根据上述内容可知,该示例中确定与查询图片中的2D特征点匹配的数据库图片中的2D 特征点,再根据数据库图片的2D特征点与3D特征点的对应关系,得到查询图片中的2D特征点与3D特征点的对应关系,相比于,相关技术中,只采用2D特征点到3D特征点的匹配进行定位而言,本公开实施例通过反向搜索,能够增加关联点对的数量,从而能够提高视觉定位的鲁棒性。其中,关联点对表示数据库特征点与对应的三维坐标。According to the above content, in this example, the 2D feature points in the database picture that match the 2D feature points in the query picture are determined, and then the 2D feature points in the query picture are obtained according to the correspondence between the 2D feature points and the 3D feature points of the database picture. The corresponding relationship between points and 3D feature points, compared with the related art, which only uses the matching of 2D feature points to 3D feature points for positioning, the embodiment of the present disclosure can increase the number of associated point pairs through reverse search, Thus, the robustness of visual positioning can be improved. Wherein, the associated point pair represents the database feature point and the corresponding three-dimensional coordinate.
在步骤S13中,根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。In step S13, the visual positioning result of the query image is determined according to the matched database feature points.
在一种可能的实现方式中,所述查询图像的视觉定位结果可以包括所述查询图像对应的位姿信息。其中,位姿信息可以包括位置信息和姿态信息中的一种或两种。其中,位置信息可以采用坐标来表示,姿态信息可以采用角度来表示。在一个示例中,所述查询图像的视觉定位结果可以包括所述查询图像的六自由度的位姿信息。In a possible implementation manner, the visual positioning result of the query image may include pose information corresponding to the query image. The pose information may include one or both of position information and attitude information. The position information may be represented by coordinates, and the attitude information may be represented by angles. In one example, the visual positioning result of the query image may include six degrees of freedom pose information of the query image.
在本公开实施例中,在得到所述匹配的数据库特征点之后,可以采用透视n点(Perspective-n-Point,PnP)等方法确定所述查询图像的视觉定位结果。例如,可以采用高效的透视n点(Efficient Perspective-n-Point,EPnP)、透视3点(Perspective-3-Point,P3P)或者直接最小二乘(Direct Least-Squares,DLS)等方法确定所述查询图像的视觉定位结果。In the embodiment of the present disclosure, after obtaining the matched database feature points, a method such as Perspective-n-Point (PnP) may be used to determine the visual positioning result of the query image. For example, an efficient perspective n-point (Efficient Perspective-n-Point, EPnP), perspective 3-point (Perspective-3-Point, P3P) or direct least squares (Direct Least-Squares, DLS) method can be used to determine the Visual localization results for query images.
在一个例子中,在求解PnP的基础上,在内点的数量小于第三预设值的情况下,可以确定查询图像的视觉定位结果为定位失败。例如,第三预设值可以等于12。在内点的数量大于或等于第三预设值的情况下,可以得到查询图像对应的位姿信息。其中,内点可以表示在求解位姿的情况下正确匹配的特征点。例如,可以根据RANSAC算法的inlier_mask确定内点。在一个例子中,还可以通过非线性优化器优化查询图像对应的位姿信息,得到最终的视觉定位结果。In one example, on the basis of solving the PnP, if the number of interior points is less than the third preset value, it may be determined that the visual positioning result of the query image is the positioning failure. For example, the third preset value may be equal to 12. When the number of interior points is greater than or equal to the third preset value, the pose information corresponding to the query image can be obtained. Among them, the interior points can represent the feature points that are correctly matched in the case of solving the pose. For example, the inliers can be determined according to the inlier_mask of the RANSAC algorithm. In an example, the pose information corresponding to the query image can also be optimized by a nonlinear optimizer to obtain the final visual positioning result.
在一个应用场景中,可以由用户设备采集查询图像,用户设备向云端服务器发送视觉定位请求,其中,所述视觉定位请求携带所述查询图像;云端服务器采用本公开实施例提供的视觉定位方法进行处理,得到所述查询图像的视觉定位结果,并将所述查询图像的视觉定位结果返回用户设备。其中,用户设备可以是手机等具有拍照功能的设备。视觉定位请求还可以包括用户设备的相机内参信息,例如可以包括焦距和主点位置。In an application scenario, a query image may be collected by the user equipment, and the user equipment sends a visual positioning request to the cloud server, where the visual positioning request carries the query image; the cloud server uses the visual positioning method provided by the embodiment of the present disclosure to perform processing, to obtain the visual positioning result of the query image, and return the visual positioning result of the query image to the user equipment. Wherein, the user equipment may be a device with a camera function, such as a mobile phone. The visual positioning request may also include camera intrinsic parameter information of the user equipment, for example, may include the focal length and the position of the principal point.
本公开实施例可以应用于定位导航系统、高精地图、增强现实产品等各种应用场景中。例如,本公开实施例可以用于在商场、机场、博物馆等大型室内场景中提供视觉定位和导航服务,解决室内场景中因无GPS信号而无法有效定位的问题。又如,在室外场景中,可以对高精地图进行增强,结合GPS信号实现更高精度的定位,并可以在室外GPS信号较弱的地方提供视觉定位服务。又如,由于本公开实施例可以快速得到用户设备的六自由度位置和姿态信息,因此本公开实施例可以应用于增强现实应用中。The embodiments of the present disclosure can be applied to various application scenarios such as positioning and navigation systems, high-precision maps, and augmented reality products. For example, the embodiments of the present disclosure can be used to provide visual positioning and navigation services in large indoor scenes such as shopping malls, airports, and museums, and solve the problem that effective positioning cannot be performed in indoor scenes because there is no GPS signal. For another example, in outdoor scenes, high-precision maps can be enhanced to achieve higher-precision positioning combined with GPS signals, and visual positioning services can be provided in places with weak outdoor GPS signals. For another example, since the embodiments of the present disclosure can quickly obtain the six-degree-of-freedom position and attitude information of the user equipment, the embodiments of the present disclosure can be applied to augmented reality applications.
下面以机器人在商场中进行视觉定位为例,对本公开实施例的一种应用场景进行说明。在该应用场景中,可以先拍摄多张商场的照片作为数据库图像。对于任意一个数据库图像,可以对该数据库图像进行变换处理,得到该数据库图像对应的多个变换图像;对该数据库图像和该数据库图像对应的多个变换图像进行特征提取,得到该数据库图像的特征点的特征向量,即数据库特征点的特征向量。对于任意一个数据库特征点,可以将该数据库特征点的特征向量进行分解,得到该数据库特征点的多个子特征向量。对所有数据库特征点的子特征向量进行聚类,得到多个数据库类中心。对于任一数据库特征点,建立该数据库特征点与数据库类中心之间的对应关系。机器人在需要进行定位的情况下,可以将当前采集的图像作为查询图像。对查询图像进行变换处理,得到查询图像对应的多个变换图像;对查询图像和查询图像对应的多个变换图像进行特征提取,得到查询图像的特征点的特征向量。将查询图像的特征点的特征向量进行分解,得到查询图像的特征点的多个子特征向量。查找与查询图像的特征点的多个子特征向量匹配的数据库类中心,根据与查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与查询图像的特征点匹配的第一组数据库特征点。确定第一组数据库特征点对应的三维坐标,确定所述三维坐标对应的第二组数据库特征点。根据所述第一组数据库特征点和所述第二组数据库特征点,确定查询图像的视 觉定位结果,即,确定机器人当前在商场中的位置信息以及机器人当前的姿态信息。An application scenario of the embodiment of the present disclosure will be described below by taking the visual positioning of a robot in a shopping mall as an example. In this application scenario, multiple photos of shopping malls can be taken first as database images. For any database image, transform the database image to obtain multiple transformed images corresponding to the database image; perform feature extraction on the database image and multiple transformed images corresponding to the database image to obtain the features of the database image The feature vector of the point, that is, the feature vector of the database feature point. For any database feature point, the feature vector of the database feature point can be decomposed to obtain multiple sub-feature vectors of the database feature point. The sub-feature vectors of all database feature points are clustered to obtain multiple database class centers. For any database feature point, establish the corresponding relationship between the database feature point and the database class center. When the robot needs to locate, it can use the currently collected image as a query image. Transform the query image to obtain multiple transformed images corresponding to the query image; perform feature extraction on the query image and the multiple transformed images corresponding to the query image to obtain feature vectors of feature points of the query image. The feature vector of the feature points of the query image is decomposed to obtain multiple sub-feature vectors of the feature points of the query image. Find the database class centers that match the multiple sub-feature vectors of the feature points of the query image, and determine the first set of database features that match the feature points of the query image according to the database class centers that match the multiple sub-feature vectors of the feature points of the query image. point. Three-dimensional coordinates corresponding to the first group of database feature points are determined, and a second group of database feature points corresponding to the three-dimensional coordinates are determined. According to the first group of database feature points and the second group of database feature points, the visual positioning result of the query image is determined, that is, the current position information of the robot in the shopping mall and the current posture information of the robot are determined.
可以理解,本公开实施例提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开实施例不再赘述。It can be understood that the above method embodiments mentioned in the embodiments of the present disclosure can be combined with each other to form a combined embodiment without violating the principle and logic.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that, in the above-mentioned method of the specific embodiment, the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the execution order of each step should be based on its function and possible intrinsic Logical OK.
此外,本公开实施例还提供了视觉定位装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开实施例提供的任一种视觉定位方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the embodiments of the present disclosure also provide visual positioning devices, electronic devices, computer-readable storage media, and programs, all of which can be used to implement any of the visual positioning methods provided by the embodiments of the present disclosure, and the corresponding technical solutions and descriptions and refer to the methods. Some of the corresponding records will not be repeated.
图5示出本公开实施例提供的视觉定位装置的框图。如图5所示,所述视觉定位装置包括:第一提取部分51,被配置为提取查询图像的特征点的特征向量;查找部分52,被配置为根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点;确定部分53,被配置为根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。FIG. 5 shows a block diagram of a visual positioning apparatus provided by an embodiment of the present disclosure. As shown in FIG. 5 , the visual positioning device includes: a first extraction part 51 configured to extract feature vectors of the feature points of the query image; a search part 52 configured to extract feature vectors of the feature points of the query image according to the feature vectors of the query image , searching for the database feature points matching the feature points of the query image, wherein the database feature points represent the feature points of the database image; the determining part 53 is configured to determine the query based on the matched database feature points The visual localization result of the image.
在一种可能的实现方式中,所述第一提取部分51被配置为:对查询图像进行变换处理,得到所述查询图像对应的至少一个变换图像;对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量。In a possible implementation manner, the first extraction part 51 is configured to: perform transformation processing on the query image to obtain at least one transformed image corresponding to the query image; Feature extraction is performed on at least two images in the images to obtain feature vectors of feature points of the query image.
在一种可能的实现方式中,所述第一提取部分51被配置为:将所述查询图像和所述至少一个变换图像中的至少两个图像分别输入第一神经网络中,经由所述第一神经网络输出所述至少两个图像的特征图;对所述至少两个图像的特征图进行分组卷积,得到至少两项分组卷积结果;对所述至少两项分组卷积结果进行特征融合,得到所述查询图像的特征点的特征向量。In a possible implementation manner, the first extraction part 51 is configured to: input at least two images of the query image and the at least one transformed image into a first neural network respectively, A neural network outputs the feature maps of the at least two images; performs grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results; performs feature on the at least two grouped convolution results Fusion to obtain the feature vector of the feature points of the query image.
在一种可能的实现方式中,所述查找部分52被配置为:将所述查询图像的特征点的特征向量进行分解,得到所述查询图像的特征点的多个子特征向量,其中,所述查询图像的特征点的子特征向量的维数小于所述查询图像的特征点的特征向量的维数;查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,其中,所述数据库类中心表示数据库特征点的子特征向量的类中心;根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点。In a possible implementation manner, the searching part 52 is configured to: decompose the feature vector of the feature points of the query image to obtain multiple sub-feature vectors of the feature points of the query image, wherein the The dimension of the sub-feature vector of the feature point of the query image is less than the dimension of the feature vector of the feature point of the query image; find the database class center that matches the multiple sub-feature vectors of the feature point of the query image, wherein all the The database class center represents the class center of the sub-feature vector of the database feature point; according to the database class center matched with the multiple sub-feature vectors of the feature point of the query image, determine the first group matching the feature point of the query image. Database feature points.
在一种可能的实现方式中,所述装置还包括:第二提取部分,被配置为提取多个数据库特征点的特征向量;分解部分,被配置为对于所述多个数据库特征点中的任一数据库特征点,将所述任一数据库特征点的特征向量进行分解,得到所述任一数据库特征点的多个子特征向量,其中,所述任一数据库特征点的子特征向量的维数小于所述任一数据库特征点的特征向量的维数;聚类部分,被配置为对所述多个数据库特征点的子特征向量进行聚类,得到数据库类中心;建立部分,被配置为建立所述任一数据库特征点与数据库类中心之间的对应关系。In a possible implementation manner, the apparatus further includes: a second extraction part configured to extract feature vectors of multiple database feature points; a decomposition part configured to extract feature vectors for any of the multiple database feature points; A database feature point, decompose the feature vector of any database feature point to obtain a plurality of sub-feature vectors of any database feature point, wherein the dimension of the sub-feature vector of any database feature point is less than The dimension of the feature vector of the feature points of any database; the clustering part is configured to cluster the sub-feature vectors of the multiple database feature points to obtain the database class center; the establishment part is configured to establish all Describe the correspondence between any database feature point and the database class center.
在一种可能的实现方式中,所述查找部分52被配置为:根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点;对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点。In a possible implementation manner, the searching part 52 is configured to: determine the candidate database corresponding to the feature points of the query image according to the database class centers matching a plurality of sub-feature vectors of the feature points of the query image Feature points; perform geometric verification on the candidate database feature points, and determine a first group of database feature points matching the feature points of the query image.
在一种可能的实现方式中,所述查找部分52被配置为:确定所述候选数据库特征点与相应的查询图像的特征点之间的相似变换矩阵;在预设的多个矩阵区间中,确定所述相似变换矩阵所属的矩阵区间;将所述多个矩阵区间中相似变换矩阵的数量满足第一数量条件的矩阵区间,确定为目标矩阵区间;根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的所述第一组数据库特征点。In a possible implementation manner, the searching part 52 is configured to: determine the similarity transformation matrix between the feature points of the candidate database and the feature points of the corresponding query image; in a plurality of preset matrix intervals, Determine the matrix interval to which the similarity transformation matrix belongs; determine the matrix interval in which the number of similar transformation matrices in the plurality of matrix intervals satisfies the first quantity condition as the target matrix interval; according to the similarity transformation matrix in the target matrix interval For the corresponding candidate database feature points, the first group of database feature points matching the feature points of the query image is determined.
在一种可能的实现方式中,所述查找部分52被配置为:确定备选数据库特征点所属的 数据库图像,其中,所述备选数据库特征点表示所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点;根据备选数据库特征点满足第二数量条件的数据库图像中的备选数据库特征点,确定所述第一组数据库特征点。In a possible implementation manner, the searching part 52 is configured to: determine the database image to which the candidate database feature point belongs, wherein the candidate database feature point indicates that the similarity transformation matrix in the target matrix interval corresponds to The candidate database feature points of the candidate database; the first group of database feature points is determined according to the candidate database feature points in the database images whose candidate database feature points satisfy the second quantity condition.
在一种可能的实现方式中,所述查找部分52被配置为:确定所述第一组数据库特征点对应的三维坐标;确定所述三维坐标对应的第二组数据库特征点;所述第二组数据库特征点为与所述三维坐标对应的多组数据库特征点中所述第一组数据库特征点以外的数据库特征点;根据所述第一组数据库特征点和所述第二组数据库特征点,确定所述查询图像的视觉定位结果。In a possible implementation manner, the searching part 52 is configured to: determine three-dimensional coordinates corresponding to the first group of database feature points; determine a second group of database feature points corresponding to the three-dimensional coordinates; The group database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates; according to the first group of database feature points and the second group of database feature points , and determine the visual positioning result of the query image.
在本公开实施例中,通过提取查询图像的特征点的特征向量,根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,并根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果,由此在视觉定位中无需检索获取局部地图,直接进行特征点匹配,根据与查询图像的特征点匹配的数据库特征点确定查询图像的视觉定位结果,从而使得定位过程更加直接有效,内存消耗更低,能够减少视觉定位的耗时,且定位过程更加可靠。In the embodiment of the present disclosure, by extracting the feature vector of the feature points of the query image, searching for the database feature points matching the feature points of the query image according to the feature vector of the feature points of the query image, and according to the matching feature points The database feature points of the query image are determined, and the visual positioning result of the query image is determined, so that there is no need to retrieve and obtain a local map in the visual positioning, and feature point matching is performed directly. Therefore, the positioning process is more direct and effective, the memory consumption is lower, the time-consuming of visual positioning can be reduced, and the positioning process is more reliable.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的部分可以被配置为执行上文方法实施例描述的方法,其实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or included parts of the apparatus provided in the embodiments of the present disclosure may be configured to execute the methods described in the above method embodiments. For implementation, reference may be made to the above method embodiments. For brevity, here No longer.
在本公开实施例以及其他的实施例中,“部分”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是单元,还可以是模块也可以是非模块化的。In the embodiments of the present disclosure and other embodiments, a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, a unit, a module or a non-modularity.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。其中,所述计算机可读存储介质可以是非易失性计算机可读存储介质,或者可以是易失性计算机可读存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented. Wherein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的视觉定位方法的指令。Embodiments of the present disclosure also provide a computer program product, including computer-readable codes. When the computer-readable codes are run on a device, a processor in the device executes a method for implementing the visual positioning method provided by any of the above embodiments. instruction.
本公开实施例还提供了另一种计算机程序产品,用于存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的视觉定位方法的操作。Embodiments of the present disclosure further provide another computer program product for storing computer-readable instructions, which, when executed, cause the computer to perform the operations of the visual positioning method provided by any of the foregoing embodiments.
本公开实施例还提供一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。Embodiments of the present disclosure further provide an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke executable instructions stored in the memory instruction to execute the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。The electronic device may be provided as a terminal, server or other form of device.
图6示出本公开实施例提供的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 6 shows a block diagram of an electronic device 800 provided by an embodiment of the present disclosure. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc. terminal.
参照图6,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。6, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者 它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。 Power supply assembly 806 provides power to various components of electronic device 800 . Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。在电子设备800处于操作模式,如拍摄模式或视频模式的情况下,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),在电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式的情况下,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。 Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or transmitted via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触的情况下检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 . For example, the sensor assembly 814 can detect the on/off state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 can also detect the electronic device 800 or one of the electronic device 800 Changes in the position of components, presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如Wi-Fi、2G、3G、4G/LTE、5G或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. The electronic device 800 may access wireless networks based on communication standards, such as Wi-Fi, 2G, 3G, 4G/LTE, 5G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium, such as a memory 804 comprising computer program instructions executable by the processor 820 of the electronic device 800 to perform the above method is also provided.
图7示出本公开实施例提供的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图7,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指 令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 7 shows a block diagram of an electronic device 1900 provided by an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. 7, the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource, represented by memory 1932, for storing instructions, such as applications, executable by the processing component 1922. An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Additionally, the processing component 1922 is configured to execute instructions to perform the above-described methods.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows
Figure PCTCN2020139166-appb-000003
或类似。
The electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 . Electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows
Figure PCTCN2020139166-appb-000003
or similar.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
在示例性实施例中,提供了一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备中的处理器执行时实现上述方法。In an exemplary embodiment, there is provided a computer program comprising computer readable code which, when executed in an electronic device, implements the above method when executed by a processor in the electronic device.
本公开实施例可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。Embodiments of the present disclosure may be systems, methods and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的例子(非穷举的列表)可以包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. Examples (a non-exhaustive list) of computer readable storage media may include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory) ), static random access memory (SRAM), portable compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards with instructions stored thereon Or the protruding structure in the groove, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开实施例操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开实施例的各个方面。The computer program instructions for carrying out the operations of the disclosed embodiments may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or programmed in one or more Source or object code written in any combination of languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the embodiments of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开实施例的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of embodiments of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理 装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
该计算机程序产品可以通过硬件、软件或其结合的方式实现。在本公开的一些实施例中,所述计算机程序产品体现为计算机存储介质,在本公开的另一些实施例中,计算机程序产品体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be implemented in hardware, software or a combination thereof. In some embodiments of the present disclosure, the computer program product is embodied as a computer storage medium, and in other embodiments of the present disclosure, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Various embodiments of the present disclosure have been described above, and the foregoing descriptions are exemplary, not exhaustive, and not limiting of the disclosed embodiments. Numerous modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the various embodiments, the practical application or improvement over the technology in the marketplace, or to enable others of ordinary skill in the art to understand the various embodiments disclosed herein.
工业实用性Industrial Applicability
本公开实施例涉及一种视觉定位方法及装置、电子设备和计算机可读存储介质。所述方法包括:提取查询图像的特征点的特征向量;根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点;根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。通过提取查询图像的特征点的特征向量,根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,并根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果,由此在视觉定位中无需检索获取局部地图,直接进行特征点匹配,根据与查询图像的特征点匹配的数据库特征点确定查询图像的视觉定位结果,从而使得定位过程更加直接有效,内存消耗更低,能够减少视觉定位的耗时,且定位过程更加可靠。Embodiments of the present disclosure relate to a visual positioning method and apparatus, an electronic device, and a computer-readable storage medium. The method includes: extracting a feature vector of a feature point of a query image; searching for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image, wherein the database feature point represents feature points of the database image; determine the visual positioning result of the query image according to the matched database feature points. By extracting the feature vectors of the feature points of the query image, searching for the database feature points matching the feature points of the query image according to the feature vectors of the feature points of the query image, and determining the database feature points according to the matched database feature points. The visual positioning result of the query image is described, so there is no need to retrieve and obtain a local map in the visual positioning, and feature point matching is performed directly, and the visual positioning result of the query image is determined according to the database feature points matching the feature points of the query image, so that the positioning process It is more direct and effective, with lower memory consumption, which can reduce the time-consuming of visual positioning, and the positioning process is more reliable.

Claims (13)

  1. 一种视觉定位方法,包括:A visual positioning method comprising:
    提取查询图像的特征点的特征向量;Extract the feature vector of the feature points of the query image;
    根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点;According to the feature vector of the feature points of the query image, search for the database feature points matching the feature points of the query image, wherein the database feature points represent the feature points of the database image;
    根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。According to the matched database feature points, the visual positioning result of the query image is determined.
  2. 根据权利要求1所述的方法,其中,所述提取查询图像的特征点的特征向量,包括:The method according to claim 1, wherein the extracting the feature vector of the feature points of the query image comprises:
    对查询图像进行变换处理,得到所述查询图像对应的至少一个变换图像;Transforming the query image to obtain at least one transformed image corresponding to the query image;
    对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量。Feature extraction is performed on at least two images of the query image and the at least one transformed image to obtain feature vectors of feature points of the query image.
  3. 根据权利要求2所述的方法,其中,所述对所述查询图像和所述至少一个变换图像中的至少两个图像进行特征提取,得到所述查询图像的特征点的特征向量,包括:The method according to claim 2, wherein, performing feature extraction on at least two images in the query image and the at least one transformed image to obtain feature vectors of feature points of the query image, comprising:
    将所述查询图像和所述至少一个变换图像中的至少两个图像分别输入第一神经网络中,经由所述第一神经网络输出所述至少两个图像的特征图;Inputting at least two images of the query image and the at least one transformed image into a first neural network respectively, and outputting feature maps of the at least two images via the first neural network;
    对所述至少两个图像的特征图进行分组卷积,得到至少两项分组卷积结果;Performing grouped convolution on the feature maps of the at least two images to obtain at least two grouped convolution results;
    对所述至少两项分组卷积结果进行特征融合,得到所述查询图像的特征点的特征向量。Feature fusion is performed on the at least two grouped convolution results to obtain feature vectors of feature points of the query image.
  4. 根据权利要求1至3中任意一项所述的方法,其中,所述根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,包括:The method according to any one of claims 1 to 3, wherein, according to the feature vector of the feature points of the query image, searching for the database feature points matching the feature points of the query image comprises:
    将所述查询图像的特征点的特征向量进行分解,得到所述查询图像的特征点的多个子特征向量,其中,所述查询图像的特征点的子特征向量的维数小于所述查询图像的特征点的特征向量的维数;Decompose the feature vector of the feature points of the query image to obtain a plurality of sub-feature vectors of the feature points of the query image, wherein the dimension of the sub-feature vectors of the feature points of the query image is smaller than the dimension of the query image. The dimension of the feature vector of the feature point;
    查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,其中,所述数据库类中心表示数据库特征点的子特征向量的类中心;Finding a database class center that matches a plurality of sub-feature vectors of the feature points of the query image, wherein the database class center represents the class center of the sub-feature vectors of the database feature points;
    根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点。A first group of database feature points matching the feature points of the query image is determined according to the database class centers matching the plurality of sub-feature vectors of the feature points of the query image.
  5. 根据权利要求4所述的方法,其中,在所述查找与所述查询图像的特征点的多个子特征向量匹配的数据库类中心之前,所述方法还包括:The method according to claim 4, wherein before the searching for a database class center matching a plurality of sub-feature vectors of the feature points of the query image, the method further comprises:
    提取多个数据库特征点的特征向量;Extract feature vectors of multiple database feature points;
    对于所述多个数据库特征点中的任一数据库特征点,将所述任一数据库特征点的特征向量进行分解,得到所述任一数据库特征点的多个子特征向量,其中,所述任一数据库特征点的子特征向量的维数小于所述任一数据库特征点的特征向量的维数;For any database feature point among the plurality of database feature points, the feature vector of the any database feature point is decomposed to obtain a plurality of sub-feature vectors of the any database feature point, wherein the any one The dimension of the sub-feature vector of the database feature point is less than the dimension of the feature vector of any of the database feature points;
    对所述多个数据库特征点的子特征向量进行聚类,得到数据库类中心;Clustering the sub-feature vectors of the multiple database feature points to obtain a database class center;
    建立所述任一数据库特征点与数据库类中心之间的对应关系。A corresponding relationship between any of the database feature points and the database class center is established.
  6. 根据权利要求4或5所述的方法,其中,所述根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:The method according to claim 4 or 5, wherein the first group of databases matching the feature points of the query image is determined according to the database class centers matching a plurality of sub-feature vectors of the feature points of the query image Feature points, including:
    根据与所述查询图像的特征点的多个子特征向量匹配的数据库类中心,确定所述查询图像的特征点对应的候选数据库特征点;Determine the candidate database feature points corresponding to the feature points of the query image according to the database class centers matching the multiple sub-feature vectors of the feature points of the query image;
    对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点。Geometric verification is performed on the candidate database feature points, and a first group of database feature points matching the feature points of the query image is determined.
  7. 根据权利要求6所述的方法,其中,所述对所述候选数据库特征点进行几何验证,确定与所述查询图像的特征点匹配的第一组数据库特征点,包括:The method according to claim 6, wherein, performing geometric verification on the candidate database feature points to determine the first group of database feature points matching the feature points of the query image, comprising:
    确定所述候选数据库特征点与相应的查询图像的特征点之间的相似变换矩阵;determining the similarity transformation matrix between the feature points of the candidate database and the feature points of the corresponding query image;
    在预设的多个矩阵区间中,确定所述相似变换矩阵所属的矩阵区间;In a plurality of preset matrix intervals, determine the matrix interval to which the similarity transformation matrix belongs;
    将所述多个矩阵区间中相似变换矩阵的数量满足第一数量条件的矩阵区间,确定为目标矩阵区间;Determining a matrix interval where the number of similar transformation matrices in the plurality of matrix intervals satisfies the first quantity condition as a target matrix interval;
    根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的所述第一组数据库特征点。According to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval, the first group of database feature points matching the feature points of the query image is determined.
  8. 根据权利要求7所述的方法,其中,所述根据所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点,确定与所述查询图像的特征点匹配的所述第一组数据库特征点,包括:The method according to claim 7, wherein the first group of database feature points matching the feature points of the query image is determined according to the candidate database feature points corresponding to the similarity transformation matrix in the target matrix interval ,include:
    确定备选数据库特征点所属的数据库图像,其中,所述备选数据库特征点表示所述目标矩阵区间中的相似变换矩阵对应的候选数据库特征点;Determine the database image to which the candidate database feature point belongs, wherein the candidate database feature point represents the candidate database feature point corresponding to the similarity transformation matrix in the target matrix interval;
    根据备选数据库特征点满足第二数量条件的数据库图像中的备选数据库特征点,确定所述第一组数据库特征点。The first group of database feature points is determined according to candidate database feature points in the database image whose candidate database feature points satisfy the second quantity condition.
  9. 根据权利要求4至8中任意一项所述的方法,其中,所述根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,还包括:The method according to any one of claims 4 to 8, wherein, according to the feature vector of the feature points of the query image, searching for the database feature points matching the feature points of the query image, further comprising:
    确定所述第一组数据库特征点对应的三维坐标;determining the three-dimensional coordinates corresponding to the first group of database feature points;
    确定所述三维坐标对应的第二组数据库特征点;所述第二组数据库特征点为与所述三维坐标对应的多组数据库特征点中所述第一组数据库特征点以外的数据库特征点;Determine the second group of database feature points corresponding to the three-dimensional coordinates; the second group of database feature points are database feature points other than the first group of database feature points in the multiple groups of database feature points corresponding to the three-dimensional coordinates;
    根据所述第一组数据库特征点和所述第二组数据库特征点,确定所述查询图像的视觉定位结果。According to the first set of database feature points and the second set of database feature points, a visual positioning result of the query image is determined.
  10. 一种视觉定位装置,包括:A visual positioning device, comprising:
    第一提取部分,被配置为提取查询图像的特征点的特征向量;a first extraction part configured to extract feature vectors of feature points of the query image;
    查找部分,被配置为根据所述查询图像的特征点的特征向量,查找与所述查询图像的特征点匹配的数据库特征点,其中,所述数据库特征点表示数据库图像的特征点;a search section configured to search for a database feature point matching the feature point of the query image according to the feature vector of the feature point of the query image, wherein the database feature point represents the feature point of the database image;
    确定部分,被配置为根据所述匹配的数据库特征点,确定所述查询图像的视觉定位结果。The determining part is configured to determine the visual positioning result of the query image according to the matched database feature points.
  11. 一种电子设备,包括:An electronic device comprising:
    一个或多个处理器;one or more processors;
    被配置为存储可执行指令的存储器;memory configured to store executable instructions;
    其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行权利要求1至9中任意一项所述的方法。wherein the one or more processors are configured to invoke executable instructions stored in the memory to perform the method of any one of claims 1-9.
  12. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至9中任意一项所述的方法。A computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the method of any one of claims 1 to 9 when executed by a processor.
  13. 一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备中的处理器执行时实现权利要求1至9中任意一项所述的方法。A computer program, comprising computer-readable codes, when the computer-readable codes are executed in an electronic device, a processor in the electronic device implements the method described in any one of claims 1 to 9 when executed. method.
PCT/CN2020/139166 2020-07-22 2020-12-24 Visual positioning method and apparatus, electronic device, and computer readable storage medium WO2022016803A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010710996.0 2020-07-22
CN202010710996.0A CN111859003B (en) 2020-07-22 2020-07-22 Visual positioning method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022016803A1 true WO2022016803A1 (en) 2022-01-27

Family

ID=73002310

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139166 WO2022016803A1 (en) 2020-07-22 2020-12-24 Visual positioning method and apparatus, electronic device, and computer readable storage medium

Country Status (3)

Country Link
CN (1) CN111859003B (en)
TW (1) TW202205206A (en)
WO (1) WO2022016803A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111859003B (en) * 2020-07-22 2021-12-28 浙江商汤科技开发有限公司 Visual positioning method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104596519A (en) * 2015-02-17 2015-05-06 哈尔滨工业大学 RANSAC algorithm-based visual localization method
CN104820718A (en) * 2015-05-22 2015-08-05 哈尔滨工业大学 Image classification and searching method based on geographic position characteristics and overall situation vision characteristics
US20150286894A1 (en) * 2012-11-16 2015-10-08 Enswers Co., Ltd. System and method for providing additional information using image matching
CN110296686A (en) * 2019-05-21 2019-10-01 北京百度网讯科技有限公司 Localization method, device and the equipment of view-based access control model
CN110390356A (en) * 2019-07-03 2019-10-29 Oppo广东移动通信有限公司 Visual dictionary generation method and device, storage medium
CN111859003A (en) * 2020-07-22 2020-10-30 浙江商汤科技开发有限公司 Visual positioning method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150286894A1 (en) * 2012-11-16 2015-10-08 Enswers Co., Ltd. System and method for providing additional information using image matching
CN104596519A (en) * 2015-02-17 2015-05-06 哈尔滨工业大学 RANSAC algorithm-based visual localization method
CN104820718A (en) * 2015-05-22 2015-08-05 哈尔滨工业大学 Image classification and searching method based on geographic position characteristics and overall situation vision characteristics
CN110296686A (en) * 2019-05-21 2019-10-01 北京百度网讯科技有限公司 Localization method, device and the equipment of view-based access control model
CN110390356A (en) * 2019-07-03 2019-10-29 Oppo广东移动通信有限公司 Visual dictionary generation method and device, storage medium
CN111859003A (en) * 2020-07-22 2020-10-30 浙江商汤科技开发有限公司 Visual positioning method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YUAN LIU; ZEHONG SHEN; ZHIXUAN LIN; SIDA PENG; HUJUN BAO; XIAOWEI ZHOU: "GIFT: Learning Transformation-Invariant Dense Visual Descriptors via Group CNNs", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 14 November 2019 (2019-11-14), 201 Olin Library Cornell University Ithaca, NY 14853 , XP081532326 *

Also Published As

Publication number Publication date
CN111859003A (en) 2020-10-30
TW202205206A (en) 2022-02-01
CN111859003B (en) 2021-12-28

Similar Documents

Publication Publication Date Title
US11120078B2 (en) Method and device for video processing, electronic device, and storage medium
TWI753348B (en) Pose determination method, pose determination device, electronic device and computer readable storage medium
US8391615B2 (en) Image recognition algorithm, method of identifying a target image using same, and method of selecting data for transmission to a portable electronic device
TWI761851B (en) Image processing method, image processing apparatus, electronic device, and computer-readable storage medium
EP3206163B1 (en) Image processing method, mobile device and method for generating a video image database
US20200327353A1 (en) Image processing method and apparatus, electronic device, and storage medium
US20140253592A1 (en) Method for providing augmented reality, machine-readable storage medium, and portable terminal
CN111538855B (en) Visual positioning method and device, electronic equipment and storage medium
JP2021524957A (en) Image processing methods and their devices, terminals and computer programs
CN110059652B (en) Face image processing method, device and storage medium
CN110909209B (en) Live video searching method and device, equipment, server and storage medium
CN110781957A (en) Image processing method and device, electronic equipment and storage medium
WO2023103377A1 (en) Calibration method and apparatus, electronic device, storage medium, and computer program product
WO2022033111A1 (en) Image information extraction method, training method and apparatus, medium, and electronic device
AU2014271204A1 (en) Image recognition of vehicle parts
WO2023273499A1 (en) Depth measurement method and apparatus, electronic device, and storage medium
WO2022016803A1 (en) Visual positioning method and apparatus, electronic device, and computer readable storage medium
CN114581525A (en) Attitude determination method and apparatus, electronic device, and storage medium
WO2023066373A1 (en) Sample image determination method and apparatus, device, and storage medium
WO2023155393A1 (en) Feature point matching method and apparatus, electronic device, storage medium and computer program product
WO2023155350A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
WO2022217882A1 (en) Pose data processing method, and interface, apparatus, system, device and medium
WO2022110801A1 (en) Data processing method and apparatus, electronic device, and storage medium
US20220321798A1 (en) Shooting method, apparatus, and electronic device
US20220345621A1 (en) Scene lock mode for capturing camera images

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20946117

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20946117

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20946117

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 260723)