Method, device and equipment for preventing package tampering based on identification location, storage medium

By setting QR code labels on the surface of concrete samples and constructing a coordinate system using random pressing areas and target feature points, the offset angle can be determined, thus eliminating the risk of concrete samples being switched during the testing process and improving the reliability and accuracy of identification.

CN121684966BActive Publication Date: 2026-05-01ZHUHAI XINHUATONG SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI XINHUATONG SOFTWARE CO LTD
Filing Date
2026-02-10
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, there is a risk that concrete samples may be switched during the testing process, and existing anti-counterfeiting labels and image processing technologies cannot guarantee the reliability of identification.

Method used

By setting QR code labels on the surface of concrete samples, a coordinate system is constructed using random pressing areas and target feature points to determine the offset angle of the positioning mark, and image comparison is used to identify anti-tampering.

Benefits of technology

It improves the reliability of anti-spoofing identification by combining randomness and texture features, reducing the possibility of forgery and ensuring the accuracy of identification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121684966B_ABST
    Figure CN121684966B_ABST
Patent Text Reader

Abstract

The application provides an anti-fraud identification method and device based on an identified position, equipment and a storage medium. The method comprises the following steps: obtaining a first image after a concrete sample is placed in a two-dimensional code label; obtaining a second image after the two-dimensional code label is pressed according to a randomly determined pressing area; selecting a target feature point from a plurality of first texture feature points and constructing a target coordinate system; and determining a first offset angle of each positioning mark. When a third image sent by an inspection terminal is obtained, the target coordinate system is constructed based on the target feature point, the second offset angle of each positioning mark is determined, and an anti-fraud identification result is determined based on the corresponding plurality of first offset angles and second offset angles. According to the technical scheme of the embodiment of the application, the two-dimensional code label can be longitudinally offset by the randomly determined pressing area, the coordinate system is constructed based on the randomly selected target feature point to obtain the offset angle as the identification information, and the reliability of the anti-fraud identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Anti-spoofing identification method, device, equipment, and storage medium based on identifier location Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for anti-tampering identification based on identifier location. Background Technology

[0002] In the construction industry, concrete delivered by mixer trucks needs to be poured within a short time to prevent it from hardening. The industry typically takes samples from the delivered concrete and sends them to testing institutions for testing several days later. Since a large amount of concrete has already been poured into the building, if a concrete sample fails the test, it will result in significant economic losses. This leads to the risk that inferior concrete samples may be switched during the testing process.

[0003] To ensure the authenticity of concrete samples, anti-counterfeiting labels are usually added to the concrete samples during sampling, or image processing technology is used to identify the texture of the concrete sample surface. The samples are photographed for evidence before being sent for testing, and photographed again during testing for verification. Image comparison technology is used to determine whether the concrete samples have been switched.

[0004] However, anti-counterfeiting labels are usually just tags, which are easily counterfeited in counterfeit products. The concrete was not yet solidified when sampled, and the surface texture may have changed during the solidification process, making the reliability of anti-tampering identification unreliable. Summary of the Invention

[0005] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a method, apparatus, device, and storage medium for anti-tampering identification based on the identifier position. This method can randomly change the pose of the QR code label by pressing it, and use the randomly generated offset angle as anti-tampering identification information, thereby improving the reliability of anti-tampering identification.

[0006] In a first aspect, embodiments of the present invention provide a method for preventing data tampering based on identifier location, applied to a server, wherein the server is communicatively connected to a sampling terminal and an inspection terminal, and the method includes:

[0007] Acquire a first image of a concrete sample sent by the sampling terminal, wherein a QR code label is provided on the surface of the concrete sample, and the QR code label includes multiple positioning marks;

[0008] Based on the first image, a pressing area is determined in the QR code label and sent to the sampling terminal. A target feature point is randomly selected from a plurality of first texture feature points, wherein the first texture feature point is located in an area outside the QR code label.

[0009] The second image sent by the sampling terminal is acquired, a target coordinate system is constructed in the second image based on the target feature points, and a first offset angle of each of the positioning marks is determined based on the target coordinate system. The second image is acquired after the QR code label is pressed based on the pressing area, and the first offset angle is used to characterize the plane angle between the same positioning mark in the second image and the first image.

[0010] When the third image sent by the inspection terminal is obtained, the target coordinate system is constructed in the third image based on the target feature points, the second offset angle of each of the positioning marks is determined based on the target coordinate system, and the anti-tampering identification result is determined based on the corresponding multiple sets of first offset angles and second offset angles. The second offset angle is used to characterize the plane angle between the same positioning mark in the third image and the first image.

