A method for model training, a method for building a map and a device
By compressing image feature points and training matching models in unmanned devices, the problem of reduced feature point matching accuracy caused by limited storage space of unmanned devices is solved, and high-precision map construction is achieved.
Patent Information
- Application Number
- CN202210530127.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-16
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-05-16
AI Technical Summary
In the limited storage space of unmanned driving equipment, how to ensure the accuracy of feature point matching to ensure the accuracy of the map constructed, especially in unfamiliar environments, the problem of reduced distinction between image feature points.
By obtaining the original description features of image feature points for compression, and using matching model training to maximize the matching of feature points and ensure the matching accuracy of feature points after compression, two encoders are used to quickly determine the matching relationship, and queues are used to reduce storage Pressure, adjust network parameters to improve training efficiency.
It effectively improves the accuracy of image feature point matching, ensures map accuracy, reduces storage space requirements, and improves the map construction capabilities of unmanned devices in unfamiliar environments.
Smart Images

Figure CN114972909B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned driving technology, and in particular to a model training method, a map construction method and a device. Background Art
[0002] In an unmanned driving environment, it is necessary to construct a map of the unmanned driving equipment so that the drone can drive according to the constructed map.
[0003] To build a map in an unfamiliar environment, unmanned equipment needs to collect a large number of images to build a high-precision map. However, due to the limited storage space of unmanned equipment, when building a map, it is often necessary to reduce the storage space occupied by the collected images by reducing the descriptive information in the image that contributes less to map construction.
[0004] In the process of building a map, it is necessary to match the same feature points in the real world in multiple images acquired by unmanned equipment. However, because some descriptive information in the image is reduced, the distinction between the feature points contained in the acquired image is reduced, which reduces the accuracy of feature point matching.
[0005] Therefore, how to ensure the matching accuracy of feature points and thus the accuracy of the constructed map under the limited storage space of unmanned equipment is an urgent problem to be solved. Summary of the invention
[0006] This specification provides a model training method, a map construction method and a device to partially solve the above-mentioned problems existing in the prior art.
[0007] This manual adopts the following technical solutions:
[0008] This manual provides a method for model training and a method for building a map, including:
[0009] Acquire a first image and a second image, and determine a matching relationship between image feature points contained in the first image and the second image;
[0010] Inputting the first image and the second image into a matching model to be trained to compress original description features of each image feature point contained in the first image and the second image, and determining, for each image feature point contained in the first image, a matching degree between the compressed description features of the image feature point and the compressed description features of an image feature point in the second image that has the matching relationship with the image feature point, as a first matching degree;
[0011] The matching model is trained with maximizing the first matching degree as an optimization goal.
[0012] Optionally, the method further comprises:
[0013] For each image feature point included in the first image, determining a degree of matching between a compression description feature of the image feature point and a compression description feature of an image feature point in the second image that does not have the matching relationship with the image feature point, as a second matching degree;
[0014] The matching model is trained with minimizing the second matching degree as an optimization goal.
[0015] Optionally, the matching model includes: a first encoder and a second encoder;
[0016] Inputting the first image and the second image into a matching model to be trained to compress original description features of each image feature point contained in the first image and the second image, specifically comprising:
[0017] Inputting the first image into the first encoder to compress original description features of each image feature point contained in the first image;
[0018] The second image is input into the second encoder to compress the original description features of each image feature point contained in the second image.
[0019] Optionally, for each image feature point included in the first image, determining a degree of matching between a compression description feature of the image feature point and a compression description feature of an image feature point in the second image that has the matching relationship with the image feature point specifically includes:
[0020] Putting compressed description features of some image feature points contained in the second image into a queue of a specified length;
[0021] For each image feature point contained in the first image, after determining the degree of match between the compressed description features of the image feature point and each compressed description feature contained in the queue, the compressed description features contained in the queue are deleted, and the compressed description features of the image feature points in the second image that have not been added to the queue are placed in the queue until the degree of match between the compressed description features of the image feature point and each compressed description feature of the image feature point contained in the second image is determined.
[0022] Optionally, the network structure of the first encoder is the same as the network structure of the second encoder;
[0023] Training the matching model specifically includes:
[0024] adjusting the network parameters of the first encoder according to the result output by the matching model and the optimization target, and adjusting the network parameters of the second encoder according to the adjusted network parameters of the first encoder; or
[0025] According to the result output by the matching model and the optimization target, the network parameters of the second encoder are adjusted, and according to the adjusted network parameters of the second encoder, the network parameters of the first encoder are adjusted.
[0026] Optionally, for each image feature point included in the first image, determining, as a first matching degree, a matching degree between a compression description feature of the image feature point and a compression description feature of an image feature point in the second image that has the matching relationship with the image feature point, specifically includes:
[0027] Inputting each image feature point contained in the first image into the first encoder, determining a compression description feature of the image feature point, and using the compression description feature of each image feature point contained in the first image as a query value;
[0028] Inputting each image feature point contained in the second image into the second encoder, determining a compression description feature of the image feature point, and using the compression description feature of each image feature point contained in the second image as a key value;
[0029] For each image feature point included in the first image, a matching degree between a query value of the image feature point and a key value of an image feature point in the second image that has the matching relationship with the image feature point is determined as the first matching degree.
[0030] This specification provides a method for constructing a map, including:
[0031] Acquire each target image for constructing a map;
[0032] Inputting each target image into a pre-trained matching model to compress the original description features of the image feature points contained in each target image, and determining the matching degree between the compressed description features of the image feature points in different target images, wherein the matching model is trained by the above-mentioned model training method;
[0033] A map is constructed according to the matching degree and the target images.
[0034] This specification provides a model training device, including:
[0035] An acquisition module, used to acquire a first image and a second image, and determine a matching relationship between each image feature point contained in the first image and the second image;
[0036] a determination module, configured to input the first image and the second image into a matching model to be trained, so as to compress original description features of each image feature point contained in the first image and the second image, and determine, for each image feature point contained in the first image, a degree of matching between the compressed description features of the image feature point and the compressed description features of the image feature point in the second image that has the matching relationship with the image feature point, as a first matching degree;
[0037] An optimization module is used to train the matching model with maximizing the first matching degree as an optimization goal.
[0038] This specification provides a device for constructing a map, including:
[0039] An acquisition module, used for acquiring each target image used for constructing a map;
[0040] A compression module, used for inputting each target image into a pre-trained matching model to compress the original description features of the image feature points contained in each target image, and determining the matching degree between the compressed description features of the image feature points in different target images, wherein the matching model is trained by the above-mentioned model training method;
[0041] A construction module is used to construct a map according to the matching degree and each target image.
[0042] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned model training method and map construction method.
[0043] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned model training method and map construction method when executing the program.
[0044] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0045] In the model training method and the map construction method provided in this specification, the server obtains the first image and the second image, and determines the matching relationship between each image feature point contained in the first image and the second image. After obtaining the first image and the second image, the server inputs the first image and the second image into the matching model to be trained to compress the original description features of each image feature point contained in the first image and the second image, and for each image feature point contained in the first image, determines the matching degree between the compressed description features of the image feature point and the compressed description features of the image feature point in the second image that has a matching relationship with the image feature point, as the first matching degree. The matching model is trained with maximizing the first matching degree as the optimization goal.
[0046] It can be seen from the above method that the matching relationship between the image feature points obtained before compressing the first image and the second image can be used to determine the matching degree between the image feature points with a matching relationship, and the model can be trained with maximizing the matching degree as the optimization goal. In this way, in the actual application process, the accuracy of the matching between the image feature points after compression can be effectively guaranteed, thereby ensuring the accuracy of the map finally constructed. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0048] Figure 1 A flowchart of a model training method provided in this specification;
[0049] Figure 2 A flowchart of a method for constructing a map provided in this specification;
[0050] Figure 3 This is an operation flow of a matching model provided in this manual;
[0051] Figure 4 A schematic diagram of a model training device provided in this specification;
[0052] Figure 5 A schematic diagram of a device for constructing a map provided in this specification;
[0053] Figure 6 A method corresponding to the Figure 1 Schematic diagram of an electronic device. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0055] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0056] Figure 1 A flow chart of a model training method provided in this specification includes the following steps:
[0057] S101: Acquire a first image and a second image, and determine a matching relationship between image feature points contained in the first image and the second image.
[0058] In this specification, the execution entity of the specific implementation method of building a map may be a terminal device such as a server, a desktop computer, a laptop computer, or may refer to unmanned equipment such as a drone, an unmanned vehicle, an autonomous driving robot, etc. For ease of description, the following will only take the server as an example to illustrate the method of building a map provided in this specification.
[0059] At present, when unmanned equipment builds maps in unfamiliar environments, it often needs to collect a large number of images to build high-precision maps. However, due to the limited storage space of unmanned equipment, when building maps, it is necessary to reduce the storage space occupied by the collected images by reducing the descriptive information in the images that contributes less to map construction.
[0060] In the process of building a map, it is first necessary to obtain multiple images collected by the image acquisition device (such as a camera) carried by the unmanned equipment, and then extract the feature points contained in the image, match the feature points corresponding to the same position in the real world, so as to determine the matching relationship between the feature points, and build a map based on the matching relationship between the feature points and the acquired images.
[0061] In practical applications, after acquiring an image, unmanned equipment often reduces the storage space occupied by the image by reducing the descriptive features of the acquired image. However, because some descriptive features in the image are reduced, the distinction between the feature points contained in the acquired image is reduced, which reduces the accuracy of feature point matching.
[0062] Based on this, this specification provides a model training method, where the server first obtains multiple images for constructing a map, and uses two images that are at least partially identical among the obtained target images as the first image and the second image. After the server obtains the first image and the second image, the image feature points contained in the first image and the second image are extracted, and the matching relationship between each image feature point contained in the first image and the second image is determined.
[0063] In this specification, the method of extracting image feature points contained in the first image and the second image and the method of determining the matching relationship between each image feature point contained in the first image and the second image are existing conventional methods and are not specifically limited here.
[0064] The first image and the second image may be obtained by an unmanned device, a manned device, a camera, etc. The unmanned device using the map constructed by the map construction method provided in this specification can be used to perform delivery tasks in the delivery field, such as using unmanned devices for delivery business scenarios such as express delivery, logistics, and takeout.
[0065] S102: Input the first image and the second image into the matching model to be trained to compress the original description features of each image feature point contained in the first image and the second image, and determine, for each image feature point contained in the first image, a matching degree between the compressed description features of the image feature point and the compressed description features of the image feature point in the second image that has the matching relationship with the image feature point, as a first matching degree.
[0066] After acquiring the first image and the second image, the server inputs the first image and the second image into the matching model to be trained to compress the original description features of each image feature point contained in the first image and the second image. The description features are used to characterize the feature vectors near the image features around the image feature points for determining whether the image feature points have a matching relationship with other image feature points. The original description features refer to the description features contained in each image feature point of the first image and the second image before compression.
[0067] Because the position of each image feature point in the image remains unchanged before and after the description feature is compressed, the image feature points that have a matching relationship before compression should also have a matching relationship after compression. Therefore, for each image feature point contained in the first image, the server can determine the image feature point in the second image that has a matching relationship with the image feature point based on the matching relationship between the acquired image feature points. After determining the image feature point that has a matching relationship with the image feature point, the server obtains the compressed description features of the image feature point and the compressed description features of the image feature point that have a matching relationship with the image feature point, and determines the matching degree between the compressed description features of the image feature point and the compressed description features of the image feature point that have a matching relationship with the image feature point as the first matching degree. The matching degree can be based on the similarity of the grayscale values between the acquired compressed description features.
[0068] Therefore, for each image feature point contained in the first image, the server can determine the degree of matching between a compressed description feature of the image feature point in the second image that has no matching relationship with the image feature point and the compressed description feature of the image feature point as the second matching degree.
[0069] It should be noted that the matching model provided in this specification includes two encoders, namely a first encoder and a second encoder. The first encoder is used to compress the original description features of each image feature point contained in the first image after the server inputs the first image into the first encoder. The second encoder is used to compress the original description features of each image feature point contained in the second image after the server inputs the second image into the second encoder.
[0070] The purpose of the server setting the first encoder and the second encoder is to be able to more quickly determine the degree of match between the compressed description features of each image feature point contained in the first image and the compressed description features of each image feature point contained in the second image. That is, the server can input the first image into the first encoder, and after determining the compressed description features of each image feature point contained in the first image, it can use the compressed description features of each image feature point contained in the first image as a query value. At the same time, the server can input the second image into the second encoder, and after determining the compressed description features of each image feature point contained in the second image, it can use the compressed description features of each image feature point contained in the second image as a key value.
[0071] For each image feature point included in the first image, the server may use the matching degree between the query value for determining the image feature point and the key value of the image feature point in the second image that has a matching relationship with the image feature point as the first matching degree. Similarly, for each image feature point included in the first image, the server may use the matching degree between the query value for determining the image feature point and the key value of the image feature point in the second image that does not have a matching relationship with the image feature point as the second matching degree. In this way, the server can complete the training of the matching model more quickly through the relationship between the query value and the key value.
[0072] In practical applications, due to the memory limitation of the graphics processing unit (GPU), this specification determines the first matching degree and the second matching degree by setting a queue. That is, the compressed description features of some image feature points contained in the second image are placed in a queue of a specified length, and the queue length here can be set according to actual conditions. For each image feature point contained in the first image, after determining the matching degree between the compressed description features of the image feature point and each compressed description feature contained in the queue, the compressed description features contained in the queue are deleted, and the compressed description features of the image feature points in the second image that have not been added to the queue are placed in the queue until the matching degree between the compressed description features of the image feature point and the compressed description features of each image feature point contained in the second image is determined.
[0073] For example, assuming that the second image contains 100 image feature points and the specified length of the queue is 10, the server can select 10 image feature points from the second image and put the compressed description features of the 10 image feature points into the queue. After determining the degree of match between all the compressed description features contained in the current queue and the compressed description features of an image feature point in the first image, the 10 compressed description features in the current queue can be deleted, and 10 more image feature points can be selected from the remaining 90 image feature points in the second image, and the compressed description features of the reselected 10 image feature points can be put into the queue. This process continues until the degree of match between the compressed description features of the image feature point in the first image and the compressed description features of the 100 image feature points in the second image is determined.
[0074] It should be noted that the server sorts the compressed description features of each image feature point contained in the second image in advance to determine the order in which the compressed description features are placed in the queue. They can also be placed randomly. It is only necessary to ensure that the number of compressed description features placed in meets the preset queue length. There is no specific limitation on the order of image feature points placed in the queue. In actual applications, the queue length can be set to 65536.
[0075] S103: Training the matching model with maximizing the first matching degree as an optimization goal.
[0076] After obtaining the first matching degree or the second matching degree between the compressed description features of each image feature point contained in the first image and the compressed description features of each image feature point contained in the second image, the server trains the matching model with maximizing the first matching degree as the optimization goal and minimizing the second matching degree as the optimization goal.
[0077] Specifically, the server may train the matching model according to a preset loss function. This specification provides a loss function for training the matching model:
[0078]
[0079] In the above loss function, L represents the loss value, z q represents the query value for each image feature point contained in the first image, z k Represents the second image with z q The corresponding image feature points have key values of image feature points with matching relationships, represents the key value corresponding to the i-th image feature point contained in the second image. τ is the adjustment parameter, z q .z k Represents z q With z k The matching degree between Represents z q and k represents the number of image feature points contained in the second image, so Characterized as z in the first image q The sum of the matching degrees between τ and all the image feature points contained in the second image. In practical applications, in order to more effectively complete the training of the matching model, the value of τ can be set to 0.07.
[0080] From the above loss function, we can see that z q With z k The larger the product of , the smaller the corresponding loss value, that is, the greater the matching degree between the image feature points with matching relationship, the smaller the loss function. q and The smaller the product of is, the smaller the loss value is. Contains z k , but because the number of image feature points contained in the second image is often larger, it is different from z q The key values of image feature points that do not have a matching relationship are The value of z has a much greater impact than k for Therefore, the smaller the matching degree between image feature points that do not have a matching relationship, the smaller the above loss function can be. Therefore, for each training, the model is trained by adjusting the relevant parameters to minimize the value of the loss function as the optimization goal.
[0081] After each completion of the training of the matching model, the server will adjust the parameters of the first encoder and / or the second encoder. In order to facilitate the adjustment of the parameters, in this specification, the first encoder and the second encoder can be set to encoders with the same network structure, that is, the network structure of the first encoder is the same as the network structure of the second encoder, so that after the server adjusts the network parameters of the first encoder according to the results output by the matching model and the optimization target, the network parameters of the second encoder can be adjusted according to the adjusted network parameters of the first encoder. Similarly, after the server adjusts the network parameters of the second encoder according to the results output by the matching model and the optimization target, the server can also adjust the network parameters of the first encoder according to the adjusted network parameters of the second encoder.
[0082] For details, please refer to the following formula:
[0083] θ k ←mθ k +(1-m)θ q
[0084] In the above formula, θ q Represents the network parameters of the encoder adjusted according to the matching model output and the optimization target, θ k Represents according to θ q Adjusted parameters Adjusted encoder network parameters, m is the weight coefficient, used to control θ q The parameter adjustment for θ k That is, the server adjusts the network parameter θ of the first encoder according to the result of the matching model output and the optimization goal. q After that, the network parameters θ of the first encoder can be adjusted. q , adjust the network parameters θ of the second encoder k Similarly, the server can adjust the network parameters θ of the second encoder according to the matching model output results and optimization goals. q After that, according to the adjusted network parameters θ of the second encoder q , adjust the network parameters θ of the first encoder k In this specification, in order to ensure the effect of adjusting the parameters, the value of m can be set to 0.9.
[0085] The above is a model training method provided in this specification. The following is combined with the accompanying drawings to illustrate how to construct a map based on the model trained in the above manner in actual applications. Figure 2 shown.
[0086] Figure 2 A flowchart of a method for constructing a map provided in this specification includes the following steps:
[0087] S201: Acquire target images for constructing a map.
[0088] In practical applications, unmanned equipment can obtain target images for building maps in unfamiliar environments. The target images can be obtained by using an image acquisition device (such as a camera) mounted on the unmanned equipment to acquire images.
[0089] S202: Input each of the target images into a pre-trained matching model to compress the original description features of the image feature points contained in each of the target images, and determine the matching degree between the compressed description features of the image feature points in different target images, wherein the matching model is trained by the above-mentioned model training method.
[0090] After acquiring the target image, the server inputs the target image into the matching model trained according to the above model training method to compress the original description features of the image feature points contained in each target image and determine the matching degree between the compressed description features of the image feature points in different target images. Figure 3 This is an operation flow of a matching model provided in this manual.
[0091] exist Figure 3 In the process, the server inputs the description feature A, i.e., the description feature of each image feature point contained in the first image, into the first encoder to obtain the compressed feature A, i.e., the compressed description feature of each image feature point contained in the compressed first image. At the same time, the server inputs the description feature B, i.e., the description feature of each image feature point contained in the second image, into the second encoder to obtain the compressed description feature B, i.e., the compressed description feature of each image feature point contained in the compressed second image.
[0092] The server determines the matching degree between the compressed description features of the image feature points in different target images according to the compressed compressed description features.
[0093] S203: Constructing a map according to the matching degree and the target images.
[0094] After obtaining the matching degree, the server determines the image feature points having a matching relationship based on the matching degree, and determines the position and posture of the image acquisition device when each target image is acquired based on the matching relationship between the image feature points.
[0095] The server can map each target image into a preset three-dimensional space according to the determined position of the image acquisition device when each target image is acquired. As the number of acquired target images increases, the map constructed in the three-dimensional space is gradually improved until a complete map is constructed.
[0096] It can be seen from the above method that the server can determine the degree of matching between the image feature points having a matching relationship based on the matching relationship between the image feature points obtained before compressing the first image and compressing the second image, and train the model with maximizing the matching degree as the optimization goal. The query values and key values obtained by the two encoders are used to determine the degree of matching between the image feature points, thereby ensuring the accuracy of the matching between the image feature points, so as to ensure the accuracy of the map finally constructed. At the same time, a queue method is used to determine the degree of matching between the descriptive features of each image feature point, reducing the storage pressure of the GPU. The same network structure characteristics of the first encoder and the second encoder are used to adjust the parameters of the first encoder and the second encoder, thereby improving the efficiency of model training.
[0097] It should be noted that the first image and the second image mentioned in this specification can be interchanged, that is, the server can determine the degree of match between the compressed description features of each image feature point contained in the second image and the compressed description features of the image feature point in the first image that has a matching relationship with the image feature point, and train the matching model with maximizing the degree of match as the optimization goal. Similarly, for the first encoder and the second encoder, the first image can be input into the second encoder, and the second image can be input into the first encoder, so as to perform the subsequent process of compressing the description features of the image feature points.
[0098] In this specification, the server can use the compressed description features of a pair of image feature points with a matching relationship as a positive sample, and use the compressed description features of a pair of image feature points without a matching relationship as a negative sample. That is, the compressed description features of the image feature points can be used as training samples without using the images as training samples, which greatly reduces the number of images required for training the matching model.
[0099] Figure 4 A schematic diagram of a model training device provided in this specification includes:
[0100] An acquisition module 401 is used to acquire a first image and a second image, and determine a matching relationship between each image feature point contained in the first image and the second image;
[0101] A determination module 402 is used to input the first image and the second image into a matching model to be trained, so as to compress the original description features of each image feature point contained in the first image and the second image, and determine, for each image feature point contained in the first image, a matching degree between the compressed description features of the image feature point and the compressed description features of the image feature point in the second image that has the matching relationship with the image feature point, as a first matching degree;
[0102] The optimization module 403 is used to train the matching model with maximizing the first matching degree as an optimization goal.
[0103] Optionally, the optimization module 403 is also used to determine, for each image feature point contained in the first image, a degree of matching between a compressed description feature of the image feature point and a compressed description feature of an image feature point in the second image that does not have the matching relationship with the image feature point, as a second matching degree; and train the matching model with minimizing the second matching degree as the optimization goal.
[0104] Optionally, the matching model includes: a first encoder and a second encoder;
[0105] The determination module 402 is specifically used to input the first image and the second image into the matching model to be trained to compress the original description features of each image feature point contained in the first image and the second image, specifically including: inputting the first image into the first encoder to compress the original description features of each image feature point contained in the first image; inputting the second image into the second encoder to compress the original description features of each image feature point contained in the second image.
[0106] Optionally, the determination module 402 is specifically used to place compressed description features of some image feature points contained in the second image into a queue of specified length; for each image feature point contained in the first image, after determining the degree of match between the compressed description features of the image feature point and each compressed description feature contained in the queue, delete the compressed description features contained in the queue, and place the compressed description features of the image feature points in the second image that have not been added to the queue into the queue until the degree of match between the compressed description features of the image feature point and each image feature point contained in the second image is determined.
[0107] Optionally, the network structure of the first encoder is the same as the network structure of the second encoder;
[0108] The optimization module 403 is specifically used to adjust the network parameters of the first encoder according to the result output by the matching model and the optimization target, and adjust the network parameters of the second encoder according to the adjusted network parameters of the first encoder; or adjust the network parameters of the second encoder according to the result output by the matching model and the optimization target, and adjust the network parameters of the first encoder according to the adjusted network parameters of the second encoder.
[0109] Optionally, the determination module 402 is specifically used to input each image feature point contained in the first image into the first encoder, determine the compression description features of the image feature point, and use the compression description features of each image feature point contained in the first image as a query value; input each image feature point contained in the second image into the second encoder, determine the compression description features of the image feature point, and use the compression description features of each image feature point contained in the second image as a key value; for each image feature point contained in the first image, determine the query value of the image feature point and the matching degree between the key value of the image feature point in the second image that has the matching relationship with the image feature point, as the first matching degree.
[0110] Figure 5 A schematic diagram of a device for constructing a map provided in this specification includes:
[0111] An acquisition module 501 is used to acquire target images for constructing a map;
[0112] A compression module 502 is used to input each target image into a pre-trained matching model to compress the original description features of the image feature points contained in each target image, and determine the matching degree between the compressed description features of the image feature points in different target images, wherein the matching model is trained by the above-mentioned model training method;
[0113] The construction module 503 is used to construct a map according to the matching degree and the target images.
[0114] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A model training method and Figure 2 Provides a method for building a map.
[0115] This manual also provides Figure 6 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 6 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The model training method and Figure 2 A method for constructing a map is provided. Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0116] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0117] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0118] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0119] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0120] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0121] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0122] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0124] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0125] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0126] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0127] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0128] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0130] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0131] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A model training method, characterized in that: include: Acquire a first image and a second image, and determine a matching relationship between image feature points contained in the first image and the second image; Inputting the first image and the second image into a matching model to be trained to compress original description features of each image feature point contained in the first image and the second image, and determining, for each image feature point contained in the first image, a matching degree between the compressed description features of the image feature point and the compressed description features of an image feature point in the second image that has the matching relationship with the image feature point, as a first matching degree; Training the matching model with maximizing the first matching degree as an optimization goal; For each image feature point included in the first image, determining a degree of matching between a compression description feature of the image feature point and a compression description feature of an image feature point in the second image that does not have the matching relationship with the image feature point, as a second matching degree; Training the matching model with minimizing the second matching degree as an optimization goal; The matching model includes: a first encoder and a second encoder; Inputting the first image and the second image into a matching model to be trained to compress original description features of each image feature point contained in the first image and the second image, specifically comprising: Inputting the first image into the first encoder to compress original description features of each image feature point contained in the first image; The second image is input into the second encoder to compress the original description features of each image feature point contained in the second image.
2. The method according to claim 1, characterized in that For each image feature point included in the first image, determining a degree of matching between a compression description feature of the image feature point and a compression description feature of an image feature point in the second image that has the matching relationship with the image feature point specifically includes: Putting compressed description features of some image feature points contained in the second image into a queue of a specified length; For each image feature point contained in the first image, after determining the degree of match between the compressed description features of the image feature point and each compressed description feature contained in the queue, the compressed description features contained in the queue are deleted, and the compressed description features of the image feature points in the second image that have not been added to the queue are placed in the queue until the degree of match between the compressed description features of the image feature point and each compressed description feature of the image feature point contained in the second image is determined.
3. The method according to claim 1, characterized in that The network structure of the first encoder is the same as the network structure of the second encoder; and training the matching model specifically includes: adjusting the network parameters of the first encoder according to the result output by the matching model and the optimization target, and adjusting the network parameters of the second encoder according to the adjusted network parameters of the first encoder; or According to the result output by the matching model and the optimization target, the network parameters of the second encoder are adjusted, and according to the adjusted network parameters of the second encoder, the network parameters of the first encoder are adjusted.
4. The method according to claim 1, characterized in that For each image feature point included in the first image, determining, as a first matching degree, a matching degree between a compression description feature of the image feature point and a compression description feature of an image feature point in the second image that has the matching relationship with the image feature point, specifically includes: Inputting each image feature point contained in the first image into the first encoder, determining a compression description feature of the image feature point, and using the compression description feature of each image feature point contained in the first image as a query value; Inputting each image feature point contained in the second image into the second encoder, determining a compression description feature of the image feature point, and using the compression description feature of each image feature point contained in the second image as a key value; For each image feature point included in the first image, a matching degree between a query value of the image feature point and a key value of an image feature point in the second image that has the matching relationship with the image feature point is determined as the first matching degree.
5. A method for constructing a map, characterized in that: include: Acquire each target image for constructing a map; Inputting each target image into a pre-trained matching model to compress original description features of image feature points contained in each target image, and determining the matching degree between the compressed description features of image feature points in different target images, wherein the matching model is trained by the method according to any one of claims 1 to 4 above; A map is constructed according to the matching degree and the target images.
6. A device for constructing a map, characterized in that: include: An acquisition module, used for acquiring each target image used for constructing a map; A compression module, used for inputting each target image into a pre-trained matching model to compress the original description features of the image feature points contained in each target image, and determining the matching degree between the compressed description features of the image feature points in different target images, wherein the matching model is trained by the method according to any one of claims 1 to 4 above; A construction module is used to construct a map according to the matching degree and each target image.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for extracting image
CN108898186A
Evaluation method of image registration algorithm, terminal and storage medium
CN113034553A
Map constructing method, positioning method and wireless communication terminal
US20220114750A1
