Matching method, device, computer equipment and storage medium

By obtaining the feature vector and pose information of the image to be matched, the basic pictures that meet the preset pose conditions are selected, which solves the problem of feature vector matching errors in image query and improves the matching accuracy.

CN114282028BActive Publication Date: 2025-02-18BEIJING AIBI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111654232.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-02-18
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

During image query, some areas are similar, resulting in the picture with the closest feature vector that does not match the image to be retrieved, which reduces the matching accuracy.

Method used

By obtaining the feature vector of the picture to be matched, the basic picture and its pose information that meet the similarity conditions with its feature vectors are determined, and the basic picture that meets the preset pose conditions is filtered based on the pose information, and the basic picture that meets the preset pose conditions is determined as being matched. The target picture matches the picture.

Benefits of technology

Improve the accuracy of image matching and avoid feature vector matching errors caused by similar regions in the target scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114282028B_ABST
    Figure CN114282028B_ABST
Patent Text Reader

Abstract

The present application relates to a matching method, device, computer equipment and storage medium. The method includes: obtaining a feature vector of a picture to be matched; determining a first number of basic pictures and their corresponding posture information that meet similarity conditions with the feature vector of the picture to be matched; according to the posture information corresponding to the first number of basic pictures, determining the basic pictures that meet the preset posture screening conditions in the first number of basic pictures, and determining the basic pictures that meet the preset posture screening conditions as target pictures that match the picture to be matched. The method provided by an embodiment of the present invention can reorder multiple pictures in a similar picture set according to the posture information of each picture to obtain the correct target picture, avoiding the problem that the picture with the closest feature vector does not match the picture to be matched due to the similarity of some areas of the target scene, thereby improving the retrieval accuracy of the query picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a matching method, apparatus, computer device and storage medium. Background Art

[0002] In recent years, with the increasing demand for image query, the purpose of image query is to find the image most similar to the image to be retrieved in a large-scale image library.

[0003] In the related art, in the image query process, images are generally matched by comparing their feature vectors. For example, the result with the most similar feature vector can be regarded as the final matching result of the image to be retrieved. However, in some scenes, if some areas in these scenes are similar, the image with the closest feature vector will not match the image to be retrieved, resulting in a low matching accuracy. Summary of the invention

[0004] Based on this, it is necessary to provide a matching method, device, computer equipment, computer-readable storage medium and computer program product that can improve image matching accuracy in order to solve the above technical problems.

[0005] In a first aspect, the present application provides a matching method. The method comprises:

[0006] Get the feature vector of the image to be matched;

[0007] Determine a first number of basic pictures whose feature vectors satisfy a similarity condition with the picture to be matched and their corresponding posture information, wherein the preset picture library contains a plurality of picture information, the picture information includes basic pictures and posture information corresponding to the basic pictures, the basic pictures are obtained by scanning the target scene with a picture acquisition device, and the posture information is posture information when the picture acquisition device takes the basic pictures;

[0008] According to the posture information corresponding to the first number of basic pictures, basic pictures that meet the preset posture screening conditions are determined among the first number of basic pictures, and the basic pictures that meet the preset posture screening conditions are determined as target pictures that match the pictures to be matched.

[0009] In one embodiment, the image acquisition device is a robot acquisition device; the generation process of the preset image library includes:

[0010] The robot acquisition device scans the target scene at various positions in the target scene according to the mobile acquisition instruction, and obtains the posture information of the robot acquisition device at the current position and the basic picture corresponding to the posture information;

[0011] Each of the posture information and the basic pictures corresponding to the posture information are stored to obtain the preset picture library.

[0012] In one of the embodiments, determining the basic pictures satisfying the preset posture screening condition from the first number of basic pictures according to the posture information corresponding to the first number of basic pictures includes:

[0013] For each basic picture in the first number of basic pictures, according to the posture information corresponding to the first number of basic pictures, calculate the number of times each basic picture in the first number of basic pictures is in a posture that is closely adjacent to other basic pictures;

[0014] The basic picture with the highest number of adjacent postures among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

[0015] In one of the embodiments, determining the basic pictures satisfying the preset posture screening condition from the first number of basic pictures according to the posture information corresponding to the first number of basic pictures includes:

[0016] Determine, according to the pose information corresponding to each basic picture in the preset picture library and the pose information corresponding to the first number of basic pictures, pose adjacent pictures corresponding to the first number of basic pictures, to obtain a pose adjacent picture set;

[0017] The basic picture that appears most frequently in the set of pictures adjacent to the posture among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

[0018] In one embodiment, the method further comprises:

[0019] Sort each of the first number of basic pictures according to the number of times that the posture of each basic picture in the first number of basic pictures is adjacent to each other, to obtain a reordering result of the first number of basic pictures;

[0020] The reordering result is outputted.

[0021] In one embodiment, the method further comprises:

[0022] reordering each of the first number of basic pictures according to the appearance frequency of each of the first number of basic pictures in the set of pictures adjacent to the posture, to obtain a reordering result;

[0023] The reordering result is outputted.

[0024] In one of the embodiments, the posture information includes coordinate data and posture angle;

[0025] The step of determining the posture adjacent pictures corresponding to the first number of basic pictures according to the posture information corresponding to each basic picture in the preset picture library and the posture information corresponding to the first number of basic pictures includes:

[0026] For each of the first number of basic pictures, obtaining first coordinate data and a first pose angle corresponding to each of the first number of basic pictures;

[0027] Respectively obtain the second coordinate data and the second posture angle corresponding to each basic picture in the preset picture library;

[0028] Calculate the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data, the first posture angle, the second coordinate data, the second posture angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the posture angle;

[0029] A second number of basic pictures in the preset picture library whose posture distances satisfy a preset similarity distance condition are used as posture adjacent pictures of each basic picture in the first number of basic pictures.

[0030] In one embodiment, the step of calculating the posture distance between each basic image in the preset image library and each basic image in the first number of basic images according to the first coordinate data, the first posture angle, the second coordinate data, the second posture angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the posture angle includes:

[0031] Calculating a modulus between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data and the second coordinate data;

[0032] Calculating a posture angle difference according to the first posture angle and the second posture angle;