[0011] According to some embodiments of the present invention, before constructing the target coordinate system in the third image based on the target feature points, the method further includes:

[0012] Based on the third image, multiple second texture feature points are determined in the area outside the QR code label;

[0013] The target feature point is determined among multiple second texture feature points by comparing texture features;

[0014] Alternatively, when there is no second texture feature point with the same texture feature as the target feature point, multiple first texture feature points and corresponding texture lines are obtained, wherein the texture lines are line segments formed by the first texture feature points and the target feature point.

[0015] At least two reference texture feature points are determined among a plurality of second texture feature points, wherein the reference texture feature points have the same texture features as the first texture feature points;

[0016] The texture lines corresponding to the reference texture feature points are applied to the third image, and the intersection of multiple texture lines or their corresponding extensions is determined as the target feature points.

[0017] According to some embodiments of the present invention, after determining the intersection of multiple texture lines or their corresponding extensions as the target feature points, the method further includes:

[0018] Based on any of the reference texture feature points, determine the target distance between the target feature point and the target feature point, and determine the target ratio of the target distance to the length of the corresponding texture line;

[0019] The third image is magnified or reduced based on the average of all the target ratios.

[0020] According to some embodiments of the present invention, determining a first offset angle of each of the positioning markers based on the target coordinate system, or determining a second offset angle of each of the positioning markers based on the target coordinate system, includes:

[0021] The target image is converted into an initial grayscale image, and the initial grayscale image is then subjected to adaptive histogram equalization and Gaussian blurring in sequence to obtain an enhanced grayscale image, wherein the target image is either the second image or the third image;

[0022] Based on the target coordinate system and any of the positioning marks, the coordinates of the mark corner points corresponding to the four vertices are determined in the enhanced grayscale image. Based on the mark corner point coordinates, the target offset angle of the corresponding positioning mark is determined, wherein the target offset angle determined based on the second image is the first offset angle, and the target offset angle determined based on the third image is the second offset angle.

[0023] According to some embodiments of the present invention, the coordinates of the plurality of marker corner points include left top coordinates, left bottom coordinates, right top coordinates, and right bottom coordinates. Determining the target offset angle of the corresponding positioning marker based on the marker corner point coordinates includes:

[0024] The first left-side vector is determined based on the x-coordinate of the bottom left coordinate and the x-coordinate of the top left coordinate.

[0025] The second left-side vector is determined based on the ordinate of the bottom left coordinate and the ordinate of the top left coordinate.

[0026] The first right-side vector is determined based on the x-coordinate of the bottom right coordinate and the x-coordinate of the top right coordinate.

[0027] The second right-side vector is determined based on the ordinate of the bottom right coordinate and the ordinate of the top right coordinate.

[0028] The average value of the first left side vector and the first right side vector is determined as the horizontal axis side vector, and the average value of the second left side vector and the second right side vector is determined as the vertical axis side vector.

[0029] The target offset angle is obtained by calculating the arctangent of the horizontal coordinate side vector and the vertical coordinate side vector.

[0030] According to some embodiments of the present invention, after calculating the target offset angle based on the arctangent of the horizontal coordinate edge vector and the vertical coordinate edge vector, the method further includes:

[0031] In the third image, a target area extends from the outside of the QR code label based on a preset extension length, wherein the target area surrounds the QR code label.

[0032] A quadratic surface is fitted based on the target region, and the normal vector perturbation at the center of the QR code label is determined based on the quadratic surface.

[0033] The second offset angle is corrected based on the normal vector perturbation and the preset empirical coefficient.

[0034] According to some embodiments of the present invention, selecting one target feature point from a plurality of first texture feature points includes:

[0035] Based on the first image, texture recognition is performed to obtain multiple candidate texture regions. The geometric center of each candidate texture region is determined as the corresponding first texture feature point. Each candidate texture region corresponds to a texture type, and each texture type has a preset priority.

[0036] In at least one of the candidate texture regions with the highest priority, a target texture region is selected, and the first texture feature point corresponding to the target texture region is determined as the target feature point.

[0037] In a second aspect, embodiments of the present invention provide an anti-spoofing identification device based on an identifier location, including at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enables the at least one control processor to perform the anti-spoofing identification method based on an identifier location as described in the first aspect above.

[0038] Thirdly, embodiments of the present invention provide an electronic device including an anti-tampering identification device based on the identifier location as described in the second aspect above.

