Pixel precision determination method and texture feature extraction, registration and verification method
By collecting images of polymer surface textures at different pixel accuracies and determining the appropriate pixel accuracies, the problem of low accuracy in item recognition is solved, and the effective extraction and differentiation of microscopic texture information of items is achieved.
Patent Information
- Application Number
- CN202410623138.0
- 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
In existing technologies, the pixel precision setting of surface texture features of objects lacks accuracy, resulting in low object recognition accuracy and an inability to effectively distinguish the microscopic texture information of different objects.
By acquiring surface texture images of multiple target items of the same material at different candidate pixel precipitates, calculating the initial similarity and performing similarity aggregation, the candidate pixel precision after the first mutation of the comprehensive similarity change rate is determined as the target pixel precision, which is used to acquire surface texture images of the items.
It improves the accuracy of item recognition, effectively distinguishes the microscopic texture information of different items, and enhances the reliability of item identification.
Smart Images

Figure CN118537589A
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the technical field of surface texture of objects, and more particularly to a method for determining pixel accuracy and a method for extracting, registering and verifying texture features. Background Art
[0002] In the related art, the surface texture features of an object are used as the identification of the object to identify the authenticity of the object or to identify whether there is any violation such as parallel trading. Usually, the surface texture features of an object can be extracted from the surface texture image of the object. However, the extracted surface texture features are closely related to the pixel accuracy used when collecting the surface texture image. Pixel accuracy refers to the physical size corresponding to a unit pixel. The greater the pixel accuracy, the more the collected surface texture features can reflect the macro texture information of the object, but in this case the image resolution is relatively low, which is not conducive to extracting the micro texture information of the object. On the contrary, the smaller the pixel accuracy, the less effective texture information is contained in the surface texture features collected per unit area, which is not enough to serve as the identification of the object. In the related art, the pixel accuracy used to collect the surface texture image is often set based on experience, and the pixel accuracy suitable for each object cannot be accurately selected, resulting in a low accuracy rate of object recognition. Summary of the invention
[0003] In view of this, one or more embodiments of this specification provide the following technical solutions:
[0004] According to a first aspect of one or more embodiments of this specification, a method for determining pixel accuracy is proposed, including:
[0005] For M target objects made of the same material, a surface texture image of each target object collected at N candidate pixel accuracies is obtained, where M and N are positive integers greater than 1;
[0006] For each of the N candidate pixel accuracies: performing similarity calculation on the surface texture images of every two target objects in the M target objects that are collected at the corresponding candidate pixel accuracies to obtain a set of initial similarities, and performing similarity aggregation on the set of initial similarities to obtain a comprehensive similarity corresponding to the corresponding candidate pixel accuracies;
[0007] According to the order of corresponding pixel precision from small to large, the change rate of the comprehensive similarity corresponding to the N candidate pixel precisions is determined, and the candidate pixel precision corresponding to the first mutation of the change rate is determined as the target pixel precision suitable for surface texture image acquisition of the object made of the same material.
[0008] According to a second aspect of one or more embodiments of this specification, a method for extracting surface texture features of an object is provided, comprising:
[0009] Determine a target pixel accuracy according to the preparation material used for the object to be processed, wherein the target pixel accuracy is determined according to the pixel accuracy determination method described in the first aspect;
[0010] Acquire the surface texture image of the object to be processed according to the target pixel accuracy;
[0011] Feature extraction is performed on the surface texture image of the object to be processed to obtain surface texture feature information of the object to be processed.
[0012] According to a third aspect of one or more embodiments of this specification, a method for registering surface texture features of an object is provided, comprising:
[0013] Acquire surface texture feature information of the object to be registered, wherein the surface texture feature information is extracted according to the method of the second aspect;
[0014] The surface texture feature information of the object to be registered is stored in a database, so that the surface texture feature information is used as a verification standard corresponding to the object to be registered.
[0015] According to a fourth aspect of one or more embodiments of this specification, a method for verifying surface texture features of an object is provided, comprising:
[0016] Acquire surface texture feature information of the object to be verified, wherein the surface texture feature information is extracted according to the method of the second aspect;
[0017] Verify whether the surface texture feature information of the object to be verified matches the surface texture feature information of a pre-registered authentic object.
[0018] According to a fifth aspect of one or more embodiments of this specification, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor executes the executable instructions to implement the steps of the method described in any one of the first aspect, the second aspect, the third aspect, or the fourth aspect.
[0019] According to the sixth aspect of one or more embodiments of this specification, a computer-readable storage medium is proposed, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any one of the first aspect, the second aspect, the third aspect or the fourth aspect are implemented.
[0020] According to the seventh aspect of one or more embodiments of the present specification, a computer program product is proposed, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any one of the first aspect, the second aspect, the third aspect or the fourth aspect.
[0021] As can be seen from the above embodiments, this specification obtains surface texture images of M target objects made of the same material collected at multiple candidate pixel precisions, then calculates the similarity between multiple surface texture images corresponding to the same candidate pixel precision, and performs similarity aggregation on a set of calculated initial similarities to obtain a comprehensive similarity corresponding to each candidate pixel precision. Among them, similarity aggregation can integrate the attributes or features of multiple initial similarities, so that the aggregated comprehensive similarity can fully and accurately reflect the overall characteristics of a set of initial similarities, which is convenient for subsequent data analysis and processing.
[0022] Then, the change of the change rate of the comprehensive similarity corresponding to the multiple candidate pixel accuracies is analyzed in the order of pixel accuracy from small to large, and the candidate pixel accuracy corresponding to the first mutation of the change rate is determined as the target pixel accuracy, which is suitable for collecting surface texture images of items with the same preparation material as the target item. First, the mutation of the similarity change rate usually occurs when the comparison is based on a large amount of effective texture feature information. If the effective texture feature information contained in the collected surface texture features is small, the change amplitude of the similarity change rate will be relatively gentle. Therefore, when the change rate of the comprehensive similarity mutates, it indicates that the surface texture image of the item is collected according to the candidate pixel accuracy corresponding to the mutation, so that the collected surface texture image contains enough effective texture feature information. In this case, the enough effective texture feature information can be used as the identity of the item. Secondly, the candidate pixel accuracy corresponding to the first mutation of the change rate is selected as the target pixel accuracy because the candidate pixel accuracy corresponding to the first mutation is smaller on the basis of the pixel accuracy being arranged in order from small to large. Collecting the surface texture image of the item according to the smaller pixel accuracy is conducive to extracting the micro texture information of the item from the surface texture image. Compared with macro texture information, micro texture information focuses more on the subtle surface structure and details of objects, and is more helpful in distinguishing the differences between different objects.
[0023] In summary, the candidate pixel accuracy corresponding to the first mutation of the rate of change of the comprehensive similarity is determined as the target pixel accuracy, so that the surface texture image of the target object collected according to the target pixel accuracy can contain enough surface texture feature information that can effectively distinguish the differences between different objects. Using this surface texture feature information as the identity of the object can greatly improve the accuracy of object recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1a This is a schematic diagram of a scene for identifying an object based on the texture features of the object provided by an exemplary embodiment.
[0025] Figure 1b It is a block diagram of a system for acquiring surface texture images of an object provided by an exemplary embodiment.
[0026] Figure 2 It is a schematic structural diagram of a system for acquiring surface texture images of an object provided by an exemplary embodiment.
[0027] Figure 3 It is a schematic diagram of the positional relationship between an image acquisition device and a conveying device in an object surface texture image acquisition system provided by an exemplary embodiment.
[0028] Figure 4 It is a schematic diagram of the positional relationship among an image acquisition device, a target object and a conveying device in an object surface texture image acquisition system provided by an exemplary embodiment.
[0029] Figure 5 It is a flowchart of a control method of an object surface texture image acquisition system provided by an exemplary embodiment.
[0030] Figure 6a It is a schematic diagram of a texture feature extracted when the pixel precision is too large, provided by an exemplary embodiment.
[0031] Figure 6b It is a schematic diagram of a texture feature extracted when the pixel accuracy is too small, provided by an exemplary embodiment.
[0032] Figure 6c It is a schematic diagram of a texture feature extracted with appropriate pixel accuracy provided by an exemplary embodiment.
[0033] Figure 7a It is a flowchart of a method for determining pixel accuracy provided by an exemplary embodiment.
[0034] Figure 7b It is a schematic diagram of a curve showing a variation of the sum of square errors of a comprehensive similarity with pixel precision provided by an exemplary embodiment.
[0035] Figure 7c It is a flow chart of a method for extracting surface texture features of an object provided by an exemplary embodiment.
[0036] Figure 7d It is a flow chart of a method for registering surface texture features of an object provided by an exemplary embodiment.
[0037] Figure 7e It is a flow chart of a method for verifying surface texture features of an object provided by an exemplary embodiment.
[0038] Figure 8 It is a schematic diagram of dividing a pre-registered surface texture image into pre-registered sub-images provided by an exemplary embodiment.
[0039] Fig. 9 It is a schematic diagram of a process for collecting feature vectors for a surface texture image provided by an exemplary embodiment.
[0040] Fig.10 It is a schematic diagram of a process for determining a distance constraint condition provided by an exemplary embodiment.
[0041] Fig.11 It is a schematic diagram of a process for determining an angle constraint condition provided by an exemplary embodiment.
[0042] Fig.12 It is a schematic diagram of a process for determining a common constraint condition provided by an exemplary embodiment.
[0043] Fig.13 It is a schematic diagram of another process of determining a distance constraint condition provided by an exemplary embodiment.
[0044] Fig.14 It is a schematic diagram of another process of determining an angle constraint condition provided by an exemplary embodiment.
[0045] Fig.15 It is a schematic diagram of another process of determining a common constraint condition provided by an exemplary embodiment.
[0046] Fig.16 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0047] Fig.17 It is a block diagram of a device for determining pixel accuracy provided by an exemplary embodiment.
[0048] Fig.18 It is a block diagram of a device for extracting surface texture features of an object provided by an exemplary embodiment.
[0049] Fig.19 It is a block diagram of a device for registering surface texture features of an object provided by an exemplary embodiment.
[0050] Fig. 20 It is a block diagram of a device for verifying surface texture features of an object provided by an exemplary embodiment. DETAILED DESCRIPTION
[0051] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0052] With the development of information technology, the requirements for the anti-counterfeiting of objects are getting higher and higher. In related technologies, anti-counterfeiting labels or anti-counterfeiting beacons are usually used to register anti-counterfeiting products to ensure the authenticity of objects. However, criminals obtain illegal profits by imitating and transferring anti-counterfeiting products, which seriously undermines the market economic order. Therefore, a method of identifying objects using the texture features of objects is proposed.
[0053] Figure 1a FIG. 1 is a schematic diagram of a scene for identifying an object based on the texture features of the object provided by an exemplary embodiment. Figure 1a As shown, there are an object A to be verified and a trusted object B in the scene, wherein the authenticity of the object A to be verified is in doubt, and the trusted object B can be understood as a real object corresponding to the object to be verified. For example, the object A to be verified looks like a cowhide bag, and the user doubts its authenticity, suspecting that the object to be verified is a bag made of non-cowhide material. Then the trusted object B is a real cowhide bag. In order to verify the authenticity of the object A to be verified, it is necessary to collect the surface texture image a of the object A to be verified and the surface texture image b of the trusted object B respectively. Then, the surface texture features of the object A to be verified are extracted from the surface texture image a, and the surface texture features of the trusted object B are extracted from the surface texture image b. Compare the surface texture features of the object A to be verified with the surface texture features of the trusted object B to see if they match. If they match, it means that the object A to be verified is real; if they do not match, it means that the object A to be verified is fake.
[0054] The surface texture images of the object A to be verified and the authentic object B can be collected through the object surface texture image collection system. Figure 1b FIG. 1 is a block diagram of a system for collecting surface texture images of an object provided by an exemplary embodiment. Figure 1b As shown, the object surface texture image acquisition system includes: a control device 11, an image acquisition device 12 and a posture control device 13;
[0055] The control device 11 is used to determine a height adjustment instruction according to the thickness of the target object to be imaged, and send the height adjustment instruction to the posture control device 13; wherein the target height indicated by the height adjustment instruction is the sum of the thickness of the target object and the initial height, and the initial height is the interval distance between the image acquisition device 12 and the surface of the conveying device when the image acquisition device 12 meets the shooting conditions required for the target object and the surface of the conveying device is clearly focused.
[0056] The posture control device 13 is used to adjust the image acquisition device 12 to a target height according to the received height adjustment instruction.
[0057] The image acquisition device 12 is used to acquire images of the target object placed on the conveying device at a target height to obtain a surface texture image of the target object.
[0058] In this embodiment, the control device 11 can be a host computer serving as an OPC (Object Linking and Embedding for Process Control) server, and the host computer can include but is not limited to one or more of the following: a personal computer, a workstation, an industrial control all-in-one machine, a server, an embedded system, a single-chip microcomputer, a smart mobile terminal, etc.
[0059] Optionally, the thickness of the target object can be measured in advance. For example, the thickness of the target object can be measured by an ultrasonic thickness gauge, a laser ranging sensor, etc., or the thickness of the target object can be obtained by manual measurement. After the thickness is obtained, the thickness information corresponding to the thickness can be sent to the control device 11.
[0060] After determining the thickness of the target object, the control device 11 can determine the target height based on the initial height and thickness of the image acquisition device 12 when the shooting conditions required for the target object are met and the surface of the conveying device is clearly focused, and generate the height adjustment instruction. The shooting conditions may include conditions for the pixel accuracy of the image required for shooting, and may also include but are not limited to: object brightness conditions, object area conditions, etc. The object brightness conditions may be conditions for at least ensuring that the target object can be clearly photographed, and the object area conditions may be conditions for at least ensuring that the area of the target object can be completely captured by the image acquisition device 12. Pixel accuracy generally refers to the precise measurement of the actual physical size or the real-world resolution of each pixel in the image in the field of image processing, photography and display technology. The conveying device may be a conveyor belt for conveying the target object, so the surface of the conveying device is in contact with the bottom surface of the target object. Furthermore, after the target object is placed on the conveying device, the height difference between the image acquisition device 12 and the target object is the difference between the initial height and the thickness. In order to avoid changes in the shooting conditions of the image acquisition device 12 and avoid the need for the image acquisition device 12 to refocus, a height adjustment instruction indicating the sum of the thickness of the target object and the initial height is generated. In addition, the control device 11 can send the height adjustment instruction to the posture control device 13.
[0061] The posture control device 13 may be a device for at least adjusting the height of the image acquisition device 12. Further, Figure 3 is a schematic diagram of the positional relationship between an image acquisition device and a conveying device in an object surface texture image acquisition system provided by an exemplary embodiment. Figure 4 is a schematic diagram of the positional relationship between an image acquisition device, a target object and a conveying device in an object surface texture image acquisition system provided by an exemplary embodiment. The posture control device 13 can first reset the height of the image acquisition device 12 to the following Figure 3 The initial height h1 is shown, and then based on the initial height, the height of the image acquisition device 12 is further adjusted according to the height adjustment instruction, that is, the thickness h2 corresponding to the target object is increased, so that the image acquisition device 12 is finally adjusted to Figure 4 The target height h3 = h1 + h2 is shown. At the same time, the attitude control device 13 can also first determine the real-time height of the image acquisition device 12, and then determine the height difference based on the real-time height and the target height, and finally further adjust the height of the image acquisition device 12 according to the height difference, which can also ultimately achieve the purpose of adjusting the image acquisition device 12 to the target height. Figure 2 FIG. 1 is a schematic diagram of a structure of a system for collecting surface texture images of an object provided by an exemplary embodiment. Figure 2 As shown, the attitude control device 13 may include an attitude control PLC (Programmable Logic Controller) 231 and a lifting motor 232, and the image acquisition device 12 may use a line scan camera 22. The attitude control PLC 231 is connected to the control device 11 for communication, and the attitude control PLC 231 may obtain a height adjustment instruction from the control device 11. The attitude control PLC 231 is also connected to the lifting motor 232 for driving, and the attitude control PLC 231 may drive the lifting motor 232 to operate according to the height adjustment instruction, so that the line scan camera 22 is adjusted to the target height.
[0062] After the image acquisition device 12 is adjusted to the target height, the image of the target object placed on the conveying device can be acquired at the target height to obtain a surface texture image of the target object.
[0063] For example, Figure 2 As shown, the attitude control device 13 includes an attitude control PLC 231 and a lifting motor 232. On the basis of the line scan camera 22 as the image acquisition device 12, the host computer 21 can be used as the control device 11. The host computer 21 can obtain the height h2 of the target object to be collected. When the initial height of the line scan camera 22 is h1 and the lifting height is 0, the line scan camera 22 is clearly focused relative to the conveyor plane and meets a specific pixel accuracy, such as 12.9um / px (collection pixel 8192px physical size 105mm, physical size / pixel). After the height of the line scan camera 22 is reset (that is, the initial height is h1, the horizontal displacement is 0), the attitude control PLC 231 drives the motor to raise the height of the image acquisition device 12 to h3=h1+h2. In addition, the line scan camera 22 can also be replaced by a planar array camera that meets the following conditions: when collecting images of objects at the target running speed, the complete image of the object can be collected without distortion, and the target speed is the maximum running speed of the conveyor.
[0064] Through this embodiment, by setting an initial height for the image acquisition device, the image acquisition device can simultaneously meet the shooting conditions required for the target object and clearly focus on the surface of the conveying device at the initial height, thereby fixing the shooting parameters required by the image acquisition device. Furthermore, by controlling the device to obtain the thickness of the target object and generating a height adjustment instruction accordingly, the posture control device adjusts the image acquisition device to the target height based on the height adjustment instruction, thereby ensuring that the spacing distance between the image acquisition device and the surface of the target object is consistent with the spacing distance between the image acquisition device and the surface of the conveying device at the initial height. Then, the image acquisition device can meet the shooting conditions required for the target object and the clear focus on the surface of the conveying device while keeping the aforementioned shooting parameters unchanged. Therefore, after adjusting the target object to the target height, even without refocusing, a clear surface texture image of the target object can still be captured, and the surface texture image can meet the aforementioned shooting parameters. It can be seen that the system of the present specification achieves the purpose of adaptively adjusting the height of the image acquisition device according to the thickness of the object while ensuring the stability of the image acquisition quality. This helps to avoid the problems of low efficiency and high complexity caused by manual adjustment and improve image acquisition efficiency, and can also avoid the situation where the deviation that may exist in manual adjustment causes unstable image acquisition quality.
[0065] As an optional implementation manner: the control device 11 is further used to determine the target area on the surface of the target object where image acquisition needs to be performed and the offset information of the target area relative to the preset position on the conveying device, and determine the horizontal movement instruction of the image acquisition device 12 according to the target area and the offset information, and transmit the horizontal movement instruction to the posture control device 13;
[0066] The posture control device 13 is also used to control the image acquisition device 12 to move in the direction and distance indicated by the horizontal movement instruction, so that the field of view of the image acquisition device 12 covers the target area.
[0067] In this embodiment, the target area of the target object can be measured in advance. For example, the target area on the surface of the target object that needs to be imaged can be measured by image recognition, laser radar, etc. to obtain the target area. Generally, the target area is a rectangular area whose side direction is consistent with the width direction or length direction of the conveying device. The width direction is the direction perpendicular to the moving direction of the conveying device surface, and the length direction is the moving direction of the conveying device. In addition, the target area of the target object can also be obtained by manual measurement. In some optional embodiments, the target area can be all areas of the target object facing the image acquisition device 12, or it can be a specific area of all areas of the target object facing the image acquisition device 12. In addition, the target area can be characterized by coordinates to obtain corresponding target area information. For example, the target area information can be obtained by taking a point on the target area as the origin and characterizing the target area by coordinates. Since images are generally rectangular, when the target area does not meet the rectangular area whose side direction is consistent with the width direction and length direction of the conveying device, it can also be determined by determining a circumscribed rectangle corresponding to the target area and using the circumscribed rectangle as the target area information. It is easy to know that the side direction of the circumscribed rectangle is consistent with the width direction or length direction of the conveying device.
[0068] Furthermore, a limiting device may be provided in front of the conveying device, and the limiting device is used to fix the relative position of the target object and the conveying device, and different limiting devices may be provided for different types of objects, so that the objects can be located at a position on the conveying device suitable for image acquisition. For example, the limiting device may be used to ensure that the area occupied by the object on the conveying device does not exceed the area corresponding to the conveying device. After the target object is limited by the limiting device, the offset between the target object and the conveyor plane is relatively fixed, and therefore, the offset information of the target area relative to the preset position on the conveying device can be obtained, and the preset position may be the center position of the moving direction of the conveying device or the edge of the conveying device. The offset information may be the position offset relationship between the target position on the target area and the preset position, and the position relationship of the target position on the target area may be consistent with the position relationship of the preset position on the conveying device, that is, the offset information is a conversion vector that converts the coordinates of the target area from the coordinate system for obtaining the target area information to the coordinate system corresponding to the conveying device. For example, when the target position is the center of the target area, the preset position is also the center of the conveying device; when the target position is the left edge of the target area, the preset position is also the left edge of the conveying device, etc., and examples are not given here one by one. In addition, in general, the field of view of the image acquisition device 12 covers both sides of the width direction of the conveying device. If the field of view of the image acquisition device 12 cannot cover both sides of the width direction of the conveying device, the field of view of the image acquisition device 12 can also cover both sides of the width direction of the target area.
[0069] After determining the target area and the offset information, the occupied area of the target area on the conveying device can be determined based on the target area and the offset information, and then the horizontal movement information can be determined. Optionally, based on the target area information and the offset information of the target area, the occupied area information of the target area on the conveying device can be calculated, and then based on the occupied area information, the horizontal movement information required for the image acquisition device 12 to perform complete image acquisition of the target area is determined, and the horizontal movement instruction corresponding to the horizontal movement information is obtained for transmission to the posture control device 13.
[0070] After determining the horizontal movement instruction, the posture control device 13 may first reset the horizontal position of the image acquisition device 12 to the initial horizontal position, and then adjust the horizontal position of the image acquisition device 12 according to the direction and distance corresponding to the horizontal movement instruction, so that the field of view of the image acquisition device 12 after adjusting to the target horizontal position covers the target area. The initial horizontal position may be the optimal horizontal position for the image acquisition device 12 to acquire images at a preset position or a horizontal position that can achieve a better acquisition effect. In addition, the control device 11 may also determine the real-time offset of the image acquisition device 12 relative to the initial horizontal position, and determine the real-time movement instruction based on the real-time offset and the offset information, and transmit the real-time movement instruction to the posture control device 13, so that the posture control device 13 does not need to reset the horizontal position of the image acquisition device 12 to the initial horizontal position, and directly adjusts the horizontal position of the image acquisition device 12 according to the direction and distance corresponding to the real-time movement instruction. Optionally, as Figure 2 As shown, when the posture control device 13 includes a posture control PLC231 and a translation motor 233, and the image acquisition device 12 uses a line scan camera 22, the posture control PLC231 is connected to the translation motor 233, and can then drive the translation motor 233 to operate according to the horizontal movement instruction, so that the line scan camera 22 is adjusted to the target horizontal position.
[0071] For example, Figure 2As shown, the attitude control device 13 includes an attitude control PLC 231 and a translation motor 233, and the image acquisition device 12 uses a line scan camera 22. The control device 11 can use a host computer 21. The host computer 21 can predetermine the target area R of the target object that needs to be collected. The target area R is represented by R_tl, which represents the upper left corner of the target area R, and R_br represents the lower right corner of the target area R. After the target object is limited by the limiting device, the offset information of the target object relative to the conveying device is Offset (Offset_x, Offset_y). Based on this, the area of the target object that needs to be collected can be known, and the corresponding position of the occupied area in the conveying area is R_tl+Offset, R_br+Offset. Among them, Offset_x is the offset of the target object in the width direction relative to the plane of the conveying device, and Offset_y is the offset of the target object in the length direction relative to the plane of the conveying device. After resetting the horizontal position of the line scan camera 22 (i.e., resetting to the initial horizontal position, recorded as horizontal position 0), the attitude control PLC 231 horizontally displaces the line scan camera 22 to the target horizontal position, i.e., R_tl_x+Offset_x, by controlling the translation motor 233 to operate. The attitude adjustment of the horizontal position of the line scan camera 22 is completed. Further, after the height and horizontal position of the line scan camera 22 are adjusted, the current position of the line scan camera 22 can be electromagnetically locked to avoid displacement.
[0072] Through the method of this embodiment, the horizontal position of the image acquisition device 12 can be adjusted according to the target area of the target object and the offset information of the target area relative to the preset position on the conveying device, so that even if the target area is not currently at the optimal horizontal acquisition position of the image acquisition device 12, the horizontal position of the image acquisition device 12 can be adjusted according to the offset information, so that the image acquisition device 12 can acquire the texture image of the target area at the optimal image acquisition position. As an optional implementation, it also includes: a speed detection device 14;
[0073] The speed detection device 14 is used to detect the speed information of the conveying device conveying the target object, and transmit the speed information to the control device 11;
[0074] The control device 11 is also used to determine the image acquisition frequency according to the speed information, and send the image acquisition frequency to the image acquisition device 12;
[0075] The image acquisition device 12 is also used to acquire surface texture images according to the image acquisition frequency.
[0076] In this embodiment, the speed detection device 14 can be one or more of the following: a linear speed encoder, a photoelectric encoder, a laser displacement encoder, etc. The speed detection device 14 can determine the speed information of the conveying device when conveying the target object. The speed detection device 14 is connected to the control device 11 in communication, so the control device 11 can obtain the speed information from the speed detection device 14. The control device 11 can also determine the pixel accuracy of the image acquisition device 12, and then the image acquisition frequency can be determined based on the speed information and pixel accuracy, that is, the actual physical size corresponding to the image acquired by the image acquisition device 12 each time is the distance obtained by the product of the speed indicated by the speed information and the image acquisition period corresponding to the image acquisition frequency. After obtaining the image acquisition frequency, the image acquisition frequency can be sent to the image acquisition device 12, so that the image acquisition device 12 can acquire the texture image of the object according to the image acquisition frequency. Therefore, according to the image acquisition frequency, the image acquisition device 12 can accurately acquire the surface texture image of the target object, avoiding the situation of missing or duplication of the surface texture image, thereby affecting the later texture authentication.
[0077] For example, Figure 2 As shown, when the control device 11 is the host computer 21, the speed detection device 14 is the linear velocity encoder 24, the conveying device is the conveyor belt, and the image acquisition device 12 is the line scan camera 22, the line scan camera line frequency (i.e., the image acquisition frequency of the line scan camera) M can be calculated based on the pulse data Q within 1s of the linear velocity encoder 24, and the line frequency of the line scan camera 22 is transmitted to the line scan camera controller through the host computer 21. Assuming that the circumference of the linear velocity encoder 24 is D, the total number of pulses of the linear velocity encoder 24 after one revolution is T, and the camera acquisition accuracy is P, then M = DPQ / T. It can be known from the formula that DP / T is a constant, which is recorded as K. Then, the real-time pulse data is multiplied by the coefficient K to obtain the line frequency QK of the line scan camera 22.
[0078] As an optional implementation, it further includes: an object detection device 15;
[0079] The object detection device 15 is used to generate a trigger signal when the target object on the conveying device reaches a preset position, and send the generated trigger signal to the control device 11;
[0080] The control device 11 is further configured to send a delayed shooting instruction to the image acquisition device 12 upon receiving a trigger signal; wherein the delayed shooting instruction includes a shooting delay and a shooting duration, wherein the shooting delay is calculated based on the interval distance between the image acquisition area of the image acquisition device 12 and the preset position and the moving speed of the conveying device, and the shooting duration is calculated based on the moving direction length and the moving speed of the target object;
[0081] The image acquisition device 12 is used to perform time-delay shooting according to the shooting delay and shooting duration indicated by the time-delay shooting instruction.
[0082] In this embodiment, the object detection device 15 may be a device for detecting whether there are items being transported on the conveying device. Optionally, the object detection device 15 may include, but is not limited to, one or more of the following: a laser trigger, an image recognition device, and the like. The detection area of the object detection device 15 is a preset position on the conveying device. Therefore, when the object detection device 15 detects that there is an object at the preset position, a trigger signal may be generated, that is, the trigger signal indicates that there is an object at the preset position. Then, based on the communication channel between the object detection device 15 and the control device 11, the trigger signal is sent to the control device 11.
[0083] After acquiring the trigger signal, the control device 11 can calculate the shooting delay T1 based on the interval distance d1 between the image acquisition area of the image acquisition device 12 and the preset position and the moving speed v of the conveyor, that is, T1=d1 / v. And the shooting duration T2 can also be calculated according to the moving direction length d2 of the target object and the moving speed v, that is, T2=d2 / v. And based on the shooting delay and shooting duration, a delayed shooting instruction for controlling the image acquisition device 12 is obtained, and finally the delayed shooting instruction is sent to the image acquisition device 12.
[0084] After receiving the delayed shooting instruction, the image acquisition device 12 starts shooting images after the shooting delay, and stops shooting after the shooting time is reached.
[0085] For example, Figure 2 As shown, when the object detection device 15 adopts a laser trigger 25 and the image acquisition device 12 adopts a line scan camera 22, if the distance between the laser trigger 25 and the line scan acquisition area is d, and the average speed of the conveying device within 1 second is v (v=DQ / T), then the line scan camera 22 needs to delay t=(d+R_tl_y) / v seconds to start acquisition, and the acquisition time is c=(R_br_y-R_tl_y) / v seconds. The image acquired within c seconds is generated into a file and returned to the control device 11 for uploading.
[0086] Through the method of this embodiment, the image acquisition device 12 can be accurately controlled to acquire images. By controlling the image acquisition device 12 through the determined shooting delay and shooting duration, the purpose of only acquiring images related to the target object can be achieved, avoiding the acquisition of too many useless images.
[0087] As an optional implementation:
[0088] The control device 11 is further used to: when the shooting conditions include pixel accuracy, determine the target pixel accuracy required for image acquisition, determine the initial height according to the target pixel accuracy and the device parameters of the image acquisition device 12, and send an initialization adjustment instruction corresponding to the initial height to the posture control device 13;
[0089] The posture control device 13 is used to adjust the image acquisition device 12 to an initial height according to the acquired initialization adjustment instruction, and feed back the generated adjustment completion information to the control device 11 to trigger the control device 11 to send a focus instruction to the image acquisition device 12;
[0090] The image acquisition device 12 is also used to focus according to the focus instruction.
[0091] In this embodiment, when the shooting conditions include pixel accuracy, the required target pixel accuracy can be manually input to the control device 11 in advance. After the control device 11 obtains the target pixel accuracy, the initial height can be determined according to the target pixel accuracy and the device parameters of the image acquisition device 12. Optionally, the control device 11 can calculate the initial height based on the device parameters such as the focal length and pixels of the image acquisition device 12, and use the initial height as the default height of the image acquisition device 12. After determining the initial height, an initialization adjustment instruction corresponding to the initial height can be generated, and the initialization adjustment instruction can be sent to the posture control device 13 through the communication channel between the posture control device 13.
[0092] After acquiring the initialization adjustment instruction, the posture control device 13 can adjust the height of the image acquisition device 12 according to the initial height indicated in the initialization adjustment instruction. After the image acquisition device 12 has been adjusted to the initial height, the posture control device 13 generates adjustment completion information indicating that the image acquisition device 12 has been adjusted to the initial height. The adjustment completion information is fed back to the control device 11. After the adjustment of the image acquisition device 12 is completed, the current position can be electromagnetically locked to avoid displacement.
[0093] After obtaining the adjustment completion information, the control device 11 can generate a focus instruction for instructing the image acquisition device 12 to focus, and send the focus instruction to the image acquisition device 12 through the communication channel between the image acquisition device 12 and the image acquisition device 12. After obtaining the focus instruction, the image acquisition device 12 can focus according to the object instruction, so that the image acquisition device 12 can focus on the object at an initial height from itself and take a clear picture of it.
[0094] As an optional embodiment, it also includes: an illumination device; the illumination device is used to illuminate the target object with a side light source. In this embodiment, the illumination device can be a light strip arranged in a rectangular frame, and the light strip is also surrounded by a rectangular shape. Further, the relative position between the illumination device and the image acquisition device 12 is protected and fixed. Optionally, the image acquisition device 12 can be fixed under the platform, and the rectangular frame is also fixed around the platform, and the illumination device is also located under the platform. Each light strip is facing the preset position facing the image acquisition device 12, and the preset position is illuminated in a side lighting manner. Therefore, when shooting the target object, the target object can be illuminated by a side light source. Moreover, after the illumination device illuminates the target object, the image of the target object captured can clearly distinguish the texture of the target object. Optionally, the angle between the side light source and the plane of the conveying device can be between 25° and 40°, and preferably, the angle between the side light source and the plane of the conveying device can be 30°. This can avoid overexposure caused by direct exposure to the target object, which makes it impossible to clearly capture the surface texture of the target object.
[0095] Furthermore, the object surface texture image acquisition system can be a system operating in a dark field environment. Here, the line scanning light source method belongs to dark field lighting. The following beneficial effects can be achieved through dark field lighting: Enhance contrast: Since the target object is illuminated from the side, any light reflected or refracted from the surface of the target object will make the sample appear very bright on the dark background. Highlight details: Dark field lighting can reveal the tiny details of the target object. Reduce interference from direct light: Since no light directly from the light source enters the objective lens, the image of the target object is not overexposed, reducing light diffusion and glare.
[0096] As an optional implementation, it further includes: a storage device 16; after the control device 11 acquires the surface texture image from the image acquisition device 12, the surface texture image is stored in the storage device 16. The storage device 16 can be a separate device independent of the control device 11, or a device integrated in the control device 11. Therefore, after the control device 11 acquires the surface texture image, the surface texture image can be stored in the storage device 16 through the communication channel between the control device 11 and the storage device 16, so that the surface texture image can be directly acquired from the storage device 16 at a later time, and processed to obtain a complete surface texture image corresponding to the target object.
[0097] The related art uses an area array camera module to collect texture images, which has the following disadvantages: 1. The collection range is limited and the cost is high. Currently, the mainstream large-area area array camera modules are almost all CMOS modules. However, even the largest module has a limited collection range and may not be able to collect all images of the expected area. In addition, the size of the CMOS camera module is exponentially related to the price. 2. The collection quality is low. Since the current mainstream large-area area array camera module is CMOS, the natural characteristic of CMOS is that it will produce a jello effect when shooting high-speed moving objects, which will seriously affect the micro-texture imaging.
[0098] In order to overcome the above technical problems, as an optional implementation, the image acquisition device 12 is a line scan camera. Further, the resolution and number of the line scan cameras used in the image acquisition device 12 are not restricted here. Generally, one or more line scan cameras can be used to capture images in the width direction of the conveyor in parallel. The number and resolution of the line scan cameras depend on the maximum width of the micro texture of the object to be captured.
[0099] Figure 5 This is a flow chart of a control method of an object surface texture image acquisition system provided by an exemplary embodiment. The object surface texture image acquisition system includes: a control device, an image acquisition device and a posture control device. The method is applied to the control device and includes:
[0100] Step S501, determining a height adjustment instruction according to the thickness of the target object to be imaged, wherein the target height indicated by the height adjustment instruction is the sum of the thickness of the target object and the initial height, and the initial height is the spacing distance between the image acquisition device and the surface of the conveying device when the image acquisition device meets the shooting conditions required for the target object and the surface of the conveying device is clearly focused;
[0101] Step S502, controlling the posture control device to adjust the image acquisition device to a target height;
[0102] Step S503, controlling the image acquisition device to acquire an image of the target object placed on the conveying device at a target height to obtain a surface texture image of the target object.
[0103] The specific implementation of the control method in this embodiment can be referred to Figure 1b The implementation method of the corresponding parts in the illustrated system embodiment will not be described in detail here.
[0104] As an optional implementation, the method further includes the following steps:
[0105] Determine the target area on the surface of the target object where image acquisition needs to be implemented and the offset information of the target area relative to the preset position on the conveying device, determine the horizontal movement instruction of the image acquisition device based on the target area and the offset information, and transmit the horizontal movement instruction to the posture control device; control the posture control device to move the image acquisition device in the direction and distance indicated by the horizontal movement instruction so that the field of view of the image acquisition device covers the target area.
[0106] The specific implementation of the control method in this embodiment can be referred to Figure 1b The implementation method of the corresponding parts in the illustrated system embodiment will not be described in detail here.
[0107] As an optional implementation, the object surface texture image acquisition system further includes a speed detection device, and the method further includes:
[0108] Acquire speed information of the conveying device conveying the target object detected by the speed detection device;
[0109] The image acquisition frequency is determined according to the speed information, and the image acquisition device is controlled to acquire the surface texture image according to the image acquisition frequency.
[0110] The specific implementation of the control method in this embodiment can be referred to Figure 1b The implementation method of the corresponding parts in the illustrated system embodiment will not be described in detail here.
[0111] As an optional embodiment, the object surface texture image acquisition system also includes an object detection device, and the method also includes: upon receiving a trigger signal generated by the object detection device when the target object on the conveying device reaches a preset position, sending a time-delay shooting instruction to the image acquisition device; wherein the time-delay shooting instruction includes a shooting delay and a shooting duration, the shooting delay is calculated based on the interval distance between the image acquisition area of the image acquisition device and the preset position and the moving speed of the conveying device, and the shooting duration is calculated based on the length of the moving direction and the moving speed of the target object; controlling the image acquisition device to perform time-delay shooting according to the shooting delay and shooting duration indicated by the time-delay shooting instruction.
[0112] The specific implementation of the control method in this embodiment can be referred to Figure 1b The implementation method of the corresponding parts in the illustrated system embodiment will not be described in detail here.
[0113] As an optional implementation, the method also includes: when the shooting conditions include pixel accuracy, determining the target pixel accuracy required for image acquisition, determining the initial height according to the target pixel accuracy and the device parameters of the image acquisition device, and sending the initialization adjustment instruction corresponding to the initial height to the posture control device; controlling the posture control device to adjust the image acquisition device to the initial height according to the initialization adjustment instruction, and obtaining the adjustment completion information generated by the posture control device to trigger the control of the image acquisition device to focus.
[0114] The specific implementation of the control method in this embodiment can be referred to Figure 1b The implementation method of the corresponding parts in the illustrated system embodiment will not be described in detail here.
[0115] As an optional implementation, the object surface texture image acquisition system further includes a storage device, and the method further includes: after acquiring the surface texture image from the image acquisition device, storing the surface texture image in the storage device.
[0116] The specific implementation of the control method in this embodiment can be referred to Figure 1b The implementation method of the corresponding parts in the illustrated system embodiment will not be described in detail here.
[0117] In the process of collecting the surface texture images of the above objects, pixel accuracy plays a vital role, which is directly related to the accuracy and precision of texture feature extraction. Taking tiles P and Q as examples, Figure 6a FIG. 1 is a schematic diagram of a texture feature extracted when the pixel precision is too large, provided by an exemplary embodiment. Figure 6a As shown in the figure, when the pixel precision is too high, the surface texture images of tile P and tile Q are collected respectively according to the high pixel precision. The surface texture features extracted from the two surface texture images reflect the macro texture information of the tile, but cannot reflect the micro texture information of the object. Figure 6a The macro texture information shown will result in an erroneous recognition result that tile P and tile Q are the same tile.
[0118] Figure 6b FIG. 1 is a schematic diagram of a texture feature extracted when the pixel precision is too small, provided by an exemplary embodiment. Figure 6b In the example, box 601 represents a single pixel with too low pixel precision. Obviously, collecting texture feature information of tile P and tile Q through this single pixel may easily lead to too little effective texture feature information contained in a single pixel, thereby identifying the wrong conclusion that tile P and tile Q are the same tile.
[0119] Figure 6cFIG. 1 is a schematic diagram of a texture feature extracted with appropriate pixel accuracy provided by an exemplary embodiment. Figure 6c In the example, box 601 represents a single pixel with too low pixel precision, and box 602 represents a single pixel with appropriate pixel precision. Compared with box 601, box 602 contains more effective texture features, based on which tile P and tile Q can be distinguished as different tiles.
[0120] In summary, in the scenario of identifying objects based on their texture features, it is crucial to select a pixel accuracy suitable for the objects. However, in the related art, the pixel accuracy used to collect the surface texture image of the object is often set based on experience, and the pixel accuracy suitable for each object cannot be accurately selected, resulting in a low accuracy rate of object recognition. In view of this, this specification proposes a method for determining pixel accuracy, which is used to determine the pixel accuracy suitable for collecting surface texture images of each object.
[0121] Figure 7a FIG. 1 is a flow chart of a method for determining pixel accuracy provided by an exemplary embodiment. Figure 7a As shown, the process may include the following steps:
[0122] S702: For M target objects made of the same material, respectively obtain a surface texture image of each target object captured at N candidate pixel accuracies, where M and N are positive integers greater than 1.
[0123] The surface texture image of an object can be used to display the microscopic or macroscopic geometric structure characteristics of the object surface (or the surface texture image contains the microscopic or macroscopic texture features of the object). Since the texture features of objects made from different materials are completely different, it is necessary to use a pixel accuracy that is suitable for the material of the object to collect the surface texture image of the object in order to extract accurate object texture features from the surface texture image. Therefore, in the process of determining the pixel accuracy, the scheme of this specification needs to specifically determine the pixel accuracy suitable for collecting the surface texture image of the object made of the material of the object according to the material of the object.
[0124] The target object in this embodiment can be any object, but the M target objects need to be made of the same material. For example, the material of the object can be lychee leather, cowhide, ceramic tile, etc. For each of the M target objects, the surface texture image of each target object collected at N candidate pixel accuracies is obtained respectively. There are many ways to obtain the surface texture image of the target object. For example, the surface texture image of the target object can be directly collected using a camera. The size of the pixel accuracy is determined by factors such as the focal length, field of view, and aperture of the camera lens. Therefore, for each of the N candidate pixel accuracies, the camera lens that matches each candidate pixel accuracy can be determined first, and then the camera lens of the corresponding candidate pixel accuracy can be used for focusing. When the focusing is successful, the surface texture image of the target object is captured to achieve the collection of the surface texture image of the target object according to the corresponding candidate pixel accuracy. Obviously, this method requires repeated replacement of the lens and refocusing when collecting images according to different candidate pixel accuracies.
[0125] Among them, the N candidate pixel accuracies can be determined based on the empirical expectations of previous knowledge. For example, for different objects (including target objects) made of various materials, multiple historical cases of image acquisition of the different objects are obtained, and the maximum and minimum values of the historical pixel accuracies used in the multiple historical cases are determined. Define an interval consisting of minimum pixel accuracy and maximum pixel accuracy, wherein the minimum pixel accuracy is less than or equal to the minimum value of the historical pixel accuracy, and the maximum pixel accuracy is greater than or equal to the maximum value of the historical pixel accuracy. Then, a series of pixel accuracies are selected within the interval as N candidate pixel accuracies. The selection process can be performed at equal intervals or according to non-uniform step sizes. The selection principle aims to cover as wide a range of pixel accuracy as possible. In this way, N candidate pixel accuracies suitable for multiple different objects can be obtained.
[0126] In addition, N candidate pixel accuracies suitable for the target item can be determined in a targeted manner. For example, historical cases similar to the target item are determined based on factors such as the production process, preparation materials, and industry standards of the target item. By analyzing the pixel accuracies used in historical cases and the image effects they produce (image clarity and the extraction and restoration effects of item texture features), the approximate range of ideal pixel accuracies suitable for the target item is determined. Based on this approximate range, the value range of the candidate pixel accuracies can be determined. The upper limit of the value range can be greater than or equal to the upper limit of the above approximate range, and the lower limit of the value range can be less than or equal to the lower limit of the above approximate range. Then a series of pixel accuracies are selected from the defined value range as N candidate pixel accuracies.
[0127] By determining the N candidate pixel accuracies in the above manner, it can be ensured that the target pixel accuracy selected from the N candidate pixel accuracies can be as close as possible to or even accurately reach the ideal pixel accuracy suitable for the target object, thereby avoiding the inability to select the target pixel accuracy suitable for the target object due to the value range of the N candidate pixel accuracies not covering the ideal pixel accuracy.
[0128] In one embodiment, the surface texture image of each target object captured at the minimum candidate pixel precision among N candidate pixel precisions can be first obtained. For example, the surface texture image of each target object (referred to as "initial surface texture image") can be captured using a camera lens that matches the minimum candidate pixel precision. Then, the initial surface texture image of each target object is downsampled to obtain surface texture images of each target object corresponding to N-1 candidate pixel precisions except the minimum candidate pixel precision. In the field of image processing, downsampling processing generally refers to obtaining a new image by reducing the number of pixels in the image. It can be seen that when the image size is fixed, the pixel precision of the image obtained by downsampling processing will increase, so the initial surface texture image of the target object needs to be collected according to the minimum candidate pixel precision. For example, the candidate pixel precisions are 2um / px, 5um / px, 10um / px, and 20um / px, respectively. In the process of acquiring the surface texture image of the target object, the initial surface texture images of M target objects are first collected according to the candidate pixel accuracy of 2um / px, and then the initial surface texture images of each target object are downsampled to obtain surface texture images of each target object corresponding to the three candidate pixel accuracies of 5um / px, 10um / px, and 20um / px. There are many algorithms for implementing downsampling processing, such as interpolation downsampling algorithm, layered downsampling algorithm, approximate downsampling algorithm, etc. Among them, the interpolation algorithm may include but is not limited to a bilinear interpolation algorithm, a trilinear interpolation algorithm, and a neighboring interpolation algorithm. This specification does not limit the specific downsampling algorithm.
[0129] The above-mentioned surface texture image acquisition method only needs to use one lens to capture the initial surface texture image, and other surface texture images can be acquired based on the initial surface texture image. The entire acquisition process does not require repeated lens replacement and repeated focusing, which greatly improves the acquisition efficiency of the target object surface texture image. In addition, the downsampling process can maintain the main image features / image information of the initial surface texture image as much as possible, thereby ensuring that the surface texture image obtained by the downsampling process is a valid image containing the texture features of the object, which helps to improve the accuracy of subsequent image similarity analysis.
[0130] In one embodiment, if the M target objects are printed products, then after acquiring the surface texture images of the target objects, the surface texture images of each target object can be aligned at a macro level to avoid interference with subsequent similarity calculations due to image deformation, tilt, etc.
[0131] S704: For each candidate pixel precision among the N candidate pixel precisions: perform similarity calculation on the surface texture images of every two target objects among the M target objects that are collected at the corresponding candidate pixel precision to obtain a set of initial similarities, and perform similarity aggregation on the set of initial similarities to obtain a comprehensive similarity corresponding to the corresponding candidate pixel precision.
[0132] After the image acquisition process in S702, there are M surface texture images at each candidate pixel precision. For each candidate pixel precision, similarity calculation is performed on every two surface texture images at the candidate pixel precision to obtain a set of initial similarities.
[0133] In one embodiment, an image quality assessment algorithm can be used to calculate the similarity of every 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.
[0134] In addition, the similarity between every two surface texture images can be calculated by comparing the image feature vectors. For each M surface texture image under the candidate pixel accuracy, feature extraction is performed on the M surface texture images to obtain the image features corresponding to each of the M surface texture images. This process can be implemented using feature extraction algorithms such as gray level co-occurrence matrix (GLCM), local binary pattern (LBP, Local Binary Pattern), etc., or it can be implemented using a pre-trained image feature extraction model. An image feature extraction network for extracting image features is deployed in the image feature extraction model, such as ResNet (Residual Network), VGG (Visual Geometry Group), Inception (Google Inception Network, also known as GoogLeNet) and other image feature extraction networks. When using a pre-trained image feature extraction model for feature extraction, 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. The image features of each surface texture image are then integrated into a vector representation to obtain an image feature vector corresponding to each surface texture image. The image feature vector is equivalent to a mathematical summary of the image features. By simplifying the complex image feature information into a data structure that can be mathematically operated, it is convenient for subsequent calculations. For example, the similarity of the image feature vectors of every two images can be calculated by methods such as 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 calculated initial similarity.
[0135] According to the principle of permutation and combination, a set of initial similarities corresponding to each candidate pixel precision contains M*(M-1) initial similarities. By performing similarity aggregation on a set of initial similarities corresponding to each candidate pixel precision, the comprehensive similarity corresponding to each candidate pixel precision can be obtained. Similarity aggregation aims to integrate the attributes or features of a set of initial similarities corresponding to the corresponding candidate pixel precision, so that the aggregated comprehensive similarity can more comprehensively and accurately reflect the overall similarity of the surface texture images of the M target objects collected at the corresponding candidate pixel precision. There are many specific ways to aggregate similarities, such as weighted averaging a set of initial similarities, using the weighted average result as the comprehensive similarity, or taking the maximum / minimum value in a set of initial similarities as the comprehensive similarity, and this specification does not limit this.
[0136] In one embodiment, the comprehensive similarity obtained by similarity aggregation of a group of initial similarities may include any of the following statistics: the average value of the group of initial similarities, the median of the group of initial similarities, the maximum value of the group of initial similarities, the weighted average value of the group of initial similarities, and the minimum value of the group of initial similarities. Taking the comprehensive similarity as the average value of a group of initial similarities as an example, the calculation principle of the comprehensive similarity can refer to formula (1):
[0137]
[0138] In formula (1), p represents any candidate pixel accuracy among N candidate pixel accuracies, similarity P represents the comprehensive similarity corresponding to the candidate pixel precision p, M represents the number of target items, i and j represent the i-th target item and j-th target item among the M target items respectively, Represents the surface texture image of the i-th target object captured at the candidate pixel accuracy p, Represents the surface texture image of the jth target object captured at the candidate pixel accuracy p, It represents the initial similarity calculated by similarity calculation of the surface texture images of the i-th and j-th target objects respectively collected at the candidate pixel precision p. The numerator in formula (1) represents a set of initial similarities corresponding to the candidate pixel precision p.
[0139] S706: Determine the change rate of the comprehensive similarities corresponding to the N candidate pixel accuracies in ascending order of corresponding pixel accuracies, and determine the candidate pixel accuracy corresponding to the first mutation of the change rate as the target pixel accuracy suitable for surface texture image acquisition of the object made of the same material.
[0140] According to the order of pixel precision from small to large, the change of the comprehensive similarity corresponding to the N candidate pixel precisions is analyzed, and the candidate pixel precision corresponding to the first mutation of the change rate is determined as the target pixel precision, which is suitable for collecting surface texture images of items with the same preparation material as the target item. First, the mutation of the similarity change rate usually occurs when the comparison is based on a large amount of effective texture feature information. If the effective texture feature information contained in the collected surface texture features is small, the change amplitude of the similarity change rate will be relatively gentle. Therefore, when the change rate of the comprehensive similarity mutates, it indicates that the surface texture image of the item is collected according to the candidate pixel precision corresponding to the mutation, so that the collected surface texture image contains enough effective texture feature information. In this case, the enough effective texture feature information can be used as the identity of the item. Here, an example is given for "the candidate pixel precision corresponding to the mutation". For example, the change rate of the comprehensive similarity mutates as the candidate pixel precision changes from 5um / px to 8um / px. Then 5um / px is the candidate pixel precision corresponding to the mutation before the mutation, and 8um / px is the candidate pixel precision corresponding to the mutation after the mutation. Secondly, the candidate pixel accuracy corresponding to the first mutation of the change rate is selected as the target pixel accuracy because the candidate pixel accuracy corresponding to the first mutation is smaller on the basis of the pixel accuracy being arranged in order from small to large. Collecting the surface texture image of the object according to the smaller pixel accuracy is conducive to extracting the micro texture information of the object from the surface texture image. Compared with the macro texture information, the micro texture information pays more attention to the subtle surface structure and details of the object, and is more helpful in distinguishing the differences between different objects.
[0141] In the above embodiment, surface texture images of M target objects made of the same material are obtained according to N candidate pixel accuracies, and the target pixel accuracy suitable for the target object is determined according to the similarity between the surface texture images, so that the surface texture image of the target object collected according to the target pixel accuracy can contain enough surface texture feature information, and based on the surface texture feature information, the differences between different target objects made of the same material can be effectively distinguished. Therefore, using this surface texture feature information as the identity of the object can greatly improve the accuracy of object recognition.
[0142] In one embodiment, the K-means elbow method can be used to analyze the change of the comprehensive similarity change rate corresponding to the N candidate pixel accuracies in the order of the corresponding pixel accuracies from small to large. The K-means elbow method is used to determine the optimal number of clusters used in the K-means clustering algorithm, specifically by analyzing the trend of the sum of squared errors (SSE, Sum of Squared Errors) or the intra-class error changing with the increase of the number of clusters under different numbers of clusters to identify the inflection point. The inflection point indicates that the error reduction rate is significantly slowed down, so the number of clusters corresponding to the inflection point can be used as the optimal number of clusters.
[0143] In this embodiment, when the K-means elbow method is used to analyze the change of the comprehensive similarity change rate corresponding to the N candidate pixel accuracies, it is necessary to first calculate the sum of square errors of the comprehensive similarity corresponding to each candidate pixel accuracy. The calculation principle can refer to the relevant content of the K-means elbow method in the relevant technology, which will not be repeated here. Then, according to the order of the corresponding pixel accuracy from small to large, a curve of the sum of square errors of the comprehensive similarity changing with the candidate pixel accuracy is generated. Figure 7b FIG. 1 is a schematic diagram of a curve showing a variation of the sum of square errors of a comprehensive similarity with the accuracy of candidate pixels provided by an exemplary embodiment. Figure 7b As shown in the figure, the inflection point in the change curve indicates that the change rate of the sum of square errors of the comprehensive similarity has a sudden change from 10um / px to 20um / px. Among them, 10um / px is the candidate pixel accuracy corresponding to the change rate before the sudden change, and 20um / px is the candidate pixel accuracy corresponding to the change rate after the sudden change. Therefore, it can be Figure 7b The candidate pixel accuracy (ie, 20 um / px) corresponding to the first inflection point in the variation curve shown is determined as the target pixel accuracy, which is suitable for collecting surface texture images of objects made of the same material as the target object.
[0144] In the above method, by generating a curve showing the change of the sum of square errors of the comprehensive similarity with the candidate pixel accuracy, the first sudden change in the rate of change of the comprehensive similarity can be intuitively and clearly represented as the first inflection point in the change curve. This method does not require complex calculations, reduces the computational pressure of the system, and improves the efficiency and accuracy of determining the target pixel accuracy.
[0145] In one embodiment, the change of the rate of change of the comprehensive similarity can also be represented by the second-order derivative of the comprehensive similarity. Specifically, the comprehensive similarities corresponding to the N candidate pixel accuracies are arranged in order from small to large to form a comprehensive similarity sequence. Then the second-order derivative of the comprehensive similarity sequence is calculated to obtain the corresponding second-order derivative sequence. Since the comprehensive similarity sequence is a numerical sequence, the second-order derivative of the comprehensive similarity sequence is actually to calculate the second-order difference of the discrete function corresponding to the numerical sequence (that is, the second-order derivative sequence is actually a second-order difference sequence). The first-order difference of the comprehensive similarity sequence can be calculated first to obtain a first-order difference sequence, and each element in the first-order difference sequence is the difference between two adjacent comprehensive similarities in the comprehensive similarity sequence. Then the first-order difference sequence is subjected to a difference operation again to obtain a second-order difference sequence, and each element in the second-order difference sequence is the difference between two adjacent elements in the first-order difference sequence. For example, assuming that the comprehensive similarity sequence is {0.10, 0.15, 0.50, 0.58, 0.60}, then after the first-order difference operation, the first-order difference sequence is {0.05, 0.35, 0.08, 0.02}. The first-order difference sequence is subjected to the difference operation again, and the second-order difference sequence is {0.30, -0.27, -0.06}. Then, the candidate pixel accuracy corresponding to the first second-order derivative greater than the preset threshold in the second-order derivative sequence is determined as the target pixel accuracy.
[0146] Since the first-order derivative of the comprehensive similarity is used to reflect the rate of change of the comprehensive similarity, and the second-order derivative is used to represent the rate of change of the first-order derivative, that is, the second-order derivative can reflect the change of the rate of change of the comprehensive similarity. Therefore, when the second-order derivative of the comprehensive similarity is greater than the preset threshold, it means that the rate of change of the comprehensive similarity has undergone a sudden change. Furthermore, the candidate pixel accuracy corresponding to the first second-order derivative greater than the preset threshold can be determined as the target pixel accuracy. This method uses the physical meaning of the second-order derivative (i.e., reflecting the change of the rate of change of the original numerical sequence) to clearly and accurately determine the target pixel accuracy, which helps to improve the accuracy of the determined target pixel accuracy.
[0147] For an object made of any material, after determining a target pixel accuracy suitable for collecting surface texture images of the object, surface texture features of the object can be extracted based on the target pixel accuracy. Figure 7c FIG. 1 is a flow chart of a method for extracting surface texture features of an object provided by an exemplary embodiment. Figure 7c As shown, the extraction method may include the following steps:
[0148] S708: Determine a target pixel accuracy according to the preparation material used for the object to be processed, wherein the target pixel accuracy is determined according to the aforementioned method for determining pixel accuracy.
[0149] As mentioned above, since the texture features of objects made of different materials are completely different, it is necessary to use pixel accuracy that is suitable for the material of the object to collect the surface texture image of the object. For the objects to be processed that need to be subjected to texture feature extraction operations, the target pixel accuracy can be determined based on the materials used to prepare the objects to be processed. The specific process of determining the target pixel accuracy can be referred to Figure 7a The embodiments shown in FIG. 1 are not described in detail here. Figure 7a After the method of the illustrated embodiment determines the target pixel accuracy applicable to an object made of any material, the association between the target pixel accuracy and the any material can be stored in a database, so that when it is necessary to subsequently perform texture feature analysis on an object made of the same material, the target pixel accuracy associated with the material can be directly obtained from the database, and the surface texture image of the object can be collected based on the target pixel accuracy.
[0150] S710: Collecting a surface texture image of the object to be processed according to the target pixel accuracy.
[0151] S712: Extracting features from the surface texture image of the object to be processed to obtain surface texture feature information of the object to be processed.
[0152] The surface texture feature information of an object includes the microscopic or macroscopic geometric structure characteristics such as the surface material, arrangement pattern, roughness, and directionality of the object. There are many ways to extract the surface texture feature information of an object from its surface texture image, such as gray level co-occurrence matrix, local binary pattern, texture spectrum analysis (such as FFT, Fast Fourier Transform), neural networks for feature extraction (such as CNNs, Convolutional Neural Networks), etc. Those skilled in the art can choose the appropriate feature extraction method according to actual needs, and this specification does not limit this.
[0153] In the above embodiment, the surface texture image of the object to be processed is collected according to the target pixel accuracy adapted to the material of the object to be processed, so that the surface texture image can contain sufficient and effective surface texture feature information, so that the difference between the object to be processed and other objects can be effectively distinguished based on the surface texture feature information.
[0154] In addition, for scenarios such as item anti-counterfeiting, item identification, and item traceability, this specification also proposes a registration method for the surface texture features of an item and an item verification method. In scenarios such as item anti-counterfeiting, item identification, and item traceability, there are usually a registrant and a verifier. Among them, the registrant can register the surface texture feature information of the item to the database after the item is produced / before it leaves the factory / before it is sold, so as to use the surface texture feature information of the item as the identity of the item. After receiving the item, if the verifier has doubts about the authenticity of the item or whether there is any violation such as channel diversion, the verifier can verify the surface texture feature information of the received item.
[0155] Figure 7d FIG. 1 is a flow chart of a method for registering surface texture features of an object provided by an exemplary embodiment. Figure 7d As shown, the registration method may include the following steps:
[0156] S714: Acquire surface texture feature information of the object to be registered, wherein the surface texture feature information is extracted according to the aforementioned method for extracting surface texture features of the object.
[0157] The items to be registered can be any items that have been produced / have not yet been shipped / have not yet been sold. The specific process of extracting the surface texture feature information of the items to be registered can be referred to Figure 7c The embodiments shown will not be described in detail here.
[0158] S716: Storing the surface texture feature information of the object to be registered in a database, so as to use the surface texture feature information as a verification standard corresponding to the object to be registered.
[0159] The surface texture feature information of the item to be registered is stored in the database, and the registration operation of the surface texture feature information of the item to be registered is completed. The surface texture feature information stored in the database can be used as the verification standard (i.e., identity identification) corresponding to the item for the verification party to verify the authenticity of the item or determine whether there is any violation such as parallel trading.
[0160] Figure 7e FIG. 1 is a flow chart of a method for verifying the surface texture features of an object provided by an exemplary embodiment. Figure 7e As shown, the verification method may include the following steps:
[0161] S718: Acquire surface texture feature information of the object to be verified, wherein the surface texture feature information is extracted according to the aforementioned object surface texture feature extraction method.
[0162] The items to be verified are items whose authenticity is in doubt or whose sales license is yet to be confirmed. When the verifier verifies the items to be verified, it is necessary to first obtain the surface texture feature information of the items to be verified. Figure 7c The method of the illustrated embodiment extracts surface texture feature information of the object to be verified, which will not be described in detail here.
[0163] S720: Verify whether the surface texture feature information of the object to be verified matches the surface texture feature information of a pre-registered authentic object.
[0164] The verifier can verify the surface texture feature information of the object to be verified locally, or upload the surface texture feature information of the object to be verified to the cloud server for verification by the cloud server. Whether it is local verification or cloud verification, the surface texture feature information of the object to be verified needs to be compared with the surface texture feature information of the pre-registered credible object during the verification process. Among them, the credible object can be understood as the real object to be verified. The surface texture feature information of the credible object can be registered to the database through the registration method of the surface texture feature of the object mentioned above, so that the surface texture feature information of the credible object can be obtained from the database for verification during the verification process.
[0165] If the comparison result shows that the surface texture feature information of the object to be verified matches the surface texture feature information of the authentic object, the object to be verified is determined to have passed the verification. If the comparison result shows that the surface texture feature information of the object to be verified cannot match the surface texture feature information of the authentic object, the object to be verified is determined to have failed the verification.
[0166] In the anti-counterfeiting scenario of items, if the item to be verified passes the verification, it means that the item to be verified is authentic; if the item to be verified fails the verification, it means that the item to be verified is a counterfeit.
[0167] In the scenario of determining whether an item is sold through cross-selling, for the sake of convenience, it is assumed that the item to be verified is authentic (i.e., the authenticity of the item to be verified does not need to be verified). For example, if the item to be verified is sold in region A, then the item to be verified is first verified with the credible items that are limited to be sold in region A. If the item to be verified passes the verification, it means that the item to be verified is not sold through cross-selling. If the item to be verified fails the verification, it means that the item to be verified is an item sold through cross-selling. In this case, the item to be verified can be further verified to determine the specific area where it is sold through cross-selling. For example, a set of credible items shipped / produced by the manufacturer of the item to be verified is obtained, and then the item to be verified is compared with the set of credible items. If the item to be verified matches a credible item in the set of credible items, it is determined that cross-selling has occurred in the sales area where the credible item is located. Alternatively, the item to be verified is compared with credible items sold in other areas (different from region A), and if the credible items in a certain area match the item to be verified, it is determined that cross-selling has occurred in that area.
[0168] Figure 7d , Figure 7e The embodiment shown collects the surface texture image of the object according to the target pixel accuracy applicable to the object, and extracts accurate surface texture feature information that can be used to distinguish the differences between different objects from the surface texture image, so as to use the surface texture feature information as the identity of the object. Since the surface texture feature information of the object is difficult to imitate, the above method can effectively distinguish between genuine and counterfeit goods, or effectively identify whether there is illegal behavior such as channel diversion, which greatly improves the anti-counterfeiting effect of the object.
[0169] In the aforementioned embodiment, extracting the surface texture feature information of the object from the surface texture image of the object can be achieved by a feature extraction model. In one embodiment, the structure of the feature extraction model includes a local feature extraction module and a global feature extraction module. Among them, the local feature extraction module is used to identify the key points of the input image and extract the key point description information of the corresponding key points; the global feature extraction module is used to generate a corresponding aggregate feature vector based on at least a part of the key point description information extracted by the local feature extraction module.
[0170] The image is input to the local feature extraction module of the feature extraction model to identify the key points of the image and extract the corresponding key point description information. The global feature extraction module based on the feature extraction model generates a corresponding aggregate feature vector based on at least a portion of the extracted key point description information. Among them, the key point description information is used to characterize the relevant feature information of the key points of the identified image, for example, it can include a feature vector for characterizing the key point feature, probability information for measuring whether the key point is a real key point, and / or the position information of the key point. The local feature extraction module can identify n key points from the input image (n is a positive integer, and the value of n is a hyperparameter of the feature extraction model). The key point description information of any key point can characterize the unique details that are distinguished from other images, and the image category can be identified or any two images can be determined to be the same image by comparing the key point description information of different images. The aggregate feature vector is used to characterize the global features of the entire image, and can also be used to identify the image category or determine whether any two images are the same image.
[0171] In one embodiment, the local feature extraction module may include a backbone network based on a convolutional neural network and an information description layer connected to the backbone network, and the information description layer is used to generate key point description information according to the output of the backbone network.
[0172] Specifically, the backbone network is used to extract feature information such as edges and textures of the image, and gradually extract corresponding more abstract and complex feature representations. The backbone network can adopt the existing convolutional neural network architecture such as the VGG network and the ResNet network. Of course, those skilled in the art can also design the architecture of the backbone network according to the needs, and the specific design architecture of the backbone network does not affect the implementation of this solution.
[0173] Next, we will introduce the structure of the information description layer:
[0174] In one embodiment, the information description layer may include a feature description submodule, and the key point description information generated by the information description layer includes a key point feature vector. The feature description submodule may generate n key point feature vectors for characterizing key point feature information, and then, at least a portion of the generated n key point feature vectors may be processed into an aggregate feature vector through a global feature extraction module. Among them, all of the generated n key point feature vectors may be processed into an aggregate feature vector through a global feature extraction module, and a portion of the generated n key point feature vectors may be processed into an aggregate feature vector through a global feature extraction module.
[0175] In another embodiment, the information description layer may include a score description submodule and a feature description submodule. The score description submodule is used to generate the key point score contained in the key point description information, and the key point score is used to measure the probability that the corresponding key point is a true key point. The global feature extraction module is used to generate at least a portion of the key point description information of the aggregated feature vector, and the at least a portion of the key point description information may be the key point description information whose corresponding key point score is greater than a preset score. For example, the information description layer identifies three key points of the image and generates three key point description information accordingly, and the values of each key point score are 0.6, 0.3 and 0.7 respectively. If the preset score is set to 0.5, only the key point description information with key point scores of 0.6 and 0.7 is used by the global feature extraction module to generate the aggregated feature vector.
[0176] In the above manner, more reliable key point description information can be screened out for the global feature extraction module to generate an aggregated feature vector, which can enable the global feature extraction module to better capture the essential features of the image based on the reliable key point description information, thereby generating a robust aggregated feature vector.
[0177] It should be noted that the larger the value of the preset score is, the greater the probability that the key point description information finally selected is the key point description information of the real key point, which means that the key point description information of the key point can more effectively represent the unique details of the image. However, if the value of the preset score is too large, too little key point description information is screened out, and the aggregated feature vector generated based on too little key point description information is difficult to represent the global features of the image. Therefore, the preset score can be determined according to the actual training effect of the feature extraction model, and this specification does not impose any restrictions on this.
[0178] In another embodiment, the information description layer may include a score description submodule, a feature description submodule and a position description submodule. The position description submodule is used to generate key point position information corresponding to the key point feature vector. The key point position information can be represented by (x, y) relative offset position, that is, the relative center offset in the x-axis direction and the y-axis direction. The key point repetition rate can be determined by comparing the key point position information of the image with the key point position information of other images, so as to determine whether the image matches other images according to the key point repetition rate.
[0179] Next, we will introduce the structure of the global feature extraction module:
[0180] In one embodiment, in order to achieve the purpose of generating an aggregated feature vector for characterizing the global features of an image based on at least a portion of the extracted key point description information, the global feature extraction module may include a projection layer and a pooling layer. Among them, the projection layer is used to expand the dimension of the key point feature vector contained in at least a portion of the key point description information extracted by the local feature extraction module, and recompress it into an intermediate feature vector with the same dimension as the input. For example, the dimension of the key point feature vector is C*W*D1, and the dimension D1 of the key point feature vector can be expanded to D2 (D2 is greater than D1), and recompressed into an intermediate feature vector with the same dimension as the input D1 (the dimension is still C*W*D1). The pooling layer is used to aggregate the intermediate feature vector into an aggregated feature vector. For example, the intermediate feature vector (with a dimension of C*W*D1) is aggregated into an aggregated feature vector (with a dimension of 1*1*D1).
[0181] In this embodiment, the key point feature vector is dimensionally expanded through the projection layer and then compressed to the original dimension. More valuable features can be retained through dimensional change, and then the higher-value intermediate feature vectors are aggregated into an aggregated feature vector through the pooling layer to improve the global representation capability of the aggregated feature vector.
[0182] In another embodiment, the global feature extraction module includes a projection layer, a pooling layer and a multi-layer perception layer. The projection layer is used to expand the dimension of the key point feature vector contained in at least a part of the key point description information extracted by the local feature extraction module, and then recompress it into an intermediate feature vector with the same dimension as the input. The pooling layer is used to aggregate the intermediate feature vector into an initial aggregate feature vector; the multi-layer perception layer is used to expand the dimension of the initial aggregate feature vector and normalize it into an aggregate feature vector of the target dimension.
[0183] In this embodiment, compared with the previous embodiment, a multi-layer perception layer is added after the pooling layer. By adding a multi-layer perception layer to expand the dimension and normalize the initial aggregated feature vector, the image information can be further fully captured, so that a more generalized aggregated feature vector is finally generated. In addition, the newly added multi-layer perception layer can also be used to adjust the dimension size of the final output aggregated feature vector, thereby improving the flexibility of setting the target dimension of the aggregated feature vector.
[0184] In one embodiment, in order to enhance the differentiated characterization capability of the aggregated feature vector, a method is proposed for Figure 2 The global feature extraction module can be trained by the following method:
[0185] (1) Construct a positive sample pair including an original image and a positive sample corresponding to the original image, and a negative sample pair including an original image and a negative sample corresponding to the original image.
[0186] (2) training a global feature extraction module based on positive sample pairs and negative sample pairs through a contrastive learning strategy; and, during the training process, screening out at least a portion of the positive sample pairs and / or negative sample pairs whose corresponding contrast loss values are lower than a preset loss threshold, and iteratively training the global feature extraction module using the remaining positive sample pairs and negative sample pairs.
[0187] In this embodiment, a global feature extraction module is trained based on positive sample pairs and negative sample pairs through a contrastive learning strategy, so that the aggregated feature vector of the original image output by the training global feature extraction module is closer to the aggregated feature vector of the positive sample and farther away from the aggregated feature vector of the negative sample, thereby improving the differentiated characterization capability of the aggregated feature vector used to characterize the global features of the image. Moreover, based on the contrastive learning strategy, this specification further improves the training effect by iteratively training the misclassified positive sample pairs and negative sample pairs again. Among them, the contrastive learning strategy can adopt the MOCO algorithm or the SimCLR algorithm.
[0188] In one embodiment, the original image is subjected to image augmentation processing to obtain a positive sample and construct a positive sample pair of the original image and the positive sample. The image augmentation processing includes but is not limited to: image rotation, histogram equalization, blurring and / or sharpening. The original image is subjected to elastic grid deformation processing to obtain a negative sample and construct a negative sample pair of the original image and the negative sample; and / or, other images similar to the original image are selected as negative samples and a negative sample pair of the original image and the negative sample is constructed. For example, if the original image is a surface texture image of a collected ceramic tile, then the other images may be surface texture images of other similar ceramic tiles. Of course, if the original image is a grid sub-image of the surface texture image of a ceramic tile, then the other images may be grid sub-images at corresponding positions of similar surface texture images. For example, if the original image is a grid sub-image of a surface texture image at coordinates (2,3), then the other images may also be grid sub-images of similar surface texture images at coordinates (2,3). Wherein, (2,3) indicates that the grid sub-image is a grid sub-image of the second row and third column of the surface texture image.
[0189] In terms of the construction of positive sample pairs and negative sample pairs, complex positive sample pairs and complex negative sample pairs can be constructed in the above manner, making it more difficult for the global feature extraction module to distinguish between samples and original images, so as to improve the differentiated representation ability of the aggregated feature vector by increasing the training difficulty.
[0190] In the process of extracting the surface texture features of objects in the registration stage, the aggregated feature vector that characterizes the global features of the surface texture image needs to be represented by a high-dimensional aggregated feature vector, and surface texture images with too large an area generally require a more complex network model to accurately extract the aggregated feature vector that characterizes the global features of the image.
[0191] In view of the above problem, this specification proposes another implementation method: for any pre-registered object (i.e., an object in the registration stage), the pre-registered surface texture image 62 of the pre-registered object can be divided into corresponding pre-registered sub-images according to a preset size. Figure 8 As shown, the pre-registered surface texture image is divided into 9 pre-registered sub-images ①-⑨ of the same grid size according to the preset size of 3*3. For any pre-registered sub-image, the corresponding pre-registered aggregated feature vector is extracted through the feature extraction model, and the pre-registered aggregated feature vector corresponding to the pre-registered surface texture image is the 9 pre-registered aggregated feature vectors corresponding to the 9 pre-registered sub-images into which the pre-registered surface texture image is divided.
[0192] The associated information of the pre-registered surface texture image may be the number of the pre-registered surface texture image and the position information of each pre-registered sub-image in the pre-registered surface texture image. Figure 8As shown, for the preregistered sub-image ③ of the preregistered surface texture image 62, its position information can be represented by the coordinates (1,3), indicating that the preregistered sub-image ③ is located in the first row and third column of the preregistered surface texture image 62; for the preregistered sub-image ⑥, its position information can be represented by the coordinates (2,3), indicating that the preregistered sub-image ⑥ is located in the second row and third column of the preregistered surface texture image 62.
[0193] Finally, the pre-registered aggregated feature vectors of each pre-registered sub-image are associated with the associated information of the pre-registered surface texture image 62 and stored in the vector database.
[0194] In this embodiment, by dividing the pre-registered surface texture image into several pre-registered sub-images, each pre-registered sub-image has a smaller area than the pre-registered surface texture image. Therefore, an overly complex deep network model is not required to accurately extract the pre-registered aggregated feature vector of each pre-registered sub-image. Moreover, since the image information in the pre-registered sub-image is less than that in the pre-registered surface texture image, it is easier to improve the accuracy of extracting the image information in the pre-registered sub-image.
[0195] An exemplary embodiment of the present specification provides a surface texture image comparison method. The method comprises the following steps:
[0196] Step 801: Acquire a surface texture image of an object to be verified.
[0197] Step 802: extracting the aggregated feature vector to be verified corresponding to the surface texture image to be verified based on the feature extraction model.
[0198] Step 803: perform a similarity comparison between the aggregated feature vector to be verified and the pre-registered aggregated feature vectors in the vector database, and recall a group of pre-registered surface texture images according to the comparison result.
[0199] Step 804: Based on the local feature extraction module, key point description information of the surface texture image to be verified and the recalled pre-registered surface texture image are respectively extracted, and by comparing the key point description information, it is determined whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0200] In one embodiment, the user may capture a surface texture image of the object to be verified.
[0201] Among them, the surface texture image to be verified can be the surface texture image of the entire area of the surface of the object to be verified, or it can be the surface texture image of a specific local area. It should be noted that if the verification surface texture image is the surface texture image of a specific local area, the specific local area where the verification surface texture image is located needs to be consistent with the specific local area where the pre-registered surface texture image of the pre-registered object is located. For example, for a marble slab, if during the registration stage, only the pre-registered surface texture image of the specific local area in the upper left corner of the pre-registered marble slab is collected, then during the verification stage, it is also necessary to collect the surface texture image to be verified of the same specific local area in the upper left corner of the marble slab to be verified, so as to achieve alignment between the pre-registered surface texture image and the surface texture image to be verified.
[0202] Before inputting the surface texture image to be verified into the feature extraction model, the surface texture image to be verified may be preprocessed, and the preprocessed surface texture image to be verified is input into the feature extraction model. The image preprocessing includes but is not limited to image sharpening, image gamma correction, image histogram equalization and / or image graying.
[0203] In the coarse matching sub-stage, after the aggregated feature vector to be verified of the surface texture image to be verified is extracted by the feature extraction model, in the coarse matching screening module, the aggregated feature vector to be verified is compared with the pre-registered aggregated feature vector in the vector database for similarity, and a group of pre-registered surface texture images are recalled based on the comparison results.
[0204] In the fine matching sub-stage, the local feature extraction module based on the feature extraction model extracts the key point description information of the surface texture image to be verified and the key point description information of the pre-registered surface texture images recalled in the preliminary screening stage respectively, and in the fine matching module, by comparing the key point description information with the key point description information respectively, it is determined whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0205] In this embodiment, the verification stage is divided into two stages: a coarse matching sub-stage and a fine matching sub-stage. In the coarse matching sub-stage, candidate pre-registered surface texture images are preliminarily screened out from all pre-registered surface texture images. Then, in the fine matching sub-stage, the matching degree between the candidate pre-registered surface texture images and the surface texture image to be verified is verified to determine the pre-registered surface texture image corresponding to the surface texture image to be verified, so that it can be used to examine the authenticity of the object to be verified based on the pre-registered object information to which the matched pre-registered surface texture image belongs. This embodiment is based on a feature extraction model to cooperate with the above two-stage verification method: the feature extraction model includes a local feature extraction module and a global feature extraction module, the local feature extraction module is used to identify key points from the input image and extract corresponding key point description information, and the global feature extraction module is used to generate a corresponding aggregate feature vector based on at least a part of the key point description information extracted by the local feature extraction module. In the coarse matching sub-stage, the aggregated feature vector to be verified corresponding to the surface texture image to be verified is extracted based on the feature extraction model, the aggregated feature vector to be verified is compared with the pre-registered aggregated feature vector in the vector database for similarity, and a group of pre-registered surface texture images are recalled according to the comparison result; wherein, the pre-registered surface texture image is collected from the pre-registered object, and the pre-registered aggregated feature vector is generated by the feature extraction model based on the pre-registered surface texture image. Through the processing of the above coarse matching sub-stage, candidate pre-registered surface texture images similar to the surface texture image to be verified can be quickly screened out from all pre-registered surface texture images to reduce the verification calculation amount of the fine matching sub-stage and thus improve the verification speed. In the fine matching sub-stage, the key point description information of the surface texture image to be verified and the recalled pre-registered surface texture image are respectively extracted based on the local feature extraction module, and the pre-registered surface texture image matching the surface texture image to be verified is determined by comparing the key point description information. In the verification process of the fine matching sub-stage, the pre-registered surface texture image that matches the surface texture image to be verified can be accurately determined based on the key point description information extracted by the local feature extraction module of the feature extraction model for characterizing more image detail information. It can be seen that the above-mentioned verification method based on the feature extraction model and the two-stage verification method can achieve the purpose of taking into account both verification speed and verification accuracy.
[0206] In one embodiment, in the coarse matching sub-stage, a similarity comparison can be performed based on the aggregated feature vector to be verified and the pre-registered aggregated feature vectors of the pre-registered surface texture images of all pre-registered items of the same type as the item to be verified stored in the vector database, and a group of pre-registered surface texture images can be recalled based on the comparison result. For example, the similarity between the aggregated feature vector to be verified and the pre-registered aggregated feature vectors of the pre-registered surface texture images of each pre-registered item is calculated based on cosine similarity, and the top K pre-registered aggregated feature vectors with the highest similarity are determined based on the similarity calculation result, and the pre-registered surface texture images corresponding to the pre-registered aggregated feature vectors are recalled.
[0207] In the fine matching sub-stage, the local feature extraction module based on the feature extraction model extracts the key point description information of the surface texture image to be verified and the key point description information of the pre-registered surface texture image recalled in the fine matching sub-stage respectively, and in the fine matching module, by comparing the key point description information with the key point description information respectively, it is determined whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0208] In one embodiment, for the coarse matching sub-stage, M sub-images to be verified can be intercepted from the surface texture image to be verified through a sliding window of a preset size, and M aggregated feature vectors to be verified corresponding to the M sub-images to be verified are extracted based on the feature extraction model. It should be noted that each pre-registered surface texture image also needs to be divided into corresponding pre-registered sub-images according to a preset size, and the pre-registered aggregated feature vectors correspond to the pre-registered sub-images one-to-one. By controlling the size of the sliding window to be the same as the size of the pre-registered surface texture image, it can be ensured that the sub-image to be verified intercepted by the sliding window is aligned with the pre-registered sub-image.
[0209] For any aggregate feature vector to be verified extracted by the feature extraction model, the similarity is compared with each pre-registered aggregate feature vector in the vector database, and the top K pre-registered aggregate feature vectors with the highest similarity to the aggregate feature vector to be verified are determined. For the M×K vector pairs formed by the M aggregate feature vectors to be verified and the corresponding pre-registered aggregate feature vectors determined, the vector pairs that meet the geometric consistency constraint conditions are screened out; at least a portion of the pre-registered surface texture image corresponding to the screened vector pairs is recalled.
[0210] Specifically, a set of M aggregate feature vectors to be verified {a1, a2, a3, ..., a m}, for any aggregate feature vector a to be verified i , retrieve the vector corresponding to a from the vector database i The top K pre-registered aggregate feature vectors with the highest similarity {b i,1 , b i,2 , b i,3 , …, b i,kFor any aggregate feature vector a to be verified i , forming K vector pairs {a i , b i,1}, {a i , b i,2}, ..., {a i , b i,k}. For any vector pair, verify whether it satisfies the geometric consistency constraint condition, and select the vector pairs that satisfy the geometric consistency constraint condition. And determine the b in each vector pair from the selected vector pairs i,j The pre-registered surface texture image to which it belongs. And when the number of vector pairs corresponding to the same pre-registered surface texture image is greater than the screening threshold, the pre-registered surface texture image is recalled. For example, for the screened vector pair {a1, b 1,1}, {a1, b 1,4}, {a1, b 2,3}, {a2, b 2,5}, if the screening threshold is set to 2, b 1,1 , b 1.4 and b 2,3 are the pre-registered aggregated feature vectors of different pre-registered sub-images in the same pre-registered surface texture image, then the number of vector pairs corresponding to the same pre-registered surface texture image is 3, and the pre-registered surface texture image can be recalled.
[0211] In the fine matching stage, the key point description information of the surface texture image to be verified extracted by the local feature extraction module is compared with the key point description information of a group of recalled pre-registered surface texture images extracted based on the local feature extraction module, and it is determined whether there is a pre-registered surface texture image that matches the surface texture image to be verified.
[0212] Specifically, the key point feature vector Descriptor of the surface texture image to be verified is extracted based on the local feature extraction module query And key point position information Position query For any recalled pre-registered surface texture image, extract the key point feature vector Descriptor of the pre-registered surface texture image gallery And key point position information Position gallery For any recalled pre-registered surface texture image, construct a vector pair {Descriptor query , Descriptor gallery}, and select the vector pairs {Descriptor query , Descriptor gallery}, then, based on the RANSAC method, the vector pairs {Descriptor query , Descriptor gallery}Perform affine transformation estimation to obtain the radial transformation matrix M.
[0213] For any selected vector pair, determine the corresponding radiation transformation matrix M, the key point feature vector Descriptor of the surface texture image to be verified in the vector pair query The corresponding key point position information Position query , and the key point feature vector Descriptor of the pre-registered surface texture image in the vector pair gallery The corresponding key point position information Position gallery Based on the radiation transformation matrix M, Descriptor query Perform affine transformation on the coordinates to get Position′ query , and calculate the position of query The coordinates of the circle are the center of the circle. Is there a Position within the range of the circle with the preset radius R? gallery , if it exists, it means that the key point is repeated.
[0214] For any pre-registered surface texture image recalled, the repetition rate of the key point repeated vector pairs to all vector pairs is calculated.
[0215] Then, the similarity between the pre-registered surface texture image and the surface texture image to be verified is calculated. When the repetition rate is greater than the preset repetition rate and the image similarity is greater than the preset similarity, it is determined that the surface texture image to be verified matches the corresponding pre-registered surface texture image. Optionally, the pre-registered aggregate feature vector of the pre-registered surface texture image and the aggregate feature vector to be verified of the image to be verified can be extracted respectively by a feature extraction model, and the similarity between the pre-registered aggregate feature vector and the aggregate feature vector to be verified can be calculated. Optionally, the similarity between the pre-registered surface texture image and the surface texture image to be verified can be calculated based on contrast algorithms such as PSNR, SSIM, LPIPS, etc. Optionally, the similarity between the pre-registered surface texture image and the surface texture image to be verified can be calculated using a network model (such as ResNet50, VGG19, InceptionV3) pre-trained by MoCo or SimCLR contrast learning methods.
[0216] An exemplary embodiment of the present specification provides a surface texture image comparison method, which can be applied to a verification client running in a verification device, or to a server of a surface texture image comparison system. The method includes steps 1502-1506, which belong to a rough screening (i.e., rough matching) stage.
[0217] Step 1502 : obtaining a surface texture image to be verified collected from the object to be verified, and intercepting a sub-image to be verified from the surface texture image to be verified through a sliding window of a preset size.
[0218] As mentioned above, the verifier can use the verifier device or its associated image acquisition device to collect the corresponding surface texture image to be verified for the object to be verified. Then, the verifier device or the server as the executor of the method can obtain the image and intercept M sub-images to be verified from the image through a sliding window of a preset size (hereinafter referred to as the first preset size), where M is a positive integer (i.e., at least one sub-image to be verified is intercepted).
[0219] Fig. 9 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 equal to the above-mentioned first preset size. The surface texture image is a surface texture image collected from a tile with a cloud-like pattern. It may be assumed that the image is a surface texture image to be verified. Through a sliding window of the first preset size, 24 sub-images to be verified can be intercepted from the surface texture image to be verified (a total of 4 rows and 6 columns, M=24 at this time). 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 (such as 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 that the sub-image number can be used to represent its position in the surface texture image to be verified.
[0220] In fact, during the registration process of any pre-registered item, the registration client or server as the registration subject can also divide the pre-registered surface texture image of the image into multiple pre-registered sub-images according to a preset size (hereinafter referred to as the second preset size), and the division method is similar to the interception method for the surface texture image to be verified.
[0221] 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.
[0222] In addition, when the first preset size is equal to the second preset size, the sliding window step size of the verification process can be set to be less than or equal to the size, so that the corresponding sub-images to be verified can be intercepted as much as possible for the areas corresponding to all pre-registered sub-images, thereby avoiding the omission of key points and the reduction of comparison accuracy due to incomplete interception of the sub-images to be verified. Among them, whether it is the aggregated feature vector to be verified or the pre-registered aggregated feature vector, the feature representation ability of the aggregated feature vector (that is, the ability to represent the micro-texture differences between different images) is determined by the feature extraction algorithm. This solution can use convolutional neural network architectures such as VGG network and ResNet network to build a feature extraction network for extracting aggregated feature vectors, so that it has a higher feature representation ability. Correspondingly, the above sliding window step size can be negatively correlated with the feature representation ability of the aggregated feature vector to be verified, that is, the stronger the feature representation ability, the smaller the sliding window step size can be set, and the weaker the feature representation ability, the larger the sliding window step size can be set. In addition, the smaller the sliding window step size is set, the more likely the sub-image to be verified intercepted in the verification phase is to be aligned with the pre-registered sub-image divided in the registration phase, and the subsequent comparison accuracy will be higher. Based on the above factors, a suitable sliding window step size may be set according to actual conditions, such as 25%, 50%, 75% of the aforementioned first preset size, etc., and this specification does not limit this.
[0223] Step 1504, extracting the aggregated feature vectors to be verified of each sub-graph to be verified, and for each aggregated feature vector to be verified: retrieving a group of pre-registered aggregated feature vectors with the highest vector similarity with the aggregated feature vector to be verified in the vector database, and the aggregated feature vector to be verified and each feature vector in the group of pre-registered aggregated feature vectors respectively constitute an aggregated vector pair; wherein each pre-registered aggregated feature vector is extracted from a pre-registered sub-graph, and the pre-registered sub-graph is obtained by dividing a pre-registered surface texture image collected from a pre-registered object according to the preset size.
[0224] For the M subgraphs to be verified intercepted in step 1502, the aggregate feature vectors to be verified of each subgraph can be extracted. Among them, when extracting the aggregate feature vector to be verified in the intercepted subgraph to be verified, the same method as when extracting the pre-registered aggregate feature vector in the divided pre-registered subgraph can be adopted, that is, the aggregate feature vector to be verified and the pre-registered aggregate feature vector are extracted in the same way. 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 repeated here.
[0225] In one embodiment, when extracting the aggregated feature vector to be verified of any sub-graph to be verified, the key points to be verified can be identified from the sub-graph and the corresponding description information of the key points to be verified can be extracted, and the description information includes the feature vector of the key points to be verified. Furthermore, the feature vectors of the key points to be verified corresponding to at least a portion of the identified key points to be verified can be aggregated to generate the aggregated feature vector to be verified of any sub-graph to be verified. It can be seen that the aggregated feature vector to be verified extracted in this way is obtained by aggregating the feature vectors of the key points to be verified of each key point to be verified in the sub-graph to be verified, so the aggregated feature vector to be verified can reflect the overall characteristics of these key points to be verified, which is convenient for the subsequent image comparison based on the relevant features of the key points, thereby improving the accuracy of the comparison.
[0226] 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.
[0227] At least one key point to be verified may be identified in each sub-image of the surface texture image to be verified. Fig.16 As shown, four key points to be verified are identified in sub-graph SP23, one key point to be verified is identified in sub-graph SP24, and three key points to be verified are identified in sub-graph SP26 (the key points to be verified in the remaining sub-graphs are not shown one by one). Taking sub-graph SP26 as an example, for the three key points to be verified ROI1, ROI2 and ROI3, the corresponding key point feature vectors Qroi26-1, Qroi26-2 and Qroi26-3 can be extracted respectively; then these three feature vectors are aggregated to obtain the aggregate feature vector Qagg26 corresponding to sub-graph SP26.
[0228] In addition, for each key point to be verified identified from any of the subgraphs to be verified, the credibility scores of each of these key points to be verified can also be determined. Among them, the credibility score of any key point to be verified is proportional to the accuracy / credibility of the identification result of the key point to be verified, that is, the larger the credibility score of any key point to be verified, the greater the possibility that the key point actually exists in the subgraph to be verified. Based on the above credibility scores, during the aggregation process, at least a portion of the key points to be verified whose credibility scores are not less than the score threshold can be determined among the key points to be verified, and the feature vectors of the key points to be verified corresponding to these key points can be aggregated. It can be understood that the credibility of the recognition results of at least a part of the key points to be verified whose credible scores are greater than the score threshold is relatively high. Only the feature vectors of the key points to be verified corresponding to these key points are aggregated (instead of using the feature vectors of the key points to be verified corresponding to the key points to be verified whose credible scores are lower than the score threshold). This can ensure that the processed aggregated feature vectors to be verified also have high accuracy, and can truly reflect the distribution of each key point to be verified in the sub-graph to be verified. The credibility is also high, which helps to improve the accuracy of subsequent comparisons.
[0229] As mentioned above, for each sub-graph to be verified that has been intercepted, the corresponding aggregated feature vector to be verified can be extracted. In addition, the coordinates of the sub-graph to be verified of each sub-graph to be verified can also be recorded, where the coordinates of any sub-graph to be verified are used to represent the position of the sub-graph in the surface texture image to be verified (such as the number of rows and columns) - the coordinates can accurately determine the position involved in the coarse screening stage to the sub-graph level. The coordinates of the sub-graph to be verified can be based on the image origin of the surface texture image to be verified (such as Fig.10 In addition, as mentioned above, at least one key point to be verified may be identified in each sub-graph to be verified (the aggregated feature vector to be verified of the sub-graph can be obtained by aggregating the feature vectors of the key points to be verified of each key point in the sub-graph), wherein the description information of the key point to be verified of each key point to be verified may include not only the feature vector of the key point to be verified, but also the position information of the key point to be verified (such as the coordinates of the key point in the texture image of the surface to be verified, which can accurately determine the position involved in the subsequent fine screening stage to the pixel level).
[0230] In addition, given that the fine screening stage shown in the subsequent step 1508 requires the description information of the key points to be verified of each key point to be verified, in order to speed up the data acquisition efficiency of the fine screening stage, the coarse screening stage can cache the extracted description information of the key points to be verified so that it can be directly obtained in the subsequent fine screening stage without the need to extract it again.
[0231] It should be noted that, in the registration stage, for each image to be registered, the above processing can also be performed to extract the pre-registered aggregate feature vector and pre-registered key point description information (including pre-registered key point feature vector and pre-registered key point position information) corresponding to its pre-registered sub-image, and save it in the aforementioned vector database. It can be understood that each pre-registered aggregate feature vector in the database is extracted from a pre-registered sub-image, and the pre-registered sub-image is obtained by dividing the pre-registered surface texture image collected from the pre-registered object according to the preset size.
[0232] Through the above-mentioned method, the aggregate feature vector to be verified corresponding to each subgraph in the M subgraphs to be verified can be extracted, 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 in the vector database. After the retrieval is completed, the aggregate feature vector to be verified constitutes 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 (K is a positive integer) vectors, then the aggregate feature vector to be verified will constitute K aggregate vector pairs with these K pre-registered aggregate feature vectors, and the M aggregate feature vectors to be verified corresponding to all the M subgraphs to be verified will participate in the formation of M*K aggregate vector pairs. Of course, the number of vectors in a group of pre-registered aggregate feature vectors corresponding to each aggregate feature vector to be verified may not be equal, and the embodiments of this specification do not limit this.
[0233] Among them, if the executor of the method is the aforementioned verification client, the client can synchronize the vector database maintained by it from the server in advance or temporarily, and then perform the above-mentioned search locally; or it can also initiate a search request for the aggregate feature vector to be verified to the server, and receive the search results returned by the server (that is, the retrieved M groups of pre-registered aggregate feature vectors). If the executor of the method is the aforementioned server, the server can perform the above-mentioned search locally in response to the search request initiated by the verification client for the aggregate feature vector to be verified, or extract the aggregate feature vector to be verified by itself after receiving the surface texture image to be verified sent by the verification client and perform the above-mentioned search locally. It can be seen that retrieving a corresponding set of pre-registered aggregate feature vectors for each aggregate feature vector to be verified can be completed by the verification client or the server.
[0234] It should also be noted that all pre-registered aggregate feature vectors contained in the vector database can be set according to the verification purpose of the item to be verified. For example, in order to verify whether the item to be verified is a compliant product produced by a certain merchant, the pre-registered surface texture images corresponding to each pre-registered aggregate feature vector in the database can be collected from these compliant products; and in order to verify whether the item to be verified is a batch of goods authorized to be sold by a certain store, the pre-registered surface texture images corresponding to each pre-registered aggregate feature vector in the database can be collected from this batch of goods. In addition, given that the pre-registered aggregate feature vectors in the vector database are extracted from pre-registered sub-graphs obtained by dividing the pre-registered surface texture image, and a pre-registered surface texture image obtained by collecting a pre-registered item can be divided into multiple pre-registered sub-graphs, the number of pre-registered items corresponding to the vector database (i.e., the number of pre-registered surface texture images) is usually less than the total number of pre-registered aggregate feature vectors stored in the database.
[0235] As for the retrieval process for each aggregate feature vector to be verified, in one embodiment, the vector similarity between the aggregate feature vector to be verified and each pre-registered aggregate feature vector stored in the vector database can be calculated. Then, a group of pre-registered aggregate feature vectors whose vector similarity is not less than the similarity threshold are retrieved (at this time, the number of vectors in each group of pre-registered aggregate feature vectors is not certain, and may be zero or any positive integer). Alternatively, a preset number (i.e., the aforementioned K) of pre-registered aggregate feature vectors with the largest vector similarity are retrieved (at this time, the number of vectors in each group of pre-registered aggregate feature vectors is the preset number).
[0236] like Fig.10As shown, each subgraph to be verified (i.e., SP11 to SP54) in the surface texture image to be verified is located at different positions, and each preregistered subgraph in any preregistered surface texture image i (only SPR1 to SPR9 are shown) is also located at different positions. It is advisable to record the aggregated feature vector to be verified corresponding to SP23 as Qagg23, and the preregistered aggregated feature vector corresponding to SPR1 as Qaggr1, and the same is true for other aggregated feature vectors to be verified and preregistered aggregated feature vectors. Among them, the solid lines with arrows pointing to the preregistered subgraphs SPR1, SPR2 and SPR3 of the subgraph to be verified SP23 are used to indicate that the aggregated feature vector to be verified corresponding to SP23 (i.e., Qagg23) and the preregistered aggregated feature vectors corresponding to SPR1, SPR2 and SPR3 (i.e., Qaggr1, Qaggr2 and Qaggr3) each constitute an aggregated vector pair (i.e., the aggregated feature vector to be verified corresponding to SP23 recalls the preregistered aggregated feature vectors corresponding to SPR1, SPR2 and SPR3). Similarly, the dashed arrow lines of SP44 pointing to the pre-registered subgraphs SPR4, SPR5, SPR6 and SPR7 are used to indicate that Qagg44 and Qaggr4, Qaggr5, Qaggr6 and Qaggr7 each form a cluster vector pair. For the sake of simplicity, [Qagg23, Qaggr1] is used below to represent the cluster vector pair formed by Qagg23 and Qaggr1, and the same applies to other cluster vector pairs.
[0237] Through the screening process based on vector similarity in step 1504, a small number of pre-registered aggregated feature vectors with high similarity to the aggregated feature vector to be verified can be preliminarily screened out from the massive / large number of pre-registered aggregated feature vectors saved in the vector database based on vector similarity, so as to eliminate most of the pre-registered surface texture images that have a large difference in micro-texture from the surface texture image to be verified from all the pre-registered surface texture images corresponding to all the pre-registered aggregated feature vectors in the vector database, thereby greatly reducing the amount of calculation in subsequent steps.
[0238] Step 1506, based on the position information of each sub-image to be verified and each pre-registered sub-image in the corresponding surface texture image, select the target aggregate vector pair of the corresponding sub-image that meets the geometric consistency constraint condition from the aggregate vector pair composed of the aggregate feature vector to be verified, and recall at least a part of the pre-registered surface texture image corresponding to the target aggregate vector pair.
[0239] For the M aggregate feature vectors to be verified, step 1504 screens and obtains M groups of corresponding pre-registered aggregate feature vectors, and each aggregate feature vector to be verified and each adjacent group of pre-registered aggregate feature vectors corresponding to itself constitute an aggregate vector pair. Among them, the aggregate feature vectors to be verified that constitute each aggregate vector pair are extracted from the corresponding subgraph to be verified, and the pre-registered aggregate feature vectors are extracted from the corresponding pre-registered subgraph. As mentioned above, the subgraph coordinates of each subgraph are the position information of the subgraph in the surface texture image to which it belongs. Based on the position information of the subgraph, the target aggregate vector pairs whose corresponding subgraphs meet the geometric consistency constraints can be screened out from the aggregate vector pairs formed by the aggregate feature vectors to be verified, and at least a part of the pre-registered surface texture images corresponding to these target aggregate vector pairs can be recalled to achieve further screening of the pre-registered surface texture images.
[0240] In one embodiment, the sub-image coordinates of any aggregation vector pair may include the coordinates of the sub-image to be verified and the coordinates of the pre-registered sub-image, wherein the coordinates of the sub-image to be verified are the position information of the sub-image to be verified corresponding to the aggregation feature vector to be verified in the aggregation vector pair in the surface texture image to which it belongs, and the coordinates of the pre-registered sub-image are the position information of the pre-registered sub-image corresponding to the pre-registered aggregation feature vector in the aggregation vector pair in the pre-registered surface texture image to which it belongs. Fig.10 As shown, for the aggregated vector pair composed of the aggregated feature vector to be verified corresponding to SP23 and the pre-registered aggregated feature vector corresponding to SPR1, its subgraph coordinates include the coordinates of SP23 in the surface texture image to be verified and the coordinates of SPR1 in the pre-registered surface texture image i, and the subgraph coordinates of other aggregated vector pairs are the same. Based on the subgraph coordinates of each aggregated vector pair, when screening the target aggregated vector pair that meets the geometric consistency constraint condition, it is possible to traverse each aggregated vector pair composed of the acquired aggregated feature vectors to be verified, select at least one aggregated vector pair each time according to the quantity required by the geometric consistency constraint condition, and determine whether the subgraph coordinates of the at least one aggregated vector pair all meet the geometric consistency constraint condition; wherein, if the subgraph coordinates of the at least one aggregated vector pair all meet the condition, then the at least one aggregated vector pair is determined to be the target aggregated vector pair; if there is an aggregated vector pair in the at least one aggregated vector pair whose subgraph coordinates do not meet the condition, then it is determined that the at least one aggregated vector pair is not the target aggregated vector pair. In this way, all combinations of all aggregate vector pairs can be checked one by one according to the number requirements of the geometric consistency constraints, and finally the target aggregate vector pairs that meet the geometric consistency constraints can be screened out to avoid omissions, which helps to ensure the accuracy of the final comparison results.
[0241] Geometric consistency refers to the property in geometry that the relationship between two or more geometric objects remains unchanged. In short, geometric consistency describes the ability of a set of geometric objects to maintain similarity and relative position after transformation (such as rotation, translation or scaling). In this scheme, the relative position relationship between different subgraphs is verified by geometric consistency constraints.
[0242] Among them, the geometric consistency constraint condition includes a distance constraint condition, an angle constraint condition and / or a common constraint condition, that is, when screening the target aggregate vector pair, any number of conditions can be selected from these three constraints to check each aggregate vector pair, which are explained below. For example, when the geometric consistency constraint condition includes these three conditions at the same time, for all S0 aggregate vector pairs to be checked, S1 aggregate vector pairs that meet the distance constraint condition can be screened out first; then for these S1 aggregate vector pairs, S2 aggregate vector pairs that meet the angle constraint condition can be screened out; finally, for these S2 aggregate vector pairs, S3 aggregate vector pairs that meet the common constraint condition can be screened out, that is, as the final target aggregate vector pair. It can be understood that the above process can realize the progressive step-by-step screening of the aggregate vector pairs, where S0≥S1≥S2≥S3. In view of the fact that the calculation amount of the distance constraint condition, the angle constraint condition and the common constraint condition increases successively, this step-by-step screening method can effectively reduce the total calculation amount of the geometric consistency constraint screening process, thereby improving the overall efficiency of the rough screening stage to a certain extent.
[0243] Two clustering vector pairs are required for each check of the distance constraint. For example, for the first clustering vector pair and the second clustering vector pair in any two clustering vector pairs, if the absolute value of the difference between the distance of the subgraph to be verified and the distance of the pre-registered subgraph between the two clustering vector pairs is not greater than the distance threshold, it is determined that the corresponding subgraphs of the two clustering vector pairs satisfy the distance constraint; wherein the distance of the subgraph to be verified is the distance between the coordinates of the subgraph to be verified of the first clustering vector pair and the coordinates of the subgraph to be verified of the second clustering vector pair, and the pre-registered subgraph distance is the distance between the coordinates of the pre-registered subgraph of the first clustering vector pair and the coordinates of the pre-registered subgraph of the second clustering vector pair.
[0244] Following the above embodiment, Fig.10As shown, the to-be-verified aggregate feature vectors corresponding to SP23 participate in the formation of three aggregate vector pairs, namely [Qagg23, Qaggr1], [Qagg23, Qaggr2] and [Qagg23, Qaggr3]; the to-be-verified aggregate feature vectors corresponding to SP44 participate in the formation of four aggregate vector pairs, namely [Qagg44, Qaggr4], [Qagg44, Qaggr5], [Qagg44, Qaggr6] and [Qagg44, Qaggr7]. There are 21 combinations of the above seven aggregate vector pairs, that is, there are 21 combinations of "two aggregate vector pairs". For each of them, it can be determined whether the absolute value of the difference between the distance of the to-be-verified subgraph and the distance of the pre-registered subgraph is greater than the distance threshold d0, and then whether the subgraph corresponding to this combination meets the distance constraint. Taking the combination of [Qagg23, Qaggr1] and [Qagg44, Qaggr5] as an example, Fig.10 As shown, the distance of the subgraph to be verified in this combination is the length d of the line segment between SP23 and SP44, and the distance of the pre-registered subgraph is the length dr of the line segment between SPR1 and SPR5; if |d-dr|>d0, it is determined that SP23, SP44, SPR1 and SPR5 do not meet the distance constraint; otherwise, if |d-dr|≤d0, it is determined that the above subgraphs meet the distance constraint, and the two aggregation vector pairs [Qagg23, Qaggr1] and [Qagg44, Qaggr5] can be screened out. The determination method of the other six combinations is similar to this and will not be repeated.
[0245] It should be noted that, since any aggregation vector pair may form multiple combinations with other multiple aggregation vector pairs, and the judgment results of these combinations are not exactly the same, in order to avoid misjudgment, when any combination satisfies the distance constraint condition, it is determined that the two aggregation vector pairs participating in the formation of the combination satisfy the distance constraint condition, and there is no need to check whether other combinations formed by the two aggregation vector pairs satisfy the condition. Of course, in order to increase the screening strength of the distance constraint condition, a threshold value of the number of times the aggregation vector pair satisfies the condition can also be set. For example, if it is set to twice, any aggregation vector pair needs to satisfy the condition with at least the combination composed of the other two aggregation vector pairs before the aggregation vector pair is judged to satisfy the condition, which will not be repeated.
[0246] At least three clustered vector pairs are required for each check of the angle constraint. For example, for the first clustered vector pair, the second clustered vector pair, and the third clustered vector pair among any three clustered vector pairs, if the absolute value of the difference between the angle of the subgraph to be verified between the three clustered vector pairs and the angle of the pre-registered subgraph is not greater than the angle threshold, then it is determined that the corresponding subgraphs of the three clustered vector pairs all meet the angle constraint; wherein the angle of the subgraph to be verified is the angle between the line connecting the first and second subgraphs to be verified and the line connecting the second and third subgraphs to be verified, and the line connecting the first and second subgraphs to be verified is the angle between the coordinates of the subgraph to be verified of the first clustered vector pair and the coordinates of the subgraph to be verified of the second clustered vector pair. The second-third subgraph to be verified connection line is the connection line between the subgraph coordinates to be verified of the second aggregation vector pair and the subgraph coordinates to be verified of the third aggregation vector pair, the pre-registered subgraph angle is the angle between the first-two pre-registered subgraph connection line and the second-three pre-registered subgraph connection line, the first-two pre-registered subgraph connection line is the connection line between the pre-registered subgraph coordinates of the first aggregation vector pair and the pre-registered subgraph coordinates of the second aggregation vector pair, and the second-three pre-registered subgraph connection line is the connection line between the pre-registered subgraph coordinates of the second aggregation vector pair and the pre-registered subgraph coordinates of the third aggregation vector pair.
[0247] like Fig.11 As shown, assuming that after screening by the distance constraint, the remaining SP32 corresponding to the to-be-verified aggregate feature vector participates in forming two aggregate vector pairs, namely [Qagg32, Qaggr1] and [Qagg32, Qaggr2]; the to-be-verified aggregate feature vector corresponding to SP44 participates in forming an aggregate vector pair, namely [Qagg44, Qaggr5]; the to-be-verified aggregate feature vector corresponding to SP14 participates in forming an aggregate vector pair, namely [Qagg14, Qaggr8]. There are four combinations of any three of the above four aggregate vector pairs, that is, there are four combinations of "three aggregate vector pairs". For each of them, it can be judged that the absolute value of the difference between the angle of the sub-graph to be verified and the angle of the pre-registered sub-graph is not greater than the angle threshold θ0, and then it is determined whether the three aggregate vector pairs in this combination meet the distance constraint. Taking the combination of [Qagg32, Qaggr1], [Qagg44, Qaggr5] and [Qagg14, Qaggr8] as an example, Fig.11As shown, the angle of one of the subgraphs to be verified in the combination is the angle θ between the line segment between SP32 and SP44 and the line segment between SP32 and SP14, and the angle of the pre-registered subgraph is the angle θr between the line segment between SPR1 and SPR5 and the line segment between SPR1 and SPR8; if |θ-θr|>θ0, it is determined that SP32, SP44, SP14, SPR1, SPR5 and SPR8 do not meet the distance constraint; otherwise, if |θ-θr|≤θ0, it is determined that the above subgraphs meet the angle constraint, and the three aggregation vector pairs [Qagg32, Qaggr1], [Qagg44, Qaggr5] and [Qagg14, Qaggr8] can be screened out. The determination method of the other three combinations is similar to this and will not be repeated.
[0248] Similarly, since any aggregate vector pair may form multiple combinations with other multiple aggregate vector pairs, and the judgment results of these combinations are not exactly the same, in order to avoid misjudgment, when any combination satisfies the angle constraint condition, it is determined that the two aggregate vector pairs participating in the combination both satisfy the angle constraint condition, and there is no need to check whether the other combinations formed by the three aggregate vector pairs meet the condition. Of course, in order to increase the screening strength of the angle constraint condition, a threshold value of the number of times the aggregate vector pair meets the condition can also be set. For example, if it is set to three times, any aggregate vector pair needs to meet the condition with at least the combination formed by the other three aggregate vector pairs before the aggregate vector pair is judged to meet the condition. This will not be repeated.
[0249] Each check of the common constraint condition requires an aggregate vector pair, that is, each aggregate vector pair can be checked by itself without combining. For example, for any aggregate vector pair, if the distance between the coordinates of the sub-graph to be verified and the coordinates of the pre-registered sub-graph of the aggregate vector pair is not greater than the distance threshold, and the angle between the line between the coordinates of the sub-graph to be verified of any aggregate vector pair and the coordinate origin of the surface texture image to be verified and the line between the coordinates of the pre-registered sub-graph of any aggregate vector pair and the coordinate origin of the corresponding pre-registered surface texture image is not greater than the angle threshold, then it is determined that the corresponding sub-graph of any aggregate vector pair meets the common constraint condition.
[0250] like Fig.12As shown, assuming that after screening by the distance constraint and the angle constraint, at least one aggregate vector pair may remain, taking the aggregate vector pair corresponding to SP44 and SPR5, [Qagg44, Qaggr5] as an example. At this time, the surface texture image to be verified can be used as a reference to determine the co-located subgraph of SPR5 in the image (i.e., SPR5' shown by the dotted line in the image), and then calculate whether the distance d between SP44 and SPR5' is greater than the distance threshold d0, and the angle θ between the line connecting SP44 and the origin and the line connecting SPR5' and the origin. If |d-dr|≤d0 and |θ-θr|≤θ0, it is determined that SP44 and SPR5 meet the above common constraints, and the aggregate vector pair [Qagg44, Qaggr5] can be screened out; otherwise (i.e., |d-dr|>d0 and / or |θ-θr|>θ0), it is determined that the two do not meet the above common constraints.
[0251] 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.
[0252] Through the above screening, some target aggregate vector pairs whose corresponding subgraphs satisfy the geometric consistency constraint conditions can be screened out from all aggregate vector pairs; further, at least a portion of the pre-registered surface texture images corresponding to the target aggregate vector pairs can be recalled. In one embodiment, for each pre-registered surface texture image corresponding to the target aggregate vector pair, the number of target aggregate vector pairs corresponding to each image can be determined first (if the pre-registered aggregate feature vector constituting a certain target aggregate vector pair is extracted from a pre-registered subgraph obtained by dividing a certain pre-registered surface texture image, then the pre-registered surface texture image corresponds to the target aggregate vector pair), and then the pre-registered surface texture images whose number of corresponding target aggregate vector pairs is greater than the number threshold are recalled (at this time, the number of recalled pre-registered surface texture images is not certain, and may be zero or any positive integer); or, the preset number of pre-registered surface texture images with the largest number of corresponding target aggregate vector pairs are recalled (at this time, the number of recalled pre-registered surface texture images is the preset number). At this point, the coarse screening stage in the verification process is completed, and the coarse screening result is the recalled at least a portion of the above-mentioned pre-registered surface texture images.
[0253] It can be seen from the above embodiments that the verification process of the present specification is in the coarse screening stage: for the aggregated feature vectors to be verified extracted from each sub-graph of the surface texture image to be verified, a group of pre-registered aggregated feature vectors with the highest similarity are screened out from the pre-registered aggregated feature vectors stored in the vector database to form an aggregated vector pair with the aggregated feature vector to be verified, and then, according to the position information of the sub-graph in the surface texture image, the target aggregated vector pair whose corresponding sub-graph satisfies the geometric consistency constraint condition is screened out from all the aggregated vector pairs, and at least a part of the corresponding pre-registered surface texture image is recalled.
[0254] The embodiments of this specification realize verification of the object to be verified by comparing the surface texture image to be verified with the pre-registered surface texture image. The above verification process is based on the following general rule: the surface texture image collected from the object can reflect the microscopic texture of the surface of the object. For any two identical surface texture images and any two sub-images respectively captured from the two images, if the positions of the two sub-images in the corresponding images are the same (or close), then the surface textures of the two sub-images are also the same (or close). This scheme characterizes the overall micro-texture of the sub-graph through the aggregated feature vector corresponding to the sub-graph. It can be understood that: for the aggregated feature vector to be verified collected from each sub-graph to be verified in the object to be verified and the pre-registered aggregated feature vector collected from each pre-registered sub-graph in at least one pre-registered object, if the object to be verified is not a pre-registered object, each pre-registered surface texture image will not match the surface texture image to be verified. Therefore, the sub-graph to be verified in the surface texture image to be verified and the pre-registered sub-graph in each pre-registered surface texture image are unlikely to satisfy the geometric consistency constraint (the condition is used to constrain the relative position of the sub-graph); in addition, if the object to be verified is a pre-registered object (that is, the two are the same object), the pre-registered surface texture image collected from the pre-registered object will match the surface texture image to be verified. Correspondingly, since the pre-registered surface texture image is divided to obtain multiple pre-registered sub-graphs and the surface texture image to be verified is intercepted to obtain multiple sub-graphs to be verified, the positions of the sub-graphs in the corresponding images are not exactly the same, so only the positions of the sub-graphs corresponding to some aggregated vector pairs satisfy the above general rules. It can be seen that among all the aggregated vector pairs before the coarse screening, only a small number of the subgraph positions corresponding to the aggregated vector pairs satisfy the above general rules.
[0255] In this regard, the embodiment of this specification uses vector similarity and geometric consistency constraints to screen all aggregate vector pairs in the coarse screening stage, which can preliminarily screen out a large number of aggregate vector pairs whose corresponding subgraphs do not satisfy the above general rules, thereby reducing the processing pressure in the subsequent fine screening stage and comparison stage, and greatly reducing the overall computational complexity of the verification process. Therefore, this solution not only reduces the computing power requirements of the verification process for the verification party (such as the buyer of the product), and reduces the difficulty of applying the solution; but also improves the verification efficiency because the computational complexity is reduced, which helps to achieve batch verification of a large number of items.
[0256] In addition, when selecting at least a part of the target key point vector pairs by comparing the key point feature vectors, for each key point feature vector to be verified that is obtained: a group of pre-registered key point feature vectors with the highest vector similarity with the key point feature vector to be verified are retrieved from the obtained pre-registered key point feature vectors, and the key point feature vector to be verified and each feature vector in the group of pre-registered key point feature vectors respectively constitute a key point vector pair; then, at least a part of the target key point vector pairs whose corresponding key points meet the geometric consistency constraint conditions are screened out from the key point vector pairs constituted by the obtained key point feature vectors to be verified. Among them, the retrieval method of the above-mentioned pre-registered key point feature vectors is similar to the retrieval method of the pre-registered aggregate feature vectors in the aforementioned step 1504, and can refer to the embodiment recorded in the aforementioned embodiment; the geometric consistency constraint conditions include distance constraint conditions, angle constraint conditions and / or common constraint conditions, and the specific inspection method of each condition can refer to the record of the aforementioned embodiment, which will not be repeated here.
[0257] In one embodiment, in addition to the aforementioned key point repetition rate, the overall similarity between the surface texture image to be verified and the pre-registered surface texture image can also be compared. For example, the image similarity between the surface texture image to be verified and the pre-registered surface texture image can be calculated, and the prerequisite for determining that any pre-registered surface texture image matches the surface texture image to be verified can include: the image similarity corresponding to the pre-registered surface texture image is not less than a similarity threshold.
[0258] 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.
[0259] 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.
[0260] An exemplary embodiment of the present specification also provides another surface texture image comparison method, which can be applied to a verification party client running in a verification party device, or to a server of a surface texture image comparison system. The method includes steps 2004-2008, wherein steps 2004-2006 belong to the fine screening (i.e., fine matching) stage, and step 2008 belongs to the comparison stage.
[0261] Step 2004, 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.
[0262] Each of the recalled pre-registered surface texture images is obtained through the processing of the coarse screening stage in the aforementioned embodiment.
[0263] 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.
[0264] 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.
[0265] 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.
[0266] 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.
[0267] 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.
[0268] Step 2006, 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.
[0269] 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.
[0270] like Fig.13 As 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.
[0271] 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.
[0272] 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.
[0273] 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. Fig.13 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.
[0274] 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.
[0275] 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.
[0276] 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.
[0277] 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.
[0278] Following the above embodiment, Fig.13 As shown, the feature vector of the key point to be verified corresponding to ROI1 participates in the formation 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 formation 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 judged 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. Taking the combination of [Qroi1, Qroir1] and [Qroi2, Qroir5] as an example, the distance of the key points 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 points 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.
[0279] 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.
[0280] 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.
[0281] like Fig.14As 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. Fig.14 As 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.
[0282] 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.
[0283] 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.
[0284] like Fig.15 As 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.
[0285] 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.
[0286] 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.
[0287] Step 2008: 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.
[0288] 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.
[0289] 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.
[0290] 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.
[0291] 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.
[0292] 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.
[0293] 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.
[0294] 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.
[0295] 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.
[0296] 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.
[0297] 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.
[0298] 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.
[0299] Fig.16 is a schematic structural diagram of a device provided by an exemplary embodiment. Fig.16 At the hardware level, the device includes a processor 1602, an internal bus 1604, a network interface 1606, a memory 1608, and a non-volatile memory 1610, 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 1602 reading the corresponding computer program from the non-volatile memory 1610 into the memory 1608 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.
[0300] Please refer to Fig.17 , the pixel accuracy determination device can be applied to Fig.16The device shown in the figure can realize the technical solution of this specification. The pixel accuracy determination device can include: an acquisition module 1702, a similarity calculation module 1704 and a determination module 1706. Among them,
[0301] The acquisition module 1702 is configured to acquire, for M target objects made of the same material, surface texture images of each target object captured at N candidate pixel accuracies, where M and N are positive integers greater than 1.
[0302] The similarity calculation module 1704 is configured to, for each of the N candidate pixel precisities: perform similarity calculation on the surface texture images collected between every two target objects in the M target objects at the corresponding candidate pixel precision to obtain a set of initial similarities, and perform similarity aggregation on the set of initial similarities to obtain a comprehensive similarity corresponding to the corresponding candidate pixel precision.
[0303] The determination module 1706 is configured to determine the change rate of the comprehensive similarities corresponding to the N candidate pixel accuracies in order from small to large corresponding pixel accuracies, and determine the candidate pixel accuracy corresponding to the first mutation of the change rate as the target pixel accuracy suitable for surface texture image acquisition of the object made of the same material.
[0304] Optionally, the acquisition module 1702 is specifically used to: respectively acquire the surface texture image of each target object collected at the minimum candidate pixel precision among the N candidate pixel precisions; downsample the surface texture image of each target object collected at the minimum candidate pixel precision to obtain the surface texture images of each target object collected at N-1 candidate pixel precisions different from the minimum candidate pixel precision.
[0305] Optionally, the similarity calculation module 1704 is specifically used to: use an image quality assessment algorithm to perform similarity calculation on image quality evaluation indicators of the surface texture images of each two target objects collected at the corresponding candidate pixel precision to obtain the set of initial similarities; and / or, respectively perform feature extraction on the surface texture images of the M target objects collected at the corresponding candidate pixel precision, and convert the extracted image features into image feature vectors; and, respectively calculate the similarity between the image feature vectors of the surface texture images of each two target objects collected at the corresponding candidate pixel precision to obtain the set of initial similarities.
[0306] Optionally, the comprehensive similarity corresponding to the corresponding candidate pixel precision includes any one of the following statistics: an average value of the set of initial similarities, a median of the set of initial similarities, and a maximum value of the set of initial similarities.
[0307] Optionally, the determination module 1706 is specifically used to: calculate the sum of square errors of the comprehensive similarity corresponding to each candidate pixel precision; generate a curve of the sum of square errors of the comprehensive similarity changing with the candidate pixel precision, and determine the candidate pixel precision corresponding to the first inflection point in the change curve as the target pixel precision.
[0308] Optionally, the determination module 1706 is specifically used to: calculate the second-order derivative of the comprehensive similarity sequence to obtain the second-order derivative sequence, wherein the comprehensive similarities corresponding to the N candidate pixel precisions are composed in ascending order of the corresponding pixel precisions; and determine the candidate pixel precision corresponding to the first second-order derivative in the second-order derivative sequence that is greater than a preset threshold as the target pixel precision.
[0309] Please refer to Fig.18 The device for extracting surface texture features of an object can be applied to Fig.16 The device shown in the figure can realize the technical solution of this specification. The device for extracting the surface texture features of an object can include: a pixel accuracy determination module 1802, an image acquisition module 1804 and a feature extraction module 1806. Among them,
[0310] The pixel accuracy determination module 1802 is configured to determine a target pixel accuracy according to the preparation material used for the object to be processed, and the target pixel accuracy is determined according to the aforementioned pixel accuracy determination method.
[0311] The image acquisition module 1804 is configured to acquire the surface texture image of the object to be processed according to the target pixel accuracy.
[0312] The feature extraction module 1806 is configured to extract features from the surface texture image of the object to be processed to obtain surface texture feature information of the object to be processed.
[0313] Please refer to Fig.19 , the registration device of the surface texture features of an object can be applied to Fig.16 The device shown in the figure can realize the technical solution of this specification. The device for registering the surface texture features of an object can include: a feature acquisition module 1902 and a storage module 1904.
[0314] The feature acquisition module 1902 is configured to acquire surface texture feature information of the object to be registered, wherein the surface texture feature information is extracted according to the aforementioned object surface texture feature extraction method.
[0315] The storage module 1904 is configured to store the surface texture feature information of the object to be registered in a database, so as to use the surface texture feature information as a verification standard corresponding to the object to be registered.
[0316] Please refer to Fig. 20 , the verification device of the surface texture characteristics of an object can be applied to Fig.16 The device shown in the figure can realize the technical solution of this specification. The device for verifying the surface texture characteristics of an object can include: an acquisition module 2002 and a verification module 2004. Among them,
[0317] The acquisition module 2002 is configured to acquire surface texture feature information of the object to be verified, wherein the surface texture feature information is extracted according to the aforementioned object surface texture feature extraction method.
[0318] The verification module 2004 is configured to verify whether the surface texture feature information of the object to be verified matches the surface texture feature information of the pre-registered authentic object.
[0319] 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.
[0320] 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.
[0321] 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 method for determining pixel accuracy, comprising: For M target objects made of the same material, a surface texture image of each target object collected at N candidate pixel accuracies is obtained, where M and N are positive integers greater than 1; For each of the N candidate pixel accuracies: performing similarity calculation on the surface texture images of every two target objects in the M target objects that are collected at the corresponding candidate pixel accuracies to obtain a set of initial similarities, and performing similarity aggregation on the set of initial similarities to obtain a comprehensive similarity corresponding to the corresponding candidate pixel accuracies; According to the order of corresponding pixel precision from small to large, the change rate of the comprehensive similarity corresponding to the N candidate pixel precisions is determined, and the candidate pixel precision corresponding to the first mutation of the change rate is determined as the target pixel precision suitable for surface texture image acquisition of the object made of the same material.
2. According to the method of claim 1, the step of respectively acquiring the surface texture image of each target object captured at N candidate pixel accuracies comprises: Respectively obtain a surface texture image of each target object captured at the minimum candidate pixel precision among the N candidate pixel precisions; Down-sampling processing is performed on the surface texture image of each target object collected at the minimum candidate pixel precision to obtain surface texture images of each target object collected at N-1 candidate pixel precisions different from the minimum candidate pixel precision.
3. The method according to claim 1, wherein the surface texture images of every two target objects among the M target objects collected at the corresponding candidate pixel precision are subjected to similarity calculation to obtain a set of initial similarities, comprising: Using an image quality assessment algorithm, similarity calculation is performed on image quality assessment indicators of surface texture images of each of the two target objects captured at corresponding candidate pixel accuracies to obtain the set of initial similarities; and / or, Feature extraction is performed on the surface texture images of the M target objects collected at the corresponding candidate pixel precision, and the extracted image features are converted into image feature vectors; and the similarity between the image feature vectors of the surface texture images of every two target objects collected at the corresponding candidate pixel precision is calculated to obtain the set of initial similarities.
4. According to the method of claim 1, the comprehensive similarity corresponding to the corresponding candidate pixel precision includes any of the following statistics: an average value of the set of initial similarities, a median of the set of initial similarities, and a maximum value of the set of initial similarities.
5. The method according to claim 1, wherein determining the change rate of the comprehensive similarities corresponding to the N candidate pixel accuracies in the order of corresponding pixel accuracies from small to large, and determining the candidate pixel accuracies corresponding to the first mutation of the change rate as the target pixel accuracies suitable for surface texture image acquisition of the objects made of the same material, comprises: Calculate the sum of square errors of the comprehensive similarity corresponding to each candidate pixel precision; A curve of the sum of square errors of the comprehensive similarity varying with the candidate pixel precision is generated, and the candidate pixel precision corresponding to the first inflection point in the variation curve is determined as the target pixel precision.
6. The method according to claim 1, wherein determining the change rate of the comprehensive similarities corresponding to the N candidate pixel accuracies in the order of corresponding pixel accuracies from small to large, and determining the candidate pixel accuracies corresponding to the first mutation of the change rate as the target pixel accuracies suitable for surface texture image acquisition of the objects made of the same material, comprises: Calculating the second-order derivative of the comprehensive similarity sequence to obtain a second-order derivative sequence, wherein the comprehensive similarity sequence is composed of the comprehensive similarities corresponding to the N candidate pixel precisons in ascending order of the corresponding pixel precisons; The candidate pixel precision corresponding to the first second-order derivative in the second-order derivative sequence that is greater than a preset threshold is determined as the target pixel precision.
7. A method for extracting surface texture features of an object, comprising: Determine a target pixel accuracy according to the preparation material used for the article to be processed, wherein the target pixel accuracy is determined according to the method described in any one of claims 1 to 6; Acquire the surface texture image of the object to be processed according to the target pixel accuracy; Feature extraction is performed on the surface texture image of the object to be processed to obtain surface texture feature information of the object to be processed.
8. A method for registering surface texture features of an object, comprising: Acquire surface texture feature information of the object to be registered, wherein the surface texture feature information is extracted according to the method of claim 7; The surface texture feature information of the object to be registered is stored in a database, so that the surface texture feature information is used as a verification standard corresponding to the object to be registered.
9. A method for verifying surface texture features of an object, comprising: Acquire surface texture feature information of the object to be verified, wherein the surface texture feature information is extracted according to the method of claim 7; Verify whether the surface texture feature information of the object to be verified matches the surface texture feature information of a pre-registered authentic object.
10. An electronic device, comprising: 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 9 by executing the executable instructions.
11. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.
12. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Cited By
Children autism spectrum disorder engraving behavior recognition system based on video images
CN122392137A
