Label template font update detection method and device, equipment and storage medium

By automatically detecting the update of tag template fonts, problems such as information loss and layout abnormalities in tag generation in the prior art are solved, the detection efficiency and accuracy are improved, and the high cost and low accuracy of manual detection are avoided.

CN120014618APending Publication Date: 2025-05-16HEFEI LCFC INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411887179.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

When the tag template font is updated, the existing technology may cause some information loss, typesetting abnormalities or character overwrites to occur when the tag template is updated, and it requires manual detection and adjustment, which is high cost, low accuracy and long time, which may lead to the production line shutdown.

Method used

Provide a detection method for tag template font update, by obtaining images of the initial label, the label to be detected and the target label, font update detection, font expectation detection and information display detection in turn, and automatically identify and alert abnormal conditions.

Benefits of technology

Multi-dimensional, fast and accurate detection of tag template font updates is achieved, which improves detection efficiency and accuracy, reduces manual intervention, and avoids production line shutdowns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014618A_ABST
    Figure CN120014618A_ABST
Patent Text Reader

Abstract

The invention provides a label template font update detection method and device, equipment and a storage medium, and the method comprises the steps: updating a first label template comprising a target information template according to a font update instruction of the target information template, and obtaining a second label template; based on the label information, obtaining an initial image of the initial label according to the first label template, obtaining a to-be-detected image of the to-be-detected label according to the second label template, and obtaining a target image of the target label according to the font updating instruction; the label information comprises label information corresponding to the target information template, and the initial image, the to-be-detected image and the target image comprise characters in corresponding labels; and according to the initial image and the target image, sequentially performing font update detection, font expectation detection and information display detection on the to-be-detected image. According to the method and the device, multi-dimensional, rapid and accurate detection of label template font update can be realized, and the efficiency and the accuracy of label template font update detection are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for detecting a label template font update. Background Art

[0002] In the digital label intelligent design and online real-time generation technology, the system can collect product information in real time and integrate it into the label template designed in the background to generate product labels online instantly. Among them, the label template includes multiple information templates. The label template specifies the coordinate position, size, corresponding label information, etc. of each information template. The information template specifies the style of its corresponding label information, such as the font, font size, color and other styles of the text. An information template can be used by multiple label templates. When it is necessary to change the font of a certain information template, due to the different display states of the same label description information under different fonts, the final generated label may have some information loss, or abnormal typesetting, characters overlapping each other and other problems. In the prior art, in order to avoid this problem, the labels can only be manually inspected and adjusted one by one. The disadvantages are high labor costs, cumbersome comparison process, low accuracy, long time consumption, reduced production efficiency, and more seriously, may cause the production line to stop. Summary of the invention

[0003] The present disclosure provides a method, device, equipment and storage medium for detecting a label template font update, so as to at least solve the above technical problems existing in the prior art.

[0004] According to a first aspect of the present disclosure, a method for detecting a label template font update is provided, the method comprising:

[0005] According to the font update instruction of the target information template, the first label template including the target information template is updated to obtain a second label template;

[0006] Based on the label information, an initial image of an initial label is acquired according to the first label template, an image to be detected of a label to be detected is acquired according to the second label template, and a target image of a target label is acquired according to the font update instruction; the label information includes label information corresponding to the target information template, and the initial image, the image to be detected and the target image include characters in corresponding labels;

[0007] According to the initial image and the target image, font update detection, font expectation detection and information display detection are sequentially performed on the image to be detected.

[0008] In one possible implementation, the step of sequentially performing font update detection, font expectation detection, and information display detection on the image to be detected based on the initial image and the target image includes:

[0009] According to the initial image, performing a font update detection on the image to be detected to determine whether the font of the characters in the image to be detected is changed compared with the font of the characters in the initial image, and obtaining a font update detection result;

[0010] If the font update detection result indicates that the font has changed, then based on the target image, a font expectation detection is performed on the image to be detected, so as to determine whether the font of the characters in the image to be detected meets expectations based on the font of the characters in the target image, and obtain a font expectation detection result;

[0011] If the expected font detection result indicates that the font meets expectations, then according to the target image, information display detection is performed on the image to be detected to determine whether the label information of the image to be detected is displayed completely according to the label information displayed in the target image, and obtain an information display detection result.

[0012] In one embodiment, the method further comprises:

[0013] If the font update detection result indicates that the font has not changed, generating abnormal information and issuing an alarm according to the font update detection result; or,

[0014] If the expected font detection result indicates that the font does not meet expectations, abnormal information is generated according to the expected font detection result and an alarm is issued; or,

[0015] If the information display detection result indicates that the label information display of the to-be-detected label image is incomplete, abnormal information is generated according to the information display detection result and an alarm is issued.