[0033] According to the first weight corresponding to the model and the second weight corresponding to the posture angle difference, the model and the posture angle difference are weightedly calculated to obtain the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures.

[0034] In one embodiment, determining a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding pose information includes:

[0035] Calculating, by means of a picture feature extractor, a first picture feature vector of the picture to be matched and a second picture feature vector of each of the basic pictures;

[0036] For each of the basic pictures, calculating a feature vector distance between a feature vector of the first picture and a feature vector of the second picture by using a preset distance calculation algorithm;

[0037] In the preset picture library, screening is performed according to the distance of each feature vector to determine a first number of basic pictures that meet a preset similarity condition with the picture to be matched, and the posture information corresponding to the first number of basic pictures is obtained.

[0038] In a second aspect, the present application also provides a matching device. The device comprises:

[0039] An acquisition module is used to obtain a feature vector of a picture to be matched;

[0040] A first determination module is used to determine a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding posture information;

[0041] The second determination module is used to determine, among the first number of basic pictures, a basic picture that meets a preset posture condition as a target picture that matches the picture to be matched.

[0042] In one embodiment, the image acquisition device is a robot acquisition device; the apparatus further comprises:

[0043] A collection module, used for the robot collection device to scan the target scene at various positions in the target scene according to the mobile collection instruction, to obtain the posture information of the robot collection device at the current position and the basic picture corresponding to the posture information;

[0044] The storage module is used to store each of the posture information and the basic pictures corresponding to the posture information to obtain the preset picture library.

[0045] In one embodiment, the second determining module is specifically configured to:

[0046] For each basic picture in the first number of basic pictures, according to the posture information corresponding to the first number of basic pictures, calculate the number of times each basic picture in the first number of basic pictures is in a posture that is closely adjacent to other basic pictures;

[0047] The basic picture with the highest number of adjacent postures among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

[0048] In one embodiment, the second determining module is specifically configured to:

[0049] Determine, according to the pose information corresponding to each basic picture in the preset picture library and the pose information corresponding to the first number of basic pictures, pose adjacent pictures corresponding to the first number of basic pictures, to obtain a pose adjacent picture set;

[0050] The basic picture that appears most frequently in the set of pictures adjacent to the posture among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

[0051] In one embodiment, the device further comprises:

[0052] A first sorting module is used to reorder each of the first number of basic pictures according to the appearance frequency of each of the first number of basic pictures in the set of pictures with adjacent postures, so as to obtain a reordering result;

[0053] The first output module is used to output the reordering result.

[0054] In one embodiment, the device further comprises:

[0055] A second sorting module is used to sort each of the first number of basic pictures according to the number of times the posture of each basic picture in the first number of basic pictures is adjacent to each other, so as to obtain a re-sorting result of the first number of basic pictures;

[0056] The second output module is used to output the reordering result.

[0057] In one of the embodiments, the posture information includes coordinate data and posture angle;

[0058] The second determining module is further specifically configured to:

[0059] Obtaining first coordinate data and a first pose angle corresponding to each basic picture in the first number of basic pictures;

[0060] Respectively obtain the second coordinate data and the second posture angle corresponding to each basic picture in the preset picture library;

[0061] Calculate the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data, the first posture angle, the second coordinate data, the second posture angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the posture angle;

[0062] A second number of basic pictures in the preset picture library whose posture distances satisfy a preset similarity distance condition are used as posture adjacent pictures of each basic picture in the first number of basic pictures.

[0063] In one embodiment, the second determining module is further specifically configured to:

[0064] Calculating a modulus between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data and the second coordinate data;

[0065] Calculating a posture angle difference according to the first posture angle and the second posture angle;

[0066] According to the first weight corresponding to the model and the second weight corresponding to the posture angle difference, the model and the posture angle difference are weightedly calculated to obtain the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures.

[0067] In one embodiment, the first determining module is specifically configured to:

[0068] Calculating, by means of a picture feature extractor, a first picture feature vector of the picture to be matched and a second picture feature vector of each of the basic pictures;

[0069] For each of the basic pictures, calculating a feature vector distance between a feature vector of the first picture and a feature vector of the second picture by using a preset distance calculation algorithm;

[0070] In the preset picture library, screening is performed according to the distance of each feature vector to determine a first number of basic pictures that meet a preset similarity condition with the picture to be matched, and the posture information corresponding to the first number of basic pictures is obtained.

[0071] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0072] Get the feature vector of the image to be matched;

[0073] Determine a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding position and posture information;

[0074] According to the posture information corresponding to the first number of basic pictures, basic pictures that meet the preset posture screening conditions are determined among the first number of basic pictures, and the basic pictures that meet the preset posture screening conditions are determined as target pictures that match the pictures to be matched.

[0075] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0076] Get the feature vector of the image to be matched;

[0077] Determine a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding position and posture information;

[0078] According to the posture information corresponding to the first number of basic pictures, basic pictures that meet the preset posture screening conditions are determined among the first number of basic pictures, and the basic pictures that meet the preset posture screening conditions are determined as target pictures that match the pictures to be matched.

[0079] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0080] Get the feature vector of the image to be matched;

[0081] Determine a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding position and posture information;

[0082] According to the posture information corresponding to the first number of basic pictures, basic pictures that meet the preset posture screening conditions are determined among the first number of basic pictures, and the basic pictures that meet the preset posture screening conditions are determined as target pictures that match the pictures to be matched.

[0083] The above-mentioned matching method, apparatus, computer equipment, storage medium and computer program product obtain the feature vector of the picture to be matched; determine the first number of basic pictures and their corresponding posture information that meet the similarity condition with the feature vector of the picture to be matched; determine the basic pictures that meet the preset posture screening condition in the first number of basic pictures according to the posture information corresponding to the first number of basic pictures, and determine the basic pictures that meet the preset posture screening condition as the target pictures that match the picture to be matched. The method provided by the embodiment of the present invention can reorder multiple pictures in a similar picture set according to the posture information of each picture to obtain the correct target picture, avoiding the problem that the picture with the closest feature vector does not match the picture to be matched due to the similarity of some areas of the target scene, thereby improving the retrieval accuracy of the query picture. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 A schematic diagram of a matching method in one embodiment;