[0039] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions for performing the anti-spoofing identification method based on identifier location as described in the first aspect above.

[0040] The anti-tampering identification method based on identifier location according to embodiments of the present invention has at least the following beneficial effects: acquiring a first image of a concrete sample sent by the sampling terminal, wherein a QR code label is provided on the surface of the concrete sample, and the QR code label includes multiple positioning markers; based on the first image, determining a pressing area in the QR code label and sending it to the sampling terminal, and randomly selecting a target feature point from multiple first texture feature points, wherein the first texture feature point is located in an area outside the QR code label; acquiring a second image sent by the sampling terminal, constructing a target coordinate system in the second image based on the target feature point, and determining various positioning markers based on the target coordinate system. The first offset angle of the positioning mark, wherein the second image is obtained after pressing the QR code label based on the pressing area, the first offset angle is used to characterize the plane angle between the same positioning mark and the first image; when the third image sent by the verification terminal is obtained, the target coordinate system is constructed in the third image based on the target feature points, the second offset angle of each positioning mark is determined based on the target coordinate system, and the anti-spoofing identification result is determined based on the corresponding multiple sets of first offset angles and second offset angles, wherein the second offset angle is used to characterize the plane angle between the same positioning mark and the first image. According to the technical solution of the embodiment of the present invention, the first image can be used as a reference, and the QR code label can be vertically offset by a randomly determined pressing area, and then a coordinate system can be constructed based on randomly selected target feature points to obtain the first offset angle, which can effectively improve the randomness of the identification information and improve the reliability of anti-spoofing identification. Attached Figure Description

[0041] Figure 1 is a schematic diagram of a principle provided by an embodiment of the present invention;

[0042] Figure 2 is a flowchart of an anti-spoofing identification method based on identifier location provided in another embodiment of the present invention;

[0043] Figure 3 is a structural diagram of an anti-tampering identification device based on the identifier location provided in another embodiment of the present invention. Detailed Implementation

[0044] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0045] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0046] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0047] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0048] This invention provides a method, apparatus, device, and storage medium for anti-tampering identification based on identifier location. The method includes: acquiring a first image of a concrete sample sent by a sampling terminal, wherein a QR code label is provided on the surface of the concrete sample, and the QR code label includes multiple positioning markers; determining a pressing area in the QR code label based on the first image and sending it to the sampling terminal; selecting a target feature point from multiple first texture feature points, wherein the first texture feature point is located outside the QR code label; acquiring a second image sent by the sampling terminal; and constructing a [structure / method] based on the target feature point in the second image. A target coordinate system is established, and a first offset angle is determined for each positioning marker based on the target coordinate system. The second image is acquired after pressing the QR code label based on the pressing area. The first offset angle represents the plane angle between the same positioning marker and the first image. When a third image sent by the verification terminal is acquired, a target coordinate system is constructed in the third image based on target feature points. A second offset angle is determined for each positioning marker based on the target coordinate system. The anti-tampering identification result is determined based on multiple sets of corresponding first and second offset angles. The second offset angle represents the plane angle between the same positioning marker and the first image. According to the technical solution of this embodiment, the first image can be used as a reference, and the QR code label can be vertically offset by a randomly determined pressing area. Then, a coordinate system is constructed based on randomly selected target feature points to obtain the first offset angle, which can effectively improve the randomness of the identification information and improve the reliability of anti-tampering identification.

[0049] The technical solution of the embodiment of the present invention will be further described below based on the accompanying drawings.

[0050] Referring to FIG. 2, FIG. 2 is a flowchart of a method for preventing package substitution recognition based on the identification position provided by an embodiment of the present invention. The method for preventing package substitution recognition based on the identification position includes but is not limited to the following steps:

[0051] S10. Obtain a first image of the concrete sample sent by the sampling terminal. A two-dimensional code label is provided on the surface of the concrete sample, and the two-dimensional code label includes a plurality of positioning marks.

[0052] It should be noted that as shown in FIG. 1, after the sampling of the concrete sample 10 is completed, the sampling APP can be opened on the sampling terminal to enter the photographing interface. In the photographing interface, determine the first target frame corresponding to the concrete sample 10, randomly select a position in the first target frame as the second target frame, and prompt the insertion position of the two-dimensional code label 20 through the second target frame. After inserting the two-dimensional code label 20, obtain the first image of the surface of the concrete sample 10 through the sampling terminal. There is a "hui" character pattern at the upper left, upper right, and lower left of the two-dimensional code label 20, and this embodiment uses this as the positioning mark 21.