[0016] In one possible implementation, the step of performing font update detection on the image to be detected based on the initial image includes:

[0017] Detecting feature points in the image to be detected and the initial image respectively, and obtaining a feature description vector of each feature point;

[0018] Matching the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the initial image to obtain a feature point pair;

[0019] Based on the feature point pairs, determining a matching degree between the image to be detected and the initial image;

[0020] If the matching degree is less than a first threshold, the font update detection result indicates that the font has changed.

[0021] In one possible implementation, the step of performing font expectation detection on the image to be detected according to the target image includes:

[0022] Detecting feature points in the image to be detected and the target image respectively, and obtaining a feature description vector of each feature point;

[0023] Matching the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the target image to obtain a feature point pair;

[0024] Based on the feature point pairs, determining a matching degree between the image to be detected and the target image;

[0025] If the matching degree is greater than a second threshold, the expected font detection result indicates that the font meets expectations.

[0026] In one possible implementation manner, performing information display detection on the image to be detected according to the target image includes:

[0027] Performing text recognition on the image to be detected and the target image respectively to obtain a first recognized text and a second recognized text;

[0028] If the first recognition text and the second recognition text are the same, the information display detection result indicates that the label information of the image to be detected is displayed completely.

[0029] According to a second aspect of the present disclosure, a device for detecting a label template font update is provided, the device comprising:

[0030] An updating module, configured to update a first label template including the target information template according to a font updating instruction of the target information template to obtain a second label template;

[0031] An image acquisition module is used to acquire an initial image of an initial label according to the first label template, acquire an image to be detected of a label to be detected according to the second label template, and acquire a target image of a target label according to the font update instruction based on the label information; the label information includes label information corresponding to the target information template, and the initial image, the image to be detected and the target image include characters in the corresponding labels;

[0032] The detection module is used to perform font update detection, font expectation detection and information display detection on the image to be detected in sequence according to the initial image and the target image.

[0033] In one embodiment, the detection module includes:

[0034] a font update detection unit, configured to perform a font update detection on the image to be detected based on the initial image, so as to determine whether the font of the characters in the image to be detected is changed compared with the font of the characters in the initial image, and obtain a font update detection result;

[0035] A font expectation detection unit, if the font update detection result indicates that the font has changed, performs font expectation detection on the image to be detected according to the target image, so as to determine whether the font of the characters in the image to be detected meets expectations according to the font of the characters in the target image, and obtain a font expectation detection result;

[0036] The information display detection unit is used to perform information display detection on the image to be detected according to the target image if the expected font detection result indicates that the font meets expectations, so as to determine whether the label information of the image to be detected is displayed completely according to the label information displayed in the target image, and obtain the information display detection result.

[0037] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0038] at least one processor; and

[0039] a memory communicatively connected to the at least one processor; wherein,

[0040] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.

[0041] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure.

[0042] The disclosed label template font update detection method, apparatus, device and storage medium can realize multi-dimensional, rapid and accurate detection of label template font updates by sequentially performing font update detection, font expectation detection and information display detection on the image to be detected of the label to be detected according to the initial image of the initial label and the target image of the target label, further determine whether there is an abnormality and obtain specific abnormality information, thereby effectively improving the efficiency and accuracy of label template font update detection, so that technical personnel can carry out targeted abnormality repair.

[0043] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0045] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0046] Figure 1 The following is a schematic diagram showing the implementation process of the method for detecting font update of a label template according to an embodiment of the present disclosure. Figure 1 ;

[0047] Figure 2 A schematic diagram showing an initial image, an image to be detected and a target image according to an embodiment of the present disclosure is shown;

[0048] Figure 3 The following is a schematic diagram showing the implementation process of the method for detecting font update of a label template according to an embodiment of the present disclosure. Figure 2 ;

[0049] Figure 4 The following is a schematic diagram showing the implementation process of the method for detecting font update of a label template according to an embodiment of the present disclosure. Figure 3 ;

[0050] Figure 5 The following is a schematic diagram showing the implementation process of the method for detecting font update of a label template according to an embodiment of the present disclosure. Figure 4 ;

[0051] Figure 6 The following is a schematic diagram showing the implementation process of the method for detecting font update of a label template according to an embodiment of the present disclosure. Figure 5 ;

[0052] Figure 7 The following is a schematic diagram showing the implementation process of the method for detecting font update of a label template according to an embodiment of the present disclosure. Figure 6 ;

[0053] Figure 8 The schematic diagram shows the composition structure of the detection device for updating the font of the label template according to the embodiment of the present disclosure. Figure 7 ;