[0085] Figure 2 A schematic diagram of a flow chart of steps for generating a preset picture library in one embodiment;

[0086] Figure 3 A schematic diagram of a flow chart of steps for determining a basic image that meets a preset posture condition in one embodiment;

[0087] Figure 4 A schematic diagram of a flow chart of steps for determining a basic image that meets a preset posture condition in another embodiment;

[0088] Figure 5 is a schematic diagram of a flow chart of a reordering step in one embodiment;

[0089] Figure 6 is a schematic diagram of a flow chart of a reordering step in another embodiment;

[0090] Figure 7 A schematic diagram of a flow chart of a step of calculating a pose adjacent picture in one embodiment;

[0091] Figure 8 A schematic diagram of a flow chart of a step of calculating a posture distance in one embodiment;

[0092] Fig. 9 A schematic diagram of a flow chart of a step of obtaining posture information corresponding to a first number of basic pictures in one embodiment;

[0093] Fig.10 is a structural block diagram of a matching device in one embodiment;

[0094] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0095] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0096] In one embodiment, Figure 1 As shown, a matching method is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The above-mentioned terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented with an independent server or a server cluster composed of multiple servers. In this embodiment, the matching method can be applied to a specific application environment of target scene recognition. The matching method includes the following steps:

[0097] Step 102: Obtain a feature vector of the image to be matched.

[0098] Specifically, the terminal can obtain the feature vector of the image to be matched and the preset image library, which contains multiple image information, the image information includes the basic image and the posture information corresponding to the basic image, the basic image is obtained by scanning the target scene through the image acquisition device, and the posture information is the posture information when the image acquisition device takes the basic image. The target scene can be an indoor scene, such as an interior scene of a building (such as an interior scene of a shopping mall, an interior scene of a room, etc.). The terminal continuously moves in the target scene through the image acquisition device, thereby scanning the target scene, and multiple image information can be obtained to form a preset image library. The image information includes the posture information of the image acquisition device when acquiring the image and the acquired image, which is the basic image, and the posture information includes the position information and posture information of the image acquisition device. The position information can be the coordinate data of the image acquisition device in the world coordinate system, such as (x, y, z); the posture information can be expressed by a unit quaternion, wherein the unit quaternion is an imaginary number with three imaginary parts, which represents the rotation and orientation of the three-dimensional space, and the posture information can also be the rotation angle of the camera of the image acquisition device in the horizontal direction.

[0099] Specifically, the quaternion can be expressed by the following formula, q = ((x, y, z), w) = (v, w), where v is a vector and w is a real number. It is also necessary to define a rotation, the rotation axis of which is the vector v = (vx, vy, vz), and the rotation angle is the rotation angle determined by the right-hand rule: θ.

[0100] Specifically, quaternions can also be represented in the following way: Quaternions are hypercomplex numbers. Complex numbers are composed of real numbers plus imaginary units i, where i 2 =-1. Similarly, quaternions are composed of real numbers plus three imaginary units i, j and k, and they have the following relationship: i 2 =j 2 =k 2 =-1, i°=j°=k°=1, each quaternion is a linear combination of 1, i, j and k, that is, quaternion can be generally expressed as a+bi+cj+dk, where a, b, c, d are real numbers. The geometric meaning of i, j and k themselves is a kind of rotation, where i rotation represents the rotation from the positive direction of the Z axis to the positive direction of the Y axis in the plane where the Z axis intersects with the Y axis, j rotation represents the rotation from the positive direction of the X axis to the positive direction of the Z axis in the plane where the X axis intersects with the Z axis, and k rotation represents the rotation from the positive direction of the Y axis to the positive direction of the X axis in the plane where the Y axis intersects with the X axis. -i, -j, -k represent the reverse rotations of i, j, and k rotations respectively.

[0101] Optionally, image matching in the target scene is actually target scene recognition. The recognition process can be: multiple images scanned by the image acquisition device form a previously established image database for the scene. When the user randomly takes a query image (image to be matched) with a mobile phone in the scene through the terminal, if the query image is very similar to a certain image in the database, the scene of the image in the database is the scene where the user is at the moment. We call this image retrieval with indoor scene information indoor scene recognition.

[0102] Step 104: Determine, in a preset picture library, a first number of basic pictures whose feature vectors satisfy a similarity condition with the picture to be matched and their corresponding posture information.

[0103] Specifically, the preset picture library includes a plurality of basic pictures, and the preset similarity condition may be that the distance to the picture feature vector of the picture to be matched is small. The first number may be k pictures, and the specific value of the number may be determined according to the actual application scenario.

[0104] That is to say, the terminal needs to calculate the feature vector distance between each basic picture contained in the preset picture library and the picture to be matched. In this way, the terminal can arrange the feature vector distances from small to large, and obtain the basic pictures with the first k (first number) small feature vector distances (hereinafter, for the sake of convenience of description, each basic picture in the first number of basic pictures will be referred to as the first basic picture). The terminal needs to obtain the posture information corresponding to the first number of basic pictures, that is, the posture information corresponding to each first basic picture.

[0105] Optionally, the specific parameter values ​​of the first number may be determined based on requirements for accuracy of matching pictures and requirements for computational efficiency.

[0106] Step 106, based on the posture information corresponding to the first number of basic pictures, determine the basic pictures that meet the preset posture screening conditions among the first number of basic pictures, and determine the basic pictures that meet the preset posture screening conditions as target pictures that match the pictures to be matched.

[0107] Specifically, the terminal screens the first number of basic pictures according to the posture information of the first number of basic pictures, determines the basic pictures that meet the preset posture screening conditions, and determines the basic pictures that meet the preset posture screening conditions as target pictures that match the picture to be matched.

