Method and device for comparing surface texture images
Through the comparison of aggregated feature vectors and geometric consistency screening of surface texture images, the accuracy and efficiency problems of item authenticity verification in the existing technology are solved, and efficient item authenticity verification is achieved.
Patent Information
- Application Number
- CN202410623179.X
- 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 using existing technologies to verify the authenticity of items, methods based on overall features have low accuracy, while methods based on microscopic textures are computationally intensive and difficult to achieve efficient batch verification.
By extracting the aggregated feature vectors of the to-be-verified and pre-registered surface texture images, performing vector similarity comparison and geometric consistency constraint screening, matching pre-registered surface texture images are recalled, reducing computing power requirements and improving efficiency.
It achieves efficient verification of the authenticity of items, reduces the calculation amount and difficulty of the verification process, and supports batch verification.
Smart Images

Figure CN118537590A
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] For a surface texture image to be verified collected from the object to be verified and a pre-registered surface texture image collected from a corresponding pre-registered object, based on a vector similarity comparison result between an aggregated feature vector to be verified extracted from the surface texture image to be verified and a pre-registered aggregated feature vector extracted from the pre-registered surface texture image, recalling at least a portion of the pre-registered surface texture images;
[0007] Acquire the pre-registered key point position information and pre-registered key point feature vectors corresponding to the pre-registered key points respectively identified from each recalled pre-registered surface texture image, and the key point position information and key point feature vectors corresponding to the key points to be verified identified from the surface texture image to be verified;
[0008] 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, 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, and the retrieved pre-registered key point vector corresponds to a group of pre-registered surface texture images in the at least a portion of the recalled pre-registered surface texture images; and, a target key point vector pair whose corresponding key points meet the geometric consistency constraint condition is screened out from the key point vector pairs constituted by the obtained key point feature vectors to be verified;
[0009] Determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture images corresponding to the target key point vector pair.
[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 three stages: a rough screening stage, a fine screening stage, and a comparison stage. In the rough screening stage: based on the vector comparison result between the aggregate feature vector to be verified and the pre-registered aggregate feature vector, at least a part of the pre-registered surface texture images are first recalled from all the candidate pre-registered surface texture images. Further, in the fine screening stage, for this part of the pre-registered surface texture images recalled in the rough screening stage, the pre-registered key point position information and pre-registered key point feature vectors of the pre-registered key points identified from each of the pre-registered surface texture images will be obtained first, and the key point information to be verified and the key point feature vector to be verified of the key points to be verified identified from the surface texture image to be verified will be obtained; then for each key point feature vector to be verified 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 to form a key point vector pair with the key point feature vector to be verified, and the target key point vector pairs whose corresponding key points meet the geometric consistency constraint conditions are screened out from all the key point vector pairs. In the comparison stage: determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture image corresponding to the target key point vector pair, so as to complete the comparison.
[0014] The embodiments of the 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 reliability of the above comparison result 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 key points respectively identified from the two images, if the positions of the two key points in the corresponding images are the same (or close), then the local textures of the two key points are also the same (or close). This scheme characterizes the local micro-texture of the key point through the key point feature vector corresponding to the key point. It can be understood that: for the aggregate feature vector to be verified of each key point to be verified identified in the surface texture image to be verified and the pre-registered aggregate feature vector of each pre-registered key point identified in each pre-registered surface texture image, 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 key points to be verified in the surface texture image to be verified and the pre-registered key points 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 key points); 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; accordingly, since at least one key point to be verified is identified in the pre-registered surface texture image and at least one pre-registered key point is identified in the surface texture image to be verified, the positions of the key points in the corresponding images are not exactly the same, so only the positions of the key points corresponding to some key point vector pairs satisfy the above general rules. It can be seen that, in at least a portion of the pre-registered surface texture images recalled in the rough screening stage, there may still be some pre-registered surface texture images whose positions of key points do not satisfy the above general rules.
[0015] In this regard, for the key point vectors in at least a portion of the pre-registered surface texture images recalled in the rough screening stage, the embodiment of this specification uses vector similarity and geometric consistency constraints to perform more detailed screening again in the fine screening stage, which can screen out the key point vector pairs whose corresponding key points do not meet the above general rules, thereby further reducing the number of images that need to be compared in the subsequent comparison 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 amount of calculation 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 2It is a schematic diagram of a registration and 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 1 and pre-registered aggregate feature vector 1) 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 device (i.e., an electronic device used by a verification 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 step 302 belongs to the coarse screening stage, steps 304-306 belong to the fine screening stage, and step 308 belongs to the comparison stage.
[0037] Step 302, for the surface texture image to be verified collected from the object to be verified and the pre-registered surface texture image collected from the corresponding pre-registered object, based on the vector similarity comparison result between the aggregated feature vector to be verified extracted from the surface texture image to be verified and the pre-registered aggregated feature vector extracted from the pre-registered surface texture image, recall at least a part of the pre-registered surface texture images.
[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 surface texture image 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 4 This 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 exactly 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, in 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. In addition, the above-mentioned processing can be performed on each pre-registered sub-image to extract its corresponding 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), and save it in the aforementioned vector database to complete the registration. 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.
[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 aforementioned second preset size, so that in the subsequent verification process, 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 a convolutional neural network architecture such as a V key point feature vector network and a 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 captured in the verification phase is 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 can 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] For the M sub-images to be verified that are intercepted from the surface texture image to be verified, the description information of the key points to be verified (including the position information of the key points to be verified and the feature vectors of the key points to be verified) and the aggregated feature vectors to be verified of each sub-image can be extracted. Among them, the position information of the key points to be verified of each key point to be verified is used to characterize the specific position of the key point in the surface texture image to be verified. This position information is used in the subsequent fine screening stage, and the position involved in this stage can be accurately determined to the pixel level; the key point vector to be verified of each key point to be verified is used to characterize the local surface texture of the key point. In view of the fact that the description information of the key points to be verified of each key point to be verified is needed in the subsequent fine screening stage, in order to speed up the data acquisition efficiency in the fine screening stage, the extracted description information of the key points to be verified can be cached in the coarse screening stage so that it can be directly obtained in the subsequent fine screening stage without the need to be extracted again.
[0044] When extracting the aggregate feature vector to be verified from the intercepted subgraph to be verified, the same method as that for extracting the pre-registered aggregate feature vector from the divided pre-registered subgraph can be used, that is, the aggregate feature vector to be verified and the pre-registered aggregate feature vector are extracted in the same manner. Exemplarily, a pre-built and trained feature extraction network can be used to extract the aggregate feature vector to be verified and the pre-registered aggregate feature vector, etc., which will not be described in detail.
[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 then the feature vectors of the key points to be verified corresponding to at least a part of the identified key points to be verified are aggregated to generate the aggregated feature vector to be verified of any sub-graph to be verified. It is assumed that N key points to be verified are identified from the surface texture image 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 relevant features 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. In addition, the coordinates of the sub-graphs to be verified of each sub-graph to be verified can also be determined and recorded, wherein the coordinates of any sub-graph to be verified are used to characterize the position of the sub-graph in the surface texture image to be verified (such as a few rows and columns), and the coordinates can accurately determine the position involved in the coarse screening stage to the sub-graph level.
[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, and these three feature vectors are aggregated to obtain the aggregated feature vector Qroi26 corresponding to sub-graph SP26. The position information of the key point to be verified of the key point ROI1 to be verified is used to characterize the specific position of the key point in the surface texture image to be verified, such as the image origin of the surface texture image to be verified (such as Figure 5 The origin (2) shown in the figure is used as a reference to determine its position, and the position information of the other key points to be verified is similar to this and will not be repeated here.
[0048] Among them, for each key point to be verified identified from any of the sub-graphs to be verified, the credibility score of each of these key points to be verified can also be determined. Among them, the size of 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 identified key point to be verified, the greater the possibility that the key point actually exists in the sub-graph to be verified. Based on the above credibility score, during the aforementioned aggregation processing, at least a part of the key points to be verified whose credibility score is not less than the score threshold among the key points to be verified can be determined, 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] For the surface texture image to be verified collected from the object to be verified and the pre-registered surface texture image collected from the corresponding pre-registered object, the aggregated feature vector to be verified extracted from the surface texture image to be verified (that is, the aggregated feature vector to be verified extracted from the sub-graph to be verified) and the pre-registered aggregated feature vector extracted from the pre-registered surface texture image (that is, the pre-registered aggregated feature vector extracted from the pre-registered sub-graph) can be obtained respectively, and then based on the vector similarity comparison result between the two types of aggregated feature vectors, at least a part of the pre-registered surface texture images can be recalled.
[0050] When recalling at least a portion of the pre-registered surface texture image based on the vector similarity comparison result, for each aggregated feature vector to be verified: a group of pre-registered aggregated feature vectors with the highest vector similarity to the aggregated feature vector to be verified can be retrieved from the acquired pre-registered aggregated feature vector, 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 aggregated feature vector to be verified is extracted from a sub-graph to be verified, and the sub-graph to be verified is obtained by dividing the surface texture image to be verified according to a preset size, and each pre-registered aggregated feature vector is extracted from a pre-registered sub-graph. A registered sub-image is obtained by dividing the corresponding pre-registered surface texture image according to the preset size; then, according to the position information of each sub-image to be verified and each pre-registered sub-image in the surface texture image to which it belongs (i.e., the position coordinates of each sub-image to be verified in the surface texture image to be verified and the pre-registered sub-image coordinates of each pre-registered sub-image in the corresponding pre-registered surface texture image), the target aggregate vector pair of the corresponding sub-image that satisfies the geometric consistency constraint condition is screened out from the aggregate vector pairs composed of 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. In this way, some target aggregate vector pairs of the corresponding sub-image that satisfies the geometric consistency constraint condition can be screened out from all aggregate vector pairs, and at least a part of the pre-registered surface texture image corresponding to these target aggregate vector pairs can be recalled. Among them, the geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition. The specific inspection method of each condition can refer to the description of the embodiment below, which will not be repeated here.
[0051] 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.
[0052] In addition, when recalling at least a part of the above-mentioned pre-registered surface texture images, the number of target aggregation vector pairs corresponding to each image corresponding to all target aggregation vector pairs can be determined first (if the pre-registered aggregation feature vector constituting a certain target aggregation vector pair is extracted from a pre-registered sub-graph obtained by dividing a certain pre-registered surface texture image, then the pre-registered surface texture image corresponds to the target aggregation vector pair), and then recall each pre-registered surface texture image whose number of corresponding target aggregation vector pairs is greater than the number threshold (at this time, the number of pre-registered surface texture images recalled is not certain, and may be zero or any positive integer); or, recall a preset number of pre-registered surface texture images with the largest number of corresponding target aggregation vector pairs (at this time, the number of pre-registered surface texture images recalled is the preset number). In this way, in the rough screening stage, all aggregation vector pairs are preliminarily screened using vector similarity and geometric consistency constraints, and a large number of aggregation vector pairs whose corresponding sub-graph positions do not meet the above general rules can be screened out, thereby reducing the processing pressure of the subsequent fine screening stage and greatly reducing the overall computational complexity of the verification process.
[0053] At this point, the rough screening stage in the verification process is completed, and the rough screening result is the recalled at least part of the pre-registered surface texture images. At this point, the fine screening process can be started for the recalled pre-registered surface texture images.
[0054] Step 304, obtaining the preregistered key point position information and preregistered key point feature vector corresponding to the preregistered key points respectively identified from each recalled preregistered surface texture image, and the key point position information and key point feature vector corresponding to the key points to be verified identified from the surface texture image to be verified.
[0055] In one embodiment, as described above, the vector database maintained by the server records the pre-registered key point position information and pre-registered key point feature vectors corresponding to the recalled pre-registered key points (respectively identified from each pre-registered surface texture image), so these pre-registered key point position information and pre-registered key point feature vectors can be retrieved from the vector database, and the specific process will not be repeated here.
[0056] In one embodiment, as described above, after extracting the description information of the key points to be verified of the sub-graph to be verified (including the feature vectors of the key points to be verified and the position information of the key points to be verified) in the rough screening stage, this information 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, when obtaining the position information of the key points to be verified and the feature vectors of the key points to be verified in the fine screening stage, the cached position information of the key points to be verified and the feature vectors of the key points to be verified corresponding to the key points identified from the surface texture image to be verified can be directly 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.
[0057] 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 surface texture image to be verified in the fine screening stage and extract the corresponding key point position information to be verified and key point feature vectors to be verified. The specific acquisition method can be flexibly selected according to actual needs, and this specification does not limit this.
[0058] Among them, when identifying the key points to be verified from the surface texture image to be verified and extracting the corresponding key point position information and key point feature vector to be verified, a sub-image to be verified can be intercepted from the surface texture image to be verified through a sliding window of a preset size; for each intercepted sub-image to be verified: the key points to be verified can be identified from the sub-image to be verified and the corresponding key point position information and key point feature vector to be verified can be extracted. Of course, in addition to dividing the sub-image to be verified, it is also possible not to intercept the sub-image to be verified, but to directly identify each key point to be verified in the surface texture image to be verified and extract the corresponding key point description information to be verified, which will not be repeated.
[0059] Through the above method, the key point position information and key point feature vector of the N key points to be verified in the surface texture image to be verified can be obtained, as well as the pre-registered key point position information and pre-registered key point feature vector of each pre-registered key point contained in each pre-registered surface texture image recalled in the coarse screening stage.
[0060] Step 306, for each key point feature vector to be verified that is obtained: retrieve a group of preregistered key point feature vectors with the highest vector similarity with the key point feature vector to be verified from the obtained preregistered key point feature vectors, the key point feature vector to be verified and each feature vector in the group of preregistered key point feature vectors respectively constitute a key point vector pair, and the retrieved preregistered key point vector corresponds to a group of preregistered surface texture images in the at least a part of the preregistered surface texture images that are recalled; and, filter out the target key point vector pair whose corresponding key points meet the geometric consistency constraint condition from the key point vector pair constituted by the obtained key point feature vectors to be verified.
[0061] For each of the N key points to be verified that have been obtained, the key point vector pairs of each of the key point feature vectors to be verified can be constructed next. Among them, when retrieving the set of pre-registered key point feature vectors, the vector similarity between the vector to be verified and each of the pre-registered key point feature vectors obtained can be calculated first; then a set of pre-registered key point feature vectors whose vector similarity is not less than the similarity threshold is retrieved (the number of vectors in each set of pre-registered key point feature vectors is not certain at this time, and may be zero or any positive integer), or a preset number of pre-registered key point feature vectors with the largest vector similarity are retrieved (the number of vectors in each set of pre-registered key point feature vectors is the preset number at this time). For example, assuming that a set of pre-registered key point feature vectors retrieved for each key point feature vector to be verified includes H (H is a positive integer) vectors, then the key point feature vector to be verified will constitute H key point vector pairs with the H pre-registered key point feature vectors, and the N key point feature vectors to be verified that correspond one-to-one to all the N key points to be verified will participate in constituting N*H key point vector pairs. Of course, the number of vectors in a group of pre-registered key point feature vectors corresponding to each key point feature vector to be verified may also be unequal, and the embodiments of this specification do not limit this.
[0062] like Figure 5As shown, each key point to be verified in the surface texture image to be verified (such as ROI1~ROI4, etc.) is located at different positions, and each pre-registered key point in any pre-registered surface texture image i (i.e. ROIR1~ROIR8, etc.) is also located at different positions. It is advisable to record the key point feature vector to be verified corresponding to ROI1 as Qroi1, and the pre-registered key point feature vector corresponding to ROIR1 as Qroir1. The same is true for other key point feature vectors to be verified and pre-registered key point feature vectors. Among them, the arrowed solid lines pointing to the pre-registered key points ROIR1, ROIR2 and ROIR3 of the key point to be verified are used to indicate that Qroi1 and Qroir1, Qroir2 and Qroir3 each constitute a key point vector pair (indicating that Qroi1 recalls Qroir1, Qroir2 and Qroir3). Similarly, ROI2 points to the pre-registered key points ROIR4, ROIR5, ROIR6 and ROIR7 with dotted arrows, which are used to indicate that Qroi2 and Qroir4, Qroir5, Qroir6 and Qroir7 each form a key point vector pair. For the sake of simplicity, [Qroi2, Qroir1] is used below to represent the key point vector pair formed by Qroi2 and Qroir1, and the same applies to other key point vector pairs.
[0063] Through the above-mentioned screening process based on vector similarity, a part of pre-registered key point feature vectors with high similarity to the key point feature vector to be verified can be preliminarily screened out from the pre-registered key point feature vectors recalled in the coarse screening stage, 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 recalled pre-registered key point vectors, thereby greatly reducing the amount of calculation in the subsequent steps.
[0064] For N key point feature vectors to be verified, the aforementioned similarity-based screening process can screen out M groups of corresponding pre-registered key point feature vectors, and each key point feature vector to be verified and each adjacent pre-registered key point feature vector corresponding to itself constitute a key point vector pair. Among them, the key point vector to be verified that constitutes each key point vector pair corresponds to the corresponding key point to be verified, and the pre-registered key point vector corresponds to the corresponding pre-registered key point. As mentioned above, the position information of each key point is used to reflect the position of the key point in the surface texture image to which it belongs. Based on the position information of the key point, the target key point vector pair whose corresponding key point meets the geometric consistency constraint condition can be screened out from the key point vector pair constituted by the key point feature vector to be verified.
[0065] In one embodiment, the key point coordinates of any key point vector pair may include the key point coordinates to be verified and the pre-registered key point coordinates, wherein the key point coordinates to be verified are the position information of the key point to be verified corresponding to the key point feature vector to be verified in the key point vector pair in the surface texture image to be verified, and the pre-registered key point coordinates are the position information of the pre-registered key point corresponding to the pre-registered key point feature vector in the key point vector pair in the pre-registered surface texture image to which it belongs. Figure 5 As shown, for the key point vector pair [Qroi1, Qroir1] composed of the key point feature vector to be verified corresponding to ROI1 and the pre-registered key point feature vector corresponding to ROIR1, its key point coordinates include the coordinates of ROI1 in the surface texture image to be verified and the coordinates of ROIR1 in the pre-registered surface texture image i.
[0066] Based on the above key point coordinates, when screening the target key point vector pairs that meet the geometric consistency constraint conditions, the key point vector pairs formed by the key point feature vectors to be verified can be traversed, and at least one key point vector pair can be selected each time according to the number requirements of the geometric consistency constraint conditions, and it is determined whether the key point coordinates of the at least one key point vector pair all meet the geometric consistency constraint conditions; wherein, if the key point coordinates of the at least one key point vector pair all meet the conditions, then the at least one key point vector pair is determined to be the target key point vector pair; if the key point coordinates of the key point vector pair in the at least one key point vector pair do not meet the conditions, then it is determined that the at least one key point vector pair is not the target key point vector pair. In this way, all combinations of all key point vector pairs can be checked one by one according to the number requirements of the geometric consistency constraint conditions, and finally the target key point vector pairs that meet the geometric consistency constraint conditions are screened out, avoiding omissions, and helping to ensure the accuracy of the final comparison results.
[0067] 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 solution, the relative position relationship between different key points is verified through geometric consistency constraints.
[0068] 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 key point vector pair, any number of conditions can be selected from these three constraints to check each key point vector pair. They are explained below respectively. For example, when the geometric consistency constraint condition includes these three conditions at the same time, for all S0 key point vector pairs to be checked, S1 key point vector pairs that meet the distance constraint condition can be screened out first; then for these S1 key point vector pairs, S2 key point vector pairs that meet the angle constraint condition can be screened out; finally, for these S2 key point vector pairs, S3 key point vector pairs that meet the common constraint condition can be screened out, that is, as the final target key point vector pair. It can be understood that the above process can realize the progressive step-by-step screening of the aggregated 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.
[0069] Two key point vector pairs are required for each check of the distance constraint. For example, for the first key point vector pair and the second key point vector pair in any two key point vector pairs, if the absolute value of the difference between the distance of the key point to be verified and the distance of the pre-registered key point between the two key point vector pairs is not greater than the distance threshold, it is determined that the corresponding key points of the key point pairs corresponding to the two key point vectors respectively meet the distance constraint; wherein the distance of the key point to be verified is the distance between the coordinates of the key point to be verified of the first key point vector pair and the coordinates of the key point to be verified of the second key point vector pair, and the distance of the pre-registered key point is the distance between the coordinates of the pre-registered key point of the first key point vector pair and the coordinates of the pre-registered key point of the second key point vector pair.
[0070] Following the above embodiment, Figure 5As shown, the feature vector of the key point to be verified corresponding to ROI1 participates in the construction of three key point vector pairs, namely [Qroi1, Qroir1], [Qroi1, Qroir2] and [Qroi1, Qroir3]; the feature vector of the key point to be verified corresponding to ROI2 participates in the construction of four key point vector pairs, namely [Qroi2, Qroir4], [Qroi2, Qroir5], [Qroi2, Qroir6] and [Qroi2, Qroir7]. There are 21 combinations of the above seven key point vector pairs, that is, there are 21 combinations of "two key point vector pairs". For each of them, it can be determined whether the absolute value of the difference between the distance of the key point to be verified and the distance of the pre-registered key point is greater than the distance threshold d0, and then determine whether the key point corresponding to this combination meets the distance constraint. Figure 5 Taking the combination of [Qroi1, Qroir1] and [Qroi2, Qroir5] as an example, the distance of the key point to be verified in this combination is the length d of the line segment between ROI1 and ROI2, and the distance of the pre-registered key point is the length dr of the line segment between ROIR1 and ROIR5; if |d-dr|>d0, it is determined that ROI1, ROI, ROIR1 and ROIR5 do not meet the distance constraint; otherwise, if |d-dr|≤d0, it is determined that the above key points meet the distance constraint, and the two key point vector pairs [Qroi1, Qroir1] and [Qroi1, Qroir5] can be selected. The determination method of the other six combinations is similar and will not be repeated.
[0071] It should be noted that, since any key point vector pair may form multiple combinations with multiple other key point 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 key point vector pairs participating in the formation of the combination satisfy the distance constraint condition, and there is no need to check whether the other combinations formed by the two key point 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 key point vector pair satisfies the condition can also be set. For example, if it is set to twice, any key point vector pair needs to satisfy the condition with at least the combination composed of the other two key point vector pairs before it is determined that the key point vector pair satisfies the condition, which will not be repeated.
[0072] At least three key point vector pairs are required for each check of the angle constraint. For example, for the first key point vector pair, the second key point vector pair, and the third key point vector pair among any three key point vector pairs, if the absolute value of the difference between the angle of the key point to be verified between the three key point vector pairs and the angle of the pre-registered key point is not greater than the angle threshold, then it is determined that the corresponding key points of the three key point vector pairs all meet the angle constraint; wherein the angle of the key point to be verified is the angle between the line connecting the first and second key points to be verified and the line connecting the second and third key points to be verified, and the line connecting the first and second key points to be verified is the angle between the coordinates of the key point to be verified of the first key point vector pair and the coordinates of the key point to be verified of the second key point vector pair. The line connecting the two and three key points to be verified is the line between the coordinates of the key points to be verified of the second key point vector pair and the coordinates of the key points to be verified of the third key point vector pair, the pre-registered key point angle is the angle between the line connecting the one and two pre-registered key points and the line connecting the two and three pre-registered key points, the line connecting the one and two pre-registered key points is the line between the pre-registered key point coordinates of the first key point vector pair and the pre-registered key point coordinates of the second key point vector pair, and the line connecting the two and three pre-registered key points is the line between the pre-registered key point coordinates of the second key point vector pair and the pre-registered key point coordinates of the third key point vector pair.
[0073] like Figure 6 As shown, assuming that after the distance constraint is screened, the feature vectors of the key points to be verified corresponding to the remaining ROI1 participate in the formation of two key point vector pairs, namely [Qroi1, Qroir1] and [Qroi1, Qroir2]; the feature vectors of the key points to be verified corresponding to ROI2 participate in the formation of a key point vector pair, namely [Qroi2, Qroir4]; the feature vectors of the key points to be verified corresponding to ROI3 participate in the formation of a key point vector pair, namely [Qroi3, Qroir7]. There are four combinations of any three of the above four key point vector pairs, that is, there are four combinations of "three key point vector pairs". For each of them, it can be judged that the absolute value of the difference between the angle of the key point to be verified and the angle of the pre-registered key point is not greater than the angle threshold θ0, and then it is determined whether the three key point vector pairs in this combination meet the distance constraint. Take the combination of [Qroi1, Qroir1], [Qroi2, Qroir4] and [Qroi3, Qroir7] as an example. Figure 6As shown, the angle of one of the key points to be verified in the combination is the angle θ between the line segment between ROI1 and ROI2 and the line segment between ROI2 and ROI3, and the angle of the pre-registered key point is the angle θr between the line segment between ROIR1 and ROIR4 and the line segment between ROIR4 and ROIR8; if |θ-θr|>θ0, it is determined that ROI1, ROI2, ROI3, ROIR1, ROIR4 and ROIR7 do not meet the distance constraint condition; otherwise, if |θ-θr|≤θ0, it is determined that the above key points meet the angle constraint condition. The determination method of the other three combinations is similar to this and will not be repeated.
[0074] Similarly, since any key point vector pair may form multiple combinations with multiple other key point 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 key point vector pairs participating in the combination satisfy the angle constraint condition, and there is no need to check whether the other combinations formed by the three key point 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 key point vector pair meets the condition can also be set. For example, if it is set to three times, any key point vector pair needs to meet the condition with at least the combination formed by the other three key point vector pairs before it is determined that the key point vector pair meets the condition. This will not be repeated.
[0075] Each check of the common constraint condition requires a key point vector pair, that is, each key point vector pair can be checked by itself without combining. For example, for any key point vector pair, if the distance between the key point coordinates to be verified and the pre-registered key point coordinates of the key point vector pair is not greater than the distance threshold, and the angle between the line between the key point coordinates to be verified of any key point vector pair and the coordinate origin of the surface texture image to be verified and the line between the pre-registered key point coordinates of any key point 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 key point of any key point vector pair meets the common constraint condition.
[0076] like Figure 7As shown, assuming that after screening the distance constraint and the angle constraint, at least one key point vector pair may remain, taking the key point vector pair corresponding to ROI2 and ROIR4, that is, [Qroi2, Qroir4] as an example. At this time, the surface texture image to be verified can be used as a reference to determine the key point of ROIR4 in the same position in the image (that is, ROIR4' shown by the dotted line in the image), and then calculate whether the distance d between ROI2 and ROIR4' is greater than the distance threshold d0, and the angle θ between the line connecting ROI2 and the origin and the line connecting ROIR4' and the origin. If |d-dr|≤d0 and |θ-θr|≤θ0, it is determined that ROI2 and ROIR4 meet the above common constraints, otherwise (that is, |d-dr|>d0 and / or |θ-θr|>θ0), it is determined that the two do not meet the above common constraints.
[0077] 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.
[0078] Through the above screening process based on geometric consistency constraints, some target key point vector pairs whose corresponding key points meet the geometric consistency constraints can be further screened out from each group of key point vector pairs screened based on vector similarity.
[0079] Step 308: Determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture images corresponding to the target key point vector pair.
[0080] After the fine screening stage, the final image matching judgment can be performed in the comparison stage. In summary, it is to determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture image corresponding to the target key point vector pair. 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 aggregate vectors in the aforementioned vector database), that is, the item to be verified is not the above-mentioned compliant product or authorized commodity.
[0081] It can be seen from the above embodiments that the verification process of this specification includes three stages: a rough screening stage, a fine screening stage, and a comparison stage. In the rough screening stage: based on the vector comparison result between the aggregate feature vector to be verified and the pre-registered aggregate feature vector, at least a part of the pre-registered surface texture images are first recalled from all the candidate pre-registered surface texture images. Further, in the fine screening stage, for this part of the pre-registered surface texture images recalled in the rough screening stage, the pre-registered key point position information and pre-registered key point feature vectors of the pre-registered key points identified from each of the pre-registered surface texture images will be obtained first, and the key point information to be verified and the key point feature vector to be verified of the key points to be verified identified from the surface texture image to be verified will be obtained; then for each key point feature vector to be verified 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 to form a key point vector pair with the key point feature vector to be verified, and the target key point vector pairs whose corresponding key points meet the geometric consistency constraint conditions are screened out from all the key point vector pairs. In the comparison stage: determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture image corresponding to the target key point vector pair, so as to complete the comparison.
[0082] The embodiments of the 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 reliability of the above comparison result 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 key points respectively identified from the two images, if the positions of the two key points in the corresponding images are the same (or close), then the local textures of the two key points are also the same (or close). This scheme characterizes the local micro-texture of the key point through the key point feature vector corresponding to the key point. It can be understood that: for the aggregate feature vector to be verified of each key point to be verified identified in the surface texture image to be verified and the pre-registered aggregate feature vector of each pre-registered key point identified in each pre-registered surface texture image, 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 key points to be verified in the surface texture image to be verified and the pre-registered key points 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 key points); 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; accordingly, since at least one key point to be verified is identified in the pre-registered surface texture image and at least one pre-registered key point is identified in the surface texture image to be verified, the positions of the key points in the corresponding images are not exactly the same, so only the positions of the key points corresponding to some key point vector pairs satisfy the above general rules. It can be seen that, in at least a portion of the pre-registered surface texture images recalled in the rough screening stage, there may still be some pre-registered surface texture images whose positions of key points do not satisfy the above general rules.
[0083] In this regard, for the key point vectors in at least a portion of the pre-registered surface texture images recalled in the rough screening stage, the embodiment of this specification uses vector similarity and geometric consistency constraints to perform more detailed screening again in the fine screening stage, which can screen out the key point vector pairs whose corresponding key points do not meet the above general rules, thereby further reducing the number of images that need to be compared in the subsequent comparison 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 amount of calculation is reduced, which helps to achieve batch verification of a large number of items.
[0084] In one embodiment, the target key point vector pair is composed of a target key point vector to be verified and a target pre-registered key point vector, and the target pre-registered key point vectors in all target key point pairs screened out in the fine screening stage correspond to at least one pre-registered surface texture image. It is understandable that, given that there may be multiple pre-registered key points in a pre-registered surface texture image, the number of pre-registered surface texture images corresponding to all target pre-registered key point feature vectors will not be greater than (i.e., less than or equal to) the total number of these target pre-registered key point feature vectors.
[0085] Based on this, for each pre-registered surface texture image in the at least one pre-registered surface texture image: 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 (used to characterize the position of the target key point to be verified in the surface texture image to be verified) and the target pre-registered key point position information corresponding to the target pre-registered key point vector (used to characterize the position of the target pre-registered key point in the pre-registered surface texture image where it is located), 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; further, 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 (that is, the proportion of the corresponding pre-registered key point within the preset radius of the key point to be verified in all pre-registered key points) 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.
[0086] 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. The specific estimation method can be found in 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 the final image matching judgment is completed.
[0087] 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.
[0088] 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 includes: the image similarity corresponding to the pre-registered surface texture image is not less than a similarity threshold.
[0089] 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.
[0090] In addition, the similarity between two surface texture images can be calculated by comparing image feature vectors. The image features corresponding to each surface texture image can be extracted by an image feature extraction model. The model is deployed with an image feature extraction network for extracting image features, such as ResNet (Residual Network), VGG (Visual Geometry Group), Inception (Google Inception Network, also known as GoogLeNet) and other image feature extraction networks. 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.
[0091] 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.
[0092] Please refer to Fig. 9 , the surface texture image comparison device can be applied to Figure 8The device shown in the figure is used to implement the technical solution of this specification. The surface texture image comparison device may include:
[0093] The image recall module 901 is configured to recall at least a portion of the preregistered surface texture images collected from the to-be-verified object and the preregistered surface texture images collected from the corresponding preregistered object based on a vector similarity comparison result between the to-be-verified aggregated feature vector extracted from the to-be-verified surface texture image and the preregistered aggregated feature vector extracted from the preregistered surface texture image;
[0094] The vector acquisition module 902 is configured to acquire the pre-registered key point position information and the pre-registered key point feature vector corresponding to the pre-registered key point respectively identified from each recalled pre-registered surface texture image, and the key point position information and the key point feature vector corresponding to the key point to be verified identified from the surface texture image to be verified;
[0095] The consistency screening module 903 is configured to: for each key point feature vector to be verified that is obtained: retrieve a group of pre-registered key point feature vectors with the highest vector similarity with the key point feature vector to be verified from the obtained pre-registered key point feature vectors, 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, and the retrieved pre-registered key point vector corresponds to a group of pre-registered surface texture images in the at least a portion of the recalled pre-registered surface texture images; and screen out a target key point vector pair whose corresponding key points meet the geometric consistency constraint condition from the key point vector pair constituted by the obtained key point feature vectors to be verified;
[0096] The matching determination module 904 is configured to determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture images corresponding to the target key point vector pair.
[0097] Optionally, the vector acquisition module 902 is specifically configured as follows:
[0098] In the case where key point position information and key point feature vectors corresponding to key points identified from the surface texture image to be verified are cached, obtaining the cached key point position information and the key point feature vectors; or,
[0099] Re-identify the key points to be verified from the surface texture image to be verified and extract the corresponding key point position information to be verified and the key point feature vector to be verified.
[0100] Optionally, the vector acquisition module 902 is specifically configured as follows:
[0101] Extracting a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size;
[0102] For each intercepted sub-graph to be verified: identify the key points to be verified from the sub-graph to be verified and extract the corresponding position information of the key points to be verified and the feature vector of the key points to be verified.
[0103] Optionally, the vector acquisition module 902 is specifically configured as follows:
[0104] For each intercepted subgraph to be verified: performing aggregation processing on key point feature vectors corresponding to at least a portion of key points identified from the subgraph to be verified, so as to generate an aggregated feature vector to be verified of the subgraph to be verified.
[0105] Optionally, the consistency screening module 903 is specifically configured as follows:
[0106] Calculating the vector similarity between the vector to be verified and each of the acquired pre-registered key point feature vectors;
[0107] A group of pre-registered key point feature vectors whose vector similarity is not less than a similarity threshold are retrieved, or a preset number of pre-registered key point feature vectors whose vector similarity is maximum are retrieved.
[0108] Optionally, the key point coordinates of any key point vector pair include the key point coordinates to be verified and the pre-registered key point coordinates, the key point coordinates to be verified are the position information of the key point to be verified corresponding to the key point feature vector to be verified in the key point vector pair in the surface texture image to which it belongs, and the pre-registered key point coordinates are the position information of the pre-registered key point corresponding to the pre-registered key point feature vector in the key point vector pair in the pre-registered surface texture image to which it belongs, and the consistency screening module 903 is specifically configured as follows:
[0109] Traverse each key point vector pair formed by the acquired key point feature vectors to be verified, select at least one key point vector pair each time according to the number required by the geometric consistency constraint, and determine whether the key point coordinates of the at least one key point vector pair all meet the geometric consistency constraint; if they all meet, determine that the at least one key point vector pair is the target key point vector pair; if there is a key point vector pair whose key point coordinates do not meet the requirements, determine that the at least one key point vector pair is not the target key point vector pair.
[0110] Optionally, the geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition. Accordingly, the consistency screening module 903 is specifically configured as at least one of the following:
[0111] For a first key point vector pair and a second key point vector pair in any two key point vector pairs, if the absolute value of the difference between the key point distance to be verified and the pre-registered key point distance between the two key point vector pairs is not greater than the distance threshold, it is determined that the corresponding key points of the two key point feature vectors satisfy the distance constraint condition; wherein the key point distance to be verified is the distance between the key point coordinates to be verified of the first key point vector pair and the key point coordinates to be verified of the second key point vector pair, and the pre-registered key point distance is the distance between the pre-registered key point coordinates of the first key point vector pair and the pre-registered key point coordinates of the second key point vector pair;
[0112] For the first key point vector pair, the second key point vector pair and the third key point vector pair among any three key point vector pairs, if the absolute value of the difference between the angle of the key point to be verified between the three key point vector pairs and the angle of the pre-registered key point is not greater than the angle threshold, it is determined that the corresponding key points of the three key point vector pairs all meet the angle constraint condition; wherein the angle of the key point to be verified is the angle between the line connecting the one and two key points to be verified and the line connecting the two and three key points to be verified, and the line connecting the one and two key points to be verified is the angle between the coordinates of the key point to be verified of the first key point vector pair and the coordinates of the key point to be verified of the second key point vector pair. The second and third key point connection lines to be verified are the lines between the coordinates of the key points to be verified of the second key point vector pair and the coordinates of the key points to be verified of the third key point vector pair, the pre-registered key point angle is the angle between the first and second pre-registered key point connection lines and the second and third pre-registered key point connection lines, the first and second pre-registered key point connection lines are the lines between the pre-registered key point coordinates of the first key point vector pair and the pre-registered key point coordinates of the second key point vector pair, and the second and third pre-registered key point connection lines are the lines between the pre-registered key point coordinates of the second key point vector pair and the pre-registered key point coordinates of the third key point vector pair;
[0113] For any key point vector pair, if the distance between the key point coordinates to be verified and the pre-registered key point coordinates of any key point vector pair is not greater than the distance threshold, and the angle between the line between the key point coordinates to be verified of any key point vector pair and the coordinate origin of the surface texture image to be verified and the line between the pre-registered key point coordinates of any key point 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 key point of any key point vector pair satisfies the common constraint condition.
[0114] Optionally, the target key point vector pair is composed of a target key point feature vector to be verified and a 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; the matching determination module 904 is specifically configured as follows:
[0115] 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;
[0116] 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.
[0117] Optionally, the matching determination module 904 is specifically configured to:
[0118] The affine transformation matrix of the target key points to be verified is estimated using the random sampling consistent RANSAC algorithm.
[0119] Optionally, the image recall module 901 is specifically configured as follows:
[0120] For each aggregated feature vector to be verified: a group of pre-registered aggregated feature vectors with the highest vector similarity to the aggregated feature vector to be verified are retrieved from the obtained pre-registered aggregated feature vectors, 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 aggregated feature vector to be verified is extracted from a sub-graph to be verified, and the sub-graph to be verified is obtained by dividing the surface texture image to be verified according to a preset size, and 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 corresponding pre-registered surface texture image according to the preset size;
[0121] According to the position information of each sub-image to be verified and each pre-registered sub-image in the corresponding surface texture image, the target aggregate vector pair of the corresponding sub-image that meets the geometric consistency constraint condition is screened out from the aggregate vector pair composed of the aggregate feature vector to be verified, and at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair is recalled.
[0122] Optionally, the matching determination module 904 is specifically configured to:
[0123] Calculate the image similarity between the surface texture image to be verified and each pre-registered surface texture image corresponding to the target key point vector pair, 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: For a surface texture image to be verified collected from the object to be verified and a pre-registered surface texture image collected from a corresponding pre-registered object, based on a vector similarity comparison result between an aggregated feature vector to be verified extracted from the surface texture image to be verified and a pre-registered aggregated feature vector extracted from the pre-registered surface texture image, recalling at least a portion of the pre-registered surface texture images; Acquire the pre-registered key point position information and pre-registered key point feature vectors corresponding to the pre-registered key points respectively identified from each recalled pre-registered surface texture image, and the key point position information and key point feature vectors corresponding to the key points to be verified identified from the surface texture image to be verified; 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, 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, and the retrieved pre-registered key point vector corresponds to a group of pre-registered surface texture images in the at least a portion of the recalled pre-registered surface texture images; and, a target key point vector pair whose corresponding key points meet the geometric consistency constraint condition is screened out from the key point vector pairs constituted by the obtained key point feature vectors to be verified; Determine whether there is an image matching the surface texture image to be verified in the pre-registered surface texture images corresponding to the target key point vector pair.
2. The method according to claim 1, characterized in that The step of obtaining the key point position information and the key point feature vector corresponding to the key point to be verified identified from the surface texture image to be verified includes: In the case where key point position information and key point feature vectors corresponding to key points identified from the surface texture image to be verified are cached, obtaining the cached key point position information and the key point feature vectors; or, Re-identify the key points to be verified from the surface texture image to be verified and extract the corresponding key point position information to be verified and the key point feature vector to be verified.
3. The method according to claim 2, characterized in that The step of identifying the key points to be verified from the surface texture image to be verified and extracting the corresponding key point position information to be verified and the key point feature vector to be verified includes: Extracting a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size; For each intercepted sub-graph to be verified: identify the key points to be verified from the sub-graph to be verified and extract the corresponding position information of the key points to be verified and the feature vector of the key points to be verified.
4. The method according to claim 3, characterized in that Extracting the aggregated feature vector to be verified from the surface texture image to be verified includes: For each intercepted subgraph to be verified: performing aggregation processing on key point feature vectors corresponding to at least a portion of key points identified from the subgraph to be verified, so as to generate an aggregated feature vector to be verified of the subgraph to be verified.
5. The method according to claim 1, characterized in that The step of retrieving a group of pre-registered key point feature vectors having the highest vector similarity with the key point feature vector to be verified from the acquired pre-registered key point feature vectors includes: Calculating the vector similarity between the vector to be verified and each of the acquired pre-registered key point feature vectors; A group of pre-registered key point feature vectors whose vector similarity is not less than a similarity threshold are retrieved, or a preset number of pre-registered key point feature vectors whose vector similarity is maximum are retrieved.
6. The method according to claim 1, characterized in that The key point coordinates of any key point vector pair include the key point coordinates to be verified and the pre-registered key point coordinates, wherein the key point coordinates to be verified are the position information of the key point to be verified corresponding to the key point feature vector to be verified in the key point vector pair in the surface texture image to which it belongs, and the pre-registered key point coordinates are the position information of the pre-registered key point corresponding to the pre-registered key point feature vector in the key point vector pair in the pre-registered surface texture image to which it belongs, and the target key point vector pair whose corresponding subgraph satisfies the geometric consistency constraint condition is selected from the key point vector pair formed by the acquired key point feature vector to be verified, including: Traverse each key point vector pair formed by the acquired key point feature vectors to be verified, select at least one key point vector pair each time according to the number required by the geometric consistency constraint, and determine whether the key point coordinates of the at least one key point vector pair all meet the geometric consistency constraint; if they all meet, determine that the at least one key point vector pair is the target key point vector pair; if there is a key point vector pair whose key point coordinates do not meet the requirements, determine that the at least one key point vector pair is not the target key point vector pair.
7. The method according to claim 6, characterized in that The geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition. Accordingly, the number of key point vector pairs required by the geometric consistency constraint condition is selected each time, and it is determined whether the key point coordinates of the at least one key point vector pair all meet the geometric consistency constraint condition, including at least one of the following: For a first key point vector pair and a second key point vector pair in any two key point vector pairs, if the absolute value of the difference between the key point distance to be verified and the pre-registered key point distance between the two key point vector pairs is not greater than the distance threshold, it is determined that the corresponding key points of the two key point feature vectors satisfy the distance constraint condition; wherein the key point distance to be verified is the distance between the key point coordinates to be verified of the first key point vector pair and the key point coordinates to be verified of the second key point vector pair, and the pre-registered key point distance is the distance between the pre-registered key point coordinates of the first key point vector pair and the pre-registered key point coordinates of the second key point vector pair; For the first key point vector pair, the second key point vector pair and the third key point vector pair among any three key point vector pairs, if the absolute value of the difference between the angle of the key point to be verified between the three key point vector pairs and the angle of the pre-registered key point is not greater than the angle threshold, it is determined that the corresponding key points of the three key point vector pairs all meet the angle constraint condition; wherein the angle of the key point to be verified is the angle between the line connecting the one and two key points to be verified and the line connecting the two and three key points to be verified, and the line connecting the one and two key points to be verified is the angle between the coordinates of the key point to be verified of the first key point vector pair and the coordinates of the key point to be verified of the second key point vector pair. The second and third key point connection lines to be verified are the lines between the coordinates of the key points to be verified of the second key point vector pair and the coordinates of the key points to be verified of the third key point vector pair, the pre-registered key point angle is the angle between the first and second pre-registered key point connection lines and the second and third pre-registered key point connection lines, the first and second pre-registered key point connection lines are the lines between the pre-registered key point coordinates of the first key point vector pair and the pre-registered key point coordinates of the second key point vector pair, and the second and third pre-registered key point connection lines are the lines between the pre-registered key point coordinates of the second key point vector pair and the pre-registered key point coordinates of the third key point vector pair; For any key point vector pair, if the distance between the key point coordinates to be verified and the pre-registered key point coordinates of any key point vector pair is not greater than the distance threshold, and the angle between the line between the key point coordinates to be verified of any key point vector pair and the coordinate origin of the surface texture image to be verified and the line between the pre-registered key point coordinates of any key point 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 key point of any key point vector pair satisfies the common constraint condition.
8. The method according to claim 1, characterized in that The target key point vector pair is composed of a target key point feature vector to be verified and a 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; and determining whether there is an image matching the surface texture image to be verified in the pre-registered surface texture image corresponding to the target key point vector pair, comprising: 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.
9. The method according to claim 8, characterized in that The determining of the affine transformation matrix for the target key point to be verified includes: The affine transformation matrix of the target key points to be verified is estimated using the random sampling consistent RANSAC algorithm.
10. The method according to claim 1, characterized in that The recalling at least a portion of the preregistered surface texture images based on a vector similarity comparison result between the to-be-verified aggregated feature vector extracted from the to-be-verified surface texture image and the preregistered aggregated feature vector extracted from the preregistered surface texture image comprises: For each aggregated feature vector to be verified: a group of pre-registered aggregated feature vectors with the highest vector similarity to the aggregated feature vector to be verified are retrieved from the obtained pre-registered aggregated feature vectors, 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 aggregated feature vector to be verified is extracted from a sub-graph to be verified, and the sub-graph to be verified is obtained by dividing the surface texture image to be verified according to a preset size, and 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 corresponding pre-registered surface texture image 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, the target aggregate vector pair of the corresponding sub-image that meets the geometric consistency constraint condition is screened out from the aggregate vector pair composed of the aggregate feature vector to be verified, and at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair is recalled.
11. The method according to any one of claims 1 to 10, characterized in that The determining whether there is an image matching the surface texture image to be verified in the pre-registered surface texture image corresponding to the target key point vector pair, comprises: Calculate the image similarity between the surface texture image to be verified and each pre-registered surface texture image corresponding to the target key point vector pair, 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
Image retrieval method and system
CN113536017A
Universal feature retrieval anti-counterfeiting method suitable for texture of object
CN115690027A
Anti-counterfeiting method and device, computer equipment and storage medium
CN116415970A
Cited By
Method and device for comparing surface texture images
CN118537587A