[0054] Fig. 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0055] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0056] With the rapid development of intelligent manufacturing technology, the intelligent design and online real-time generation technology of digital labels has made significant progress, realizing the instant online generation of product labels. Specifically, in the generation process, other hardware authentication information, such as network card, graphics card, etc., is obtained from MES (Manufacturing Execution System) by scanning the serial number of the whole machine, and then the information is integrated into the dynamic label template designed in the background to generate the final printed label. In order to improve reusability, the system has established an internal resource library, including various font libraries, icon libraries, label templates and information templates. Among them, the label template includes multiple information templates, the label template specifies the coordinate position, size, corresponding label information, etc. of each information template, and the information template specifies the style of its corresponding label information, such as the font, font size, color and other styles of the text. An information template can be used by multiple label templates. When the font of a certain information template needs to be changed, due to the different display states of the same label information in different fonts, the final generated label may have some information loss, or abnormal typesetting, characters overlapping each other and other problems. In the prior art, in order to avoid this problem, the labels can only be checked and adjusted manually one by one. The disadvantages are high labor costs, cumbersome comparison process, low accuracy, long time consumption, reduced production efficiency, and more seriously, may cause the production line to stop working.

[0057] In order to solve the above problems, the present disclosure provides a method for detecting label template font updates, such as Figure 1 As shown, including:

[0058] S101, updating a first label template including the target information template according to a font update instruction of the target information template to obtain a second label template;

[0059] S102, based on the label information, obtaining an initial image of the initial label according to the first label template, obtaining an image to be detected of the label to be detected according to the second label template, and obtaining a target image of the target label according to the font update instruction; the label information includes label information corresponding to the target information template, and the initial image, the image to be detected and the target image include characters in the corresponding labels;

[0060] S103 . According to the initial image and the target image, sequentially perform font update detection, font expectation detection and information display detection on the image to be detected.

[0061] In step S101, the label information included in the target information template can be displayed as characters in the label. The font update instruction can be used only to update the font of the characters corresponding to the target information template, or can be used to update the font, font size, color and other attributes related to the display of the characters (referred to as font attributes for short) of the characters corresponding to the target information template. In one example, the target information template can include font attributes. The number of first label templates including the target information template is at least one, and for each first label template, the detection method of the embodiment of the present disclosure can be used for detection. The first label template is an initial label template including the target information template before the font attributes are updated, and the second label template is an updated label template including the target information template after the font attributes are updated.

[0062] In step S102, the label information is the content to be displayed in the product label, that is, the information to be displayed of the label to be generated. A complete label includes multiple label information, each of which corresponds to an information template. In the present disclosure, the label information includes the label information corresponding to the target information template.

[0063] Based on the label information, the initial image of the initial label is obtained according to the first label template: based only on the label information corresponding to the target information template, according to the coordinate position, size and other configuration parameters of the first label template for the target information template, an initial image of the initial label that only includes the target information template area is generated; it is also possible to generate a complete label image, i.e., the initial label, based on the label information of the complete label according to the first label template, and intercept the complete label image according to the coordinate position, size and other configuration parameters of the target information template in the first label template to obtain an initial image that only includes the target information template area.

[0064] Based on the label information, the image to be detected of the label to be detected is obtained according to the second label template: based only on the label information corresponding to the target information template, according to the second label template for the coordinate position, size and other configuration parameters of the target information template, an image to be detected of the label to be detected that only includes the target information template area is generated: it is also possible to generate a complete label image, i.e., the label to be detected, according to the second label template based on the label information of the complete label, and intercept the complete label image according to the coordinate position, size and other configuration parameters of the target information template in the second label template to obtain an image to be detected that only includes the target information template area.

[0065] Based on the label information, a target image of the target label is obtained according to the font update instruction. The target image of the target label is an image provided by the user who issued the font update instruction and represents the label desired by the user according to the font update instruction. If the user provides a complete target label, a target image including only the target information template area can be intercepted from the complete target label image; if the user provides a target label including only the target information template area, the complete image of the target label can be used as the target image.

[0066] In the example disclosed in the present invention, according to the font update instruction, only the display effect of the characters is detected. Therefore, the initial image, the image to be detected and the target image at least include the characters in the corresponding labels, and the characters in the corresponding labels correspond to the label information corresponding to the target information template. Figure 2 As shown, the initial image (A), the image to be detected (B), and the target image (C) all display characters of the same label information. It should be understood that since the font update instruction only changes the font attributes of the label information corresponding to the target information template, and does not change the configuration parameters for the target information template, the size of the image to be detected and the initial image are the same. When the initial size does not meet the display requirements of the label information after the font update, the problem of partial information loss will occur. The target image is the expected display image of the label information after the font update, so the size of the target image may be the same or different from the size of the initial image or the image to be detected.