[0108] In the above matching method, the feature vector of the picture to be matched is obtained; the first number of basic pictures and their corresponding posture information that meet the similarity condition with the feature vector of the picture to be matched are determined; according to the posture information corresponding to the first number of basic pictures, the basic pictures that meet the preset posture screening condition are determined in the first number of basic pictures, and the basic pictures that meet the preset posture screening condition are determined as the target pictures that match the picture to be matched. The method provided by the embodiment of the present invention can reorder multiple pictures in a similar picture set according to the posture information of each picture to obtain the correct target picture, avoiding the problem that the picture with the closest feature vector does not match the picture to be matched due to the similarity of some areas of the target scene, thereby improving the retrieval accuracy of the query picture.

[0109] In one embodiment, Figure 2 As shown, the image acquisition device is a robot acquisition device; the generation process of the preset image library includes:

[0110] Step 202: The robot acquisition device scans the target scene at various positions in the target scene according to the mobile acquisition instruction to obtain the posture information of the robot acquisition device at the current position and the basic image corresponding to the posture information.

[0111] Specifically, the preset mobile acquisition instruction is used to instruct the robot acquisition device to move in order at various positions in the target scene, so that the robot acquisition device can acquire images at each position in the target scene space. The terminal can send the preset mobile acquisition instruction to the robot acquisition device. After receiving the mobile acquisition instruction, the robot acquisition device can take a basic image of the target scene at each position in the target scene and obtain the posture information of the position.

[0112] Step 204, storing each position information and the basic pictures corresponding to the position information to obtain a preset picture library.

[0113] Specifically, the terminal may store the posture information of each position in the space of the target scene and the basic pictures corresponding to each posture information to obtain a preset picture library.

[0114] In this embodiment, by making the robot acquisition device move in order at various positions in the target scene, a preset picture library corresponding to the target scene is formed, and the preset picture library can describe the target scene more comprehensively.

[0115] In one embodiment, if Figure 3 As shown, the specific execution process of step 106 "determining basic pictures that meet the preset posture screening condition from the first number of basic pictures according to the posture information corresponding to the first number of basic pictures" includes:

[0116] Step 302, for each basic picture in the first number of basic pictures, according to the posture information corresponding to the first number of basic pictures, calculate the number of times each basic picture in the first number of basic pictures is in a posture that is closely adjacent to other basic pictures.

[0117] Specifically, for each basic picture among the first number of basic pictures (for the sake of ease of description below, each basic picture among the first number of basic pictures will be referred to as a first basic picture), that is, for each first basic picture, according to the posture information of each first basic picture, the posture distance between the first basic picture and each other first basic picture is calculated respectively.

[0118] Optionally, the condition for two first basic images to be in a posture-adjacent relationship with each other may be that the posture distance between the two first basic images is less than a preset posture distance threshold. In this way, the terminal can calculate the posture distance between the first basic image and each other first basic image for each first basic image, and count the number of times the posture distance is less than the preset posture distance threshold as the number of posture-adjacent times that the first basic image and the other first basic images are in a posture-adjacent relationship with each other.

[0119] Step 304: determine the basic picture with the highest number of posture adjacencies among the first number of basic pictures as the basic picture that meets the preset posture condition.

[0120] Specifically, the terminal may compare the number of times each first basic picture is closely adjacent to other first basic pictures, and determine the first closely adjacent picture corresponding to the highest number of closely adjacent pictures as the basic picture that meets the preset posture condition.

[0121] In one possible implementation, for each first basic picture, the terminal can calculate the posture distances between the first basic picture and other first basic pictures according to the posture information of each first basic picture, calculate the sum of the posture distances between the first basic picture and other first basic pictures, and determine the first basic picture with the smallest sum of posture distances as the basic picture that meets the preset posture conditions.

[0122] In this embodiment, the first data first basic images can be screened and reordered again according to the posture information of each first basic image to obtain the correct target image, thereby avoiding the problem that the image with the closest feature vector does not match the image to be matched due to the similarity of some areas of the target scene, thereby improving the retrieval accuracy of the query image.

[0123] In one embodiment, if Figure 4 As shown, the specific execution process of step 106 "determining basic pictures that meet the preset posture screening condition from the first number of basic pictures according to the posture information corresponding to the first number of basic pictures" includes:

[0124] Step 402, according to the pose information corresponding to each basic picture in the preset picture library and the pose information corresponding to the first number of basic pictures, determine the pose adjacent pictures corresponding to the first number of basic pictures to obtain a pose adjacent picture set.

[0125] Specifically, each first basic picture may have multiple pose adjacent pictures. The pose adjacent picture set includes multiple pose adjacent pictures of each first basic picture. That is to say, for each first basic picture, the terminal calculates multiple pose adjacent pictures corresponding to the first basic picture based on the pose information of each basic picture in the preset picture library and the pose information of the first basic picture, so that the terminal can form a pose adjacent picture set with multiple pose adjacent pictures corresponding to each first basic picture.

[0126] Step 404: determine the basic picture with the highest appearance frequency in the set of pictures adjacent to the pose among the first number of basic pictures as the basic picture that meets the preset pose condition.

[0127] Specifically, for each first basic picture, the frequency of occurrence of the first basic picture in the set of pictures adjacent to the pose is calculated respectively. In this way, the terminal can determine the first basic picture with the highest frequency of occurrence in the set of pictures adjacent to the pose as the basic picture that meets the preset pose condition, that is, as the target picture of the picture to be matched. In other words, the target picture is used as the matching result of the picture to be matched.

[0128] In the above matching method, the set of adjacent pictures in posture is reordered according to the frequency of occurrence, and the first basic picture with the highest frequency of occurrence in the set of adjacent pictures in posture is determined as the target picture that matches the picture to be matched. The first number of basic pictures can be reordered according to the posture information of each picture to obtain the correct target picture, avoiding the problem that the picture with the closest feature vector does not match the picture to be matched due to the similarity of some areas of the target scene, thereby improving the retrieval accuracy of the query picture.

[0129] In one embodiment, Figure 5 As shown, the matching method also includes:

[0130] Step 502: sort each basic picture in the first number of basic pictures according to the number of times the posture of each basic picture in the first number of basic pictures is adjacent to each other, so as to obtain a re-sorting result of the first number of basic pictures.

[0131] Specifically, the terminal sorts each basic picture in the first number of basic pictures according to the number of times the posture of each first basic picture is adjacent to each other, and obtains the re-sorting result of the first number of basic pictures.