[0053] S20. Based on the first image, determine the pressing area in the two-dimensional code label and send it to the sampling terminal. Arbitrarily select a target feature point from a plurality of first texture feature points, where the first texture feature points are located in the area outside the two-dimensional code label.

[0054] It should be noted that as shown in FIG. 1, after the two-dimensional code label 20 is first placed, it is flush with the surface of the concrete sample 10. In this embodiment, a pressing area 22 is generated in any area of the two-dimensional code label 22, and the pressing area 22 is used to prompt the sampling personnel to press the two-dimensional code label 20. At this time, the concrete sample 10 is not completely solidified, so that the two-dimensional code label 20 can generate a certain inclination on the surface of the concrete sample 10.

[0055] It should be noted that the first texture feature point is the texture feature on the surface of the concrete sample. The texture feature can be surface undulation, air holes or aggregate texture, etc. As shown in FIG. 1, there is an irregular air hole 11 on the surface of the concrete sample 10, and the geometric center point of the air hole 11 is used as the first texture feature point.

[0056] It should be noted that the surface of the concrete sample has a number of primary texture feature points. In this embodiment, one of these is selected as the target feature point for subsequent coordinate system construction and related judgment. This process is completed by the server, and the relevant personnel cannot know which texture feature was selected. Therefore, the subsequent target coordinate system has strong randomness and is invisible. The surface texture of concrete cannot be faked. In this embodiment, a randomly tilted QR code label formed by randomly pressing the area is superimposed with the randomly determined target feature point on the outside, which can effectively improve the reliability of anti-tampering identification.

[0057] S30, acquire the second image sent by the sampling terminal, construct a target coordinate system in the second image based on the target feature points, and determine the first offset angle of each positioning mark based on the target coordinate system. The second image is acquired after pressing the QR code label based on the pressing area, and the first offset angle is used to characterize the plane angle between the same positioning mark in the second image and the first image.

[0058] It should be noted that the second image was taken after the QR code label was pressed during the sampling stage, and the shooting angle was the same as that of the first image. Therefore, the concrete sample is consistent with the one in the first image, and the target feature points in the first image can be directly used without comparison and confirmation. For example, the target feature points can be marked in the first image and then located in the same position in the second image.

[0059] It should be noted that, as shown in Figure 1, in this embodiment, a two-dimensional rectangular coordinate system is constructed with the target feature point as the origin of the target coordinate system. The coordinate axes of the target coordinate system are parallel to the sides of the QR code label 20 in the first image. In this embodiment, the first offset angle is determined by the coordinates of the four corner points of the same positioning mark 21. When the QR code label 20 is not pressed, for example, in the state of the first image, for the same positioning mark 21, the horizontal coordinate of the top left corner is the same as the horizontal coordinate of the bottom left corner, and the vertical coordinate of the top left corner is the same as the vertical coordinate of the top right corner, and so on. When the QR code label 20 is pressed, for example, in the state of the second image, the horizontal coordinate of the top left corner is no longer the same as the horizontal coordinate of the bottom left corner because of the tilt, and other coordinates are similar, as shown in the lower part of Figure 1. If the positioning mark 21 is a straight line in the left-viewing direction of the first image, it will be a diagonal line in the left-viewing direction of the second image, thus forming a first offset angle. The angle α of the first offset angle is randomly determined according to the pressing force, so it cannot be predicted in advance, reducing the possibility of counterfeiting and improving the reliability of anti-tampering identification.

[0060] It is worth noting that the first offset angle in this embodiment is for a single positioning mark. Different positioning marks will have different offsets when pressed. Therefore, this embodiment can obtain three first offset angles, which are not equal to each other. The same applies to the subsequent second offset angle. By comparing multiple sets of offset angles, misidentification caused by a set of offset angles being occasionally equal can be avoided, thereby improving the reliability of anti-tampering identification.

[0061] S40, when the third image sent by the inspection terminal is acquired, a target coordinate system is constructed in the third image based on the target feature points, the second offset angle of each positioning mark is determined based on the target coordinate system, and the anti-spoofing identification result is determined based on the corresponding multiple sets of first offset angles and second offset angles. The second offset angle is used to characterize the plane angle between the same positioning mark and the first image.