[0067] In step S103, based on the initial image of the label before updating and the target image of the label after updating expected by the user, the image to be detected corresponding to the label template automatically updated by the system is detected in turn from three dimensions: whether the font has changed, whether the font change is in line with expectations, and whether the information display is complete.

[0068] The disclosed embodiment does not require inspection personnel to manually inspect and adjust label images one by one, and can achieve multi-dimensional, fast and accurate detection of label template font updates, further determine whether there are anomalies and obtain specific anomaly information, thereby effectively improving the efficiency and accuracy of label template font update detection, allowing technical personnel to perform targeted anomaly repairs.

[0069] In some embodiments, Figure 3 As shown, in step S103, according to the initial image and the target image, font update detection, font expectation detection and information display detection are sequentially performed on the image to be detected, including:

[0070] S201, performing a font update detection on the image to be detected according to the initial image to determine whether the font of the characters in the image to be detected is changed compared with the font of the characters in the initial image, and obtaining a font update detection result;

[0071] S202: If the font update detection result indicates that the font has changed, then based on the target image, perform font expectation detection on the image to be detected, so as to determine whether the font of the characters in the image to be detected meets expectations based on the font of the characters in the target image, and obtain a font expectation detection result.

[0072] S203. If the expected font detection result indicates that the font meets expectations, information display detection is performed on the image to be detected according to the target image, so as to determine whether the label information of the image to be detected is displayed completely according to the label information displayed in the target image, and obtain an information display detection result.

[0073] In step S201, font update detection is used to detect whether the updated font of the target information template is changed compared with the font before the update. Therefore, font update detection is performed on the image to be detected using the updated font based on the initial image using the font before the update to obtain the font update detection result.

[0074] In step S202, when the font update detection result indicates that the font has changed, the image to be detected is then subjected to font expectation detection. The font expectation detection is used to detect whether the font after the target information template is updated meets expectations, that is, whether it is the target font. Therefore, according to the target image using the target font, the font expectation detection is performed on the image to be detected using the updated font to obtain the font expectation detection result.

[0075] In step S203, when the expected font detection result indicates that the font meets expectations, the image to be detected is then subjected to information display detection. The information display detection is used to detect whether the label image generated using the font updated by the target information template can fully display the label information contained in the target information template. Therefore, based on the target image with the expected display effect, the image to be detected using the updated font is subjected to information display detection to obtain the expected font detection result. The disclosed embodiment adopts a layer-by-layer progressive detection method, which can detect the image to be detected from multiple dimensions and accurately obtain the detection results of multiple dimensions.

[0076] In some embodiments:

[0077] If the font update detection result indicates that the font has not changed, generating abnormal information and issuing an alarm according to the font update detection result; or,

[0078] If the expected font detection result indicates that the font does not meet expectations, abnormal information is generated according to the expected font detection result and an alarm is issued; or,

[0079] If the information display detection result indicates that the label information display of the to-be-detected label image is incomplete, abnormal information is generated according to the information display detection result and an alarm is issued.

[0080] The overall flow chart of the embodiment of the present disclosure is as follows: Figure 4 As shown:

[0081] S1. Update label template;

[0082] S2, based on the label information, obtaining an initial image of the initial label according to the initial label template, obtaining an image to be detected of the label to be detected according to the updated label template, and obtaining a target image of the target label input by the user;

[0083] S3, detecting whether the font of the image to be detected has changed relative to the initial image, i.e., font update detection; if so, executing step S4; if not, executing step S7;

[0084] S4, according to the font of the target image, detect whether the font of the image to be detected meets the expectation, that is, font expectation detection; if so, execute step S5; if not, execute step S7;

[0085] S5, according to the label information displayed on the target image, detect whether the label information of the image to be detected is displayed completely, that is, information display detection; if so, execute step S6; if not, execute step S7;

[0086] S6, test passed;

[0087] S7. Generate abnormal information and issue an alarm.

[0088] In some embodiments, Figure 5 As shown, in step S201, the font update detection is performed on the image to be detected according to the initial image, including:

[0089] S301, detecting feature points in the image to be detected and the initial image respectively, and obtaining a feature description vector of each feature point;

[0090] S302, matching the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the initial image to obtain a feature point pair;

[0091] S303, determining the matching degree between the image to be detected and the initial image based on the feature point pairs;

[0092] S304: If the matching degree is less than a first threshold, the font update detection result is characterized as a font change.