[0132] Step 504: output the reordering result.

[0133] In one embodiment, Figure 6 As shown, the matching method also includes:

[0134] Step 602, reordering each of the first number of basic pictures according to the appearance frequency of each of the first number of basic pictures in the set of pictures with adjacent postures, to obtain a reordering result;

[0135] Specifically, the terminal sorts each basic picture in the first number of basic pictures according to the appearance frequency of each first basic picture in the set of pictures adjacent to the posture, and obtains the re-sorting result of the first number of basic pictures.

[0136] Step 604: output the reordering result.

[0137] Specifically, the terminal can use the first basic picture ranked first after reordering as the matching picture of the picture to be matched, that is, the target picture. The terminal can use multiple first basic pictures ranked before the target order in the first basic picture set as candidate pictures. In this way, the terminal can output the matching results of the picture to be matched: the target picture and multiple candidate pictures for the user to select and confirm.

[0138] Optionally, the target order can be specifically determined according to the actual application scenario, for example, it can be the sixth. In this way, the terminal can output a target picture and five candidate pictures for the user to select and confirm, thereby improving the user experience.

[0139] In this embodiment, by reordering a plurality of adjacent pose pictures included in the first basic picture set according to the frequency of occurrence of the first basic picture in the adjacent pose picture set, accurate matching of the pictures to be matched can be achieved.

[0140] In a possible implementation, the specific processing process of step 402 "determining the pose adjacent pictures corresponding to the first number of basic pictures according to the pose information corresponding to each basic picture in the preset picture library and the pose information corresponding to the first number of basic pictures to obtain a pose adjacent picture set" includes:

[0141] Step A, for each first basic picture, according to the pose information corresponding to the first basic picture and the pose information of each basic picture in the preset picture library, determine multiple pose adjacent pictures of the first basic picture in the preset picture library.

[0142] Specifically, for the first basic image, the terminal will determine multiple posture adjacent images that are in a posture adjacent relationship with the first basic image based on the posture information of the first basic image and the posture information corresponding to each basic image in the preset image library. For example, the terminal can select a preset number of basic images that are in a posture adjacent relationship with the first basic image in the preset image library as posture adjacent images of the first basic image.

[0143] Step B: multiple pose adjacent pictures are grouped into a pose adjacent picture subset.

[0144] Specifically, for the first basic picture, the terminal will select a preset number of basic pictures that are in a posture-adjacent relationship with the first basic picture in the preset picture library as the posture-adjacent pictures of the first basic picture to form a posture-adjacent picture subset. In other words, for each first basic picture, the terminal will select a preset number of posture-adjacent pictures from the preset picture library as the posture-adjacent picture subset of the first basic picture. Each first basic picture corresponds to a posture-adjacent picture subset.

[0145] Step C: grouping the pose adjacent picture subsets of the plurality of first basic pictures into a pose adjacent picture set.

[0146] Specifically, the terminal combines the posture adjacent picture subsets corresponding to each first basic picture to obtain a posture adjacent picture set.

[0147] In this embodiment, by using the posture information of each first basic picture, the posture adjacent pictures corresponding to each first basic picture are selected in the preset picture library to form a posture adjacent picture set.

[0148] In one embodiment, the posture information includes coordinate data and posture angle. The coordinate data may be the coordinate data of the image acquisition device in the world coordinate system, such as (x, y, z); the posture information also includes posture data, which may be represented by quaternion, and the posture angle may be quaternion information or a posture angle in the quaternion. The posture angle may be the rotation angle of the image acquisition device in the horizontal direction.

[0149] Accordingly, if Figure 7 As shown, the specific processing process of step 402 "determining the posture adjacent pictures corresponding to the first number of basic pictures according to the posture information corresponding to each basic picture in the preset picture library and the posture information corresponding to the first number of basic pictures" includes:

[0150] Step 702, obtaining first coordinate data and a first pose angle corresponding to each basic image in a first number of basic images.

[0151] Specifically, a plurality of basic pictures are stored in the preset picture library, as well as the position coordinate data and posture data when the picture acquisition device acquires the basic pictures. The terminal can obtain the first coordinate data and the first posture angle of the first basic picture stored in the preset picture library, that is, obtain the position coordinate data and the rotation angle in the horizontal direction when the picture acquisition device acquires the first basic picture.

[0152] Step 704, respectively obtain the second coordinate data and the second posture angle corresponding to each basic image in the preset image library.

[0153] Specifically, the terminal obtains the second coordinate data and the second posture angle corresponding to each basic picture in the preset picture library, that is, the terminal needs to obtain the position coordinate data of the picture acquisition device and the rotation angle of the picture acquisition device in the horizontal direction when the picture acquisition device acquires each basic picture.

[0154] Step 706, calculates the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures based on the first coordinate data, the first posture angle, the second coordinate data, the second posture angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the posture angle.

[0155] Specifically, the first weight corresponding to the coordinate data and the second weight corresponding to the posture angle may be weight values ​​determined according to an actual application scenario. The terminal calculates the posture distance between the basic image and the first basic image based on the first coordinate data and the first posture angle corresponding to the basic image, and the second coordinate data and the second posture angle of the first basic image.

[0156] Step 708: Use a second number of basic pictures in the preset picture library whose posture distances satisfy the preset similarity distance condition as posture adjacent pictures of each basic picture in the first number of basic pictures.

[0157] Specifically, the terminal can select the pose adjacent picture of the first basic picture in the preset picture library according to the calculated multiple pose distances. The terminal can sort the calculated multiple pose distances in order from small to large, so that the terminal can use the second number (m) of basic pictures with the smallest pose distances as the pose adjacent pictures of the first basic picture.

[0158] In another possible implementation, the matching method may further include:

[0159] The terminal determines that the image acquisition device samples uniformly within the target scene, then for each first basic image, the terminal calculates the posture distance between each basic image in the preset image library and the first basic image. In this way, the terminal uses the multiple basic images corresponding to the multiple posture distances whose posture distances are less than the preset posture distance threshold as the posture adjacent images of the first basic image based on the multiple posture distances calculated. The number of posture adjacent images of each first basic image in the first basic image set can be the same or different, and the matching method provided in this embodiment is not limited to this. The preset posture distance threshold can be determined by the user according to the actual application scenario, or it can be determined by counting the posture distances of multiple images and obtaining the statistical results.