[0062] It should be noted that the testing terminal is the terminal that takes pictures when testing concrete samples. The same APP can be deployed on the sampling terminal and the testing terminal. When taking pictures, prompt boxes are used to ensure that the shooting angle and distance are the same. For example, prompt boxes are displayed on the operation interface of both terminals. The image is automatically taken after the edge of the concrete sample overlaps with the edge of the prompt box. The second and third images are ensured to have the same image ratio, ensuring consistency in subsequent comparisons.

[0063] It should be noted that the texture features of the target feature points are known. The target feature points can be located in the third image by texture comparison. The method of constructing the target coordinate system is the same as in the second image, so as to obtain a coordinate system with the same position. If the concrete sample has not been tampered with, the coordinates of each positioning mark are the same as in the second image, and the first offset angle and the second offset angle of the same positioning mark are the same.

[0064] It should be noted that this embodiment compares the offset angles for each positioning marker, thus obtaining three sets of first offset angles and second offset angles. When the first offset angles and second offset angles in each set are the same, it can be determined that the QR code tags in the second image and the third image have the same pose. According to the description of the above embodiment, the pressing position is random, and the pressing depth is determined according to the random pressing force of the sampling personnel. Therefore, the pose of the QR code tag is difficult to be forged. When the offset angles of the same positioning marker are the same, it can be determined that the anti-tampering identification result is successful. Otherwise, if any set of offset angles is different, it can be determined that the identification is unsuccessful.

[0065] In another embodiment, before constructing the target coordinate system in the third image based on the target feature points in step S40, the following steps are included, but are not limited to:

[0066] S411, based on the third image, determine multiple second texture feature points in the area outside the QR code label;

[0067] S412, determine the target feature point among multiple second texture feature points by comparing texture features;

[0068] S413, when there is no second texture feature point with the same texture feature as the target feature point, obtain multiple first texture feature points and corresponding texture lines, wherein the texture lines are line segments formed by the first texture feature points and the target feature point;

[0069] S414, at least two reference texture feature points are determined among a plurality of second texture feature points, wherein the reference texture feature points have the same texture features as first texture feature points;

[0070] S415, apply the texture connection lines corresponding to the reference texture feature points to the third image, and determine the intersection of multiple texture connection lines or their corresponding extensions as the target feature points.

[0071] It should be noted that the third image was taken during the inspection. The inspection and sampling are usually several tens of days apart. Even if the concrete sample is not tampered with, it will produce subtle texture changes during the solidification process. Therefore, in this embodiment, after obtaining the third image, texture recognition is first performed in the area outside the QR code label to obtain multiple second texture feature points. If the concrete sample is consistent with the one submitted for inspection, the second texture feature points are actually one-to-one with the first texture feature points. The target feature point is determined from the first texture feature points. Therefore, the texture features of the second texture feature points at the same position can be compared with those of the target feature point. If the two are the same, the target feature point can be directly located.

[0072] It should be noted that if there are no second texture feature points with the same texture features as the target feature point, the texture features may undergo slight changes during the solidification process. Since the surface texture features are randomly generated during the solidification process and cannot be copied, if there are many first texture feature points, at least two unchanged second texture feature points can be identified as reference texture feature points. If there are no reference texture feature points, the anti-spoofing identification result can be directly determined as failing.

[0073] It should be noted that the positions of the first texture feature point and the target feature point are fixed. Therefore, in the second image, a texture line can be obtained by connecting the first texture feature point and the target feature point. Since two straight lines will only have one intersection point, the target feature point can be determined by taking the intersection point of the two texture lines.

[0074] It should be noted that after determining the target feature points, the texture features of the target feature points can also be compared with those in the second image. Although the texture features in the two images may change, there will still be a certain similarity. It can be judged by a similarity threshold to determine that the texture features in the area where the target feature points of the third image are located have changed slightly rather than disappeared. If the texture disappears, it can be determined that there has been a substitution.

[0075] In addition, in one embodiment, the first offset angle of each positioning mark is determined based on the target coordinate system, or the second offset angle of each positioning mark is determined based on the target coordinate system. Specifically, it includes but is not limited to the following steps:

[0076] S51, convert the target image into an initial grayscale image, and perform adaptive histogram equalization and Gaussian blur on the initial grayscale image in sequence to obtain an enhanced grayscale image, where the target image is the second image or the third image;

[0077] S52, based on the target coordinate system and any positioning mark, determine the coordinate of the mark corner point corresponding to each of the four top corners in the enhanced grayscale image, and determine the target offset angle of the corresponding positioning mark based on the coordinate of the mark corner point. Among them, the target offset angle determined based on the second image is the first offset angle, and the target offset angle determined based on the third image is the second offset angle.