[0093] In step S301, an image feature descriptor algorithm can be used to extract key feature points of the image and obtain a feature description vector. The image feature descriptor algorithm includes a SIFT (Scale Invariant Feature Transform) algorithm, a SURF (Speeded Up Robust Features) algorithm, and an ORB (Oriented FAST and Rotated BRIEF) algorithm, etc., wherein the image feature points extracted by different algorithms are different, and the descriptors / feature description vectors generated by different algorithms are also different. In the disclosed embodiment, font update detection can use any of these algorithms, as long as the same algorithm is used for the image to be detected and the initial image.

[0094] In one embodiment, the ORB algorithm is used to extract feature points and calculate feature description vectors for the image to be detected and the initial image. The ORB algorithm is a feature point extraction and descriptor generation algorithm that combines the FAST (Features from accelerated segmenttest, corner detection) key point detector and the BRIEF (Binary Robust Independent ElementaryFeatures, binary robust independent elementary features) descriptor.

[0095] The ORB algorithm steps include:

[0096] 1) FAST feature point extraction

[0097] The FAST algorithm is used to detect corners in an image. The core idea is to select a pixel point P and compare the pixel values ​​on the circumference around it. The following are the basic steps and formulas of the FAST algorithm:

[0098] 1.1) Select pixel point P: Let P be a pixel point in the image.

[0099] 1.2) Compare surrounding pixels: There are 16 pixels on a circle with a radius of 3 pixels and P as the center. Let Ip be the grayscale value of point P and Ith be the set threshold. For each pixel on the circle, compare its grayscale value with Ip.

[0100] If the grayscale values ​​of n consecutive pixels meet one of the following conditions, P is considered to be a feature point:

[0101] Ip-Ith>0 and the grayscale values ​​of n consecutive pixels are all less than Ip-Ith;

[0102] Ip+Ith<255 and the grayscale values ​​of n consecutive pixels are greater than Ip+Ith;

[0103] Among them, n is usually taken as 12.

[0104] 1.3) Optimization comparison: To improve efficiency, the four points 1, 9, 5, and 13 on the circumference can be compared first. If 3 or more of these four points meet the above conditions, then all 16 points are further compared.

[0105] When performing FAST feature extraction, it is usually necessary to traverse each pixel point P in the image to obtain the feature points of the entire image. In the embodiments of the present disclosure, FAST feature points are detected in the image to be detected and the initial image respectively.

[0106] 2) BRIEF feature description

[0107] BRIEF is a binary feature descriptor used to generate a feature description vector of feature points. The following are the basic steps and formulas of the BRIEF algorithm:

[0108] 2.1) Select pixel point pairs: For each feature point, a series of pixel point pairs (p, q) are selected around it. Each point pair is used to generate a binary test.

[0109] 2.2) Binary test: For each point pair (p, q), compare their gray values to generate a binary bit:

[0110] If Ip < Iq, then this bit is 1;

[0111] If Ip ≥ Iq, then this bit is 0.

[0112] Among them, Ip and Iq are the gray values of point p and point q respectively.

[0113] 2.3) Generate feature vector: Combine the results of all binary tests into a feature description vector. This vector is the BRIEF descriptor of this key point.

[0114] Thus, in the embodiments of the present disclosure, the BRIEF feature description vectors of each feature point in the image to be detected and the initial image are obtained respectively.

[0115] In another implementable manner, the SIFT algorithm can also be used to extract SIFT feature points and calculate SIFT feature description vectors for the image to be detected and the initial image.

[0116] In yet another implementable manner, the SURF algorithm can also be used to extract SURF feature points and calculate SURF feature description vectors for the image to be detected and the initial image.

[0117] In step S302, the feature description vector of each feature point in the image to be detected is matched with the feature description vector of each feature point in the initial image to obtain a feature point pair. A Brute-Force matching algorithm can be used to calculate the distance or similarity between the feature description vectors of each feature point in different image graphs for matching. A FLANN (Fast Library for Approximate Nearest Neighbors) algorithm can also be used for matching.

[0118] Different image feature descriptor algorithms have different feature description vectors and different matching methods. The ORB algorithm, SIFT algorithm, and SURF algorithm can all be applied to the Brute-Force matching algorithm. When matching ORB feature description vectors, the best matching point is generally found by calculating the Hamming distance between the feature description vectors; sorting is performed according to the matching distance to select the best matching pair, and then all the best matching feature point pairs of the image to be detected and the initial image are obtained; the SIFT algorithm and SURF algorithm generally find the best matching point by calculating the Euclidean distance between the feature description vectors, and sorting is performed to select the best matching pair. The SIFT algorithm and SURF algorithm are also applicable to the FLANN matching algorithm, which finds the nearest k matches for each feature description vector, compares the distance ratio between the first match and the second match to get rid of poor matches, and obtains well-matched feature point pairs.

[0119] It should be understood that the feature matching performed in step S302 obtains better matching feature point pairs, but cannot completely eliminate errors or mismatching situations, that is, the feature point pairs may contain outliers.