[0160] In this embodiment, the posture distance obtained by calculating the coordinate data of each picture and the posture angle is used to determine multiple posture adjacent pictures of each first basic picture, thereby achieving accurate screening of the posture adjacent pictures of each first basic picture.

[0161] In one embodiment, Figure 8As shown, the specific processing process of step 706 "calculating the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data, the first posture angle, the second coordinate data, the second posture angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the posture angle" includes:

[0162] Step 802, calculating the modulus between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data and the second coordinate data.

[0163] Step 804, calculating the posture angle difference according to the first posture angle and the second posture angle.

[0164] Step 806, based on the first weight corresponding to the model and the second weight corresponding to the posture angle difference, weighted calculation is performed on the model and the posture angle difference to obtain the posture distance between each basic image in the preset image library and each basic image in the first number of basic images.

[0165] Specifically, the terminal can calculate the pose distance between the basic image and the first basic image by the following formula:

[0166] D qd =L1||(x q ,y q )-(x d ,y d )||+L2|Angle q -Angle d |

[0167] Among them, D qd is the pose distance between the basic image in the preset image library and the first basic image, (x q ,y q ) is the first coordinate data, (x d ,y d ) is the second coordinate data, Angle q Is the first pose angle, Angle d is the second pose angle, L1 is the first weight, and L2 is the second weight.

[0168] Optionally, the first coordinate data may also be (x q ,y q ,z q ), the first pose angle can be the pose data of the first basic image represented by quaternion. Correspondingly, the second coordinate data is (x d ,y d ,z d ), the second pose angle can be the pose data of the basic image represented by a quaternion.

[0169] In one embodiment, Fig. 9 As shown, the specific processing process of step 104 "determining a first number of basic images whose feature vectors satisfy the similarity condition with the image to be matched and their corresponding posture information" includes:

[0170] Step 902: Calculate the first picture feature vector of the picture to be matched and the second picture feature vector of each basic picture through a picture feature extractor.

[0171] Specifically, the image feature extractor can be a scene recognition model based on a convolutional neural network. The terminal can use open source networks such as ResNet101 pre-trained on the large data set ImageNet to form an image feature extractor. It can also train scene recognition models such as NetVLAD according to the data in the actual target scene (indoor scene data) to obtain an image feature extractor. The terminal inputs the image to be matched into the image feature device to obtain the feature vector of the matching image, that is, the first image feature vector. The terminal inputs each basic image in the preset image library into the image feature device respectively to obtain the feature vector of each basic image, that is, the second image feature vector.

[0172] Step 904: For each basic image, a feature vector distance between the first image feature vector and the second image feature vector is calculated using a preset distance calculation algorithm.

[0173] Specifically, the feature vector distance can be a Euclidean distance or a cosin distance. Accordingly, the preset distance calculation algorithm can be a Euclidean distance calculation algorithm or a cosin distance calculation algorithm. For each basic picture in the preset picture library, the terminal calculates the feature vector distance between the first picture feature vector of the picture to be matched and the second picture feature vector of the basic picture through the above preset distance calculation algorithm.

[0174] Step 906, in the preset picture library, screening is performed according to the distance of each feature vector, a first number of basic pictures that meet the preset similarity condition with the picture to be matched are determined, and the posture information corresponding to the first number of basic pictures is obtained.

[0175] Specifically, the terminal screens multiple basic pictures in the preset picture library according to the calculated feature vector distances of multiple basic pictures. In this way, the terminal can select the first number (k) of basic pictures with the smallest feature vector distances, and obtain the posture information corresponding to the first number of basic pictures. The first number is less than the second number.

[0176] The following describes a detailed implementation process of a matching method provided by an embodiment of the present invention:

[0177] Step 1: Obtain the feature vector of the image to be matched (query image) and the feature vectors of all basic images in the preset image library through the image feature extractor.

[0178] Step 2: Calculate the feature vector distance (Euclidean distance or cosin distance) between the image to be matched and each basic image, select each basic image according to the calculated feature vector distance, and use the first number of basic images with the smallest feature vector distance as similar images of the image to be matched to form the first number of basic images (topk preset database images) of the image to be matched. In other words, the first number of basic images includes k basic images with the feature vector closest to the image to be matched.

[0179] Step 3: Reorder the k similar images in the top k preset database images to obtain the reordered database image ranked top 1, which is used as the final matching result of the image to be matched.

[0180] Specifically, if the pose information of the device that takes the image to be matched (e.g., a mobile phone camera) is the same as the pose information of the image acquisition device (the camera of the robot acquisition device) corresponding to the basic image in the preset image library, then it can be determined that the pixel information (image content) contained in the image to be matched and the basic image should be the same or basically similar. In other words, the photos taken in the same direction at the same position in the target scene are the same or basically similar.

[0181] Specifically, since the basic images in the preset image library collected by the robot collection device are continuous, the scene of the query image (image to be matched) may overlap with the scene of multiple basic images. These basic images and the query image have a high degree of similarity, and these basic images and the target image are simultaneously located in the topk preset database images generated by the method of the above embodiment. It is also because the robot collection device collects images at a continuous collection time and collection space position, so the basic images that overlap with the query image have a closer posture distance.

[0182] In this way, the topk preset database pictures include k (first number) basic pictures (for the sake of ease of description, each basic picture in the first number of basic pictures will be referred to as a first basic picture below), and the terminal can determine that n first basic pictures (n is greater than 1 and not greater than k) among the topk first basic pictures are similar to the scene of the query picture, and kn pictures are irrelevant to the scene of the query picture. Then, for each of the n first basic pictures, the terminal needs to query the preset database for the m (second number) basic pictures that are closest to the pose of the first basic picture. The m basic pictures are the pose adjacent subsets of the first basic picture. A total of n pose adjacent subsets constitute a pose adjacent picture set, and the pose adjacent picture set contains n*m basic pictures.