[0078] It should be noted that the method for determining the offset angle for the second image and the third image is the same. For the convenience of describing this embodiment, the target image is used to refer to the second image or the third image.

[0079] It should be noted that the obtained target image is an RGB image. First, the target image is converted into a grayscale image, and then an enhanced grayscale image is obtained through adaptive histogram equalization and Gaussian blur to improve the detectability of the QR code edge under low light or a cluttered background of concrete samples.

[0080] It should be noted that as shown in FIG. 1, the positioning mark 21 is a "hui" - shaped pattern. Taking one positioning mark 21 as an example, in this embodiment, the coordinate of the mark corner point of the four top corners can be obtained by performing QR code detection through ZBar or the QRCodeDetector of OpenCV, and they are respectively the upper - left coordinate, the lower - left coordinate, the upper - right coordinate, and the lower - right coordinate. According to the description of the above embodiment, after the QR code label 20 is pressed, the horizontal and vertical coordinates of each point of the same positioning mark 21 change. For example, the abscissa of the upper - left coordinate is no longer equal to the abscissa of the lower - left coordinate. Therefore, the displacement amount can be determined according to the difference in the coordinate of the mark corner point, and the target offset angle can be determined by constructing a triangle through the displacement amount.

[0081] In another embodiment, the coordinates of multiple marker corner points include the coordinates of the top left, the bottom left, the top right, and the bottom right. Step S52 specifically includes, but is not limited to, the following steps:

[0082] S521, determine the first left side vector based on the x-coordinate of the bottom left coordinate and the x-coordinate of the top left coordinate;

[0083] S522, determine the second left side vector based on the ordinate of the bottom left coordinate and the ordinate of the top left coordinate;

[0084] S523, determine the first right-side vector based on the x-coordinate of the bottom right coordinate and the x-coordinate of the top right coordinate;

[0085] S524, determine the second right-side vector based on the ordinate of the bottom right coordinate and the ordinate of the top right coordinate;

[0086] S525, the average value of the first left side vector and the first right side vector is determined as the horizontal axis side vector, and the average value of the second left side vector and the second right side vector is determined as the vertical axis side vector.

[0087] S526, the target offset angle is obtained by calculating the arctangent of the horizontal and vertical coordinate side vectors.

[0088] It should be noted that this embodiment uses the target offset angle of one positioning marker as an example for illustration. The same operation can be performed when there are three positioning markers.

[0089] It should be noted that the coordinates of the corner points of the positioning marker include the coordinates of the top left, bottom left, top right, and bottom right, and each coordinate includes both an x-coordinate and a y-coordinate. The longitudinal tilt is mainly manifested in the left and right side plates no longer being parallel to the coordinate axes. In this embodiment, the angle between the marker and the Y-axis is used as the target offset angle. The target offset angle is determined by calculating the average longitudinal side vector, thus eliminating lateral rotation interference.

[0090] For example, the top left coordinates are (TL.x, TL.y), the bottom left coordinates are (BL.x, BL.y), the top right coordinates are (TR.x, TR.y), and the bottom right coordinates are (BR.x, BR.y). Then, the first left side vector left_vec[0] = BL.x - TL.x, the second left side vector left_vec[1] = BL.y - TL.y, the first right side vector right_vec[0] = BR.x - TR.x, and the second right side vector right_vec[1] = BR.y - TR.y. The formula for calculating the horizontal coordinate side vector is dx = (left_vec[0] + right_vec[0]) / 2; the formula for calculating the vertical coordinate side vector is dy = (left_vec[1] + right_vec[1]) / 2. Therefore, the target offset angle is obtained as α = atan2(dx / dy), where atan2() is the arctangent function. Compared with the standard atan function(), atan2() can provide a complete angle result in the range of -π to π without the need for additional logic to determine the quadrant.

[0091] In another embodiment, after step S526 is performed, the following steps are included, but are not limited to:

[0092] S527, in the third image, the target area extends from the outside of the QR code label based on a preset extension length, wherein the target area surrounds the QR code label.

[0093] S528, fit a quadratic surface based on the target region, and determine the normal vector perturbation at the center of the QR code label based on the quadratic surface;

[0094] S529, the second offset angle is corrected based on the normal vector perturbation and the preset empirical coefficient.