[0120] In step S303, based on the feature point pairs, the degree of matching between the image to be detected and the initial image is determined. The feature point pairs represent the features shared by the image to be detected and the initial image. Since both the image to be detected and the initial image correspond to the same label information, in the disclosed embodiment, the feature point pairs can represent the local features of the characters shared by the image to be detected and the initial image. On the basis of obtaining the local features of the shared characters, the degree of matching between the characters in the image to be detected and the initial image in terms of fonts is further obtained.

[0121] In one possible implementation manner, a RANSAC (Random Sample Consensus) algorithm is used to determine the matching degree between the image to be detected and the initial image.

[0122] The RANSAC algorithm is an iterative method for estimating mathematical model parameters from data with outliers. In the field of feature matching, the RANSAC algorithm is used to eliminate mismatched pairs and optimize matching results. The disclosed embodiment uses the score / matching value of the best optimization model estimated by the RANSAC algorithm as the matching degree between the image to be detected and the initial image.

[0123] The basic idea of ​​the RANSAC algorithm is to construct a model by randomly selecting a part of the data samples, and evaluate its fit, gradually optimize the model in the iterative process, and finally get a model with better fit. It is particularly suitable for situations where there are a lot of noise and outliers, because it can robustly estimate the model parameters. The algorithm steps include:

[0124] 1) Randomly select samples: Select a minimum sample set from the matching pairs that is sufficient to estimate the model parameters. For homography matrix estimation, usually 4 pairs of matching points are required.

[0125] (x1, x1′), (x2, x2′), (x3, x3′), (x4, x4′), where x1-x4 belong to one of the image to be detected and the initial image, and x1′-x4′ belong to the other image.

[0126] 2) Estimate model parameters: Use the selected sample set to estimate the model parameters. In feature matching verification, this usually means estimating a transformation matrix, such as the homography matrix H.

[0127] The homography matrix H can be estimated by solving the following system of equations:

[0128]

[0129] For each matching point pair, we can get two equations, and finally form 8 equations to solve the 8 parameters of the homography matrix H.

[0130] 3) Validate the model: Use the estimated model to validate all data points to determine which points are consistent with the model (inliers).

[0131] For each matching point pair (xi, xi′), the estimated H is used to calculate the mapping point x^i:

[0132]

[0133] Calculate the error ei between the mapped point and the actual matching point:

[0134]

[0135] 4) Scoring model: Score the model based on the number of inliers:

[0136] score(H)=number of inliers(H)

[0137] 5) Repeat: Repeat the above steps multiple times, selecting a different sample set each time, and retain the model with the highest score.

[0138] 6) Final model estimation: Re-estimate the model parameters using all inliers.

[0139] The model with the highest final estimate score is obtained. The best model is the most accurate description of the matching relationship between the feature point pairs of the image to be detected and the initial image. The score of the best model can represent the maximum matching degree between the image to be detected and the initial image. Therefore, the score of the best model is used as the matching degree between the image to be detected and the initial image.

[0140] In step S304, if the matching degree is less than the first threshold, the font update detection result is characterized as a font change. The first threshold is used to measure the similarity of the common features of the image to be detected and the initial image. In this solution, the common features of the image to be detected and the initial image are local features in the same characters. Therefore, the first threshold can be used to determine whether the font of the characters in the image to be detected has changed compared to the font of the characters in the initial image. When the matching degree is less than the first threshold, it means that the fonts of the characters in the image to be detected and the initial image are different, and the font update detection result passes.

[0141] In some embodiments, Figure 6 As shown, in step S202, the font expectation detection is performed on the image to be detected according to the target image, including:

[0142] S401, detecting feature points in the image to be detected and the target image respectively, and obtaining a feature description vector of each feature point;

[0143] S402, matching the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the target image to obtain a feature point pair;

[0144] S403, determining the matching degree between the image to be detected and the target image based on the feature point pairs;

[0145] S404: If the matching degree is greater than a second threshold, the expected font detection result indicates that the font meets expectations.

[0146] Except for replacing the initial image with the target image, the implementation methods of steps S401, S402 and S403 are respectively the same as the implementation methods of the above-mentioned steps S301, S302 and S4303, and are not described in detail here.

[0147] In step S404, in step S304, if the matching degree is greater than the second threshold, the expected font detection result is characterized as the font being as expected. The second threshold is used to measure the similarity of the common features of the image to be detected and the target image. In this solution, the common features of the image to be detected and the target image are local features in the same characters, so the second threshold can be used to determine whether the font of the characters in the image to be detected is the same as the font of the characters in the target image. When the matching degree is greater than the second threshold, it means that the fonts of the characters in the image to be detected and the target image are the same, and the expected font detection result passes.