[0183] Specifically, since the n pictures are adjacent to each other, their adjacent pictures are the same. And these n pictures are adjacent to the query picture in terms of their poses, so the topk pictures with the highest frequency among the n*m ​​pictures can be used as the matching result of the picture to be matched, that is, the target picture.

[0184] Optionally, since the terminal cannot determine which n first basic pictures in the topk picture set have similar scenes to the query picture, the terminal can determine, for each first basic picture in the topk picture set, the m pictures that are closest to the first basic picture, and then select the one that is in the topk and has the highest appearance frequency from the k*m picture set as the final top1 query result, which is the target picture.

[0185] Optionally, since the terminal cannot determine which n first basic pictures in the topk picture set are similar to the scene of the query picture, the terminal can calculate multiple pose distances between each first basic picture in the topk picture set and each basic picture in the preset picture library, and use multiple basic pictures whose pose distances are less than the preset pose distance threshold as pose adjacent pictures of the first basic picture to form a pose adjacent picture subset. Among them, the number of pose adjacent picture subsets corresponding to each first basic picture can be different, and multiple pose adjacent picture subsets form a pose adjacent picture set (which may include n pictures). In this way, the one that is both in the topk and has the highest frequency of occurrence is selected from the n picture sets as the final top1 query result, which is the target picture.

[0186] Optionally, the terminal can also directly determine whether the poses of the images in the topk image sets are neighbors of each other based on a preset pose distance threshold. The more neighbors there are, the more likely that the image is top1. For example, the terminal can predetermine that two images whose pose distance is less than a preset pose distance threshold are neighbors of each other. In this way, the terminal can calculate the poses of every two images in the topk image set respectively, so as to determine the number of neighbors with other images in the topk image set, and determine the image with the highest number as the target image.

[0187] Optionally, the method further includes a process of determining m basic images with adjacent postures: each image has position coordinate data (x, y, z) of the robot acquisition device in the world coordinate system and posture data (expressed in quaternions) of the robot acquisition device when it was taken. Because it can be assumed that the scenes taken at the same location and in the same direction are likely to have many repetitions, the position coordinate data can be (x, y), and the posture data can be the horizontal angle Angle of the posture (the rotation angle of the robot acquisition device in the horizontal direction). The posture distance between two images can be calculated using the following formula:

[0188] D qd =L1||(x q ,y q )-(x d ,y d )||+L2|Angle q -Angle d |

[0189] Among them, D qd is the pose distance between the basic image in the preset image library and the first basic image, (x q ,y q ) is the first coordinate data, (x d ,y d ) is the second coordinate data, Angle q Is the first pose angle, Angle d is the second pose angle, L1 is the first weight, and L2 is the second weight.

[0190] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0191] Based on the same inventive concept, the embodiment of the present application also provides a matching device for implementing the matching method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more matching device embodiments provided below can refer to the limitations on the matching method above, and will not be repeated here.

[0192] In one embodiment, Fig.10 As shown, a matching device 100 is provided, comprising: an acquisition module 200, a first determination module 300, and a second determination module 400, wherein:

[0193] The acquisition module 200 is used to acquire the feature vector of the image to be matched.

[0194] The first determination module 300 is used to determine a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding position and posture information.

[0195] The second determination module 400 is used to determine the basic pictures that meet the preset posture conditions among the first number of basic pictures as the target pictures that match the picture to be matched.

[0196] In one embodiment, the image acquisition device is a robot acquisition device; the apparatus further comprises:

[0197] The acquisition module is used for the robot acquisition device to scan the target scene at various positions in the target scene according to the mobile acquisition instruction, and obtain the posture information of the robot acquisition device at the current position and the basic picture corresponding to the posture information;

[0198] The storage module is used to store each position information and the basic pictures corresponding to the position information to obtain a preset picture library.

[0199] In one embodiment, the second determination module is specifically configured to:

[0200] For each basic picture in the first number of basic pictures, according to the pose information corresponding to the first number of basic pictures, calculate the number of times the basic picture and other basic pictures in the first number of basic pictures are in close pose to each other;

[0201] The basic picture with the highest number of posture adjacencies among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

[0202] In one embodiment, the second determination module is specifically configured to:

[0203] According to the pose information corresponding to each basic picture in the preset picture library and the pose information corresponding to the first number of basic pictures, determine the pose adjacent pictures corresponding to the first number of basic pictures to obtain a pose adjacent picture set;

[0204] The basic picture with the highest frequency of appearance in the set of pictures adjacent to the posture among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

[0205] In one embodiment, the matching device further comprises:

[0206] A first sorting module is used to reorder each basic picture in the first number of basic pictures according to the frequency of occurrence of each basic picture in the set of pictures with adjacent postures, so as to obtain a reordering result;

[0207] The first output module is used to output the reordering result.

[0208] In one embodiment, the matching device further comprises:

[0209] A second sorting module is used to sort each basic picture in the first number of basic pictures according to the number of times the posture of each basic picture in the first number of basic pictures is adjacent to each other, so as to obtain a re-sorting result of the first number of basic pictures;

[0210] The second output module is used to output the reordering result.

[0211] In one of the embodiments, the posture information includes coordinate data and posture angle;

[0212] The second determination module is also specifically used to: obtain the first coordinate data and the first pose angle corresponding to each basic picture in the first number of basic pictures; respectively obtain the second coordinate data and the second pose angle corresponding to each basic picture in the preset picture library; calculate the pose distance between each basic picture in the preset picture library and the basic picture according to the first coordinate data, the first pose angle, the second coordinate data, the second pose angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the pose angle; and use the second number of basic pictures in the preset picture library whose pose distances satisfy the preset similarity distance conditions as the pose adjacent pictures of each basic picture in the first number of basic pictures.

[0213] In one embodiment, the second determining module is further specifically configured to:

[0214] Calculating a modulus between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data and the second coordinate data;

[0215] Calculate the posture angle difference according to the first posture angle and the second posture angle;

[0216] According to the first weight corresponding to the model and the second weight corresponding to the posture angle difference, the model and the posture angle difference are weightedly calculated to obtain the posture distance between each basic image in the preset image library and each basic image in the first number of basic images.

