Method and device for comparing surface texture images
Through sub-image interception and aggregate feature vector retrieval of surface texture images, combined with geometric consistency screening and key point description information comparison, the accuracy and efficiency problems of item authenticity verification in the existing technology are solved, and efficient batch verification is achieved. .
Patent Information
- Application Number
- CN202410621766.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-23
AI Technical Summary
When verifying the authenticity of items in the existing technology, methods based on overall or microscopic texture features have problems such as low accuracy, large amount of calculation, high computing power requirements, and difficulty in achieving batch verification.
A surface texture image comparison method is proposed. By obtaining the surface texture image of the item to be verified, intercepting sub-images and extracting aggregate feature vectors, using the vector database to perform similarity retrieval and geometric consistency screening, the possible matching pre-registrations are initially screened out. The surface texture image is then carefully screened and compared through key point description information to determine the authenticity of the item.
The calculation amount and computing power requirements of the verification process are reduced, the verification efficiency is improved, the possibility of batch verification is realized, the application difficulty is simplified, and the accuracy of verification is improved.
Smart Images

Figure CN118537587A
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of image processing technology, and in particular, to a method and device for comparing surface texture images. Background Art
[0002] Objects in the real world are usually unique and authentic, but some violators may seek profits by carrying out illegal acts that destroy the authenticity of objects. In order to avoid possible damage to interests caused by the above-mentioned acts, relevant parties will use anti-counterfeiting technology to ensure the authenticity of objects. For example, when selling goods, in response to other merchants manufacturing and selling counterfeit goods without the formal authorization of the brand owner or illegal acts such as cross-selling between different merchants, the brand owner, manufacturer or merchant and other relevant parties will post anti-counterfeiting accessories such as QR codes or passive sensing tags (such as RFID, NFC) for the goods to be sold, so that the relevant parties can verify the authenticity of the purchased goods through the corresponding anti-counterfeiting accessories (such as consumers can verify whether a certain product purchased is a genuine product of a certain brand, and a brand owner can verify whether the goods sold in its stores are cross-selling from other stores, etc.). However, the above-mentioned anti-counterfeiting accessories will not only damage the appearance of the goods and thus affect sales, but also lead to increased product costs.
[0003] In this regard, the relevant technology has proposed measures to verify the authenticity of objects based on the surface features of the objects, that is, by comparing the appearance images collected from the target object and the registered objects, it is determined whether the target object is a certain registered object. In one type of scheme, the object is photographed in whole or in part and the overall features of the photo are extracted for comparison, but the verification accuracy of this type of scheme is low. In another type of scheme, a surface texture image containing the microscopic texture of the object (that is, the subtle structure and pattern on the surface of the object at a microscopic scale, or microscopic fingerprint) is collected, and its texture features are extracted for comparison, but the verification process of this type of method is computationally intensive, which not only requires high computing power for the verification party (such as the buyer of the product), making it difficult for ordinary buyers to apply; but the verification efficiency is low, making it difficult to achieve batch verification. Summary of the invention
[0004] In view of this, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a surface texture image comparison method is proposed, comprising:
[0006] Acquire a surface texture image to be verified collected from the object to be verified, and intercept a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size;
[0007] Extracting the aggregated feature vector to be verified of each sub-graph to be verified, and for each aggregated feature vector to be verified: retrieving a group of pre-registered aggregated feature vectors having the highest vector similarity with the aggregated feature vector to be verified in a vector database, wherein the aggregated feature vector to be verified and each feature vector in the group of pre-registered aggregated feature vectors respectively constitute an aggregated vector pair; wherein each pre-registered aggregated feature vector is extracted from a pre-registered sub-graph, and the pre-registered sub-graph is obtained by dividing a pre-registered surface texture image collected from a pre-registered object according to the preset size;
[0008] According to the position information of each sub-image to be verified and each pre-registered sub-image in the corresponding surface texture image, a target aggregate vector pair of the corresponding sub-image that satisfies the geometric consistency constraint condition is selected from the aggregate vector pairs formed by the aggregate feature vectors to be verified, and at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair is recalled;
[0009] Obtain key point description information to be verified corresponding to the key point to be verified identified from the surface texture image to be verified and pre-registered key point description information corresponding to the pre-registered key points respectively identified from each recalled pre-registered surface texture image; and, based on a comparison result between the key point description information to be verified and the pre-registered key point description information, determine whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0010] According to a second aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method described in the first aspect by running the executable instructions.
[0011] According to a third aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0012] According to a fourth aspect of one or more embodiments of the present specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.
[0013] It can be seen from the above embodiments that the verification process of this specification includes two stages: a rough screening stage, a fine screening stage, and a comparison stage. In the rough screening stage: for the aggregated feature vectors to be verified extracted from each sub-graph of the surface texture image to be verified, a group of pre-registered aggregated feature vectors with the highest similarity are screened out from the pre-registered aggregated feature vectors stored in the vector database to form an aggregated vector pair with the aggregated feature vector to be verified, and then the target aggregated vector pair of the corresponding sub-graph that meets the geometric consistency constraint condition is screened out from all aggregated vector pairs according to the position information of the sub-graph in the surface texture image, and at least a part of the corresponding pre-registered surface texture images is recalled. Further, in the fine screening stage and the comparison stage, for this part of the pre-registered surface texture images recalled in the rough screening stage, the comparison result between the description information of the key points to be verified and the description information of the pre-registered key points (corresponding to the pre-registered key points in this part of the pre-registered surface texture images) will be used to determine whether there is a pre-registered surface texture image that matches the surface texture image to be verified, so as to complete the comparison.
[0014] The embodiments of this specification realize verification of the object to be verified by comparing the surface texture image to be verified with the pre-registered surface texture image. The above verification process is based on the following general rule: the surface texture image collected from the object can reflect the microscopic texture of the surface of the object. For any two identical surface texture images and any two sub-images respectively captured from the two images, if the positions of the two sub-images in the corresponding images are the same (or close), then the surface textures of the two sub-images are also the same (or close). This scheme characterizes the overall micro-texture of the sub-graph through the aggregated feature vector corresponding to the sub-graph. It can be understood that: for the aggregated feature vector to be verified collected from each sub-graph to be verified in the object to be verified and the pre-registered aggregated feature vector collected from each pre-registered sub-graph in at least one pre-registered object, if the object to be verified is not a pre-registered object, each pre-registered surface texture image will not match the surface texture image to be verified. Therefore, the sub-graph to be verified in the surface texture image to be verified and the pre-registered sub-graph in each pre-registered surface texture image are unlikely to satisfy the geometric consistency constraint (the condition is used to constrain the relative position of the sub-graph); in addition, if the object to be verified is a pre-registered object (that is, the two are the same object), the pre-registered surface texture image collected from the pre-registered object will match the surface texture image to be verified. Correspondingly, since the pre-registered surface texture image is divided to obtain multiple pre-registered sub-graphs and the surface texture image to be verified is intercepted to obtain multiple sub-graphs to be verified, the positions of the sub-graphs in the corresponding images are not exactly the same, so only the positions of the sub-graphs corresponding to some aggregated vector pairs satisfy the above general rules. It can be seen that among all the aggregated vector pairs before the coarse screening, only a small number of the subgraph positions corresponding to the aggregated vector pairs satisfy the above general rules.
[0015] In this regard, the embodiment of this specification uses vector similarity and geometric consistency constraints to screen all aggregate vector pairs in the coarse screening stage, which can preliminarily screen out a large number of aggregate vector pairs whose corresponding subgraphs do not satisfy the above general rules, thereby reducing the processing pressure in the subsequent fine screening stage and comparison stage, and greatly reducing the overall computational complexity of the verification process. Therefore, this solution not only reduces the computing power requirements of the verification process for the verification party (such as the buyer of the product), and reduces the difficulty of applying the solution; but also improves the verification efficiency because the computational complexity is reduced, which helps to achieve batch verification of a large number of items. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a network architecture diagram of a surface texture image comparison system provided by an exemplary embodiment.
[0017] Figure 2 It is a schematic diagram of a registration process and a verification process of a surface texture image provided by an exemplary embodiment.
[0018] Figure 3 It is a flow chart of a surface texture image comparison method provided by an exemplary embodiment.
[0019] Figure 4 It is a schematic diagram of a process for collecting feature vectors for a surface texture image provided by an exemplary embodiment.
[0020] Figure 5 It is a schematic diagram of a process for determining a distance constraint condition provided by an exemplary embodiment.
[0021] Figure 6 It is a schematic diagram of a process for determining an angle constraint condition provided by an exemplary embodiment.
[0022] Figure 7 It is a schematic diagram of a process for determining a common constraint condition provided by an exemplary embodiment.
[0023] Figure 8 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0024] Fig. 9 It is a block diagram of a surface texture image comparison device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0025] As mentioned above, the related art proposes measures to verify the authenticity of items based on the surface features of the items, that is, by comparing the appearance images collected from the target item and the registered items, it is determined whether the target item is a certain registered item. In one type of scheme, the whole or part of the item will be photographed and the overall features of the photo will be extracted for comparison. However, since the manufacturing process of the verified item may be high, it is difficult to judge whether the item is real only from the overall appearance, and the verification accuracy is low. In another type of scheme, the surface texture image containing the micro-texture of the item (that is, the fine structure and pattern on the surface of the item at a microscopic scale, or micro-fingerprint) will be collected, and its texture features will be extracted for comparison. However, since the fineness of the micro-texture on the surface of the item is usually very high (such as the aforementioned micro-scale is microns or smaller), a large number of micro-texture images need to be collected during the registration and verification process of the item, and these images need to be cross-compared one by one during the verification process, resulting in a large amount of calculation in the verification process. Not only does it require a high computing power for the verification party (such as the buyer of the product), it is difficult for ordinary buyers to apply it; but the verification efficiency is low, and it is difficult to achieve batch verification.
[0026] In this regard, this specification proposes a solution for verifying the authenticity of an object by comparing the surface texture image of the object, and specifically proposes a surface texture image comparison solution. The solution is described in detail below in conjunction with the accompanying drawings.
[0027] Figure 1 FIG. 1 is a schematic diagram of the architecture of a surface texture image comparison system provided by an exemplary embodiment. Figure 1 As shown, the system may include a network 10, a server 11, and several electronic devices, such as a PC (Personal Computer) 13, a mobile phone 13, and the like.
[0028] The server 11 may be a physical server including an independent host, or the server 11 may be a virtual server carried by a host cluster. During operation, the server 11 may run a program on the server side of a certain application to implement the relevant functions of the application. For example, when the server 11 runs a program for a surface texture image comparison service, it may be implemented as a service platform for providing a surface texture image comparison service. For example, it may be used to maintain the relevant data corresponding to the pre-registered items (registered), maintain a vector database, perform comparison calculations for the surface texture image to be verified and the pre-registered surface texture image, etc.
[0029] PC12 and mobile phone 13 are only some types of electronic devices that users can use. In fact, users can obviously also use electronic devices such as tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of this specification do not limit this. During operation, the electronic device can run a program on the client side of a certain application to implement the relevant functions of the application. For example, when the electronic device runs a program for the surface texture image comparison service, it can be implemented as a client for the surface texture image comparison service. For example, a registration party client can be run in PC12, and the relevant user (hereinafter referred to as the registration party user) can complete the registration of the item to be registered through the client (the registered item is the pre-registered item); the verification party client can be run in the mobile phone 13, and the relevant user (hereinafter referred to as the verification party user) can use the client to compare the surface texture image to be verified with the pre-registered surface texture image, thereby realizing the verification of the item to be verified. Among them, the client application of the above-mentioned surface texture image comparison service can be started and run on the electronic device. The client-side program may be a native application installed on the electronic device, or the client-side program may be a small program, a quick application, or other similar forms. Of course, when using web technologies such as HTML5 or similar web pages, the relevant functions can be implemented through the pages displayed by the browser, and the browser here may be an independent browser application or a browser module embedded in some applications.
[0030] In addition, any electronic device such as PC12 and / or mobile phone 13 may have an image acquisition function or may also receive a corresponding surface texture image acquired by an image acquisition device associated with the corresponding object. For example, PC12 may acquire a corresponding pre-registered surface texture image for a pre-registered object, or receive a pre-registered surface texture image acquired and sent by an image acquisition device (not shown in the figure) to which it is connected. Similarly, mobile phone 13 may acquire a corresponding surface texture image to be verified for an object to be verified, or receive a surface texture image to be verified acquired and sent by an image acquisition device (not shown in the figure).
[0031] As for the network 10 for interaction between electronic devices such as PC 12 and mobile phone 13 and server 11, it is possible to select a wired or wireless network to achieve communication based on the communication mode supported by the corresponding electronic device, and this specification does not limit this. For example, PC 12 can support both wired and wireless communication, so it can use a wired or wireless network to achieve communication as needed, while mobile phone 13 usually only supports wireless communication, so it can use a wireless network to achieve communication.
[0032] The surface texture image comparison system described in this specification can realize the registration of objects (the registered objects become pre-registered objects), and realize the verification of the objects to be verified by comparing the surface texture image to be verified with the pre-registered surface texture image. Figure 2 It is a schematic diagram of a registration and verification process of a surface texture image provided by an exemplary embodiment. Figure 2 The registration process shown can be performed by Figure 1 The PC12 and its corresponding image acquisition device (or PC12 itself) shown in the figure participate in the implementation. Exemplarily, the image acquisition device may include a line scan camera and related modules installed on the factory assembly line by the article manufacturer. The device can respectively acquire the corresponding pre-registered surface texture images for each article to be registered (such as articles passing on the assembly line / conveyor belt) (of course, the registration has not been completed at this time, but these images are still referred to as pre-registered surface texture images to avoid ambiguity), and send these images to PC12; PC12 can then perform sub-graph division, key point recognition and vector extraction on each pre-registered surface texture image, and upload the processed pre-registered image related information (such as pre-registered key point position information, pre-registered key point feature vector, pre-registered aggregate feature vector, etc.) to the server 11; in addition, PC12 can also obtain the pre-registered article related information such as the article unique identification input by the relevant personnel and upload it to the server 11. Alternatively, PC12 can also directly upload the received pre-registered surface texture images and pre-registered article related information to the server 11, and the server 11 extracts the corresponding pre-registered image related information from these images. In summary, after obtaining the above-mentioned pre-registered item-related information and pre-registered image-related information, the server 11 can associate and save the above-mentioned information in a vector database (such as the unique identifier of any item corresponds to its pre-registered image-related information) and maintain the database for retrieval in the subsequent comparison stage. Figure 2 As shown, the S items to be registered are items G1 to Gs. Taking item G1 as an example, the pre-registered surface texture image P1 is obtained through image acquisition, and the corresponding pre-registered feature vector Q1 (including pre-registered key point feature vector and pre-registered aggregate feature vector) is obtained through key point recognition and feature extraction. In the above manner, the registration of each item can be completed, and the registered item becomes a pre-registered item.
[0033] Correspondingly, Figure 2 The verification process shown can be done by Figure 1The mobile phone 13 shown participates in the implementation itself (the mobile phone 13 itself can be equipped with a macro camera at this time), or the mobile phone 13 and its corresponding image acquisition device (the device can be a handheld high-definition camera and related modules, etc.) participate in the implementation. The mobile phone 13 can be used by the verification party user (such as a commodity buyer, a brand employee, a store employee), and the corresponding surface texture image to be verified is collected for the object to be verified through the above-mentioned image acquisition device (such as photographing or scanning the object to obtain the image); then, the mobile phone 13 can perform sub-graph division, key point recognition and vector extraction on the surface texture image to be verified, so as to obtain the relevant information of the image to be verified corresponding to the object (such as the position information of the key points to be verified, the feature vector of the key points to be verified, the aggregate feature vector to be verified, etc.); next, the vector database maintained by the server 11 can be obtained from the server 11 and the search and comparison can be completed locally, or a vector search request can be initiated to the server 11 and the search result returned by the server 11 is received, and then the comparison is completed locally according to the search result. Of course, the mobile phone 13 can also upload the surface texture image to be verified directly to the server 11 so that the server 11 can perform the above-mentioned processing to obtain the relevant information of the image to be verified, or the mobile phone 13 can upload the above-mentioned relevant information of the image to be verified obtained by its own processing to the server 11, and the server 11 will search in the vector database maintained locally, and complete the comparison locally according to the search results, and then return the corresponding verification result to the mobile phone 13. Figure 2 As shown, the surface texture image Pv to be verified is obtained by performing image acquisition on the object to be verified Gv, and the corresponding pre-registered feature vector Qv (including the key point feature vector to be verified and the aggregate feature vector to be verified) is obtained by key point recognition and feature extraction. Based on the above vector and other information, the process described in the following embodiment can be used to compare the surface texture image to be verified with the pre-registered surface texture image, thereby completing the verification process of the object to be verified.
[0034] The article described in this specification can be any article with a micro texture on the surface (whether the inner surface or the outer surface), such as leather with lychee pattern, porcelain with ice cracks, ceramic tile with cloud-like pattern, oil painting with fine cracks, etc. The following embodiments are described using ceramic tile as an example. The surface texture image described in this specification is collected for the corresponding article, which naturally includes the above-mentioned micro texture on the surface of the article, that is, the pixel value of the image can represent the above-mentioned micro texture. For example, the surface texture image to be verified collected from the article to be verified has the micro texture of the surface of the article to be verified; the pre-registered surface texture image collected from any pre-registered article has the micro texture of the surface of the pre-registered article.
[0035] It should be noted that there may be multiple items to be verified in the actual scene, each of which can be verified by applying this solution. Therefore, the items to be verified described in the embodiments below in this specification can be understood as any item to be verified, that is, the embodiments of this specification are described by taking any item to be verified as an example. In addition, this specification compares whether a pre-registered surface texture image matches the surface texture image to be verified in order to verify whether the item to be verified is a pre-registered item, and the pre-registered items corresponding to each pre-registered surface texture image participating in the comparison can be set according to actual needs to achieve the corresponding verification results. For example, if the pre-registered items corresponding to each pre-registered surface texture image participating in the comparison are compliant products produced by a certain manufacturer, then through verification, it can be determined whether the item to be verified is one of these products, that is, to verify whether the item to be verified is a compliant product produced by the manufacturer, thereby completing the authenticity verification of the item. For another example, if the pre-registered items corresponding to the pre-registered surface texture images involved in the comparison are a batch of goods sold by a certain brand and authorized by a certain store (the brand may also authorize other stores to sell the corresponding goods), then the verification can determine whether the item to be verified is one of the goods in the batch, that is, verify whether the item to be verified is transferred from other stores, thereby completing the verification of whether the item is a cross-selling product. Of course, it can also be applied to other scenarios, which will not be elaborated.
[0036] Figure 3 is a flowchart of a surface texture image comparison method provided by an exemplary embodiment. The method can be applied to a verification party device (i.e., an electronic device used by a verification party user, such as Figure 1 The verification party client running in the mobile phone 13 shown in the figure can also be applied to the server side of the surface texture image comparison system (such as Figure 1 Server 11 shown). Figure 3 As shown, the method includes steps 302-308, wherein steps 302-306 belong to the coarse screening stage, and step 308 belongs to the fine screening stage and the comparison stage.
[0037] Step 302 : obtaining a surface texture image to be verified collected from the object to be verified, and intercepting a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size.
[0038] As mentioned above, the verifier can use the verifier device or its associated image acquisition device to collect the corresponding surface texture image to be verified for the object to be verified. Then, the verifier device or the server as the executor of the method can obtain the image and intercept M sub-images to be verified from the image through a sliding window of a preset size (hereinafter referred to as the first preset size), where M is a positive integer (i.e., at least one sub-image to be verified is intercepted).
[0039] Figure 4This is a schematic diagram of a process for collecting feature vectors for a surface texture image provided by an exemplary embodiment. As can be seen from the figure, the sliding window step size at this time is equal to the above-mentioned first preset size. Figure 3 The surface texture image shown is a surface texture image collected for a tile with a cloud-like pattern. It can be assumed that the image is the surface texture image to be verified. Figure 3 As shown, 24 sub-images to be verified (4 rows and 6 columns in total, M=24 at this time) can be intercepted from the surface texture image to be verified through a sliding window of a first preset size. In view of the fact that the row and column values of the sliding window where each sub-image to be verified is located determines its position in the surface texture image to be verified, each sub-image can be numbered according to the row and column values (e.g., the sub-image to be verified in the 3rd row and 5th column is sub-image PS35, and the same applies to other sub-images), so as to characterize its position in the surface texture image to be verified through the sub-image number.
[0040] In fact, during the registration process of any pre-registered item, the registration client or server as the registration subject can also divide the pre-registered surface texture image of the image into multiple pre-registered sub-images according to a preset size (hereinafter referred to as the second preset size), and the division method is similar to the interception method for the surface texture image to be verified.
[0041] In one embodiment, the aforementioned first preset size can be set equal to the second preset size to ensure that the aggregated feature vector to be verified extracted by the verification process and the pre-registered aggregated feature vector extracted by the registration process have the same feature representation accuracy. It can be understood that the smaller the preset size, the more corresponding sub-images are intercepted / divided in the image, and the greater the amount of calculation in the subsequent registration and verification process. Therefore, the more appropriate first preset size and second preset size can be determined by comprehensively considering various factors such as computing power resources, computing speed, efficiency / precision requirements, and this specification does not limit the specific values of the two sizes.
[0042] In addition, when the first preset size is equal to the second preset size, the sliding window step size of the verification process can be set to be less than or equal to the size, so that the corresponding sub-images to be verified can be intercepted as much as possible for the areas corresponding to all pre-registered sub-images, thereby avoiding the omission of key points and the reduction of comparison accuracy due to incomplete interception of the sub-images to be verified. Among them, whether it is the aggregated feature vector to be verified or the pre-registered aggregated feature vector, the feature representation ability of the aggregated feature vector (that is, the ability to represent the micro-texture differences between different images) is determined by the feature extraction algorithm. This solution can use convolutional neural network architectures such as VGG network and ResNet network to build a feature extraction network for extracting aggregated feature vectors, so that it has a higher feature representation ability. Correspondingly, the above sliding window step size can be negatively correlated with the feature representation ability of the aggregated feature vector to be verified, that is, the stronger the feature representation ability, the smaller the sliding window step size can be set, and the weaker the feature representation ability, the larger the sliding window step size can be set. In addition, the smaller the sliding window step size is set, the more likely the sub-image to be verified intercepted in the verification phase is to be aligned with the pre-registered sub-image divided in the registration phase, and the subsequent comparison accuracy will be higher. Based on the above factors, a suitable sliding window step size may be set according to actual conditions, such as 25%, 50%, 75% of the aforementioned first preset size, etc., and this specification does not limit this.
[0043] Step 304, extracting the aggregated feature vectors to be verified of each sub-graph to be verified, and for each aggregated feature vector to be verified: retrieving a group of pre-registered aggregated feature vectors with the highest vector similarity with the aggregated feature vector to be verified in the vector database, the aggregated feature vector to be verified and each feature vector in the group of pre-registered aggregated feature vectors respectively forming an aggregated vector pair; wherein each pre-registered aggregated feature vector is extracted from a pre-registered sub-graph, and the pre-registered sub-graph is obtained by dividing a pre-registered surface texture image collected from a pre-registered object according to the preset size.
[0044] For the M subgraphs to be verified intercepted in step 302, the aggregate feature vectors to be verified of each subgraph can be extracted. Among them, when extracting the aggregate feature vectors to be verified in the intercepted subgraph to be verified, the same method as when extracting the pre-registered aggregate feature vectors in the divided pre-registered subgraph can be adopted, that is, the aggregate feature vectors to be verified and the pre-registered aggregate feature vectors are extracted in the same manner. Exemplarily, a pre-built and trained feature extraction network can be used to extract the aggregate feature vectors to be verified and the pre-registered aggregate feature vectors, etc., which will not be repeated here.
[0045] In one embodiment, when extracting the aggregated feature vector to be verified of any sub-graph to be verified, the key points to be verified can be identified from the sub-graph and the corresponding description information of the key points to be verified can be extracted, and the description information includes the feature vector of the key points to be verified. Furthermore, the feature vectors of the key points to be verified corresponding to at least a portion of the identified key points to be verified can be aggregated to generate the aggregated feature vector to be verified of any sub-graph to be verified. It can be seen that the aggregated feature vector to be verified extracted in this way is obtained by aggregating the feature vectors of the key points to be verified of each key point to be verified in the sub-graph to be verified, so the aggregated feature vector to be verified can reflect the overall characteristics of these key points to be verified, which is convenient for the subsequent image comparison based on the relevant features of the key points, thereby improving the accuracy of the comparison.
[0046] Among them, SIFT, SURF, ORB, AKAZE, DoG and other methods or ASLFeat, SuperPoint, UnSuperPoint, R2D2 and other deep learning algorithms can be used to identify the above key points. VLAD, ASMK, SMK and other methods or NetVLAD, GhostVLAD, HOW, SPoC and other deep learning algorithms can be used for the above aggregation processing. The specific use process of the above algorithms can be found in the records of the relevant technology, which will not be repeated here.
[0047] At least one key point to be verified may be identified in each sub-image of the surface texture image to be verified. Figure 4 As shown, four key points to be verified are identified in sub-graph SP23, one key point to be verified is identified in sub-graph SP24, and three key points to be verified are identified in sub-graph SP26 (the key points to be verified in the remaining sub-graphs are not shown one by one). Taking sub-graph SP26 as an example, for the three key points to be verified ROI1, ROI2 and ROI3, the corresponding key point feature vectors Qroi26-1, Qroi26-2 and Qroi26-3 can be extracted respectively; then these three feature vectors are aggregated to obtain the aggregate feature vector Qagg26 corresponding to sub-graph SP26.
[0048] In addition, for each key point to be verified identified from any of the subgraphs to be verified, the credibility scores of each of these key points to be verified can also be determined. Among them, the credibility score of any key point to be verified is proportional to the accuracy / credibility of the identification result of the key point to be verified, that is, the larger the credibility score of any key point to be verified, the greater the possibility that the key point actually exists in the subgraph to be verified. Based on the above credibility scores, during the aggregation process, at least a portion of the key points to be verified whose credibility scores are not less than the score threshold can be determined among the key points to be verified, and the feature vectors of the key points to be verified corresponding to these key points can be aggregated. It can be understood that the credibility of the recognition results of at least a part of the key points to be verified whose credible scores are greater than the score threshold is relatively high. Only the feature vectors of the key points to be verified corresponding to these key points are aggregated (instead of using the feature vectors of the key points to be verified corresponding to the key points to be verified whose credible scores are lower than the score threshold). This can ensure that the processed aggregated feature vectors to be verified also have high accuracy, and can truly reflect the distribution of each key point to be verified in the sub-graph to be verified. The credibility is also high, which helps to improve the accuracy of subsequent comparisons.
[0049] As mentioned above, for each sub-graph to be verified that has been intercepted, the corresponding aggregated feature vector to be verified can be extracted. In addition, the coordinates of the sub-graph to be verified of each sub-graph to be verified can also be recorded, where the coordinates of any sub-graph to be verified are used to represent the position of the sub-graph in the surface texture image to be verified (such as the number of rows and columns) - the coordinates can accurately determine the position involved in the coarse screening stage to the sub-graph level. The coordinates of the sub-graph to be verified can be based on the image origin of the surface texture image to be verified (such as Figure 5 In addition, as mentioned above, at least one key point to be verified may be identified in each sub-graph to be verified (the aggregated feature vector to be verified of the sub-graph can be obtained by aggregating the feature vectors of the key points to be verified of each key point in the sub-graph), wherein the description information of the key point to be verified of each key point to be verified may include not only the feature vector of the key point to be verified, but also the position information of the key point to be verified (such as the coordinates of the key point in the texture image of the surface to be verified, which can accurately determine the position involved in the subsequent fine screening stage to the pixel level).
[0050] In addition, given that the fine screening stage shown in the subsequent step 308 requires the description information of the key points to be verified of each key point to be verified, in order to speed up the data acquisition efficiency of the fine screening stage, the coarse screening stage can cache the extracted description information of the key points to be verified so that it can be directly obtained in the subsequent fine screening stage without the need to extract it again.
[0051] It should be noted that, in the registration stage, for each image to be registered, the above processing can also be performed to extract the pre-registered aggregate feature vector and pre-registered key point description information (including pre-registered key point feature vector and pre-registered key point position information) corresponding to its pre-registered sub-image, and save it in the aforementioned vector database. It can be understood that each pre-registered aggregate feature vector in the database is extracted from a pre-registered sub-image, and the pre-registered sub-image is obtained by dividing the pre-registered surface texture image collected from the pre-registered object according to the preset size.
[0052] The aforementioned method can be used to extract the aggregate feature vector to be verified corresponding to each subgraph in the M subgraphs to be verified, and then the aggregate vector pairs of these aggregate feature vectors to be verified can be constructed. For each aggregate feature vector to be verified, a group of pre-registered aggregate feature vectors with the highest vector similarity with the aggregate feature vector to be verified can be retrieved from the vector database. After the retrieval is completed, the aggregate feature vector to be verified will form an aggregate vector pair with each feature vector in the group of pre-registered aggregate feature vectors. Assuming that a group of pre-registered aggregate feature vectors retrieved for each aggregate feature vector to be verified includes K vectors (K is a positive integer), then the aggregate feature vector to be verified will form K aggregate vector pairs with these K pre-registered aggregate feature vectors, and all M subgraphs to be verified will form K aggregate vector pairs with these K pre-registered aggregate feature vectors. Figure 1 The corresponding M aggregated feature vectors to be verified participate in forming M*K aggregated vector pairs. Of course, the number of vectors in a group of pre-registered aggregated feature vectors corresponding to each aggregated feature vector to be verified may also be unequal, and this embodiment of the specification does not limit this.
[0053] Among them, if the executor of the method is the aforementioned verification client, the client can synchronize the vector database maintained by it from the server in advance or temporarily, and then perform the above-mentioned search locally; or it can also initiate a search request for the aggregate feature vector to be verified to the server, and receive the search results returned by the server (that is, the retrieved M groups of pre-registered aggregate feature vectors). If the executor of the method is the aforementioned server, the server can perform the above-mentioned search locally in response to the search request initiated by the verification client for the aggregate feature vector to be verified, or extract the aggregate feature vector to be verified by itself after receiving the surface texture image to be verified sent by the verification client and perform the above-mentioned search locally. It can be seen that retrieving a corresponding set of pre-registered aggregate feature vectors for each aggregate feature vector to be verified can be completed by the verification client or the server.
[0054] It should also be noted that all pre-registered aggregate feature vectors contained in the vector database can be set according to the verification purpose of the item to be verified. For example, in order to verify whether the item to be verified is a compliant product produced by a certain merchant, the pre-registered surface texture images corresponding to each pre-registered aggregate feature vector in the database can be collected from these compliant products; and in order to verify whether the item to be verified is a batch of goods authorized to be sold by a certain store, the pre-registered surface texture images corresponding to each pre-registered aggregate feature vector in the database can be collected from this batch of goods. In addition, given that the pre-registered aggregate feature vectors in the vector database are extracted from pre-registered sub-graphs obtained by dividing the pre-registered surface texture image, and a pre-registered surface texture image obtained by collecting a pre-registered item can be divided into multiple pre-registered sub-graphs, the number of pre-registered items corresponding to the vector database (i.e., the number of pre-registered surface texture images) is usually less than the total number of pre-registered aggregate feature vectors stored in the database.
[0055] As for the retrieval process for each aggregate feature vector to be verified, in one embodiment, the vector similarity between the aggregate feature vector to be verified and each pre-registered aggregate feature vector stored in the vector database can be calculated. Then, a group of pre-registered aggregate feature vectors whose vector similarity is not less than the similarity threshold are retrieved (at this time, the number of vectors in each group of pre-registered aggregate feature vectors is not certain, and may be zero or any positive integer). Alternatively, a preset number (i.e., the aforementioned K) of pre-registered aggregate feature vectors with the largest vector similarity are retrieved (at this time, the number of vectors in each group of pre-registered aggregate feature vectors is the preset number).
[0056] like Figure 5As shown, each subgraph to be verified (i.e., SP11 to SP54) in the surface texture image to be verified is located at different positions, and each preregistered subgraph in any preregistered surface texture image i (only SPR1 to SPR9 are shown) is also located at different positions. It is advisable to record the aggregated feature vector to be verified corresponding to SP23 as Qagg23, and the preregistered aggregated feature vector corresponding to SPR1 as Qaggr1, and the same is true for other aggregated feature vectors to be verified and preregistered aggregated feature vectors. Among them, the solid lines with arrows pointing to the preregistered subgraphs SPR1, SPR2 and SPR3 of the subgraph to be verified SP23 are used to indicate that the aggregated feature vector to be verified corresponding to SP23 (i.e., Qagg23) and the preregistered aggregated feature vectors corresponding to SPR1, SPR2 and SPR3 (i.e., Qaggr1, Qaggr2 and Qaggr3) each constitute an aggregated vector pair (i.e., the aggregated feature vector to be verified corresponding to SP23 recalls the preregistered aggregated feature vectors corresponding to SPR1, SPR2 and SPR3). Similarly, the dashed arrow lines of SP44 pointing to the pre-registered subgraphs SPR4, SPR5, SPR6 and SPR7 are used to indicate that Qagg44 and Qaggr4, Qaggr5, Qaggr6 and Qaggr7 each form a cluster vector pair. For the sake of simplicity, [Qagg23, Qaggr1] is used below to represent the cluster vector pair formed by Qagg23 and Qaggr1, and the same applies to other cluster vector pairs.
[0057] Through the screening process based on vector similarity in step 304, a small number of pre-registered aggregated feature vectors with high similarity to the aggregated feature vector to be verified can be preliminarily screened out from the massive / large number of pre-registered aggregated feature vectors saved in the vector database based on vector similarity, so as to eliminate most of the pre-registered surface texture images that have a large difference in micro-texture from the surface texture image to be verified from all the pre-registered surface texture images corresponding to all the pre-registered aggregated feature vectors in the vector database, thereby greatly reducing the amount of calculation in subsequent steps.
[0058] Step 306, based on the position information of each sub-image to be verified and each pre-registered sub-image in the corresponding surface texture image, select the target aggregate vector pair of the corresponding sub-image that meets the geometric consistency constraint condition from the aggregate vector pair composed of the aggregate feature vector to be verified, and recall at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair.
[0059] For the M aggregate feature vectors to be verified, step 304 screens and obtains M groups of corresponding pre-registered aggregate feature vectors, and each aggregate feature vector to be verified and each adjacent group of pre-registered aggregate feature vectors corresponding to itself constitute an aggregate vector pair. Among them, the aggregate feature vectors to be verified that constitute each aggregate vector pair are extracted from the corresponding subgraph to be verified, and the pre-registered aggregate feature vectors are extracted from the corresponding pre-registered subgraph. As mentioned above, the subgraph coordinates of each subgraph are the position information of the subgraph in the surface texture image to which it belongs. Based on the position information of the subgraph, the target aggregate vector pairs whose corresponding subgraphs meet the geometric consistency constraints can be screened out from the aggregate vector pairs formed by the aggregate feature vectors to be verified, and at least a part of the pre-registered surface texture images corresponding to these target aggregate vector pairs can be recalled to achieve further screening of the pre-registered surface texture images.
[0060] In one embodiment, the sub-image coordinates of any aggregation vector pair may include the coordinates of the sub-image to be verified and the coordinates of the pre-registered sub-image, wherein the coordinates of the sub-image to be verified are the position information of the sub-image to be verified corresponding to the aggregation feature vector to be verified in the aggregation vector pair in the surface texture image to which it belongs, and the coordinates of the pre-registered sub-image are the position information of the pre-registered sub-image corresponding to the pre-registered aggregation feature vector in the aggregation vector pair in the pre-registered surface texture image to which it belongs. Figure 5 As shown, for the aggregated vector pair composed of the aggregated feature vector to be verified corresponding to SP23 and the pre-registered aggregated feature vector corresponding to SPR1, its subgraph coordinates include the coordinates of SP23 in the surface texture image to be verified and the coordinates of SPR1 in the pre-registered surface texture image i, and the subgraph coordinates of other aggregated vector pairs are the same. Based on the subgraph coordinates of each aggregated vector pair, when screening the target aggregated vector pair that meets the geometric consistency constraint condition, it is possible to traverse each aggregated vector pair composed of the acquired aggregated feature vectors to be verified, select at least one aggregated vector pair each time according to the quantity required by the geometric consistency constraint condition, and determine whether the subgraph coordinates of the at least one aggregated vector pair all meet the geometric consistency constraint condition; wherein, if the subgraph coordinates of the at least one aggregated vector pair all meet the condition, then the at least one aggregated vector pair is determined to be the target aggregated vector pair; if there is an aggregated vector pair in the at least one aggregated vector pair whose subgraph coordinates do not meet the condition, then it is determined that the at least one aggregated vector pair is not the target aggregated vector pair. In this way, all combinations of all aggregate vector pairs can be checked one by one according to the number requirements of the geometric consistency constraints, and finally the target aggregate vector pairs that meet the geometric consistency constraints can be screened out to avoid omissions, which helps to ensure the accuracy of the final comparison results.
[0061] Geometric consistency refers to the property in geometry that the relationship between two or more geometric objects remains unchanged. In short, geometric consistency describes the ability of a set of geometric objects to maintain similarity and relative position after transformation (such as rotation, translation or scaling). In this scheme, the relative position relationship between different subgraphs is verified by geometric consistency constraints.
[0062] Among them, the geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition, that is, when screening the target aggregate vector pair, any number of conditions can be selected from these three constraints to check each aggregate vector pair, which are explained below. For example, when the geometric consistency constraint condition includes these three conditions at the same time, for all S0 aggregate vector pairs to be checked, S1 aggregate vector pairs that meet the distance constraint condition can be screened out first; then for these S1 aggregate vector pairs, S2 aggregate vector pairs that meet the angle constraint condition can be screened out; finally, for these S2 aggregate vector pairs, S3 aggregate vector pairs that meet the common constraint condition can be screened out, that is, as the final target aggregate vector pair. It can be understood that the above process can realize the progressive step-by-step screening of the aggregate vector pairs, where S0≥S1≥S2≥S3. In view of the fact that the calculation amount of the distance constraint condition, the angle constraint condition and the common constraint condition increases successively, this step-by-step screening method can effectively reduce the total calculation amount of the geometric consistency constraint screening process, thereby improving the overall efficiency of the rough screening stage to a certain extent.
[0063] Two clustering vector pairs are required for each check of the distance constraint. For example, for the first clustering vector pair and the second clustering vector pair in any two clustering vector pairs, if the absolute value of the difference between the distance of the subgraph to be verified and the distance of the pre-registered subgraph between the two clustering vector pairs is not greater than the distance threshold, it is determined that the corresponding subgraphs of the two clustering vector pairs satisfy the distance constraint; wherein the distance of the subgraph to be verified is the distance between the coordinates of the subgraph to be verified of the first clustering vector pair and the coordinates of the subgraph to be verified of the second clustering vector pair, and the pre-registered subgraph distance is the distance between the coordinates of the pre-registered subgraph of the first clustering vector pair and the coordinates of the pre-registered subgraph of the second clustering vector pair.
[0064] Following the above embodiment, Figure 5As shown, the to-be-verified aggregate feature vectors corresponding to SP23 participate in the formation of three aggregate vector pairs, namely [Qagg23, Qaggr1], [Qagg23, Qaggr2] and [Qagg23, Qaggr3]; the to-be-verified aggregate feature vectors corresponding to SP44 participate in the formation of four aggregate vector pairs, namely [Qagg44, Qaggr4], [Qagg44, Qaggr5], [Qagg44, Qaggr6] and [Qagg44, Qaggr7]. There are 21 combinations of the above seven aggregate vector pairs, that is, there are 21 combinations of "two aggregate vector pairs". For each of them, it can be determined whether the absolute value of the difference between the distance of the to-be-verified subgraph and the distance of the pre-registered subgraph is greater than the distance threshold d0, and then whether the subgraph corresponding to this combination meets the distance constraint. Taking the combination of [Qagg23, Qaggr1] and [Qagg44, Qaggr5] as an example, Figure 5 As shown, the distance of the subgraph to be verified in this combination is the length d of the line segment between SP23 and SP44, and the distance of the pre-registered subgraph is the length dr of the line segment between SPR1 and SPR5; if |d-dr|>d0, it is determined that SP23, SP44, SPR1 and SPR5 do not meet the distance constraint; otherwise, if |d-dr|≤d0, it is determined that the above subgraphs meet the distance constraint, and the two aggregation vector pairs [Qagg23, Qaggr1] and [Qagg44, Qaggr5] can be screened out. The determination method of the other six combinations is similar to this and will not be repeated.
[0065] It should be noted that, since any aggregation vector pair may form multiple combinations with other multiple aggregation vector pairs, and the judgment results of these combinations are not exactly the same, in order to avoid misjudgment, when any combination satisfies the distance constraint condition, it is determined that the two aggregation vector pairs participating in the formation of the combination satisfy the distance constraint condition, and there is no need to check whether other combinations formed by the two aggregation vector pairs satisfy the condition. Of course, in order to increase the screening strength of the distance constraint condition, a threshold value of the number of times the aggregation vector pair satisfies the condition can also be set. For example, if it is set to twice, any aggregation vector pair needs to satisfy the condition with at least the combination composed of the other two aggregation vector pairs before the aggregation vector pair is judged to satisfy the condition, which will not be repeated.
[0066] At least three clustered vector pairs are required for each check of the angle constraint. For example, for the first clustered vector pair, the second clustered vector pair, and the third clustered vector pair among any three clustered vector pairs, if the absolute value of the difference between the angle of the subgraph to be verified between the three clustered vector pairs and the angle of the pre-registered subgraph is not greater than the angle threshold, then it is determined that the corresponding subgraphs of the three clustered vector pairs all meet the angle constraint; wherein the angle of the subgraph to be verified is the angle between the line connecting the first and second subgraphs to be verified and the line connecting the second and third subgraphs to be verified, and the line connecting the first and second subgraphs to be verified is the angle between the coordinates of the subgraph to be verified of the first clustered vector pair and the coordinates of the subgraph to be verified of the second clustered vector pair. The second-third subgraph to be verified connection line is the connection line between the subgraph coordinates to be verified of the second aggregation vector pair and the subgraph coordinates to be verified of the third aggregation vector pair, the pre-registered subgraph angle is the angle between the first-two pre-registered subgraph connection line and the second-three pre-registered subgraph connection line, the first-two pre-registered subgraph connection line is the connection line between the pre-registered subgraph coordinates of the first aggregation vector pair and the pre-registered subgraph coordinates of the second aggregation vector pair, and the second-three pre-registered subgraph connection line is the connection line between the pre-registered subgraph coordinates of the second aggregation vector pair and the pre-registered subgraph coordinates of the third aggregation vector pair.
[0067] like Figure 6 As shown, assuming that after screening by the distance constraint, the remaining SP32 corresponding to the to-be-verified aggregate feature vector participates in forming two aggregate vector pairs, namely [Qagg32, Qaggr1] and [Qagg32, Qaggr2]; the to-be-verified aggregate feature vector corresponding to SP44 participates in forming an aggregate vector pair, namely [Qagg44, Qaggr5]; the to-be-verified aggregate feature vector corresponding to SP14 participates in forming an aggregate vector pair, namely [Qagg14, Qaggr8]. There are four combinations of any three of the above four aggregate vector pairs, that is, there are four combinations of "three aggregate vector pairs". For each of them, it can be judged that the absolute value of the difference between the angle of the sub-graph to be verified and the angle of the pre-registered sub-graph is not greater than the angle threshold θ0, and then it is determined whether the three aggregate vector pairs in this combination meet the distance constraint. Taking the combination of [Qagg32, Qaggr1], [Qagg44, Qaggr5] and [Qagg14, Qaggr8] as an example, Figure 6As shown, the angle of one of the subgraphs to be verified in the combination is the angle θ between the line segment between SP32 and SP44 and the line segment between SP32 and SP14, and the angle of the pre-registered subgraph is the angle θr between the line segment between SPR1 and SPR5 and the line segment between SPR1 and SPR8; if |θ-θr|>θ0, it is determined that SP32, SP44, SP14, SPR1, SPR5 and SPR8 do not meet the distance constraint; otherwise, if |θ-θr|≤θ0, it is determined that the above subgraphs meet the angle constraint, and the three aggregation vector pairs [Qagg32, Qaggr1], [Qagg44, Qaggr5] and [Qagg14, Qaggr8] can be screened out. The determination method of the other three combinations is similar to this and will not be repeated.
[0068] Similarly, since any aggregate vector pair may form multiple combinations with other multiple aggregate vector pairs, and the judgment results of these combinations are not exactly the same, in order to avoid misjudgment, when any combination satisfies the angle constraint condition, it is determined that the two aggregate vector pairs participating in the combination both satisfy the angle constraint condition, and there is no need to check whether the other combinations formed by the three aggregate vector pairs meet the condition. Of course, in order to increase the screening strength of the angle constraint condition, a threshold value of the number of times the aggregate vector pair meets the condition can also be set. For example, if it is set to three times, any aggregate vector pair needs to meet the condition with at least the combination formed by the other three aggregate vector pairs before the aggregate vector pair is judged to meet the condition. This will not be repeated.
[0069] Each check of the common constraint condition requires an aggregate vector pair, that is, each aggregate vector pair can be checked by itself without combining. For example, for any aggregate vector pair, if the distance between the coordinates of the sub-graph to be verified and the coordinates of the pre-registered sub-graph of the aggregate vector pair is not greater than the distance threshold, and the angle between the line between the coordinates of the sub-graph to be verified of any aggregate vector pair and the coordinate origin of the surface texture image to be verified and the line between the coordinates of the pre-registered sub-graph of any aggregate vector pair and the coordinate origin of the corresponding pre-registered surface texture image is not greater than the angle threshold, then it is determined that the corresponding sub-graph of any aggregate vector pair meets the common constraint condition.
[0070] like Figure 7As shown, assuming that after screening by the distance constraint and the angle constraint, at least one aggregate vector pair may remain, taking the aggregate vector pair corresponding to SP44 and SPR5, [Qagg44, Qaggr5] as an example. At this time, the surface texture image to be verified can be used as a reference to determine the co-located subgraph of SPR5 in the image (i.e., SPR5' shown by the dotted line in the image), and then calculate whether the distance d between SP44 and SPR5' is greater than the distance threshold d0, and the angle θ between the line connecting SP44 and the origin and the line connecting SPR5' and the origin. If |d-dr|≤d0 and |θ-θr|≤θ0, it is determined that SP44 and SPR5 meet the above common constraints, and the aggregate vector pair [Qagg44, Qaggr5] can be screened out; otherwise (i.e., |d-dr|>d0 and / or |θ-θr|>θ0), it is determined that the two do not meet the above common constraints.
[0071] It should be noted that the distance thresholds involved in the above-mentioned different constraints may be the same or different. Similarly, the angle thresholds involved in the above-mentioned different constraints may be the same or different. The specific values of the thresholds may be reasonably set according to accuracy requirements, screening intensity requirements, etc., and this specification does not limit this.
[0072] Through the above screening, some target aggregate vector pairs whose corresponding subgraphs satisfy the geometric consistency constraint conditions can be screened out from all aggregate vector pairs; further, at least a portion of the pre-registered surface texture images corresponding to the target aggregate vector pairs can be recalled. In one embodiment, for each pre-registered surface texture image corresponding to the target aggregate vector pair, the number of target aggregate vector pairs corresponding to each image can be determined first (if the pre-registered aggregate feature vector constituting a certain target aggregate vector pair is extracted from a pre-registered subgraph obtained by dividing a certain pre-registered surface texture image, then the pre-registered surface texture image corresponds to the target aggregate vector pair), and then the pre-registered surface texture images whose number of corresponding target aggregate vector pairs is greater than the number threshold are recalled (at this time, the number of recalled pre-registered surface texture images is not certain, and may be zero or any positive integer); or, the preset number of pre-registered surface texture images with the largest number of corresponding target aggregate vector pairs are recalled (at this time, the number of recalled pre-registered surface texture images is the preset number). At this point, the coarse screening stage in the verification process is completed, and the coarse screening result is the recalled at least a portion of the above-mentioned pre-registered surface texture images.
[0073] Step 308, obtaining the key point description information to be verified corresponding to the key point to be verified identified from the surface texture image to be verified and the pre-registered key point description information corresponding to the pre-registered key points identified from each recalled pre-registered surface texture image; and, based on the comparison result between the key point description information to be verified and the pre-registered key point description information, determining whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0074] After the coarse screening stage (screening pre-registered surface texture images based on the position information of the sub-image) is completed, the fine screening stage (i.e. screening pre-registered surface texture images based on the position information of the key points) can be started. In summary, it is to finally determine whether there is a pre-registered surface texture image that matches the surface texture image to be verified based on the comparison results of the key point description information. It can be understood that if there is a matching pre-registered surface texture image, it means that the item to be verified and the pre-registered item corresponding to the image are the same item, such as the item to be verified is a compliant product produced by a merchant to be verified, or is a commodity authorized to be sold by the store to be verified; otherwise, if there is no matching pre-registered surface texture image, it means that the item to be verified is different from all pre-registered items (corresponding to all pre-registered aggregated feature vectors in the aforementioned vector database), that is, the item to be verified is not the above-mentioned compliant product or authorized commodity.
[0075] It can be seen from the above embodiments that the verification process of this specification includes two stages: a rough screening stage, a fine screening stage, and a comparison stage. In the rough screening stage: for the aggregated feature vectors to be verified extracted from each sub-graph of the surface texture image to be verified, a group of pre-registered aggregated feature vectors with the highest similarity are screened out from the pre-registered aggregated feature vectors stored in the vector database to form an aggregated vector pair with the aggregated feature vector to be verified, and then the target aggregated vector pair of the corresponding sub-graph that meets the geometric consistency constraint condition is screened out from all aggregated vector pairs according to the position information of the sub-graph in the surface texture image, and at least a part of the corresponding pre-registered surface texture images is recalled. Further, in the fine screening stage and the comparison stage, for this part of the pre-registered surface texture images recalled in the rough screening stage, the comparison result between the description information of the key points to be verified and the description information of the pre-registered key points (corresponding to the pre-registered key points in this part of the pre-registered surface texture images) will be used to determine whether there is a pre-registered surface texture image that matches the surface texture image to be verified, so as to complete the comparison.
[0076] The embodiments of this specification realize verification of the object to be verified by comparing the surface texture image to be verified with the pre-registered surface texture image. The above verification process is based on the following general rule: the surface texture image collected from the object can reflect the microscopic texture of the surface of the object. For any two identical surface texture images and any two sub-images respectively captured from the two images, if the positions of the two sub-images in the corresponding images are the same (or close), then the surface textures of the two sub-images are also the same (or close). This scheme characterizes the overall micro-texture of the sub-graph through the aggregated feature vector corresponding to the sub-graph. It can be understood that: for the aggregated feature vector to be verified collected from each sub-graph to be verified in the object to be verified and the pre-registered aggregated feature vector collected from each pre-registered sub-graph in at least one pre-registered object, if the object to be verified is not a pre-registered object, each pre-registered surface texture image will not match the surface texture image to be verified. Therefore, the sub-graph to be verified in the surface texture image to be verified and the pre-registered sub-graph in each pre-registered surface texture image are unlikely to satisfy the geometric consistency constraint (the condition is used to constrain the relative position of the sub-graph); in addition, if the object to be verified is a pre-registered object (that is, the two are the same object), the pre-registered surface texture image collected from the pre-registered object will match the surface texture image to be verified. Correspondingly, since the pre-registered surface texture image is divided to obtain multiple pre-registered sub-graphs and the surface texture image to be verified is intercepted to obtain multiple sub-graphs to be verified, the positions of the sub-graphs in the corresponding images are not exactly the same, so only the positions of the sub-graphs corresponding to some aggregated vector pairs satisfy the above general rules. It can be seen that among all the aggregated vector pairs before the coarse screening, only a small number of the subgraph positions corresponding to the aggregated vector pairs satisfy the above general rules.
[0077] In this regard, the embodiment of this specification uses vector similarity and geometric consistency constraints to screen all aggregate vector pairs in the coarse screening stage, which can preliminarily screen out a large number of aggregate vector pairs whose corresponding subgraphs do not satisfy the above general rules, thereby reducing the processing pressure in the subsequent fine screening stage and comparison stage, and greatly reducing the overall computational complexity of the verification process. Therefore, this solution not only reduces the computing power requirements of the verification process for the verification party (such as the buyer of the product), and reduces the difficulty of applying the solution; but also improves the verification efficiency because the computational complexity is reduced, which helps to achieve batch verification of a large number of items.
[0078] Before fine screening, it is necessary to first obtain the description information of the key points to be verified corresponding to the key points to be verified identified from the surface texture image to be verified. As mentioned above, after extracting the feature vector of the key points to be verified of the sub-graph to be verified in the coarse screening stage, the description information of the key points to be verified (including the feature vector of the key points to be verified and the position information of the key points to be verified) can be cached in the local storage space of the verifier (such as the local memory of the client or server of the verifier). Based on this, in the fine screening stage, when the aggregated feature vector to be verified is obtained by aggregating the feature vectors of the key points to be verified corresponding to at least a part of the key points to be verified identified from the corresponding sub-graph to be verified, and the description information of the key points to be verified corresponding to the identified key points to be verified is cached, the cached description information of the key points to be verified can be obtained. This method exchanges storage space for data acquisition efficiency, which can reduce the time consumption of the fine screening stage to a certain extent. Of course, in another embodiment, given that there is only one surface texture image to be verified, when the key point recognition and feature extraction algorithms are relatively efficient, it is completely possible not to sacrifice the above storage space for caching, but to re-identify the key points to be verified from the corresponding sub-image to be verified for the surface texture image to be verified in the fine screening stage and extract the corresponding key point description information to be verified. The above different methods can be flexibly selected according to actual needs, and this specification does not limit this.
[0079] In addition, it is necessary to obtain the pre-registered key point description information corresponding to the pre-registered key points identified from each recalled pre-registered surface texture image. These pre-registered key point description information are saved in the aforementioned vector database during the registration stage. Therefore, they can be queried / retrieved from the vector database according to the image identifier of the pre-registered surface texture image, which will not be repeated here.
[0080] In one embodiment, the key point description information to be verified may include the key point position information to be verified (characterizing the specific position of the key point to be verified in the surface texture image to be verified) and the key point feature vector to be verified (characterizing the micro-texture features of the surface texture image to be verified), and the pre-registered key point description information includes the pre-registered key point position information (characterizing the specific position of the pre-registered key point in the pre-registered surface texture image) and the pre-registered key point feature vector (characterizing the micro-texture features of the pre-registered surface texture image). Based on this, by comparing the key point description information to be verified with the pre-registered key point description information, at least a portion of the target key point vector pairs can be selected from the key point vector pairs composed of the key point feature vector to be verified and the pre-registered key point feature vector, wherein the target key point vector pair is composed of the target key point feature vector to be verified and the target pre-registered key point feature vector, and the target pre-registered key point vector corresponds to at least one pre-registered surface texture image. Then, for each pre-registered surface texture image among the at least one pre-registered surface texture image obtained by screening: the affine transformation matrix for the target key point to be verified can be determined based on the target key point position information corresponding to the corresponding target key point vector to be verified and the target pre-registered key point position information corresponding to the target pre-registered key point vector, and the transformed key point position information of the transformed key point corresponding to the target key point to be verified is calculated based on the affine transformation matrix. Finally, the key point repetition rate between the transformed key point and the pre-registered key point corresponding to the target pre-registered key point vector (i.e., the proportion of the corresponding pre-registered key point in all pre-registered key points within the preset radius of the key point to be verified) can be determined based on the transformed key point position information and the target pre-registered key point position information, wherein the prerequisite for determining that the pre-registered surface texture image matches the surface texture image to be verified may include: the key point repetition rate is not less than the repetition rate threshold.
[0081] Through multiple rounds of screening in the aforementioned rough screening stage and fine screening stage, most of the pre-registered surface texture images that have large differences in features from the surface texture images to be verified have been eliminated (which can be regarded as negative samples in the images to be screened), and the remaining small number of pre-registered surface texture images generally have a high micro-texture similarity with the surface texture images to be verified; that is, at this time, the proportion of positive samples in the remaining part of the pre-registered surface texture images is already large enough. Therefore, the RANSAC (random sampling consensus) algorithm (this type of algorithm has high requirements for the proportion of positive samples in the sample, otherwise the accuracy of the estimation is low) can be used to estimate the affine transformation matrix for the key points to be verified for the target. For specific estimation methods, please refer to the records in the relevant technology, which will not be repeated here. It can be seen that the aforementioned rough screening and fine screening stages can be regarded as a screening process for all pre-registered surface texture images (i.e., the full amount of samples). After screening, at least one pre-registered surface texture image meets the use requirements of the RANSAC algorithm. At this time, the algorithm can be used for processing and finally the matching is determined.
[0082] Of course, in addition to the RANSAC algorithm, algorithms such as AdaLAM (Adaptive Locally-AffineMatching) can also be used to estimate the above affine transformation matrix. The specific estimation method can be found in the records in the relevant technology and will not be repeated here.
[0083] In addition, when selecting at least a part of the target key point vector pairs by comparing the key point feature vectors, for each key point feature vector to be verified that is obtained: a group of pre-registered key point feature vectors with the highest vector similarity with the key point feature vector to be verified are retrieved from the obtained pre-registered key point feature vectors, and the key point feature vector to be verified and each feature vector in the group of pre-registered key point feature vectors respectively constitute a key point vector pair; then, at least a part of the target key point vector pairs whose corresponding key points meet the geometric consistency constraint conditions are screened out from the key point vector pairs constituted by the obtained key point feature vectors to be verified. Among them, the retrieval method of the above-mentioned pre-registered key point feature vectors is similar to the retrieval method of the pre-registered aggregate feature vectors in the aforementioned step 304, and can refer to the embodiment recorded in the aforementioned embodiment; the geometric consistency constraint conditions include distance constraint conditions, angle constraint conditions and / or common constraint conditions, and the specific inspection method of each condition can refer to the record of the aforementioned embodiment, which will not be repeated here.
[0084] In one embodiment, in addition to the aforementioned key point repetition rate, the overall similarity between the surface texture image to be verified and the pre-registered surface texture image can also be compared. For example, the image similarity between the surface texture image to be verified and the pre-registered surface texture image can be calculated, and the prerequisite for determining that any pre-registered surface texture image matches the surface texture image to be verified can include: the image similarity corresponding to the pre-registered surface texture image is not less than a similarity threshold.
[0085] Among them, the image quality assessment algorithm can be used to calculate the similarity of two surface texture images. The specific principle of the algorithm is to calculate the similarity of the image quality evaluation indicators of the image. The image quality evaluation indicators may include but are not limited to the contrast, brightness, image structure information, peak signal-to-noise ratio, etc. of the image. There are many image quality assessment algorithms, such as PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity Index), etc. Among them, the PSNR algorithm calculates the similarity of images by comparing the peak signal-to-noise ratio of the images. The SSIM algorithm calculates the similarity of images by comparing the contrast, brightness and structural information of the images. Those skilled in the art can choose the image quality assessment algorithm according to actual needs, and this specification does not limit it. This similarity calculation method does not require a training model, and the calculation process is simple and efficient, which is particularly suitable for scenarios where image similarity is calculated in batches.
[0086] In addition, the similarity between two surface texture images can be calculated by comparing image feature vectors, wherein the image features corresponding to each surface texture image can be extracted by an image feature extraction model.
[0087] The model is deployed with image feature extraction networks for extracting image features, such as ResNet (Residual Network), VGG (Visual Geometry Group), Inception (Google Inception Network, also known as GoogLeNet), etc. The model can be pre-trained on a large number of texture data sets (such as STEX, KTH-TIPS2, Brodatz, VisTexture, KylbergTextureDataset, etc.) through contrast learning methods such as MoCo or SimCLR. In the feature extraction process, the input of the image feature extraction model is the surface texture image, and the output is the image features of the surface texture image. Image features may include texture features, shape descriptors, edges, corners, etc. Then the image features of each surface texture image are integrated into a vector representation to obtain the image feature vector corresponding to each surface texture image. The image feature vector is equivalent to the mathematical summary of the image features, which is convenient for subsequent calculations by simplifying the complex image feature information into a data structure that can be mathematically operated. For example, the similarity of the image feature vectors of each two images can be calculated by cosine similarity or Euclidean distance to obtain a set of initial similarities, which is not limited in this specification. Since image features can better reflect the high-level semantic information of the image, this similarity calculation method can further improve the accuracy of the comparison result.
[0088] Figure 8 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 8 At the hardware level, the device includes a processor 802, an internal bus 804, a network interface 806, a memory 808, and a non-volatile memory 810, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 802 reading the corresponding computer program from the non-volatile memory 810 into the memory 808 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do 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.
[0089] Please refer to Fig. 9 , the surface texture image comparison device can be applied to Figure 8 The device shown in the figure is used to implement the technical solution of this specification. The surface texture image comparison device may include:
[0090] The sub-image interception module 901 is configured to obtain a surface texture image to be verified collected from the object to be verified, and intercept a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size;
[0091] The vector retrieval module 902 is configured to extract the aggregated feature vector to be verified of each sub-graph to be verified, and for each aggregated feature vector to be verified: a group of pre-registered aggregated feature vectors with the highest vector similarity with the aggregated feature vector to be verified are retrieved from the vector database, and the aggregated feature vector to be verified and each feature vector in the group of pre-registered aggregated feature vectors respectively constitute an aggregated vector pair; wherein each pre-registered aggregated feature vector is extracted from a pre-registered sub-graph, and the pre-registered sub-graph is obtained by dividing the pre-registered surface texture image collected from the credible object according to the preset size;
[0092] The consistency screening module 903 is configured to screen out a target aggregate vector pair of the corresponding sub-graph that satisfies the geometric consistency constraint condition from the aggregate vector pairs formed by the aggregate feature vectors to be verified according to the position information of each sub-graph to be verified and each pre-registered sub-graph in the corresponding surface texture image, and recall at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair;
[0093] The image comparison module 904 is configured to obtain the key point description information to be verified corresponding to the key point to be verified identified from the surface texture image to be verified and the pre-registered key point description information corresponding to the pre-registered key point identified from each recalled pre-registered surface texture image; and, based on the comparison result between the key point description information to be verified and the pre-registered key point description information, determine whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0094] Optionally, the vector retrieval module 902 is specifically configured as follows:
[0095] Identify the key points to be verified from any of the subgraphs to be verified and extract corresponding description information of the key points to be verified, wherein the description information of the key points to be verified includes a feature vector of the key points to be verified;
[0096] Aggregation processing is performed on the feature vectors of the key points to be verified corresponding to at least a portion of the identified key points to be verified, so as to generate an aggregated feature vector to be verified of any subgraph to be verified.
[0097] Optional,
[0098] The device further comprises a score determination module 905, configured to determine a credibility score of each key point to be verified identified from any subgraph to be verified;
[0099] The vector retrieval module 902 is specifically configured to: determine at least a portion of the key points to be verified whose credible scores are not less than the score threshold among the key points to be verified, and aggregate the key point feature vectors to be verified corresponding to the at least a portion of the key points to be verified.
[0100] Optionally, the image comparison module 904 is configured as follows:
[0101] When the aggregated feature vector to be verified is obtained by aggregating feature vectors of key points to be verified corresponding to at least a part of the key points to be verified identified from the corresponding subgraph to be verified, and description information of key points to be verified corresponding to the identified key points to be verified is cached, obtaining the cached description information of key points to be verified; or,
[0102] Re-identify the key points to be verified from the corresponding sub-graph to be verified and extract the corresponding description information of the key points to be verified.
[0103] Optionally, the vector retrieval module 902 is specifically configured as follows:
[0104] Calculating the vector similarity between the aggregate feature vector to be verified and each pre-registered aggregate feature vector stored in the vector database;
[0105] A group of pre-registered aggregated feature vectors whose vector similarity is not less than a similarity threshold are retrieved, or a preset number of pre-registered aggregated feature vectors whose vector similarity is maximum are retrieved.
[0106] Optionally, the sub-graph coordinates of any aggregate vector pair include sub-graph coordinates to be verified and pre-registered sub-graph coordinates, the sub-graph coordinates to be verified are position information of the sub-graph to be verified corresponding to the aggregate feature vector to be verified in the aggregate vector pair in the surface texture image to which it belongs, and the pre-registered sub-graph coordinates are position information of the pre-registered sub-graph corresponding to the pre-registered aggregate feature vector in the aggregate vector pair in the pre-registered surface texture image to which it belongs, and the consistency screening module 903 is specifically configured as follows:
[0107] Traverse each clustered vector pair formed by the acquired clustered feature vectors to be verified, select at least one clustered vector pair each time according to the quantity required by the geometric consistency constraint, and determine whether the subgraph coordinates of the at least one clustered vector pair all meet the geometric consistency constraint; if they all meet, determine that the at least one clustered vector pair is the target clustered vector pair; if there is a clustered vector pair whose subgraph coordinates do not meet the requirements, determine that the at least one clustered vector pair is not the target clustered vector pair.
[0108] Optionally, the geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition, and the consistency screening module 903 is specifically configured as follows:
[0109] For a first aggregation vector pair and a second aggregation vector pair in any two aggregation vector pairs, if the absolute value of the difference between the subgraph distance to be verified and the pre-registered subgraph distance between the two aggregation vector pairs is not greater than the distance threshold, it is determined that the corresponding subgraphs of the two aggregation vector pairs satisfy the distance constraint condition; wherein the subgraph distance to be verified is the distance between the coordinates of the subgraph to be verified of the first aggregation vector pair and the coordinates of the subgraph to be verified of the second aggregation vector pair, and the pre-registered subgraph distance is the distance between the coordinates of the pre-registered subgraph of the first aggregation vector pair and the coordinates of the pre-registered subgraph of the second aggregation vector pair;
[0110] For the first clustering vector pair, the second clustering vector pair and the third clustering vector pair among any three clustering vector pairs, if the absolute value of the difference between the angle of the subgraph to be verified between the three clustering vector pairs and the angle of the pre-registered subgraph is not greater than the angle threshold, it is determined that the corresponding subgraphs of the three clustering vector pairs all meet the angle constraint condition; wherein the angle of the subgraph to be verified is the angle between the line connecting the first and second subgraphs to be verified and the line connecting the second and third subgraphs to be verified, and the line connecting the first and second subgraphs to be verified is the angle between the coordinates of the subgraph to be verified of the first clustering vector pair and the coordinates of the subgraph to be verified of the second clustering vector pair. The second-third to-be-verified subgraph connection line is a line between the coordinates of the subgraph to be verified of the second aggregation vector pair and the coordinates of the subgraph to be verified of the third aggregation vector pair; the pre-registered subgraph angle is an angle between the first-second pre-registered subgraph connection line and the second-third pre-registered subgraph connection line; the first-second pre-registered subgraph connection line is a line between the coordinates of the pre-registered subgraph of the first aggregation vector pair and the coordinates of the pre-registered subgraph of the second aggregation vector pair; the second-third pre-registered subgraph connection line is a line between the coordinates of the pre-registered subgraph of the second aggregation vector pair and the coordinates of the pre-registered subgraph of the third aggregation vector pair;
[0111] For any aggregation vector pair, if the distance between the coordinates of the sub-image to be verified and the pre-registered sub-image of any aggregation vector pair is not greater than the distance threshold, and the angle between the line between the coordinates of the sub-image to be verified of any aggregation vector pair and the coordinate origin of the surface texture image to be verified and the line between the coordinates of the pre-registered sub-image of any aggregation vector pair and the coordinate origin of the corresponding pre-registered surface texture image is not greater than the angle threshold, then it is determined that the corresponding sub-image of any aggregation vector pair satisfies the common constraint condition.
[0112] Optionally, the consistency screening module 903 is specifically configured as follows:
[0113] For each pre-registered surface texture image corresponding to the target aggregation vector pair, determining the number of target aggregation vector pairs corresponding to each image, wherein if the pre-registered aggregation feature vector constituting a target aggregation vector pair is extracted from a pre-registered sub-image obtained by dividing a pre-registered surface texture image, then the pre-registered surface texture image corresponds to the target aggregation vector pair;
[0114] Recall each pre-registered surface texture image whose number of corresponding target aggregation vector pairs is greater than a quantity threshold; or recall a preset number of pre-registered surface texture images whose number of corresponding target aggregation vector pairs is the largest.
[0115] Optionally, the description information of the key point to be verified includes the position information of the key point to be verified and the feature vector of the key point to be verified, the description information of the pre-registered key point includes the position information of the pre-registered key point and the feature vector of the pre-registered key point, and the image comparison module 904 is specifically configured as follows:
[0116] By comparing the key point feature vector to be verified with the pre-registered key point feature vector, selecting at least a part of target key point vector pairs from the key point vector pairs composed of the key point feature vector to be verified and the pre-registered key point feature vector, the target key point vector pairs are composed of the target key point feature vector to be verified and the target pre-registered key point feature vector, and the target pre-registered key point vector corresponds to at least one pre-registered surface texture image;
[0117] For each pre-registered surface texture image of the at least one pre-registered surface texture image: determining an affine transformation matrix for the target key point to be verified according to the target key point position information corresponding to the corresponding target key point vector to be verified and the target pre-registered key point position information corresponding to the target pre-registered key point vector, and calculating the transformed key point position information of the transformed key point corresponding to the target key point to be verified based on the affine transformation matrix;
[0118] The key point repetition rate between the transformed key point and the pre-registered key point corresponding to the target pre-registered key point vector is determined according to the transformed key point position information and the target pre-registered key point position information, wherein the prerequisite for determining that the pre-registered surface texture image matches the surface texture image to be verified includes: the key point repetition rate is not less than a repetition rate threshold.
[0119] Optionally, the image comparison module 904 is specifically configured as follows:
[0120] For each key point feature vector to be verified obtained: a group of pre-registered key point feature vectors with the highest vector similarity to the key point feature vector to be verified are retrieved from the obtained pre-registered key point feature vectors, and the key point feature vector to be verified and each feature vector in the group of pre-registered key point feature vectors respectively constitute a key point vector pair;
[0121] At least a portion of target key point vector pairs whose corresponding key points satisfy geometric consistency constraints are screened out from the key point vector pairs formed by the acquired key point feature vectors to be verified.
[0122] Optionally, the method further includes an image similarity calculation module 906, which is configured to:
[0123] The image similarity between the surface texture image to be verified and the pre-registered surface texture image is calculated, wherein a prerequisite for determining that any of the pre-registered surface texture images matches the surface texture image to be verified includes: the image similarity corresponding to the pre-registered surface texture image is not less than a similarity threshold.
[0124] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.
[0125] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0126] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.
Claims
1. A surface texture image comparison method, characterized in that: include: Acquire a surface texture image to be verified collected from the object to be verified, and intercept a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size; Extracting the aggregated feature vector to be verified of each sub-graph to be verified, and for each aggregated feature vector to be verified: retrieving a group of pre-registered aggregated feature vectors having the highest vector similarity with the aggregated feature vector to be verified in a vector database, wherein the aggregated feature vector to be verified and each feature vector in the group of pre-registered aggregated feature vectors respectively constitute an aggregated vector pair; wherein each pre-registered aggregated feature vector is extracted from a pre-registered sub-graph, and the pre-registered sub-graph is obtained by dividing a pre-registered surface texture image collected from a pre-registered object according to the preset size; According to the position information of each sub-image to be verified and each pre-registered sub-image in the corresponding surface texture image, a target aggregate vector pair of the corresponding sub-image that satisfies the geometric consistency constraint condition is selected from the aggregate vector pairs formed by the aggregate feature vectors to be verified, and at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair is recalled; Acquire description information of the key point to be verified corresponding to the key point to be verified identified from the surface texture image to be verified and description information of the pre-registered key point corresponding to the pre-registered key point identified from each recalled pre-registered surface texture image; And, according to the comparison result between the key point description information to be verified and the pre-registered key point description information, it is determined whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
2. The method according to claim 1, characterized in that Extract the aggregate feature vector to be verified of any subgraph to be verified, including: Identify the key points to be verified from any of the subgraphs to be verified and extract corresponding description information of the key points to be verified, wherein the description information of the key points to be verified includes a feature vector of the key points to be verified; Aggregation processing is performed on the feature vectors of the key points to be verified corresponding to at least a portion of the identified key points to be verified, so as to generate an aggregated feature vector to be verified of any subgraph to be verified.
3. The method according to claim 2, characterized in that The method further comprises: determining a credibility score of each key point to be verified identified from any subgraph to be verified; The aggregating process of the feature vectors of the key points to be verified corresponding to at least a portion of the identified key points to be verified includes: determining at least a portion of the key points to be verified whose credible scores are not less than a score threshold among the key points to be verified, and aggregating the feature vectors of the key points to be verified corresponding to the at least a portion of the key points to be verified.
4. The method according to claim 2, characterized in that: The step of obtaining description information of the key points to be verified corresponding to the key points to be verified identified from the surface texture image to be verified includes: When the aggregated feature vector to be verified is obtained by aggregating feature vectors of key points to be verified corresponding to at least a part of the key points to be verified identified from the corresponding subgraph to be verified, and description information of key points to be verified corresponding to the identified key points to be verified is cached, obtaining the cached description information of key points to be verified; or, Re-identify the key points to be verified from the corresponding sub-graph to be verified and extract the corresponding description information of the key points to be verified.
5. The method according to claim 1, characterized in that The step of retrieving from the vector database a group of pre-registered aggregated feature vectors having the highest vector similarity to the aggregated feature vector to be verified includes: Calculating the vector similarity between the aggregate feature vector to be verified and each pre-registered aggregate feature vector stored in the vector database; A group of pre-registered aggregated feature vectors whose vector similarity is not less than a similarity threshold are retrieved, or a preset number of pre-registered aggregated feature vectors whose vector similarity is maximum are retrieved.
6. The method according to claim 1, characterized in that The sub-graph coordinates of any aggregation vector pair include the coordinates of the sub-graph to be verified and the coordinates of the pre-registered sub-graph, wherein the coordinates of the sub-graph to be verified are the position information of the sub-graph to be verified corresponding to the aggregation feature vector to be verified in the aggregation vector pair in the surface texture image to which it belongs, and the coordinates of the pre-registered sub-graph are the position information of the pre-registered sub-graph corresponding to the pre-registered aggregation feature vector in the aggregation vector pair in the pre-registered surface texture image to which it belongs, and the target aggregation vector pair whose corresponding sub-graph satisfies the geometric consistency constraint condition is selected from the aggregation vector pair composed of the aggregation feature vector to be verified, including: Traverse each clustered vector pair formed by the acquired clustered feature vectors to be verified, select at least one clustered vector pair each time according to the quantity required by the geometric consistency constraint, and determine whether the subgraph coordinates of the at least one clustered vector pair all meet the geometric consistency constraint; if they all meet, determine that the at least one clustered vector pair is the target clustered vector pair; if there is a clustered vector pair whose subgraph coordinates do not meet the requirements, determine that the at least one clustered vector pair is not the target clustered vector pair.
7. The method according to claim 1, characterized in that The geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition, wherein: For a first aggregation vector pair and a second aggregation vector pair in any two aggregation vector pairs, if the absolute value of the difference between the subgraph distance to be verified and the pre-registered subgraph distance between the two aggregation vector pairs is not greater than the distance threshold, it is determined that the corresponding subgraphs of the two aggregation vector pairs satisfy the distance constraint condition; wherein the subgraph distance to be verified is the distance between the coordinates of the subgraph to be verified of the first aggregation vector pair and the coordinates of the subgraph to be verified of the second aggregation vector pair, and the pre-registered subgraph distance is the distance between the coordinates of the pre-registered subgraph of the first aggregation vector pair and the coordinates of the pre-registered subgraph of the second aggregation vector pair; For the first clustering vector pair, the second clustering vector pair and the third clustering vector pair among any three clustering vector pairs, if the absolute value of the difference between the angle of the subgraph to be verified between the three clustering vector pairs and the angle of the pre-registered subgraph is not greater than the angle threshold, it is determined that the corresponding subgraphs of the three clustering vector pairs all meet the angle constraint condition; wherein the angle of the subgraph to be verified is the angle between the line connecting the first and second subgraphs to be verified and the line connecting the second and third subgraphs to be verified, and the line connecting the first and second subgraphs to be verified is the angle between the coordinates of the subgraph to be verified of the first clustering vector pair and the coordinates of the subgraph to be verified of the second clustering vector pair. The second-third to-be-verified subgraph connection line is a line between the coordinates of the subgraph to be verified of the second aggregation vector pair and the coordinates of the subgraph to be verified of the third aggregation vector pair; the pre-registered subgraph angle is an angle between the first-second pre-registered subgraph connection line and the second-third pre-registered subgraph connection line; the first-second pre-registered subgraph connection line is a line between the coordinates of the pre-registered subgraph of the first aggregation vector pair and the coordinates of the pre-registered subgraph of the second aggregation vector pair; the second-third pre-registered subgraph connection line is a line between the coordinates of the pre-registered subgraph of the second aggregation vector pair and the coordinates of the pre-registered subgraph of the third aggregation vector pair; For any aggregation vector pair, if the distance between the coordinates of the sub-image to be verified and the pre-registered sub-image of any aggregation vector pair is not greater than the distance threshold, and the angle between the line between the coordinates of the sub-image to be verified of any aggregation vector pair and the coordinate origin of the surface texture image to be verified and the line between the coordinates of the pre-registered sub-image of any aggregation vector pair and the coordinate origin of the corresponding pre-registered surface texture image is not greater than the angle threshold, then it is determined that the corresponding sub-image of any aggregation vector pair satisfies the common constraint condition.
8. The method according to claim 1, characterized in that The recalling of at least a portion of the pre-registered surface texture image corresponding to the target aggregated vector pair comprises: For each pre-registered surface texture image corresponding to the target aggregation vector pair, determining the number of target aggregation vector pairs corresponding to each image, wherein if the pre-registered aggregation feature vector constituting a target aggregation vector pair is extracted from a pre-registered sub-image obtained by dividing a pre-registered surface texture image, then the pre-registered surface texture image corresponds to the target aggregation vector pair; Recall each pre-registered surface texture image whose number of corresponding target aggregation vector pairs is greater than a quantity threshold; or recall a preset number of pre-registered surface texture images whose number of corresponding target aggregation vector pairs is the largest.
9. The method according to claim 1, characterized in that: The key point description information to be verified includes the key point position information to be verified and the key point feature vector to be verified, the pre-registered key point description information includes the pre-registered key point position information and the pre-registered key point feature vector, and determining whether there is a pre-registered surface texture image that matches the surface texture image to be verified according to a comparison result between the key point description information to be verified and the pre-registered key point description information, including: By comparing the key point feature vector to be verified with the pre-registered key point feature vector, selecting at least a part of target key point vector pairs from the key point vector pairs composed of the key point feature vector to be verified and the pre-registered key point feature vector, the target key point vector pairs are composed of the target key point feature vector to be verified and the target pre-registered key point feature vector, and the target pre-registered key point vector corresponds to at least one pre-registered surface texture image; For each pre-registered surface texture image of the at least one pre-registered surface texture image: determining an affine transformation matrix for the target key point to be verified according to the target key point position information corresponding to the corresponding target key point vector to be verified and the target pre-registered key point position information corresponding to the target pre-registered key point vector, and calculating the transformed key point position information of the transformed key point corresponding to the target key point to be verified based on the affine transformation matrix; The key point repetition rate between the transformed key point and the pre-registered key point corresponding to the target pre-registered key point vector is determined according to the transformed key point position information and the target pre-registered key point position information, wherein the prerequisite for determining that the pre-registered surface texture image matches the surface texture image to be verified includes: the key point repetition rate is not less than a repetition rate threshold.
10. The method according to claim 9, characterized in that The selecting at least a part of target key point vector pairs from the key point vector pairs formed by the key point feature vector to be verified and the pre-registered key point feature vector by comparing the key point feature vector to be verified and the pre-registered key point feature vector comprises: For each key point feature vector to be verified obtained: a group of pre-registered key point feature vectors with the highest vector similarity to the key point feature vector to be verified are retrieved from the obtained pre-registered key point feature vectors, and the key point feature vector to be verified and each feature vector in the group of pre-registered key point feature vectors respectively constitute a key point vector pair; At least a portion of target key point vector pairs whose corresponding key points satisfy geometric consistency constraints are screened out from the key point vector pairs formed by the acquired key point feature vectors to be verified.
11. The method according to any one of claims 1 to 10, characterized in that Also includes: The image similarity between the surface texture image to be verified and the pre-registered surface texture image is calculated, wherein a prerequisite for determining that any of the pre-registered surface texture images matches the surface texture image to be verified includes: the image similarity corresponding to the pre-registered surface texture image is not less than a similarity threshold.
12. An electronic device, characterized in that: include: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1 to 11 by executing the executable instructions.
13. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Mismatching deleting method based on angle constraint
CN103530872A
Optimization method based on SIFT feature point matching
CN103714544A
Fingerprint identification method and device, intelligent door lock and readable storage medium
CN110516546A
Image retrieval method and system
CN113536017A
Universal feature retrieval anti-counterfeiting method suitable for texture of object
CN115690027A
