Sample identification method, device, equipment and medium based on dynamic coordinate system
By constructing a dynamic coordinate system on the surface of concrete samples and using perturbation vector deflection and QR code positioning markers, unique sample identification information is generated, which solves the problem of easy deformation of concrete samples during sample delivery and realizes the reliability verification of samples.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI XINHUATONG SOFTWARE CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, concrete samples are easily bumped or marked during the sample delivery process, resulting in insufficient reliability of image recognition and making it impossible to ensure the authenticity of the samples.
By randomly selecting multiple surface feature points on the concrete sample surface, a dynamic coordinate system is constructed. The coordinate system is then deflected using a perturbation vector to generate unique sample identification information. Combined with the location identifier of the QR code and the coordinates of the surface feature points, the uniqueness of the sample is verified.
It improves the reliability of submitted samples, ensuring that samples are not replaced during submission and testing, and the dynamically generated identification information improves the accuracy of verification.
Smart Images

Figure CN121543614B_ABST
Abstract
Description
Sample identification methods, devices, equipment, and media based on dynamic coordinate systems Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a sample identification method, apparatus, device, and medium based on a dynamic coordinate system. Background Technology
[0002] In the construction industry, concrete is sampled and sent for testing after it is delivered to the construction site. Testing agencies then conduct tests on the samples several days later to determine the quality of the concrete. During the sampling process, a witness typically observes the sample delivery process. After sampling, the relevant sample label is inserted, and a photo is taken for record-keeping. Before testing, testing personnel need to take photos to verify whether the sample has been tampered with, ensuring the authenticity of the sample.
[0003] In existing technologies, simple image recognition techniques are typically used to compare images of the sample taken by the person submitting the sample with images taken by the testing personnel, and to determine whether they match based on the surface features of the sample. However, concrete samples are only partially solidified when submitted, and may be bumped or have other markings added during the submission process. The sample surface may still change after the person submitting the sample has taken the photos, so the reliability of image recognition based solely on the sample surface features cannot be guaranteed. Summary of the Invention
[0004] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a sample identification method, apparatus, device, and medium based on a dynamic coordinate system, which can dynamically generate identification information during sampling by taking pictures, thereby improving the reliability of submitted samples.
[0005] In a first aspect, embodiments of the present invention provide a sample identification method based on a dynamic coordinate system, applied to a server, wherein the server is communicatively connected to a sample delivery terminal, and the method includes:
[0006] Acquire a first image of a concrete sample sent by the sample delivery terminal, and randomly select multiple surface feature points in the uneven area of the first image, wherein the first image includes a first QR code and a second QR code.
[0007] A first coordinate system is constructed by determining the three first positioning identifiers of the first QR code, and a weighted centroid is determined based on the first feature coordinates of each surface feature point in the first coordinate system;
[0008] Construct a perturbation vector pointing from the origin of the first coordinate system to the weighted centroid, and deflect the first coordinate system into a second coordinate system based on the perturbation vector;
[0009] Based on the second coordinate system, the second feature coordinates of each of the surface feature points are determined, and the first identifier coordinates of each of the three second positioning identifiers of the second QR code are determined.
[0010] The sample identification information of the concrete sample is determined based on the disturbance vector, the second feature coordinates, and the first identification coordinates.
[0011] According to some embodiments of the present invention, determining the weighted centroid based on the first feature coordinates of each of the surface feature points in the first coordinate system includes:
[0012] Based on any of the surface feature points, the corresponding feature weights are determined according to the feature type.
[0013] The first factor is obtained by weighting and summing each of the first feature coordinates and the feature weights, and the second factor is obtained by summing the feature weights.
[0014] The centroid coordinates are determined based on the first factor and the second factor, and the coordinate point corresponding to the centroid coordinates in the first coordinate system is determined as the weighted centroid.
[0015] According to some embodiments of the present invention, deflecting the first coordinate system to a second coordinate system based on the perturbation vector includes:
[0016] Determine the first origin of the first coordinate system, and determine the second origin by the vector sum of the first origin and the disturbance vector;
[0017] Determine the included angle of disturbance in the first coordinate system;
[0018] A rotation matrix is constructed based on the sine and cosine values of the disturbance angle, and the first coordinate system is rotated into a second coordinate system based on the rotation matrix.
[0019] According to some embodiments of the present invention, determining the sample identification information of the concrete sample based on the perturbation vector, the second feature coordinates, and the first identification coordinates includes:
[0020] The disturbance vector and the first identifier coordinates are determined as the identifier reference information;
[0021] Based on any of the second feature coordinates, determine the corresponding first descriptor in the first image;
[0022] The first descriptor and the identification reference information are determined as the sample identification information.
[0023] According to some embodiments of the present invention, after determining the first descriptor and the identification reference information as the sample identification information, the method further includes:
[0024] Based on any of the surface feature points, determine multiple associated feature points and their respective third feature coordinates in the second coordinate system;
[0025] Determine the second descriptor corresponding to each of the associated features, and add the second descriptor and the third feature coordinates to the sample identification information.
[0026] According to some embodiments of the present invention, the server is communicatively connected to the verification terminal, and after adding the second descriptor and the third feature coordinates to the sample identification information, the method further includes:
[0027] Acquire a second image of the concrete sample sent by the verification terminal, and identify a third and a fourth QR code in the second image;
[0028] A third coordinate system is constructed based on the three third positioning identifiers of the third QR code. The third coordinate system is offset into a fourth coordinate system based on the perturbation vector. The second identifier coordinates of each of the three fourth positioning identifiers of the fourth QR code are determined in the fourth coordinate system.
[0029] When the second identifier coordinates match the first identifier coordinates, the corresponding third descriptor is determined in the second image based on each of the second feature coordinates;
[0030] Based on any second feature coordinate, if the corresponding third descriptor matches the first descriptor, the second feature coordinate is determined to pass the verification.
[0031] When each of the second feature coordinates passes the verification, the second image is determined to have passed the verification.
[0032] According to some embodiments of the present invention, after determining the corresponding third descriptor in the second image based on each of the second feature coordinates, the method further includes:
[0033] When the first descriptor does not match the third descriptor, a fourth descriptor is determined in the second image based on the third feature coordinates associated with the corresponding second feature coordinates;
[0034] When multiple fourth descriptors match multiple second descriptors corresponding to the second feature coordinates, the corresponding second feature coordinates are determined to have passed the verification.
[0035] Secondly, embodiments of the present invention provide a sample identification device based on a dynamic coordinate system, including at least one control processor and a memory for communicatively connecting with the at least one control processor; the memory stores instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform the sample identification method based on a dynamic coordinate system as described in the first aspect above.
[0036] Thirdly, embodiments of the present invention provide an electronic device including a sample labeling device based on a dynamic coordinate system as described in the second aspect above.
[0037] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions for performing the sample identification method based on a dynamic coordinate system as described in the first aspect above.
[0038] The sample identification method based on a dynamic coordinate system according to embodiments of the present invention has at least the following beneficial effects: A first image of a concrete sample sent by the sample delivery terminal is acquired; multiple surface feature points are randomly selected in the uneven area of the first image; wherein the first image includes a first QR code and a second QR code; three first positioning identifiers of the first QR code are determined to construct a first coordinate system; a weighted centroid is determined based on the first feature coordinates of each surface feature point in the first coordinate system; a perturbation vector is constructed pointing from the origin of the first coordinate system to the weighted centroid; the first coordinate system is deflected into a second coordinate system based on the perturbation vector; based on the second coordinate system, second feature coordinates of each surface feature point are determined; and first identifier coordinates of each of the three second positioning identifiers of the second QR code are determined; sample identification information of the concrete sample is determined based on the perturbation vector, the second feature coordinates, and the first identifier coordinates. According to the technical solution of embodiments of the present invention, a unique second coordinate system corresponding to the concrete sample can be dynamically generated using surface features. The positioning identifiers of the second QR code and the coordinates of the surface feature points are used as sample identification information to verify the uniqueness of the sample. Identification information can be dynamically generated during sampling by taking photos, improving the reliability of the submitted samples. Attached Figure Description
[0039] Figure 1 is a schematic diagram of the principle of a sample identification method based on a dynamic coordinate system provided in an embodiment of the present invention;
[0040] Figure 2 is a flowchart of a sample identification method based on a dynamic coordinate system provided in another embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of determining associated feature points according to another embodiment of the present invention;
[0042] Figure 4 is a structural diagram of a sample identification device based on a dynamic coordinate system provided in another embodiment of the present invention. Detailed Implementation
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] This invention provides a sample identification method, apparatus, device, and medium based on a dynamic coordinate system. The sample identification method includes: acquiring a first image of a concrete sample sent by a sample delivery terminal; randomly selecting multiple surface feature points in an uneven area of the first image; wherein the first image includes a first QR code and a second QR code; determining three first positioning identifiers of the first QR code to construct a first coordinate system; determining a weighted centroid based on the first feature coordinates of each surface feature point in the first coordinate system; constructing a perturbation vector pointing from the origin of the first coordinate system to the weighted centroid; deflecting the first coordinate system into a second coordinate system based on the perturbation vector; determining the second feature coordinates of each surface feature point based on the second coordinate system; determining the first identifier coordinates of each of the three second positioning identifiers of the second QR code; and determining the sample identification information of the concrete sample based on the perturbation vector, the second feature coordinates, and the first identifier coordinates. According to the technical solution of this invention, a unique second coordinate system corresponding to the concrete sample can be dynamically generated using surface features. The positioning identifiers of the second QR code and the coordinates of the surface feature points are used as sample identification information to verify the uniqueness of the sample. This allows for dynamic generation of identification information during sampling, improving the reliability of the submitted samples.
[0048] The technical solutions of the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0049] Referring to Figure 2, which is a flowchart of a sample identification method based on a dynamic coordinate system provided by an embodiment of the present invention, the sample identification method based on a dynamic coordinate system includes, but is not limited to, the following steps:
[0050] S10, acquire the first image of the concrete sample sent by the sample delivery terminal, randomly select multiple surface feature points in the uneven area of the first image, wherein the first image includes a first QR code and a second QR code.
[0051] It should be noted that, as shown in Figure 1, the person submitting the sample can insert two QR code labels into the concrete sample in the presence of a witness, and obtain the first image of the surface of the concrete sample by taking a picture of it through the sample delivery terminal 40, which is logged into the sampler's account.
[0052] It should be noted that, as shown in Figure 1, the surface of the concrete sample has many pores, aggregate surface textures, fine undulations in the cement paste, and cracks, etc. Therefore, the surface of the concrete sample has many uneven areas 30. In this embodiment, a surface feature point is selected in each uneven area 30. The uneven area can be determined by edge recognition technology. Since there are many types of uneven areas, different methods can be used to determine the surface feature point according to different types. The surface feature point is used as a hidden feature of the concrete sample. The surface feature points of different concrete samples will necessarily be different, which can ensure the uniqueness of the identification.
[0053] Exemplarily, for tiny cracks, the Canny edge detection algorithm can be used to determine the cracks, and then the Harris corner detection is utilized to determine multiple feature points in the cracks. Subsequently, the sharp intersection point with the maximum curvature is selected as the surface feature point according to the curvature of the region where each feature point is located.
[0054] Exemplarily, for the surface texture of aggregates, the K-means clustering can be adopted to separate the aggregate regions based on the differences in color and grayscale values. The local curvature is calculated for each aggregate region, and the point with the maximum curvature value is determined as the surface feature point.
[0055] Exemplarily, for pores, the morphological opening operation can be used to remove noise, and then the elliptical region is fitted based on the connected component analysis. Taking the center of the elliptical region as the surface feature point is sufficient.
[0056] S20, Determine three first positioning identifiers of the first two-dimensional code to construct a first coordinate system, and determine the weighted centroid based on the first feature coordinates of each surface feature point in the first coordinate system.
[0057] It should be noted that a two-dimensional code usually has three "return" - shaped positioning identifiers, and the connecting lines are distributed at right angles. As shown in Figure 1, in this embodiment, the first coordinate system XOY is constructed with the center points of the three first positioning identifiers 11 of the first two-dimensional code 10.
[0058] It should be noted that after determining the first coordinate system, the first feature coordinates of each surface feature point can be determined. In this embodiment, the weighted centroid is determined by weighting based on the first feature coordinates. The weighted centroid is a point determined based on the first feature coordinates, and the natural features on the surface of the concrete sample are used as the offset data of the coordinate system. Since the surface feature points of different concrete samples are necessarily different, the obtained weighted centroids are also necessarily different, enabling each concrete sample to perform coordinate offset with different parameters. Moreover, the selection of surface feature points is random. If the concrete sample is replaced, and the same weighted centroid is used for coordinate offset during the subsequent verification process, it is inevitable that the coordinates of the same surface feature points cannot be obtained. The verification information of each concrete sample is dynamically generated, effectively improving the verification reliability.
[0059] S30, Construct a perturbation vector pointing from the origin of the first coordinate system to the weighted centroid, and deflect the first coordinate system into a second coordinate system based on the perturbation vector.
[0060] It should be noted that the weighted centroid is a point in the first coordinate system obtained according to multiple surface feature points. Therefore, a vector pointing from the origin to the weighted centroid can be obtained. In this embodiment, it is determined as the perturbation vector, and the origin and coordinate axes of the first coordinate system are deflected based on the vector, so that the obtained second coordinate system is uniquely obtained based on the surface features of the concrete sample, improving the verification reliability.
[0061] S40, based on the second coordinate system, determine the second feature coordinates of each surface feature point, and determine the first identifier coordinates of each of the three second positioning identifiers of the second QR code.
[0062] It should be noted that after obtaining the second coordinate system, the second feature coordinates of each surface feature point are determined. The second feature coordinates are necessarily different from the first feature coordinates and can be used as one of the verification information in the verification process.
[0063] It should be noted that in this embodiment, the first identifier coordinates corresponding to the three second positioning identifiers of the second QR code are further obtained. Each surface feature point may be obscured during other operations, but the second QR code will not be obscured. As shown in Figure 1, in this embodiment, a point is randomly selected as an identifier point in the second positioning identifier 21 of the second QR code 20, and the coordinate value of the identifier point in the second coordinate system is obtained as the first identifier coordinates.
[0064] S50, determine the sample identification information of the concrete sample based on the disturbance vector, the second feature coordinates and the first identification coordinates.
[0065] It should be noted that, according to the description of the above embodiments, the second coordinate system is obtained by offsetting randomly selected surface feature points; therefore, the second coordinate system is unique for different concrete samples. In this embodiment, the perturbation vector is used as part of the sample identification information. During the verification process, after the verification terminal captures the second image, the server can reconstruct the second coordinate system based on the perturbation vector. The server then uses the second feature coordinates and the first identification coordinates to determine the corresponding image points. If the content of the corresponding image points is the same, it can be determined that the concrete sample has not been replaced. Reliable sample verification is achieved through coordinate comparison of the unique second coordinate system of the concrete sample.
[0066] In another embodiment, in step S20, the weighted centroid is determined based on the first feature coordinates of each surface feature point in the first coordinate system, which specifically includes, but is not limited to, the following steps:
[0067] S21, Based on any surface feature point, determine the corresponding feature weight according to the feature type;
[0068] S22, the first factor is obtained by weighted summation of each first feature coordinate and feature weight, and the second factor is obtained by summing the feature weights;
[0069] S23, determine the centroid coordinates based on the first factor and the second factor, and determine the coordinate point corresponding to the centroid coordinates in the first coordinate system as the weighted centroid.
[0070] It should be noted that this embodiment sets different feature weights for different types of surface features. Higher feature weights are set for surface features with higher significance. For example, the significance of microcrack intersections is relatively high, so the feature weight is set to 1.2. The significance of aggregate apex is lower than that of microcrack intersections, so the feature weight is set to 1. Porosity is relatively common, so the feature weight is set to 0.8. The specific value can be set according to actual needs.
[0071] It should be noted that the formula for calculating the weighted centroid in this embodiment is: ,in, The coordinates of the weighted centroid, Let be the first feature coordinates of the i-th surface feature point. Let be the feature weight of the i-th surface feature point, and N be the number of surface feature points. For example, as shown in Figure 1, the coordinates of the three first features are (X1, Y1), (X2, Y2), and (X3, Y3).
[0072] The technical solution of this embodiment enables weighted summation of coordinates based on the saliency of surface feature points, so that the abscissa of the weighted centroid is obtained by weighting the abscissas of each first feature coordinate, and the ordinate is obtained similarly. The weighted centroid can characterize the distribution of surface features, ensuring that the weighted centroid of each concrete sample is different.
[0073] In another embodiment, in step S30, the first coordinate system is deflected into the second coordinate system based on the perturbation vector, which specifically includes, but is not limited to, the following steps:
[0074] S31, Determine the first origin of the first coordinate system, and determine the second origin by the vector sum of the first origin and the disturbance vector;
[0075] S32, determine the disturbance angle in the first coordinate system;
[0076] S33, construct a rotation matrix based on the sine and cosine values of the disturbance angle, and rotate the first coordinate system into the second coordinate system based on the rotation matrix.
[0077] It should be noted that in this embodiment, the second origin is determined by the vector sum of the first origin and the perturbation vector, and this second origin is used as the origin of the second coordinate system. To prevent excessive offset, a scaling factor can be introduced to scale the second origin, as shown in the following formula: Where O is the first origin, Let be the second origin, and α be the scaling factor, with a value range of [0.1, 0.3]. This is the perturbation vector.
[0078] It should be noted that the second coordinate system in this embodiment is obtained by deflection of the first coordinate system. Therefore, the pointing directions of the X and Y axes remain unchanged. The perturbation angle of the X-axis is then determined using a perturbation vector. The X-axis is rotated using this perturbation angle, and the Y-axis rotates synchronously with the X-axis. The expression for the perturbation angle is: ,in, Let be the angle between the X-axis and Y-axis in the first coordinate system. In this embodiment, no perturbation vector is introduced when performing coordinate system offset. This is because the subsequent descriptors need to maintain local autonomy to avoid global error propagation. Furthermore, traditional local alignment (such as the main gradient direction) is robust enough. Module decoupling is beneficial to system stability and engineering implementation.
[0079] It should be noted that the expression for the rotation matrix is: After rotating the X and Y axes of the first coordinate system according to the above rotation matrix, the second coordinate system is obtained. That is, the X-axis of the second coordinate system is... The Y-axis is Where X is the X-axis of the first coordinate system. Let X be the X-axis of the second coordinate system and Y be the Y-axis of the first coordinate system. y is the Y-axis of the second coordinate system.
[0080] In another embodiment, step S50 specifically includes, but is not limited to, the following steps:
[0081] S51, the disturbance vector and the first identifier coordinates are determined as the identifier reference information;
[0082] S52, Based on any second feature coordinate, determine the corresponding first descriptor in the first image;
[0083] S53, the first descriptor and the identification reference information are determined as the sample identification information.
[0084] It should be noted that after the verification terminal captures the second image, it needs to first construct the same coordinate system based on the disturbance vector. Therefore, in this embodiment, the disturbance vector and the first identifier coordinates are determined as the identifier reference information. After the coordinate system offset is completed, a preliminary verification is performed based on the first identifier coordinates. This not only allows for preliminary verification by checking whether the position of the second QR code is correct, but also verifies whether the recovery of the second coordinate system is correct.
[0085] For example, as shown in Figure 1, the three first identifier coordinates in the second coordinate system are (X4, Y4), (X5, Y5), and (X6, Y6), respectively. These three first identifier coordinates and the disturbance vector... Simply save it on the server.
[0086] It should be noted that the second feature coordinates are the coordinates of the surface feature points in the second coordinate system. The second feature coordinates alone can only determine a point on the image, but do not contain image information. Therefore, in this embodiment, a first descriptor is determined in the first image based on each surface feature point. The first descriptor can be a color and texture descriptor, or a feature descriptor obtained by deep learning. It only needs to be able to uniquely describe the image features of the surface feature point. In this embodiment, the descriptor and the identification reference information are used as sample identification information. The coordinate offset when verifying the image can be verified using the identification reference information. The first descriptor is used as the carrier of image information to ensure that there is sufficient information during verification.
[0087] In another embodiment, after step S53, the following steps are included, but are not limited to:
[0088] S531, Based on any surface feature point, determine multiple associated feature points and their respective third feature coordinates in the second coordinate system;
[0089] S532, determine the second descriptor corresponding to each associated feature, and add the second descriptor and the coordinates of the third feature to the sample identification information.
[0090] It should be noted that the surface feature points are obtained by randomly selecting uneven areas. In order to avoid the surface feature points being occluded, this embodiment pre-determines multiple associated feature points for each surface feature point according to a preset distance, determines the third feature coordinates and the corresponding second descriptor of each associated feature point in the second coordinate system, and associates the third feature coordinates and the second descriptor as auxiliary verification information with the sample identification information.
[0091] For example, as shown on the upper side of Figure 3, three associated feature points are determined for the surface feature point with the second feature coordinates (X2, Y2), and the corresponding third feature coordinates are (X7, Y7), (X8, Y8) and (X9, Y9). The second descriptor of each point is saved together as the sample identification information.
[0092] In another embodiment, the server communicates with the verification terminal, and after step S532, the following steps are included, but are not limited to:
[0093] S533, acquire the second image of the concrete sample sent by the verification terminal, and identify the third and fourth QR codes in the second image;
[0094] S534, construct a third coordinate system based on the three third positioning identifiers of the third QR code, offset the third coordinate system into a fourth coordinate system based on the perturbation vector, and determine the second identifier coordinates of the three fourth positioning identifiers of the fourth QR code in the fourth coordinate system.
[0095] S535, when the second identifier coordinates match the first identifier coordinates, the corresponding third descriptor is determined in the second image based on each second feature coordinate;
[0096] S536, based on any second feature coordinate, when the corresponding third descriptor matches the first descriptor, the second feature coordinate is determined to pass the verification;
[0097] S537, when each second feature coordinate passes the verification, the second image is determined to have passed the verification.
[0098] It should be noted that after the verification terminal acquires the second image of the concrete sample, it can be determined that the first and second images were taken at approximately the same angle. The third and fourth QR codes can be identified from the second image. If the concrete sample has not been replaced, the third QR code is actually the first QR code in the first image, and the fourth QR code is actually the second QR code in the first image. The server constructs a third coordinate system based on the third positioning identifier of the third QR code. This third coordinate system is actually the reconstructed first coordinate system. Based on this, the fourth coordinate system, offset by the perturbation vector, is the reconstructed second coordinate system.
[0099] It should be noted that in this embodiment, the strategy for randomly selecting points among the various second positioning markers after obtaining the fourth coordinate system is stored on the server. Therefore, the coordinates of the second markers can be determined in the same way among the various fourth positioning markers of the fourth QR code. If the coordinates of the second markers correspond one-to-one with the coordinates of the first markers, it can be determined that the QR code of the concrete sample is the QR code used when the sample was delivered, which provides a basis for subsequent judgment. If the coordinates of the second markers are different from the coordinates of the first markers, the QR code has changed. For example, if the coordinates of the first markers are the midpoint coordinates of each second positioning marker, and the coordinates of the second markers are different from the coordinates of the first markers, it can be determined that the position of the second QR code has changed, and it can be determined that there is an anomaly in the concrete sample.
[0100] It should be noted that after confirming that the QR code is normal, the pose of the fourth coordinate system is the same as that of the second coordinate system. Multiple third descriptors are determined directly in the second image by applying the fourth coordinate system based on the second feature coordinates. The third descriptors are the same as the first descriptors. The surface feature points of the concrete sample are the same during inspection and during sample delivery. The concrete sample passes the verification.
[0101] It should be noted that the judgment of the third descriptor mentioned above is performed based on each second feature coordinate. When all second feature coordinates pass the verification, it can be determined that the second image has passed the verification and the concrete sample has not been replaced.
[0102] In another embodiment, after step S535, the following steps are included, but are not limited to:
[0103] S538, when the first descriptor does not match the third descriptor, the fourth descriptor is determined in the second image based on the third feature coordinates associated with the corresponding second feature coordinates;
[0104] S539, when multiple fourth descriptors match multiple second descriptors corresponding to the second feature coordinates, the corresponding second feature coordinates are determined to pass the verification.
[0105] It should be noted that when the first descriptor and the third descriptor do not match, it may be because the corresponding surface feature point is occluded, or it may be because the surface feature point did not solidify when the concrete sample was taken, resulting in a change in the surface features. According to the description of the above embodiment, this embodiment determines the associated feature point and the corresponding second descriptor based on each surface feature point. In this embodiment, a fourth descriptor is determined in the second image based on each associated feature point. If the fourth descriptor is the same as the corresponding second descriptor, the corresponding second feature coordinates can be determined to pass the verification.
[0106] For example, as shown in the first image of FIG3, the surface feature point with coordinates (X2, Y2) includes three associated feature points. Since the surface feature points in this embodiment are randomly selected, the sample submitter and witness are unaware of the selection of the surface feature points. The concrete sample surface is labeled with relevant tags, so that the surface feature point with coordinates (X2, Y2) and the associated feature point with coordinates (X7, Y7) are occluded in the second image. However, the associated feature points with coordinates (X8, Y8) and (X9, Y9) are not occluded. The fourth descriptor corresponding to the coordinates is obtained and is equal to the pre-saved second descriptor, thereby determining that the second feature coordinates have been verified. Auxiliary verification can be achieved through associated feature points, improving the reliability of sample verification.
[0107] Figure 4 is a structural diagram of a sample labeling device based on a dynamic coordinate system provided in an embodiment of the present invention. The present invention also provides a sample labeling device based on a dynamic coordinate system, comprising:
[0108] 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.
[0109] 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 application programs. 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 called and executed by the processor 401 to execute the sample identification method based on a dynamic coordinate system according to the embodiments of this application.
[0110] Input / output interface 403 is used to implement information input and output;
[0111] 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.).
[0112] Bus 405 transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);
[0113] The processor 401, memory 402, input / output interface 403 and communication interface 404 are connected to each other within the device via bus 405.
[0114] This application also provides an electronic device, including the sample marking device based on a dynamic coordinate system as described above.
[0115] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described sample identification method based on a dynamic coordinate system.
[0116] 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.
[0117] 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.
[0118] 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 sample identification method based on a dynamic coordinate system, characterized in that, Applied to a server, the server is communicatively connected to a sample delivery terminal. The method includes: acquiring a first image of a concrete sample sent by the sample delivery terminal; randomly selecting multiple surface feature points in an uneven area of the first image, wherein the first image includes a first QR code and a second QR code; determining three first positioning identifiers of the first QR code to construct a first coordinate system; determining a weighted centroid based on the first feature coordinates of each surface feature point in the first coordinate system; constructing a perturbation vector from the origin of the first coordinate system to the weighted centroid; deflecting the first coordinate system into a second coordinate system based on the perturbation vector; determining the second feature coordinates of each surface feature point based on the second coordinate system; determining the first identifier coordinates of each of the three second positioning identifiers of the second QR code; and determining the first identifier coordinates of each surface feature point based on the perturbation vector, the second feature coordinates, and the first identifier coordinates of the second QR code. The method further includes: determining the sample identification information of the concrete sample based on the first identification coordinates; determining the sample identification information of the concrete sample based on the perturbation vector, the second feature coordinates, and the first identification coordinates, comprising: determining the perturbation vector and the first identification coordinates as identification reference information; determining a corresponding first descriptor in the first image based on any second feature coordinate; determining the first descriptor and the identification reference information as the sample identification information; after determining the first descriptor and the identification reference information as the sample identification information, the method further includes: determining multiple associated feature points and their respective third feature coordinates in the second coordinate system based on any surface feature point; determining a second descriptor corresponding to each of the associated features; and adding the second descriptor and the third feature coordinates to the sample identification information.
2. The sample identification method based on a dynamic coordinate system according to claim 1, characterized in that, Determining the weighted centroid based on the first feature coordinates of each surface feature point in the first coordinate system includes: determining the corresponding feature weight based on the feature type for any surface feature point; summing each first feature coordinate with the feature weight to obtain a first factor, and summing the feature weights to obtain a second factor; determining the centroid coordinates based on the first factor and the second factor, and determining the coordinate point corresponding to the centroid coordinates in the first coordinate system as the weighted centroid.
3. The sample identification method based on a dynamic coordinate system according to claim 2, characterized in that, The method of deflecting the first coordinate system into a second coordinate system based on the disturbance vector includes: determining a first origin of the first coordinate system, and determining a second origin by the vector sum of the first origin and the disturbance vector; determining a disturbance angle in the first coordinate system; constructing a rotation matrix based on the sine and cosine values of the disturbance angle, and rotating the first coordinate system into a second coordinate system based on the rotation matrix.
4. The sample identification method based on a dynamic coordinate system according to claim 1, characterized in that, The server is communicatively connected to the verification terminal. After adding the second descriptor and the third feature coordinates to the sample identification information, the method further includes: acquiring a second image of the concrete sample sent by the verification terminal; identifying a third QR code and a fourth QR code in the second image; constructing a third coordinate system based on the three third positioning identifiers of the third QR code; offsetting the third coordinate system into a fourth coordinate system based on the perturbation vector; determining the second identifier coordinates of each of the three fourth positioning identifiers of the fourth QR code in the fourth coordinate system; when the second identifier coordinates match the first identifier coordinates, determining the corresponding third descriptor in the second image based on each of the second feature coordinates; when the corresponding third descriptor matches the first descriptor based on any second feature coordinate, determining that the second feature coordinate has passed verification; when each of the second feature coordinates has passed verification, determining that the second image has passed verification.
5. The sample identification method based on a dynamic coordinate system according to claim 4, characterized in that, After determining the corresponding third descriptor in the second image based on each of the second feature coordinates, the method further includes: when the first descriptor does not match the third descriptor, determining a fourth descriptor in the second image based on the third feature coordinate associated with the corresponding second feature coordinate; when multiple fourth descriptors match multiple second descriptors corresponding to the second feature coordinates, determining that the corresponding second feature coordinates pass the verification.
6. A sample marking device based on a dynamic coordinate system, 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 sample identification method based on a dynamic coordinate system as described in any one of claims 1 to 5.
7. An electronic device, characterized in that, Includes the sample labeling device based on a dynamic coordinate system as described in claim 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the sample identification method based on a dynamic coordinate system as described in any one of claims 1 to 5.
Citation Information
Patent Citations
A concrete sample witness sampling system and method based on two-dimensional code and image recognition anti-counterfeiting
CN109389001A
Calculation method and evaluation system for joint surface roughness of precast concrete members
CN109612412A