[0095] It should be noted that the concrete surface may have slight unevenness, causing the QR code label to shift at an angle after solidification, thus affecting the accuracy of the offset angle judgment. This embodiment extends the target area outside the QR code label by a preset length, for example, a 1cm area outside the QR code label, to obtain a U-shaped target area, and then fits a quadratic surface into the target area.

[0096] For example, the fitted quadratic surface is z = ax² + by² + cxy + dx + ey + f, where a is the curvature coefficient in the X-axis direction, representing the curvature of the surface along the X-axis; b is the curvature coefficient in the Y-axis direction, representing the curvature of the surface along the Y-axis; c is the cross curvature coefficient, representing the twisting of the surface in the XY diagonal direction; d is the tilt coefficient in the X-axis direction, representing the overall tilt along the X-axis; e is the tilt coefficient in the Y-axis direction, representing the overall tilt along the Y-axis; and f is the height reference, representing the height offset of the surface from the origin. With a target coordinate system available, multiple sampling points can be randomly selected in the target area. The coordinate values ​​of these sampling points are substituted into the above quadratic surface expression, and the specific values ​​are obtained through least squares fitting. The specific process will not be elaborated here.

[0097] It should be noted that after fitting the quadratic surface, this embodiment calculates the normal vector perturbation at the center of the QR code using the quadratic surface. The coordinates of the QR code center point are input into the quadratic surface, and the calculated value is determined as the normal vector perturbation. The second offset angle is corrected using the following formula: α_corrected = α × (1 - k × curvature), where α is the second offset angle, α_corrected is the corrected second offset angle, k is a preset empirical coefficient, for example, 0.2, and curvature is the normal vector perturbation. Through the technical solution of this embodiment, the second offset angle can be corrected by the normal vector perturbation, reducing the uniqueness of the QR code label caused by the uneven concrete surface.

[0098] In another embodiment, in step S20, a target feature point is selected from a plurality of first texture feature points, specifically including but not limited to the following steps:

[0099] S21, based on the first image, perform texture recognition to obtain multiple candidate texture regions, and determine the geometric center of the candidate texture region as the corresponding first texture feature point. Each candidate texture region corresponds to a texture type, and each texture type has a preset priority.

[0100] S22, select any target texture region from at least one candidate texture region with the highest priority, and determine the first texture feature point corresponding to the target texture region as the target feature point.

[0101] It should be noted that in this embodiment, texture recognition is performed in the first image, which can be achieved using simple image recognition technology. Each surface texture corresponds to a candidate texture region. Taking the pore 11 shown in Figure 1 as an example, the geometric center of the pore 11 is determined as the first texture feature point. Furthermore, each candidate texture region is determined to correspond to a texture type. Texture types of concrete surfaces include pores, aggregate textures, surface undulations, etc.

[0102] It should be noted that different texture types have different probabilities of changing during the solidification process. This embodiment distinguishes them by preset priority. For example, the aggregate texture changes less, so a higher priority is set, while the pores are more likely to change, so a lower priority is set. From the identified candidate texture areas, the one with the highest priority is selected as the target texture area. If there are multiple candidate texture areas with the same priority, one can be randomly selected as the target texture area.

[0103] As shown in Figure 3, Figure 3 is a structural diagram of an anti-tampering identification device based on identifier location provided in an embodiment of the present invention. The present invention also provides an anti-tampering identification device based on identifier location, comprising:

[0104] The processor 401 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0105] The memory 402 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 402 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 402 and is called and executed by the processor 401 to implement the anti-spoofing identification method based on the identifier location of this application embodiment.

[0106] Input / output interface 403 is used to implement information input and output;

[0107] The communication interface 404 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0108] Bus 405 transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);

[0109] The processor 401, memory 402, input / output interface 403 and communication interface 404 are connected to each other within the device via bus 405.

[0110] This application also provides an electronic device, including the anti-tampering identification device based on the identifier location as described above.

[0111] This application embodiment also provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the above-described anti-spoofing identification method based on the identifier location.