[0217] In one embodiment, the first determining module is specifically used to:

[0218] Calculate the first picture feature vector of the picture to be matched and the second picture feature vector of each basic picture by using the picture feature extractor;

[0219] For each basic image, a feature vector distance between a feature vector of the first image and a feature vector of the second image is calculated using a preset distance calculation algorithm;

[0220] In a preset picture library, screening is performed according to the distance of each feature vector to determine a first number of basic pictures that meet a preset similarity condition with the picture to be matched, and the posture information corresponding to the first number of basic pictures is obtained.

[0221] Each module in the above matching device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0222] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data of the image matching process. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a matching method is implemented.

[0223] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0224] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0225] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0226] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0227] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0228] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0229] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0230] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A matching method, characterized in that: The method comprises: Get the feature vector of the image to be matched; In a preset picture library, determine a first number of basic pictures whose feature vectors satisfy a similarity condition with the picture to be matched and their corresponding posture information; According to the posture information corresponding to the first number of basic pictures, basic pictures satisfying a preset posture screening condition are determined from the first number of basic pictures, and the basic pictures satisfying the preset posture screening condition are determined as target pictures that match the pictures to be matched; The determining, according to the posture information corresponding to the first number of basic pictures, basic pictures that meet a preset posture screening condition from the first number of basic pictures includes: According to the posture information corresponding to each basic picture in the preset picture library and the posture information corresponding to the first number of basic pictures, the posture adjacent pictures corresponding to the first number of basic pictures are determined to obtain a posture adjacent picture set; the basic picture with the highest frequency of appearance in the posture adjacent picture set among the first number of basic pictures is determined as the basic picture that meets the preset posture condition, and the posture information includes coordinate data and posture angle; The step of determining the posture adjacent pictures corresponding to the first number of basic pictures according to the posture information corresponding to each basic picture in the preset picture library and the posture information corresponding to the first number of basic pictures includes: Obtain the first coordinate data and the first pose angle corresponding to each basic picture in the first number of basic pictures; respectively obtain the second coordinate data and the second pose angle corresponding to each basic picture in the preset picture library; calculate the pose distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data, the first pose angle, the second coordinate data, the second pose angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the pose angle; use the second number of basic pictures in the preset picture library whose pose distances satisfy the preset similarity distance condition as the pose adjacent pictures of each basic picture in the first number of basic pictures.

2. The method according to claim 1, characterized in that The generation process of the preset image library includes: The robot acquisition device scans the target scene at various positions in the target scene according to the mobile acquisition instruction, and obtains the posture information of the robot acquisition device at the current position and the basic picture corresponding to the posture information; Each of the posture information and the basic pictures corresponding to the posture information are stored to obtain the preset picture library.

3. The method according to claim 1, characterized in that The determining, according to the posture information corresponding to the first number of basic pictures, basic pictures that meet a preset posture screening condition from the first number of basic pictures includes: For each basic picture in the first number of basic pictures, according to the posture information corresponding to the first number of basic pictures, calculate the number of times each basic picture in the first number of basic pictures is in a posture that is closely adjacent to other basic pictures; The basic picture with the highest number of adjacent postures among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

4. The method according to claim 1, characterized in that The method further comprises: reordering each of the first number of basic pictures according to the appearance frequency of each of the first number of basic pictures in the set of pictures adjacent to the posture, to obtain a reordering result; The reordering result is outputted.

5. The method according to claim 1, characterized in that The step of calculating the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data, the first posture angle, the second coordinate data, the second posture angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the posture angle includes: Calculating a modulus between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data and the second coordinate data; Calculating a posture angle difference according to the first posture angle and the second posture angle; According to the first weight corresponding to the model and the second weight corresponding to the posture angle difference, the model and the posture angle difference are weightedly calculated to obtain the posture distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures.

6. A matching device, characterized in that: The device comprises: An acquisition module is used to obtain a feature vector of a picture to be matched; A first determination module is used to determine a first number of basic images whose feature vectors satisfy a similarity condition with the image to be matched and their corresponding posture information; A second determination module is used to determine, among the first number of basic pictures, a basic picture that meets a preset posture condition as a target picture that matches the picture to be matched; The second determination module is specifically used to: determine the posture adjacent pictures corresponding to the first number of basic pictures according to the posture information corresponding to each basic picture in the preset picture library and the posture information corresponding to the first number of basic pictures, and obtain a posture adjacent picture set; determine the basic picture with the highest frequency of appearance in the posture adjacent picture set among the first number of basic pictures as the basic picture that meets the preset posture condition; The second determination module is also specifically used to: obtain the first coordinate data and the first pose angle corresponding to each basic picture in the first number of basic pictures; respectively obtain the second coordinate data and the second pose angle corresponding to each basic picture in the preset picture library; calculate the pose distance between each basic picture in the preset picture library and each basic picture in the first number of basic pictures according to the first coordinate data, the first pose angle, the second coordinate data, the second pose angle, the first weight corresponding to the coordinate data, and the second weight corresponding to the pose angle; use the second number of basic pictures in the preset picture library whose pose distances satisfy the preset similarity distance condition as the pose adjacent pictures of each basic picture in the first number of basic pictures.

7. The device according to claim 6, characterized in that The image acquisition device is a robot acquisition device; the device also includes: A collection module, used for the robot collection device to scan the target scene at various positions in the target scene according to the mobile collection instruction, to obtain the posture information of the robot collection device at the current position and the basic picture corresponding to the posture information; The storage module is used to store each of the posture information and the basic pictures corresponding to the posture information to obtain the preset picture library.

8. The device according to claim 6, characterized in that The second determining module is specifically used for: For each basic picture in the first number of basic pictures, according to the posture information corresponding to the first number of basic pictures, calculate the number of times each basic picture in the first number of basic pictures is in a posture that is closely adjacent to other basic pictures; The basic picture with the highest number of adjacent postures among the first number of basic pictures is determined as the basic picture that meets the preset posture condition.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Machine vision based counting method and device for irregularly-shaped object

    CN104361364A

  • Indoor map generalization data generation method and indoor relocation method

    CN109389641A