[0148] The first threshold and the second threshold can be set according to actual conditions, and the first threshold and the second threshold can be the same or different.

[0149] In some embodiments, Figure 7 As shown, in step S203, information display detection is performed on the image to be detected according to the target image, including:

[0150] S501, performing text recognition on the image to be detected and the target image respectively to obtain a first recognized text and a second recognized text;

[0151] S502: If the first recognition text and the second recognition text are the same, the information display detection result indicates that the label information of the image to be detected is displayed completely.

[0152] In step S501, the second recognized text obtained by performing text recognition on the target image is the fully displayed label information, and the first recognized text obtained by performing text recognition on the image to be detected is the actually displayed label information. In order to detect whether there is a problem of partial information loss in the image to be detected, it is necessary to compare the label information actually displayed in the image to be detected with the complete label information. In addition to performing text recognition on the target image to obtain the second recognized text, the embodiment of the present disclosure can also perform text recognition on the initial image to obtain the third recognized text for comparison with the first recognized text, and can also directly obtain the text of the label information for comparison with the first recognized text.

[0153] In step S502, if the first recognized text of the image to be detected is the same as the second recognized text of the target image, it means that the label information of the image to be detected is displayed completely, and the information shows that the detection result is passed.

[0154] The disclosed embodiment also provides a detection device for label template font update, such as Figure 8 As shown, including:

[0155] An updating module 601 is used to update a first label template including the target information template according to a font update instruction of the target information template to obtain a second label template;

[0156] The image acquisition module 602 is used to acquire an initial image of an initial label according to the first label template, acquire an image to be detected of a label to be detected according to the second label template, and acquire a target image of a target label according to the font update instruction based on the label information; the label information includes label information corresponding to the target information template, and the initial image, the image to be detected and the target image include characters in the corresponding labels;

[0157] The detection module 603 is used to perform font update detection, font expectation detection and information display detection on the image to be detected in sequence according to the initial image and the target image.

[0158] The disclosed embodiment can realize multi-dimensional, fast and accurate detection of label template font update by sequentially performing font update detection, font expectation detection and information display detection on the image to be detected of the label to be detected according to the initial image of the initial label and the target image of the target label, further determine whether there is an abnormality and obtain specific abnormality information, thereby effectively improving the efficiency and accuracy of label template font update detection, so that technicians can carry out abnormality repair in a targeted manner. .

[0159] In some embodiments, the detection module 603 includes:

[0160] a font update detection unit, configured to perform a font update detection on the image to be detected based on the initial image, so as to determine whether the font of the characters in the image to be detected is changed compared with the font of the characters in the initial image, and obtain a font update detection result;

[0161] A font expectation detection unit, if the font update detection result indicates that the font has changed, performs font expectation detection on the image to be detected according to the target image, so as to determine whether the font of the characters in the image to be detected meets expectations according to the font of the characters in the target image, and obtain a font expectation detection result;

[0162] The information display detection unit is used to perform information display detection on the image to be detected according to the target image if the expected font detection result indicates that the font meets expectations, so as to determine whether the label information of the image to be detected is displayed completely according to the label information displayed in the target image, and obtain the information display detection result.

[0163] In some embodiments, the detection device also includes: an alarm module, which is used to generate abnormal information and an alarm based on the font update detection result if the font update detection result indicates that the font has not changed; or, if the font expectation detection result indicates that the font does not meet expectations, generate abnormal information and an alarm based on the font expectation detection result; or, if the information display detection result indicates that the label information of the label image to be detected is incomplete, generate abnormal information and an alarm based on the information display detection result.

[0164] In some embodiments, the font update detection unit is specifically used to detect feature points in the image to be detected and the initial image respectively, and obtain a feature description vector of each feature point; match the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the initial image to obtain a feature point pair; based on the feature point pair, determine the matching degree between the image to be detected and the initial image; if the matching degree is less than a first threshold, the font update detection result is characterized as a font change.

[0165] In some embodiments, the font expectation detection unit is specifically used to detect feature points in the image to be detected and the target image respectively, and obtain a feature description vector of each feature point; match the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the target image to obtain a feature point pair; based on the feature point pair, determine the matching degree between the image to be detected and the target image; if the matching degree is greater than a second threshold, the font expectation detection result is characterized as the font meeting expectations.

[0166] In some embodiments, the information display detection unit is specifically used to perform text recognition on the image to be detected and the target image respectively to obtain a first recognized text and a second recognized text; if the first recognized text and the second recognized text are the same, then the information display detection result indicates that the label information display of the image to be detected is complete.