[0112] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0114] The above provides a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. A method for preventing data theft based on identifier location, characterized in that, An application is made on a server, which is communicatively connected to a sampling terminal and an inspection terminal. The method includes: acquiring a first image of a concrete sample sent by the sampling terminal, wherein a QR code label is provided on the surface of the concrete sample, and the QR code label includes multiple positioning markers; based on the first image, determining a pressing area in the QR code label and sending it to the sampling terminal; randomly selecting a target feature point from multiple first texture feature points, wherein the first texture feature point is located in an area outside the QR code label; acquiring a second image sent by the sampling terminal; constructing a target coordinate system in the second image based on the target feature point; and determining each of the positioning markers based on the target coordinate system. The first offset angle of the location marker, wherein the second image is obtained after pressing the QR code label based on the pressing area, and the first offset angle is used to characterize the plane angle between the same location marker and the second image; when the third image sent by the verification terminal is obtained, the target coordinate system is constructed in the third image based on the target feature points, the second offset angle of each location marker is determined based on the target coordinate system, and the anti-tampering identification result is determined based on the corresponding multiple sets of first offset angles and second offset angles, wherein the second offset angle is used to characterize the plane angle between the same location marker and the third image and the first image; based on the target coordinate system Determining a first offset angle for each of the positioning markers, or determining a second offset angle for each of the positioning markers based on the target coordinate system, includes: converting the target image into an initial grayscale image; sequentially performing adaptive histogram equalization and Gaussian blur on the initial grayscale image to obtain an enhanced grayscale image, wherein the target image is either the second image or the third image; based on the target coordinate system and any of the positioning markers, determining the marker corner coordinates corresponding to the four vertices in the enhanced grayscale image; and determining the target offset angle of the corresponding positioning marker based on the marker corner coordinates, wherein the target offset angle determined based on the second image is the first offset angle, and the target offset angle determined based on the third image is the second offset angle. The target offset angle is defined as the second offset angle; the coordinates of the multiple marker corner points include the left top coordinate, the left bottom coordinate, the right top coordinate, and the right bottom coordinate. Determining the target offset angle of the corresponding positioning marker based on the marker corner point coordinates includes: determining a first left-side vector based on the abscissa of the left bottom coordinate and the abscissa of the left top coordinate; determining a second left-side vector based on the ordinate of the left bottom coordinate and the ordinate of the left top coordinate; determining a first right-side vector based on the abscissa of the right bottom coordinate and the abscissa of the right top coordinate; and determining a second right-side vector based on the ordinate of the right bottom coordinate and the ordinate of the right top coordinate.The average of the first left side vector and the first right side vector is determined as the x-coordinate side vector, and the average of the second left side vector and the second right side vector is determined as the y-coordinate side vector; the target offset angle is calculated by performing arctangent calculation on the x-coordinate side vector and the y-coordinate side vector; after calculating the target offset angle by performing arctangent calculation on the x-coordinate side vector and the y-coordinate side vector, the method further includes: extending a target region from the outside of the QR code label in the third image based on a preset extension length, wherein the target region surrounds the QR code label; fitting a quadratic surface based on the target region, and determining the normal vector perturbation at the center of the QR code label based on the quadratic surface; correcting the second offset angle based on the normal vector perturbation and a preset empirical coefficient.

2. The anti-spoofing identification method based on identifier location according to claim 1, characterized in that, Before constructing the target coordinate system in the third image based on the target feature points, the method further includes: determining multiple second texture feature points in the area outside the QR code label based on the third image; determining the target feature point among the multiple second texture feature points by comparing texture features; or, when there are no second texture feature points with the same texture features as the target feature point, acquiring multiple first texture feature points and corresponding texture lines, wherein the texture lines are line segments formed by the first texture feature points and the target feature point; determining at least two reference texture feature points among the multiple second texture feature points, wherein the reference texture feature points have the same texture features as the first texture feature points; applying the texture lines corresponding to the reference texture feature points to the third image, and determining the intersection of multiple texture lines or their corresponding extensions as the target feature point.

3. The anti-spoofing identification method based on identifier location according to claim 1, characterized in that, Selecting a target feature point from a plurality of first texture feature points includes: performing texture recognition based on the first image to obtain a plurality of candidate texture regions, determining the geometric center of the candidate texture regions as the corresponding first texture feature point, wherein each candidate texture region corresponds to a texture type, and each texture type has a preset priority; selecting a target texture region from at least one candidate texture region with the highest priority, and determining the first texture feature point corresponding to the target texture region as the target feature point.

4. A device for preventing product tampering based on identifier location, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform the anti-spoofing identification method based on the identifier location as described in any one of claims 1 to 3.

5. An electronic device, characterized in that, Includes the anti-tampering identification device based on the identifier location as described in claim 4.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the anti-spoofing identification method based on the identifier location as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Two-dimensional code positioning label, and two-dimensional code based positioning navigation system and method

    CN108225303A

  • AGV (Automated Guided Vehicle) visual navigation and positioning method based on novel encoding mark

    CN109739237A