[0167] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0168] Fig. 9A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0169] like Fig. 9 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0170] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0171] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a detection method for updating a label template font. For example, in some embodiments, the detection method for updating a label template font may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or a communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the detection method for updating a label template font described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the label template font update detection method in any other appropriate manner (eg, by means of firmware).

[0172] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0173] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0174] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0175] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0176] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0177] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0178] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0179] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0180] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for detecting a label template font update, characterized in that: The method comprises: According to the font update instruction of the target information template, the first label template including the target information template is updated to obtain a second label template; Based on the label information, an initial image of an initial label is acquired according to the first label template, an image to be detected of a label to be detected is acquired according to the second label template, and a target image of a target label is acquired according to the font update instruction; the label information includes label information corresponding to the target information template, and the initial image, the image to be detected and the target image include characters in corresponding labels; According to the initial image and the target image, font update detection, font expectation detection and information display detection are sequentially performed on the image to be detected.

2. The method according to claim 1, characterized in that The step of sequentially performing font update detection, font expectation detection, and information display detection on the image to be detected according to the initial image and the target image includes: According to the initial image, performing a font update detection on the image to be detected to determine whether the font of the characters in the image to be detected is changed compared with the font of the characters in the initial image, and obtaining a font update detection result; If the font update detection result indicates that the font has changed, then based on the target image, a font expectation detection is performed on the image to be detected, so as to determine whether the font of the characters in the image to be detected meets expectations based on the font of the characters in the target image, and obtain a font expectation detection result; If the expected font detection result indicates that the font meets expectations, then according to the target image, information display detection is performed on the image to be detected to determine whether the label information of the image to be detected is displayed completely according to the label information displayed in the target image, and obtain an information display detection result.

3. The method according to claim 2, characterized in that The method further comprises: If the font update detection result indicates that the font has not changed, generating abnormal information and issuing an alarm according to the font update detection result; or, If the expected font detection result indicates that the font does not meet expectations, abnormal information is generated according to the expected font detection result and an alarm is issued; or, If the information display detection result indicates that the label information display of the to-be-detected label image is incomplete, abnormal information is generated according to the information display detection result and an alarm is issued.

4. The method according to claim 2, characterized in that: The step of performing font update detection on the image to be detected according to the initial image comprises: Detecting feature points in the image to be detected and the initial image respectively, and obtaining a feature description vector of each feature point; Matching the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the initial image to obtain a feature point pair; Based on the feature point pairs, determining a matching degree between the image to be detected and the initial image; If the matching degree is less than a first threshold, the font update detection result indicates that the font has changed.

5. The method according to claim 2, characterized in that: The step of performing font expectation detection on the image to be detected according to the target image includes: Detecting feature points in the image to be detected and the target image respectively, and obtaining a feature description vector of each feature point; Matching the feature description vector of each feature point in the image to be detected with the feature description vector of each feature point in the target image to obtain a feature point pair; Based on the feature point pairs, determining a matching degree between the image to be detected and the target image; If the matching degree is greater than a second threshold, the expected font detection result indicates that the font meets expectations.

6. The method according to claim 2, characterized in that The step of performing information display detection on the image to be detected according to the target image includes: Performing text recognition on the image to be detected and the target image respectively to obtain a first recognized text and a second recognized text; If the first recognition text and the second recognition text are the same, the information display detection result indicates that the label information of the image to be detected is displayed completely.

7. A detection device for updating a label template font, characterized in that: The device comprises: An updating module, configured to update a first label template including the target information template according to a font updating instruction of the target information template to obtain a second label template; An image acquisition module is used to acquire an initial image of an initial label according to the first label template, acquire an image to be detected of a label to be detected according to the second label template, and acquire a target image of a target label according to the font update instruction based on the label information; the label information includes label information corresponding to the target information template, and the initial image, the image to be detected and the target image include characters in the corresponding labels; The detection module is used to perform font update detection, font expectation detection and information display detection on the image to be detected in sequence according to the initial image and the target image.

8. The device according to claim 7, characterized in that The detection module comprises: a font update detection unit, configured to perform a font update detection on the image to be detected based on the initial image, so as to determine whether the font of the characters in the image to be detected is changed compared with the font of the characters in the initial image, and obtain a font update detection result; A font expectation detection unit, if the font update detection result indicates that the font has changed, performs font expectation detection on the image to be detected according to the target image, so as to determine whether the font of the characters in the image to be detected meets expectations according to the font of the characters in the target image, and obtain a font expectation detection result; The information display detection unit is used to perform information display detection on the image to be detected according to the target image if the expected font detection result indicates that the font meets expectations, so as to determine whether the label information of the image to be detected is displayed completely according to the label information displayed in the target image, and obtain the information display detection result.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-6.