A detection method, an identification positioning method and related devices
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]本申请提供的一种检测方法、标识定位方法及相关装置,解决了检测精度低的问题
Smart Images

Figure CN119251846B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a detection method, a marking and positioning method, and related apparatus. Background Technology
[0002] With the development of the manufacturing industry, product markings on products generally serve as records and certification marks. For example, product markings can be the logo on the back of a mobile phone, the product model on the earphone case, the product model on the back of a smartwatch, a qualification mark on product packaging, and so on.
[0003] To ensure the accuracy of product labeling, manual inspection is sometimes used in related technologies. However, due to the large variety of product labels, manual inspection alone may result in errors or omissions.
[0004] To address the issues of false positives and false negatives caused by manual inspection, a product identification detection method is further provided in related technologies. This method detects product identifications using a pre-trained anomaly recognition model, but it still suffers from low detection accuracy. Summary of the Invention
[0005] This application provides a detection method, a marker positioning method, and a related device, which solves the problem of low detection accuracy.
[0006] To achieve the above objectives, this application adopts the following technical solution:
[0007] Firstly, this application provides a detection method comprising: acquiring a detection image including a target identifier and a detection file corresponding to the detection image indicating the type of the target identifier; determining a detection method corresponding to the target identifier based on the type information in the detection file; and using the detection method to detect the detection image to obtain a detection result for the target identifier. In related technologies, anomaly recognition models identify product identifiers using the same detection method for different product identifiers. However, given the large variety of product identifiers, this may lead to low detection accuracy in anomaly recognition models. This application improves detection accuracy by obtaining the type information of the target identifier from the detection file corresponding to the detection image and applying different detection methods to the corresponding target identifiers based on different type information.
[0008] In one possible implementation, when the identifier to be detected is a hollow identifier, contour extraction can be performed on the image to be detected and a first image template to obtain a first contour corresponding to the image to be detected and a second contour corresponding to the first image template. The first image template is an image template from an image template library that corresponds to the identifier to be detected. The image template library includes multiple image templates. Then, the first and second contours are drawn with the same line width on blank images of the same size to obtain a first drawing corresponding to the first contour and a second drawing corresponding to the second contour. The first drawing and the second drawing are then matched to obtain the detection result of the identifier to be detected. By extracting the inner and outer contours of the image to be detected and the image template corresponding to the identifier to be detected, and drawing them with the same line width on blank images of the same size, it is beneficial for matching and detecting hollow, irregular patterns of identifiers, avoiding the problem of reduced matching accuracy caused by the identifier's thin line width, and improving detection precision.
[0009] In one possible implementation, when the identifier to be detected is a rotated identifier, multiple first feature points corresponding to the identifier in the image to be detected and multiple second feature points corresponding to the second image template can be determined firstly. The second image template is an image template from an image template library that corresponds to the identifier to be detected. The image template library includes multiple image templates. Then, the multiple first feature points are matched with the multiple second feature points to obtain multiple matching results, where each matching result indicates a successful match or a failed match. If the number of successful matches is greater than a preset number, the rotation angle corresponding to the identifier to be detected is determined, and the second image template is rotated to the desired rotation angle. The identifier to be detected is then matched with the rotated second matching image template to obtain the detection result. In related technologies, when using an anomaly detection model to detect an identifier, the detection result may differ due to the identifier being rotated relative to the image template. This embodiment of the application facilitates detection and improves detection accuracy by matching multiple first feature points corresponding to the identifier to be detected with multiple second feature points corresponding to the image template, and rotating the image template to the same angle as the identifier after a successful match.
[0010] In one possible implementation, when the image to be detected includes both invariant and variable identifiers, the position of the variable identifier in the image to be detected can be determined first. Based on the position, a mask is used to process the variable identifier to obtain a processed image to be detected. Then, the invariant identifier in the processed image to be detected is matched with a third image template to obtain a first detection result. The third image template is an image template in an image template library that corresponds to the invariant identifier. The image template library includes multiple image templates. Further, optical character recognition (OCR) technology is used to recognize the variable identifier to obtain a second detection result. Finally, the first and second detection results are used as the detection results for obtaining the identifier. Since different variable-containing identifiers indicate different variables, it is difficult to detect them using template matching in related technologies, and it is easy to detect the correct variable identifier as the wrong identifier. Therefore, in this embodiment of the application, the variable identifiers are first masked using a mask, the non-variable identifiers in the image to be detected are detected first, and OSR recognition technology is further used to detect the variable identifiers, so as to avoid the influence of the variable identifiers on the image to be detected and improve the detection accuracy.
[0011] In one possible implementation, before detecting the image to be detected using a detection method, the method further includes: converting the image to be detected into a binary image; then determining multiple contour regions in the binary image; further segmenting each contour region to obtain multiple contours; then determining the minimum bounding rectangle corresponding to each contour; further filtering contours whose width or length of the minimum bounding rectangle is greater than a preset width or length; then performing region segmentation processing on the binary image to obtain multiple segmented regions; and merging one or more minimum bounding rectangles in each segmented region to obtain target rectangles indicating the location of the identifier to be detected for each segmented region. The identifier to be detected within the target rectangle is then detected using a detection method to obtain the detection result of the identifier to be detected. It should be understood that, due to the low recognition accuracy of anomaly recognition models in related technologies when identifying product logos in images, the product logos extracted from the images may be incomplete. In this embodiment, multiple contours in the image to be detected are determined and filtered. The image to be detected is then segmented according to the area where the logo to be detected is located to obtain multiple segmented regions. Then, the rectangles within the segmented regions are merged to obtain the position of the logo to be detected, i.e., the target rectangle, which facilitates the subsequent positioning and separation of the logo to be detected and improves the detection accuracy.
[0012] In one possible implementation, before determining the detection method corresponding to the identifier to be detected based on the file to be detected, the method further includes: cropping the image to be detected to obtain a first image to be detected; then thresholding the first image to be detected to obtain a second image to be detected; and finally performing morphological processing on the second image to be detected to obtain a preprocessed image. The preprocessed image can then be further used to perform detection on the detection method to obtain the detection result of the identifier to be detected. It should be understood that since the image to be detected may contain content unrelated to the identifier to be detected, this unrelated content may affect the detection accuracy of the image to be detected. Therefore, in this embodiment, by cropping and thresholding the content unrelated to the identifier to be detected in the image to be detected to obtain the preprocessed image, the influence of unrelated content on the detection accuracy of the identifier to be detected is avoided.
[0013] In one possible implementation, if the image to be detected contains annotations, before thresholding the first image to be detected, the method further includes: removing the annotations from the first image to be detected to obtain an intermediate processed image; and correspondingly, thresholding the intermediate processed image to obtain a second image to be detected. Since the image to be detected may contain annotations, and these annotations can affect detection accuracy, it is necessary to remove the annotations from the image to be detected, i.e., remove the annotations from the first image to be detected, to avoid the annotations affecting the detection accuracy of the detected identifiers.
[0014] Secondly, embodiments of this application provide a detection method, which includes: acquiring a detection image including a hollow identifier to be detected; then performing contour extraction on the detection image and a first image template to obtain a first contour corresponding to the detection image and a second contour corresponding to the first image template, wherein the first image template is an image template in an image template library corresponding to the hollow identifier to be detected, and the image template library includes multiple image templates; further, drawing the first contour and the second contour with the same line width on blank images of the same size to obtain a first drawing corresponding to the first contour and a second drawing corresponding to the second contour; then matching the first drawing and the second drawing to obtain the detection result of the hollow identifier to be detected.
[0015] It should be understood that, due to the small effective area and thin line width of hollow irregular patterns (i.e., hollow marks), the detection accuracy may be low. To solve this technical problem, the embodiments of this application extract the inner and outer contours of the image to be detected and the first image template respectively, and draw them on a blank image of the same size with the same line width. This is beneficial for matching and detecting hollow irregular patterns, avoiding the problem of reduced matching accuracy caused by the thin line width of the mark to be detected, and improving the detection accuracy.
[0016] In one possible implementation of the second aspect, before contour extraction of the image to be detected and the first image template, the method further includes: cropping the image to be detected to obtain a first image to be detected, then thresholding the first image to be detected to obtain a second image to be detected, and finally performing morphological processing on the second image to be detected to obtain a preprocessed image. Contour extraction can further be performed on the preprocessed image and the first image template. It should be understood that since the image to be detected may contain content unrelated to the identifier to be detected, this unrelated content may affect the detection accuracy of the image to be detected. Therefore, in this embodiment, by cropping and thresholding the content unrelated to the identifier to be detected in the image to be detected to obtain a preprocessed image, the influence of unrelated content on the detection accuracy of the identifier to be detected is avoided.
[0017] In one possible implementation of the second aspect, if the image to be detected contains annotations, before thresholding the first image to be detected, the method further includes: removing the annotations from the first image to be detected to obtain an intermediate processed image; and correspondingly, thresholding the intermediate processed image to obtain a second image to be detected. Since the image to be detected may contain annotations, and these annotations can affect detection accuracy, it is necessary to remove the annotations from the image to be detected, i.e., remove the annotations from the first image to be detected, to avoid the annotations affecting the detection accuracy of the detected identifiers.
[0018] In one possible implementation of the second aspect, if the detection result of the hollow marker to be detected indicates that the hollow marker to be detected is incorrect, the method further includes: drawing the marker to be detected in the first drawing onto a third blank drawing to obtain a third drawing; and further matching the third drawing with the second drawing to obtain the detection result of the hollow marker to be detected. It should be understood that since the first drawing is a drawing of the image to be detected, the detection result may be incorrect due to the second drawing being unclear. Therefore, it is beneficial to further draw the hollow marker to be detected in the first drawing separately onto the third blank drawing to obtain a third drawing, and then perform a second detection, which helps to improve the detection accuracy.
[0019] In one possible implementation of the second aspect, before extracting contours from the image to be detected and the first image template, the method further includes: converting the image to be detected into a binary image, then determining multiple contour regions of the binary image, further segmenting each contour region to obtain multiple contours, then determining the bounding minimum rectangle corresponding to each contour, further filtering contours whose width or length of the bounding minimum rectangle is greater than a preset width or a preset length, then performing region segmentation processing on the binary image to obtain multiple segmented regions, and merging one or more bounding minimum rectangles in each segmented region to obtain target rectangles corresponding to each segmented region indicating the location of the hollow identifier to be detected. It should be understood that, due to the low recognition accuracy when using anomaly recognition models to identify product identifiers in images in related technologies, the product identifiers extracted from the image may be incomplete. In this embodiment, by determining multiple contours in the image to be detected, filtering the multiple contours, and segmenting the image to be detected according to the region where the hollow identifier to be detected is located, multiple segmented regions are obtained. Then, the rectangles within the segmented regions are merged to obtain the location of the hollow identifier to be detected, i.e., the target rectangle, which facilitates subsequent positioning and separation of the identifier to be detected and improves detection accuracy.
[0020] In one possible implementation of the second aspect, before performing contour extraction on the image to be detected and the first image template, the method further includes: obtaining the image to be detected and the corresponding file to be detected; the image to be detected includes a hollow identifier to be detected; the file to be detected indicates the type information of the hollow identifier to be detected; determining the detection method corresponding to the hollow identifier to be detected based on the type information in the file to be detected; and further performing contour extraction on the image to be detected and the first image template based on the detection method.
[0021] Thirdly, embodiments of this application provide a detection method, which includes: acquiring a detection image including a rotation marker to be detected; then determining multiple first feature points corresponding to the rotation marker to be detected and multiple second feature points corresponding to a second image template, wherein the second image template is an image template in an image template library corresponding to the rotation marker to be detected, and the image template library includes multiple image templates; further matching the multiple first feature points with the multiple second feature points to obtain multiple matching results, wherein the matching results indicate successful matching or failed matching; if the number of matching results indicating successful matching is greater than a preset number, then determining the rotation angle corresponding to the rotation marker to be detected and rotating the second image template to the rotation angle; further matching the rotation marker to be detected with the rotated second matching image template to obtain a detection result for the rotation marker to be detected.
[0022] It should be understood that when using anomaly recognition models in related technologies, identification of wrapped string identifiers (rotation identifiers) may fail, resulting in low detection accuracy. To solve this technical problem, this application embodiment matches the feature points of the rotation identifier to be detected with the second image template. After successful matching, the rotation angle of the rotation identifier to be detected is determined, and the second image template is rotated to the rotation angle. Then, the rotated second image template and the rotation identifier to be detected are matched to improve detection accuracy.
[0023] In one possible implementation of the third aspect, before determining the plurality of first feature points corresponding to the rotation identifier to be detected and the plurality of second feature points corresponding to the second image template, the method further includes: cropping the image to be detected to obtain a first image to be detected; then thresholding the first image to be detected to obtain a second image to be detected; and finally performing morphological processing on the second image to be detected to obtain a preprocessed image. Further, the plurality of first feature points corresponding to the rotation identifier to be detected and the plurality of second feature points corresponding to the second image template in the preprocessed image can be determined. It should be understood that since the image to be detected may contain content unrelated to the identifier to be detected, this unrelated content may affect the detection accuracy of the image to be detected. Therefore, in this embodiment, by cropping and thresholding the content unrelated to the identifier to be detected in the image to be detected to obtain the preprocessed image, the influence of unrelated content on the detection accuracy of the identifier to be detected is avoided.
[0024] In one possible implementation of the third aspect, if the image to be detected contains annotations, before thresholding the first image to be detected, the method further includes: removing the annotations from the first image to be detected to obtain an intermediate processed image; and correspondingly, thresholding the intermediate processed image to obtain a second image to be detected. Since the image to be detected may contain annotations, and these annotations can affect detection accuracy, it is necessary to remove the annotations from the image to be detected, i.e., remove the annotations from the first image to be detected, to avoid the annotations affecting the detection accuracy of the detected identifiers.
[0025] In one possible implementation of the third aspect, before determining the multiple first feature points corresponding to the rotating identifier to be detected and the multiple second feature points corresponding to the second image template, the method further includes: converting the image to be detected into a binary image; then determining multiple contour regions of the binary image; further segmenting each contour region to obtain multiple contours; then determining the bounding minimum rectangle corresponding to each contour; further filtering contours whose width or length of the bounding minimum rectangle is greater than a preset width or a preset length; then performing region segmentation processing on the binary image to obtain multiple segmented regions; and merging one or more bounding minimum rectangles in each segmented region to obtain target rectangles corresponding to each segmented region indicating the position of the hollow identifier to be detected. Specifically, the rotating identifier to be detected is further determined based on the target rectangles, and then the multiple first feature points corresponding to the rotating identifier to be detected and the multiple second feature points corresponding to the second image template are determined. It should be understood that, due to the low recognition accuracy of anomaly recognition models in related technologies when identifying product logos in images, the product logos extracted from the images may be incomplete. In this embodiment, multiple contours in the image to be detected are determined and filtered. The image to be detected is then segmented according to the area where the logo to be detected is located to obtain multiple segmented regions. Then, the rectangles within the segmented regions are merged to obtain the position of the logo to be detected, i.e., the target rectangle, which facilitates the subsequent positioning and separation of the rotated logo to be detected, thereby improving the detection accuracy.
[0026] In one possible implementation of the third aspect, before determining the multiple first feature points corresponding to the rotation identifier to be detected and the multiple second feature points corresponding to the second image template, the method further includes: acquiring an image to be detected and a file to be detected corresponding to the image to be detected; the image to be detected includes the rotation identifier to be detected; the file to be detected indicates the type information of the rotation identifier to be detected; determining the detection method corresponding to the rotation identifier to be detected based on the type information in the file to be detected; and further determining the multiple first feature points corresponding to the rotation identifier to be detected and the multiple second feature points corresponding to the second image template based on the detection method.
[0027] Fourthly, embodiments of this application provide a detection method, which includes: acquiring a detection image including a variable identifier to be detected and a non-variable identifier to be detected; determining the position of the variable identifier to be detected in the detection image; processing the variable identifier to be detected using a mask based on the position to obtain a processed detection image; matching the non-variable identifier to be detected in the processed detection image with a third image template to obtain a first detection result, wherein the third image template is an image template in an image template library corresponding to the non-variable identifier to be detected, and the image template library includes multiple image templates; and using optical character recognition (OCR) technology to recognize the variable identifier to be detected to obtain a second detection result; and finally using the first detection result and the second detection result as the detection result of the detection image.
[0028] It should be understood that in related technologies, due to the significant difference between the variable to be detected and the image templates in the image template library, the anomaly recognition model may make anomalies in the detection of the scalar variable to be detected, thereby reducing the detection accuracy. In order to solve the above technical problem, the embodiments of this application first mask the variable to be detected using a mask, and then detect the non-variable variable to be detected. Then, OCR technology is used to detect the variable to be detected, thereby obtaining the detection result of the image to be detected and improving the detection accuracy.
[0029] In one possible implementation of the fourth aspect, before determining the location of the variable identifier to be detected in the image to be detected, the method further includes: cropping the image to be detected to obtain a first image to be detected, then thresholding the first image to be detected to obtain a second image to be detected, and finally performing morphological processing on the second image to be detected to obtain a preprocessed image, wherein the location of the variable identifier to be detected in the preprocessed image can be further determined. It should be understood that since the image to be detected may contain content unrelated to the identifier to be detected, this unrelated content may affect the detection accuracy of the image to be detected. Therefore, in this embodiment, by cropping and thresholding the content unrelated to the identifier to be detected in the image to be detected to obtain a preprocessed image, the influence of unrelated content on the detection accuracy of the identifier to be detected is avoided.
[0030] In one possible implementation of the fourth aspect, if the image to be detected contains annotations, before thresholding the first image to be detected, the method further includes: removing the annotations from the first image to be detected to obtain an intermediate processed image; and correspondingly, thresholding the intermediate processed image to obtain a second image to be detected. Since the image to be detected may contain annotations, and these annotations can affect detection accuracy, it is necessary to remove the annotations from the image to be detected, i.e., remove the annotations from the first image to be detected, to avoid the annotations affecting the detection accuracy of the detected identifiers.
[0031] In one possible implementation of the fourth aspect, before determining the location of the variable identifier to be detected in the image to be detected, the method further includes: converting the image to be detected into a binary image, then determining multiple contour regions of the binary image, further segmenting each contour region to obtain multiple contours, then determining the bounding minimum rectangle corresponding to each contour, further filtering contours whose width of the bounding minimum rectangle is greater than a preset width or whose length of the bounding minimum rectangle is greater than a preset length, then performing region segmentation processing on the binary image to obtain multiple segmented regions, and merging one or more bounding minimum rectangles in each segmented region to obtain target rectangles corresponding to each segmented region that indicate the location of the variable identifier to be detected or the non-variable identifier to be detected. It should be understood that, due to the low recognition accuracy of anomaly recognition models used in related technologies to identify product identifiers in images, the product identifiers extracted from the images may be incomplete. In this embodiment, multiple contours in the image to be detected are determined and filtered. The image to be detected is then segmented according to the region where the variable identifier or non-variable identifier to be detected is located, resulting in multiple segmented regions. The rectangles within the segmented regions are then merged to obtain the position of the variable identifier or non-variable identifier to be detected, i.e., the target rectangle. This facilitates the subsequent positioning and separation of the variable identifier or non-variable identifier to be detected, thereby improving detection accuracy.
[0032] In one possible implementation of the fourth aspect, when the invariant identifier to be detected is a hollow identifier, contour extraction can be performed on the image to be detected and the first image template to obtain a first contour corresponding to the image to be detected and a second contour corresponding to the first image template. The first image template is an image template from an image template library that corresponds to the identifier to be detected. The image template library includes multiple image templates. Then, the first contour and the second contour are drawn with the same line width on a blank image of the same size to obtain a first drawing corresponding to the first contour and a second drawing corresponding to the second contour. The first drawing and the second drawing are then matched to obtain the detection result of the invariant identifier to be detected. By extracting the inner and outer contours of the image to be detected and the image template corresponding to the invariant identifier to be detected, and drawing them with the same line width on a blank image of the same size, it is beneficial for matching and detecting hollow, irregular patterns, avoiding the problem of reduced matching accuracy caused by the thin line width of the hollow identifier, and improving detection accuracy.
[0033] In one possible implementation of the fourth aspect, when the invariant to be detected is a rotational identifier, multiple first feature points corresponding to the invariant to be detected in the image to be detected and multiple second feature points corresponding to the second image template can be determined firstly. The second image template is an image template in an image template library that corresponds to the identifier to be detected. The image template library includes multiple image templates. Then, multiple first feature points are matched with multiple second feature points to obtain multiple matching results. The matching results indicate whether the matching is successful or unsuccessful. If the number of matching results indicating successful matching is greater than a preset number, the rotation angle corresponding to the invariant to be detected is determined, and the second image template is rotated to the rotation angle. The invariant to be detected is then matched with the rotated second matching image template to obtain the detection result of the invariant to be detected. In related technologies, when using an anomaly detection model to detect invariant identifiers, the detection results may differ due to the rotation of the invariant identifier relative to the image template. In this embodiment, multiple first feature points corresponding to the invariant identifier to be detected are matched with multiple second feature points corresponding to the image template. After successful matching, the image template is rotated to the same angle as the invariant identifier to be detected, which facilitates detection and improves detection accuracy.
[0034] In one possible implementation of the fourth aspect, before determining the position of the variable identifier to be detected in the image to be detected, the method further includes: acquiring the image to be detected and the corresponding file to be detected; the image to be detected includes the variable identifier to be detected and the non-variable identifier to be detected; the file to be detected indicates a first type of information of the variable identifier to be detected and a second type of information of the non-variable identifier to be detected; determining a first detection method corresponding to the variable identifier to be detected based on the first type of information in the file to be detected, and determining a second detection method corresponding to the non-variable identifier to be detected based on the second type of information in the file to be detected; further determining multiple first feature points corresponding to the rotation identifier to be detected and multiple second feature points corresponding to the second image template based on the first detection method; and further matching the non-variable identifier to be detected in the processed image to be detected with the third image template based on the second detection method to obtain a first detection result.
[0035] Fifthly, embodiments of this application provide a marker localization method, which includes: acquiring a target image including a marker to be detected; converting the target image into a binary image; determining multiple contour regions of the binary image; further segmenting each contour region to obtain multiple contours; determining the minimum bounding rectangle corresponding to each contour; further filtering contours whose width of the minimum bounding rectangle is greater than a preset width or whose length of the minimum bounding rectangle is greater than a preset length; further performing region segmentation processing on the binary image to obtain multiple segmented regions; and then merging one or more minimum bounding rectangles in each segmented region to obtain a target rectangle corresponding to the position of the marker to be detected in each segmented region.
[0036] It should be understood that in related technologies, when using anomaly detection models to detect product logos in images, it is also necessary to locate and extract the product logos in the image before detecting them. However, due to training issues with the anomaly detection model, it may fail to recognize smaller logos, leading to the identification of correct logos as incorrect ones. To solve this technical problem, embodiments of this application determine multiple contours in the image to be detected, filter these contours, and segment the image according to the region where the logo to be detected is located, obtaining multiple segmented regions. Then, the rectangles within the segmented regions are merged to obtain the position of the logo to be detected. This facilitates the extraction of complete logos from the image, enabling the recognition of smaller logos and improving detection accuracy.
[0037] In one possible implementation of the fifth aspect, before converting the image to be detected into a binary image, the method further includes: cropping the image to be detected to obtain a first image to be detected; then thresholding the first image to be detected to obtain a second image to be detected; and finally performing morphological processing on the second image to be detected to obtain a preprocessed image. The preprocessed image can further be used as a binary image. It should be understood that since the image to be detected may contain content unrelated to the identifier to be detected, this unrelated content may affect the detection accuracy of the image. Therefore, in this embodiment, by cropping and thresholding the content unrelated to the identifier to be detected in the image to obtain the preprocessed image, the influence of unrelated content on the detection accuracy of the identifier to be detected is avoided.
[0038] In one possible implementation of the fifth aspect, if the image to be detected contains annotations, before thresholding the first image to be detected, the method further includes: removing the annotations from the first image to be detected to obtain an intermediate processed image; and correspondingly, thresholding the intermediate processed image to obtain a second image to be detected. Since the image to be detected may contain annotations, and these annotations can affect detection accuracy, it is necessary to remove the annotations from the image to be detected, i.e., remove the annotations from the first image to be detected, to avoid the annotations affecting the detection accuracy of the detected identifiers.
[0039] In one possible implementation of the fifth aspect, when the target rectangle indicates a hollow identifier, contour extraction can be performed on the image to be detected and a first image template to obtain a first contour corresponding to the image to be detected and a second contour corresponding to the first image template. The first image template is an image template from an image template library that corresponds to the identifier to be detected. The image template library includes multiple image templates. Then, the first and second contours are drawn with the same line width on blank images of the same size to obtain a first drawing corresponding to the first contour and a second drawing corresponding to the second contour. The first drawing and the second drawing are then matched to obtain the detection result of the identifier to be detected. By extracting the inner and outer contours of the image to be detected and the image template corresponding to the identifier to be detected, and drawing them with the same line width on blank images of the same size, it is beneficial for matching and detecting hollow, irregular patterns of identifiers, avoiding the problem of reduced matching accuracy caused by the thin line width of the identifier to be detected, and improving detection accuracy.
[0040] In one possible implementation of the fifth aspect, when the target rectangle indicates a rotated identifier, multiple first feature points corresponding to the identifier in the image to be detected and multiple second feature points corresponding to the second image template can be determined firstly. The second image template is an image template from an image template library corresponding to the identifier to be detected, and the image template library includes multiple image templates. Then, multiple first feature points are matched with multiple second feature points to obtain multiple matching results, where each matching result indicates a successful match or a failed match. If the number of successful matches among the multiple matching results is greater than a preset number, the rotation angle corresponding to the identifier to be detected is determined, and the second image template is rotated to the rotation angle. The identifier to be detected is then matched with the rotated second matching image template to obtain the detection result of the identifier to be detected. In related technologies, when using an anomaly detection model to detect an identifier, the detection result may differ due to the identifier being rotated relative to the image template. This embodiment of the application facilitates detection and improves detection accuracy by matching multiple first feature points corresponding to the identifier to be detected with multiple second feature points corresponding to the image template, and rotating the image template to the same angle as the identifier to be detected after a successful match.
[0041] In one possible implementation of the fifth aspect, when the target bounding box indicates both a non-variable target identifier and a variable target identifier, the position of the variable target identifier in the image to be detected can be determined first. Based on the position, a mask is used to process the variable target identifier to obtain a processed image to be detected. Then, the non-variable target identifier in the processed image to be detected is matched with a third image template to obtain a first detection result. The third image template is an image template in an image template library that corresponds to the non-variable target identifier. The image template library includes multiple image templates. Further, optical character recognition (OCR) technology is used to recognize the variable target identifier to obtain a second detection result. Finally, the first and second detection results are used as the detection results for obtaining the target identifier. Since different variable-containing identifiers indicate different variables, it is difficult to detect them using template matching in related technologies, and it is easy to detect the correct variable identifier as the wrong identifier. Therefore, in this embodiment of the application, the variable identifiers are first masked using a mask, the non-variable identifiers in the image to be detected are detected first, and OSR recognition technology is further used to detect the variable identifiers, so as to avoid the influence of the variable identifiers on the image to be detected and improve the detection accuracy.
[0042] Sixthly, embodiments of this application provide an electronic device, including: a processor and a memory; wherein, one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device performs the detection method of the first aspect, or performs the detection method of the second aspect, or performs the detection method of the third aspect, or performs the detection method of the fourth aspect, or performs the identification and positioning method of the fifth aspect.
[0043] In a seventh aspect, embodiments of this application provide a computer storage medium including computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the detection method as described in the first aspect, or the detection method as described in the second aspect, or the detection method as described in the third aspect, or the detection method as described in the fourth aspect, or the identification and positioning method as described in the fifth aspect. Attached Figure Description
[0044] Figure 1 A schematic diagram illustrating a typical anomaly identification scenario for related technologies;
[0045] Figure 2 A schematic flowchart of an image processing method provided in an embodiment of this application;
[0046] Figure 3aA schematic diagram of some image templates in the image template library provided in the embodiments of this application;
[0047] Figure 3b A schematic diagram of an image to be detected provided in an embodiment of this application;
[0048] Figure 3c A schematic diagram illustrating different identifiers to be detected provided in embodiments of this application;
[0049] Figure 3d This is a schematic diagram of a detection document provided in an embodiment of this application;
[0050] Figure 3e A schematic diagram of a tag parameter provided in an embodiment of this application;
[0051] Figure 3f A schematic diagram of a threshold parameter provided in an embodiment of this application;
[0052] Figure 4a A schematic diagram illustrating a cropping process of an image to be detected, provided as an embodiment of this application;
[0053] Figure 4b A schematic diagram illustrating the annotation removal of a second image to be detected, provided in an embodiment of this application;
[0054] Figure 4c This is a schematic diagram of a second image to be detected after thresholding, provided in an embodiment of this application.
[0055] Figure 5 A schematic diagram of rectangular frames corresponding to various contours of a preprocessed image provided in an embodiment of this application;
[0056] Figure 6a A schematic diagram showing a hollow identifier to be detected, provided as an embodiment of this application;
[0057] Figure 6b A schematic diagram of the outline of a preprocessed image and an image template provided in an embodiment of this application;
[0058] Figure 7 A schematic diagram illustrating SIFT feature point matching provided in an embodiment of this application;
[0059] Figure 8 A schematic diagram illustrating the recognition result of a variable-containing identifier provided in an embodiment of this application;
[0060] Figure 9 A flowchart illustrating another image detection method provided in an embodiment of this application;
[0061] Figure 10 This is a schematic diagram of the structure of an image detection system provided in an embodiment of this application;
[0062] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0063] In related technologies, to ensure the accuracy of product labeling, it is generally done manually. For example, product design drawings, product packaging, or product labeling can be reviewed, inspected, and recorded manually. However, it is difficult for humans to judge the completeness and correctness of product design drawings, product packaging, or product labeling.
[0064] For example, taking product design drawings as an example, the design identifier (referring to the product identifier) on the product design drawing is a unique mark that is effectively recorded and certified for each batch of products during the production and manufacturing process. The design identifier on the product design drawing is used to avoid misuse and confusion during the product design, production, storage, and circulation processes. However, when manually inspecting design identifiers, a large amount of measurement and comparison calculation is required, which may lead to false positives and false negatives. If incorrect design identifiers are not effectively intercepted during the product design stage, it may lead to the scrapping of products after mass production, resulting in significant losses. In other words, manual inspection has low inspection efficiency and low inspection accuracy.
[0065] To address the issues of low efficiency and accuracy in manual inspection, related technologies also provide a product label detection method. This method uses a pre-trained anomaly detection model to identify product design drawings, product packaging, or product labels, and intercepts product design drawings, product packaging, or products with incorrect product labels. However, due to limitations in the training of the anomaly detection model, anomalies may occur during identification. For example, Figure 1 The diagram illustrates typical anomaly detection scenarios in related technologies. For example... Figure 1 As shown, typical anomaly identification situations may include, but are not limited to, anomaly identification of DC / AC symbols, interference between marking lines and markings, failure to detect small-area markings, and anomaly identification of circular strings.
[0066] DC / AC symbol anomaly recognition refers to the possibility that the anomaly recognition model may mistakenly identify non-DC / AC symbols as DC / AC symbols when identifying DC or AC symbols. Figure 1 As shown in 'a', product identifier A includes a communication symbol (as shown by the black border within product identifier A), but outside product identifier A there is a line B resembling a communication symbol. In the anomaly detection model, this... Figure 1 When recognizing the image shown in 'a', the anomaly recognition model may misidentify content other than product identifier A (i.e., line B) as communication symbols.
[0067] Annotation line interference with markings refers to the interference caused by annotation lines when an anomaly detection model identifies markings in product design drawings. These drawings typically include annotations with dimensions, such as... Figure 1 As shown in b, however, the annotation line may cause the anomaly detection model to misidentify a correct identifier as an incorrect one when identifying the identifier. For example, the annotation line may be mistakenly identified as a product identifier (e.g., ...). Figure 1 The part of “CE” shown in b in the document may cause a product label that is actually correct to be identified as an incorrect label.
[0068] The inability to detect small-area markers refers to a situation where, due to training issues with the anomaly detection model, it may fail to identify smaller markers, such as... Figure 1 As shown in c, assuming the product label is "Audio", the dot "·" for the letter "i" may not be recognized, causing the correct label to be identified as the wrong label.
[0069] Circular string anomaly detection refers to the failure to successfully identify encircling string identifiers when using anomaly detection models, such as... Figure 1 As shown in d, Figure 1 In the diagram, 'd' indicates that 'B' represents the back of the watch. Figure 1 In the diagram, 'e' represents the recognition result for 'B', combined with... Figure 1 As shown in d, only a portion of the encircling string logo on the back of the watch can be recognized; most of the encircling string logo remains unrecognized.
[0070] In summary, in related technologies, the detection of product design drawings, product packaging, or product markings by manual methods or pre-trained anomaly recognition models may result in false detections or false negatives, leading to low detection accuracy.
[0071] To solve the above technical problems, see Figure 2 This application provides an image detection method, which may include:
[0072] S201: Establish an image template library.
[0073] The image template library includes multiple image templates, each representing a different product identifier. The image templates in the library are used to match the identifier to be detected. Image templates can be constructed based on images of the product itself, design drawings, packaging, production line photos, etc. For example, multiple image templates can be obtained by cropping and naming images of the product itself, design drawings, packaging, production line photos, etc., and an image template library can be created based on these multiple image templates, such as... Figure 3a As shown, Figure 3aThis section showcases some of the image templates in the image template library. Images of the product itself, design drawings, packaging, production line photos, etc., can be obtained through methods such as photography and scanning, but are not limited to these.
[0074] In some possible implementations, since the image template library contains a wide variety of image templates, to improve image matching efficiency, an associated image template library related to the image to be detected can be pre-built. This associated image template library can then be used to match the image to be detected, thereby improving matching efficiency. For example, if the image to be detected is a product design drawing that includes environmental protection symbols and a product logo, then the associated image template library can include various environmental protection symbols and various product logos.
[0075] The image to be detected is an image containing the identifier to be detected, such as a product design drawing, product packaging image, product image, etc., but it is not limited to this. Figure 3b As shown, Figure 3b An image to be inspected is shown, which is a product packaging image. The label to be inspected refers to the product label to be inspected, including but not limited to text labels, image labels, environmental labels, product logos, etc., and is not limited here. For example, Figure 3c It shows different product design drawings and corresponding different inspection marks, which may include inspection mark 1, inspection mark 2 and inspection mark 3.
[0076] In some possible implementations, the image to be detected can be stored in the format of an image template from an image template library. For example, assuming the image templates in the library are in PNG format, the image to be detected can be stored in PNG format in the library folder according to a preset naming rule. The preset naming rule refers to the naming convention for the image to be detected; for example, it can be named using any one or more combinations of English and numbers, English, numbers, Chinese characters, Chinese and English, or Chinese and numbers, and is not limited here.
[0077] The detection file indicates the name of the image to be detected, as well as the name and quantity of the identifiers to be detected within that image. For example, combined with... Figure 3d As shown, taking the first row as an example, the first column of the detection file can be written with the name of the image to be detected as "andy-l21D". Following this, the names and quantities of the identifiers to be detected are written sequentially. For example, the identifier name is "TUV Rheinland Low Blue Light Band QR Code", and the quantity is 1; the identifier name is "H-001", and the quantity is 4; the identifier name is "C-007", and the quantity is 1; the identifier name is "F-009", and the quantity is 1. This is just one example, combined with... Figure 3dAs shown, taking the second row as an example, "CMA-AN00-00, H-001, 2" indicates that the name of the image to be detected is "CMA-AN00-00", and the image to be detected includes a detection identifier with a quantity of 1 and a name of "H-001".
[0078] It should be understood that, since there may be multiple images to be detected, and each image may contain one or more identifiers to be detected, a detection file can be pre-built to indicate the images to be detected and the identifiers to be detected within them, in order to improve detection efficiency. That is, by building a detection file, the content to be detected in the images can be determined, facilitating matching with an image template library and improving detection speed.
[0079] S202: Define matching rules.
[0080] Matching rules refer to the rules related to image templates in the image template library, such as the storage rules of image templates, the naming rules of image templates, the rules of label parameters related to image templates, the rules of threshold parameters related to image templates, and so on.
[0081] Image templates in the image template library can be stored according to different storage formats. For example, image templates in the image template library can be stored according to preset image formats and preset naming rules, such as... Figure 3a The recycling icon shown can be C-007.png. Preset image formats include, but are not limited to, PNG, JPEG, PDF, etc., and are not specified here. Preset naming rules allow for letters, Chinese characters, numbers, etc. For example, image templates include solid and hollow icons; solid icons can be named H-001, and hollow icons can be named H-001-L.png.
[0082] It should be understood that by storing image templates in the image template library according to a preset storage format and naming them according to preset naming rules, the image to be detected can be retrieved by name when matching it with the image template library, thereby improving the matching speed.
[0083] Label parameters refer to parameters related to the image template, such as name, whether it can be rotated, whether it is hollow, whether it has color, character variables, etc., without specific limitations here. For example, the first and second columns of the label parameters are the name of the image template, and the last four columns represent whether it can be rotated, whether it is hollow, whether the color is variable, and whether character variables exist, where "Y" represents "yes" and "N" represents "no". Combined with... Figure 3eAs shown, taking the first row as an example, "H-001, H-001, Y, N, N, N" indicates that the image template name is H-001, the specific category of the image template is H-001, the image template can be rotated, is not hollow, the color is immutable, and there are no character variables. It should be noted that "whether the color is mutable" refers to whether the identifier to be detected can be changed to other colors, such as changing from black to red, green, etc.
[0084] It should be understood that since the identifier to be detected may be a product identifier that is rotated, hollow, has variable color, or has character variables, the aforementioned factors may cause the identifier to be detected to be an incorrect identifier. Therefore, in the embodiments of this application, the relevant parameters of the image template can be determined by constructing label parameters, thereby indirectly determining the parameters of the identifier to be detected corresponding to the image template. This facilitates the subsequent detection of the identifier to be detected and allows the identifier to be processed according to different detection methods.
[0085] The threshold parameter refers to the error range between the image to be detected and the image templates that match in the image template library. For example, such as... Figure 3f As shown, Figure 3f It shows the range of values for the threshold parameter, combined with... Figure 3f As shown in lines 6 to 9, “A-001,thresDown,0.90”, “A-001,thresMiddle,0.92”, “A-001,thresUp,0.93”, and “A-001,thresCorrect,0.93”, the identifier to be detected is A-001, the threshold range corresponding to A-001 is (0.9, 0.93], and the middle value in the threshold range corresponding to A-001 is 0.92.
[0086] It should be understood that the image to be detected may be affected by factors such as environment and shooting angle, resulting in an unclear image or the presence of noise. This can further lead to a certain difference between the image to be detected and the matching image template. Therefore, a threshold parameter needs to be defined to avoid affecting the accuracy of detection. The threshold parameter can be obtained by pre-training with positive and negative samples of the identifier to be detected. The threshold parameter is related to the complexity of the identifier to be detected; the more complex the identifier, the lower the threshold parameter, meaning a higher allowable error range.
[0087] S203: Preprocess the image to be detected to obtain a preprocessed image.
[0088] It should be understood that since the image to be detected may include content that is not the identifier to be detected—for example, if the image is a product design drawing of a mobile phone—it may include "HONOR," "CE," a trash can logo, English labels, and other identifiers to be detected. This product design drawing may also include the phone's outline, annotation lines, and other non-identifier content, which could affect the detection accuracy of the identifier. Therefore, preprocessing can be performed on the image to remove irrelevant areas and annotation lines, facilitating subsequent detection of the identifier. Preprocessing refers to the process of processing the image to obtain a preprocessed image. For example, if the image to be detected includes image names and subscripts, the preprocessing process could be to crop the image names and subscripts to obtain a preprocessed image without irrelevant areas. Similarly, if the image to be detected includes annotations and annotation lines, the preprocessing process could be to remove the annotations and annotation lines. In other words, preprocessing the image to be detected removes content that may affect the detection of the identifier, facilitating subsequent detection of the identifier.
[0089] In some possible implementations, the preprocessing of the image to be detected can be as follows:
[0090] Step 11: Crop the image to be detected to obtain the first image to be detected.
[0091] The first image to be detected refers to the image to be detected after cropping. After the image to be detected is read in a preset format, it can be initially cropped for subsequent removal of irrelevant regions. The image to be detected can be input in any format and can be converted to a preset format for cropping. Preset formats include, but are not limited to, BGR format, and are not limited here.
[0092] It should be understood that cropping the image to be detected can avoid interference from irrelevant regions, thereby improving subsequent detection efficiency. In one possible implementation, the cropping process can involve first identifying the region to be detected and the regions not to be detected, then cropping the non-detection regions to obtain the region to be detected as the cropped result. The region to be detected refers to the area including the identifier to be detected, and the non-detection region refers to the area not including the identifier to be detected. The identification of the region to be detected and the non-detection region can employ OCR technology or other similar technologies, which are not limited here.
[0093] For example, such as Figure 4a As shown, Figure 4a In the diagram, A represents the image to be detected. This image is a product design drawing of a mobile phone, including the design style of the back of the phone and other irrelevant areas (such as corner patterns and text descriptions). Therefore, it can be obtained by cropping. Figure 4a The first image to be detected is shown as B in the diagram.
[0094] Step 12: Remove the annotations in the first image to be detected to obtain the second image to be detected.
[0095] The second image to be detected refers to the image to be detected after the annotation and removal of the first image to be detected.
[0096] When the image to be detected is a product design drawing, there may be annotations, such as the length, width, and height of the logo to be detected and related annotations. Therefore, it is necessary to remove the annotations in the first image to be detected in order to remove the influence of the annotations on the detection of the logo.
[0097] It should be understood that when the image to be detected contains annotations and annotation lines, such as product design drawings, product sketches, product simulation images, etc., the color of the identifier to be detected in the first image to be detected is different from the color of the annotation. Therefore, the annotation color can be converted to the background color through masking to remove the annotation. For example, the first image to be detected can be transformed from the BGR color space to the HSV color space. For example, the green annotation corresponds to a range of HSV triples [35, 43, 46]-[77, 255, 255]. Then, the pixels within this range can be converted to the background color (such as white or black) using a mask. For example, Figure 4b This diagram illustrates how annotations are removed from the first image to be detected to obtain the second image to be detected.
[0098] BGR is a color space that represents an image using three channels: blue (B), green (G), and red (R). HSV is another color space that represents a color image using three parts: Hue, Saturation, and Value.
[0099] It should be understood that converting an image from the BGR color space to the HSV color space before applying a mask is beneficial for color analysis and processing, and for extracting color regions of interest.
[0100] It should be noted that if the image to be detected does not contain annotations, such as annotation lines or annotation values, step 12 can be skipped and the next step can be performed.
[0101] Step 13: Threshold the second image to be detected to obtain a thresholded image.
[0102] Thresholded image refers to the image after thresholding the second image to be detected, which can be combined with... Figure 4c As shown, Figure 4cThe thresholded image obtained after thresholding the second image to be detected is shown. In step 13, the second image to be detected is an image without labels; that is, if the second image to be detected has labels, step 12 above is performed to remove the labels, and the second image to be detected after label removal is thresholded; if the second image to be detected does not have labels, the second image to be detected is thresholded.
[0103] It should be understood that thresholding the second image to be detected is a common image processing method. Thresholding involves segmenting or transforming the pixel values in the second image to be detected according to a set threshold. For example, thresholding compares the pixel values in the second image to be detected with a set threshold. If a pixel value is greater than the threshold, it is set to a specific value (e.g., 255); otherwise, it is set to another specific value (e.g., 0). This allows the image to be segmented into different regions, thereby highlighting or removing specific image features. In other words, by thresholding the second image to be detected, it can be converted into a grayscale image, which is beneficial for locating and separating the detected identifier. For example, the second image to be detected can be globally thresholded, converting it into a binary image where the detected identifier corresponds to '1' and the background corresponds to '0'.
[0104] Step 14: Perform morphological processing on the thresholded image to obtain a preprocessed image.
[0105] As an example, morphological dilation of the thresholded image can help to integrate different elements inside the target identifier into a whole, which facilitates the subsequent localization and separation of the target identifier.
[0106] It should be noted that morphological dilation is an operation in morphological processing. Morphological dilation involves convolving a structuring element with a thresholded image, assigning the maximum value from the structuring element to pixels overlapping with it, thereby expanding or enlarging bright areas in the thresholded image. In other words, morphological dilation can expand and enhance the region of the target identifier in the thresholded image, making the identifier more obvious and prominent, facilitating subsequent localization and separation of the identifier.
[0107] It should be understood that in related technologies, the anomaly recognition model may fail to detect small-scale identifiers, resulting in low detection accuracy. Therefore, in this embodiment, preprocessing is performed through steps 11 to 14 to obtain a preprocessed image, which is beneficial for locating and separating the identifiers to be detected in the image to be detected, thereby realizing the detection of small-scale identifiers and improving the subsequent detection efficiency and accuracy of the identifiers to be detected.
[0108] It should be noted that in related technologies, there may be problems such as abnormal recognition of DC / AC symbols and interference of marking lines with the markings, which may lead to low detection accuracy of the image. The embodiments of this application preprocess the image to be detected by cutting and removing irrelevant areas, markings and other non-detectable content in the image to be detected, which can avoid the influence of irrelevant areas or markings on image detection and improve detection accuracy.
[0109] It should be noted that step S203 provided in this application embodiment can be used for preprocessing product design drawings, product sketches, etc., that contain annotations or colors. Step S203 can be omitted for other types of images. For example, if the image to be detected is an image with only two colors and no annotations, only grayscale processing can be performed; if the image to be detected is a black and white image, no processing is required.
[0110] S204: Determine the location of the identifier to be detected in the preprocessed image.
[0111] It should be understood that in order to better detect the identifiers to be detected in the preprocessed image, the identifiers to be detected can be extracted from the preprocessed image first, and then the extracted identifiers can be detected.
[0112] It should be noted that if step S203 is not executed in this embodiment, step S204 can be used to determine the position of the identifier to be detected in the image to be detected. This embodiment only takes the preprocessed image after step S203 as an example.
[0113] It should be noted that by determining the position of the identifier to be detected in the preprocessed image through step S204, the identifier to be detected can be further extracted from the preprocessed image based on its position in the image to be detected, which facilitates the subsequent identification and detection of the identifier to be detected.
[0114] In some possible implementations, the process of extracting and detecting the identifiers to be detected in the preprocessed image can be as follows:
[0115] Step 31: Extract all inner and outer contours of the preprocessed image.
[0116] The inner and outer contours correspond to the boundary curves of the white connected regions in the preprocessed image. It should be understood that by extracting the inner and outer contours from the preprocessed image, the position and shape of the target identifier can be determined. It should be noted that if the preprocessed image does not contain white connected regions, then the boundary curve indicating the black connected regions is the outer contour of the target identifier; that is, if the target identifier does not include the inner contour, then only the outer contour of the target identifier can be extracted.
[0117] It should be noted that if the image to be detected has not been processed by step S203, it needs to be binarized to obtain a binary image, that is, a grayscale image, which is convenient for locating and separating the target identifier in the image to be detected in the subsequent process.
[0118] Step 32: Segment the regions of the connected contours and obtain the minimum bounding rectangle of each contour.
[0119] A region with connected contours can be considered a single entity. Therefore, it is necessary to segment the region of the connected contours to obtain the minimum bounding rectangle of each contour. After obtaining the minimum bounding rectangles corresponding to multiple contours, contours with widths or heights greater than a threshold can be initially filtered out according to preset rules. Contours with widths or heights greater than the threshold correspond to the outer region of the object to be detected, such as the casing of a mobile phone, and this outer region is considered irrelevant.
[0120] Step 33: Perform region segmentation on the preprocessed image to obtain multiple segmented regions.
[0121] It should be understood that, since segmentation based on contours may divide a target identifier into multiple parts, for example, the target identifier "HONOR" may have five contour regions: "H", "O", "N", "O", and "R". Each of the five contour regions has a corresponding minimum bounding rectangle. Therefore, in order to extract the complete target identifier, it is possible to segment according to the region where the target identifier is located, that is, to perform region segmentation processing on the preprocessed image to obtain the segmented region corresponding to each target identifier.
[0122] Step 34: Merge one or more smallest bounding rectangles in each segmented region.
[0123] Each segmented region may have multiple minimum bounding rectangles. Therefore, it is necessary to remove the enclosing sub-rectangles within each segmented region, remove minimum bounding rectangles with excessively small widths or heights, and merge multiple rectangles that are aligned vertically or horizontally to obtain the target rectangle corresponding to each segmented region. The target rectangle contains the identifier to be detected. For example, such as... Figure 5 As shown, Figure 5 The image shows the bounding boxes corresponding to multiple segmented regions when the preprocessed image is used as a mobile phone design drawing, excluding the bounding box corresponding to the outline of the mobile phone.
[0124] Step 35: Determine the corresponding identifier to be detected for each rectangle and perform detection on the identifier.
[0125] It should be understood that after determining each rectangle through steps 31 to 34 above, the identifier to be detected can be extracted from each rectangle, and the extracted identifier to be detected can be detected.
[0126] It should be understood that in related technologies, when using anomaly detection models to detect product logos in images, it is also necessary to locate and extract the product logos from the image before detecting them. However, due to training issues with the anomaly detection model, it may be unable to identify smaller logos, such as... Figure 1 As shown in c, assuming the product identifier is "Audio", the dot "·" for the letter "i" may not be recognized, leading to the correct identifier being identified as an incorrect one. To solve this technical problem, this embodiment extracts the identifier to be detected from the image to be detected (or the preprocessed image) through steps 31-34 above. This facilitates the extraction of the complete identifier to be detected from the image to be detected (or the preprocessed image), enabling the recognition of smaller identifiers and improving detection accuracy.
[0127] S205: Use the image template library to detect the identifier to be detected.
[0128] In this embodiment of the application, the detection of the identifier to be detected in the preprocessed image is achieved by matching the identifier to be detected in the preprocessed image with the image template in the image template library, and it can be determined whether the identifier to be detected is a correct identifier.
[0129] It should be noted that, due to the wide variety of identifiers to be detected, different detection methods can be used for different identifiers to ensure detection accuracy. The detection method corresponding to different identifiers can be determined by the detection file corresponding to the image to be detected, or by other methods; no specific limitation is made here. The following provides illustrative examples of detection methods for different identifiers.
[0130] When the identifier to be detected is a hollow, irregular pattern, such as Figure 6a The preprocessed image shown has a hollow “HONOR” identifier W to be detected. Due to the small effective area and thin line width of the hollow irregular pattern, the matching detection results may be inaccurate.
[0131] To achieve accurate detection of hollow, irregularly shaped identifiers, one possible implementation is to perform matching in the following way:
[0132] Step 41: Extract the inner and outer contours of the preprocessed image and the image template corresponding to the identifier to be detected, respectively. For example, the preprocessed image can be R, and the image template corresponding to the identifier to be detected W can be T. By extracting the inner and outer contours of the preprocessed image R and the image template T, the inner and outer contours of R and T can be obtained.
[0133] Step 42: On blank images of the same size, draw the inner and outer contours of the preprocessed image R and the image template T with the same line width (e.g., 3 pixels), obtaining the inner and outer contours R' corresponding to the preprocessed image R and T' corresponding to the image template T, as shown below. Figure 6b As shown, Figure 6b In this context, A represents the inner and outer contours R'. Figure 6b In this context, B represents the inner and outer contours T'.
[0134] Step 43: Use the cross-correlation method formula to perform overall template matching and template matching of the segmented independent components of R' and T'.
[0135] In one possible implementation, the cross-correlation coefficient is formulated as follows (1):
[0136] (1)
[0137] in, Let x represent the cross-correlation coefficient between the preprocessed image R and the image template T, where x represents the x-coordinate of the preprocessed image R and y represents the y-coordinate of the preprocessed image R. This represents the x-coordinate of the image template T. The vertical coordinate of the image template T is represented by I, where T represents the image template T and I represents the preprocessed image R.
[0138] It should be noted that after performing steps 41-42 above, the inner and outer contours R' corresponding to the preprocessed image R, and the inner and outer contours T' corresponding to the image template T, can be determined by the cross-correlation coefficient using the above formula (1). Let x represent the cross-correlation coefficient between the preprocessed image R' and the image template T', where x represents the x-coordinate of the preprocessed image R' and y represents the y-coordinate of the preprocessed image R'. This represents the x-coordinate of the image template T'. The vertical coordinate of image template T' is represented by I, where T represents image template T' and I represents preprocessed image R'.
[0139] It should be noted that in this embodiment, two matching operations can be performed. The first matching is to match the preprocessed image with the image template corresponding to the identifier to be detected. The second matching is to segment the identifier to be detected from the preprocessed image and match the segmented identifier with the image template. Both matching operations can use the above formula (1). In this way, matching can be performed from two dimensions: the whole and the part, thereby improving the detection accuracy.
[0140] It should be understood that, in this embodiment, by extracting the inner and outer contours of the preprocessed image and the image template corresponding to the identifier to be detected, and drawing them on a blank image of the same size with the same line width, it is beneficial to match and detect hollow irregular patterns of the identifier to be detected, avoid the problem of reduced matching accuracy caused by the thin line width of the identifier to be detected, and improve the detection accuracy.
[0141] When the identifier to be detected is a rotated identifier, since the image template is a non-rotated pattern, while the identifier to be detected may be rotated due to design requirements or shooting angle, it may lead to a mismatch between the identifier to be detected and the image template.
[0142] To address the aforementioned issues, in some possible implementations, when the identifier to be detected is a rotated identifier, the SIFT feature point matching method can be used for matching. For example, combining... Figure 7 As shown, the SIFT keypoints of the scaled image template X and the SIFT keypoints of the target identifier Y are obtained, along with the multi-dimensional description vector (e.g., 128-dimensional, 256-dimensional, etc.) corresponding to each keypoint. Then, the FLANN Fast Nearest Neighbors search library is used to search, and the keypoints corresponding to the target identifier Y and the image template X are included in the successful matching points. If the number of successful matching points is greater than a certain preset value (e.g., 10), the image template X and the target identifier Y are considered to be successfully matched. Further, based on the correspondence of the matching points, the homography matrix H of the affine transformation from the image template X to the target identifier Y can be obtained. From this, the rotation angle along the z-axis can be decomposed, which is the rotation angle in the image plane. Then, the image template is rotated using the rotation angle, and the rotated image template is matched with the target identifier.
[0143] It should be understood that in related technologies, when using anomaly recognition models for identification, it may be impossible to successfully identify wrapping string identifiers. Therefore, in this application embodiment, for identifiers to be detected that have rotation (such as wrapping string identifiers), the SIFT feature point matching method is used for matching, thereby improving the detection accuracy.
[0144] When the identifier to be detected is an identifier with a variable (such as...) Figure 3b The barcode shown can be implemented using a masked template matching and PaddleOCR recognition of the masked portion ID content. Possible implementation steps are as follows:
[0145] Step 51: Determine the location of the variable-containing identifier to be detected.
[0146] Because the differences between the variable to be detected and the image templates in the image template library are significant, it may lead to detection anomalies. Therefore, it is necessary to process the variable to be detected in the object to be detected. That is, the object to be detected may include variable to be detected, so it is necessary to determine the location of the variable to be detected to facilitate subsequent processing of the variable to be detected.
[0147] Step 52: Retain the identifiers of the objects to be detected that do not contain variables, and set the identifiers of the objects to be detected that contain variables to the background color.
[0148] For example, a mask can be obtained by setting the variable regions in the detection identifier to 0 and the unchanging regions to 1, and then using the mask to process the identifier to be detected containing variables. Figure 8 As shown, Figure 8 The results of the identification of the target identifier in the preprocessed image after steps 51 and 52 are shown. That is, the identification and detection of the target identifier containing variables will not be performed after steps 51 and 52.
[0149] Step 53: After the nonvariable target identifiers in the preprocessed image are successfully identified, determine the cross-correlation coefficient between the target identifier and the image template. The corresponding template matching cross-correlation coefficient formula is:
[0150] (2)
[0151] in, Let x represent the cross-correlation coefficient between the preprocessed image R and the image template T, where x represents the x-coordinate of the preprocessed image R and y represents the y-coordinate of the preprocessed image R. This represents the x-coordinate of the image template T. Let I represent the ordinate of the image template T, I represent the preprocessed image R, and M represent the mask. The mask exists as a Boolean matrix, meaning a matrix composed of elements where the variable regions are set to 0 and the invariant regions are set to 1.
[0152] Step 54: After completing the recognition and matching, the mask part is used to realize ID recognition through the PaddleOCR tool.
[0153] PaddleOCR is a deep learning-based Chinese OCR (Optical Character Recognition) tool. It can recognize various fonts including Chinese, English, and numbers, and supports multiple formats such as tables, PDFs, and images. PaddleOCR boasts advantages such as high accuracy, high recall, and high efficiency, and can be applied to various fields.
[0154] It should be understood that after processing the non-variable identifiers to be detected, the PaddleOCR tool can still be used to detect the identifiers containing variables to ensure the correctness of the identifiers containing variables.
[0155] It should be noted that, in the embodiments of this application, the identification of the mask part (i.e. the identifier to be detected containing variables) is not limited to using the PaddleOCR tool. Other methods can also be used to identify the mask part. This is only an example and is not specifically limited.
[0156] It should be understood that, in the embodiments of this application, by masking the identifier to be detected that contains variables using a mask, and first detecting the identifier to be detected that does not contain variables, and then further detecting it using the PaddleOCR tool, the recognition failure of the identifier to be detected caused by the dependent variables can be avoided, thereby improving the detection accuracy.
[0157] It should be understood that in practical applications, information about each identifier to be detected can be obtained from the parameter file of the object to be detected, such as whether it is hollow, whether rotation is allowed, whether it contains variables, etc., and then the corresponding matching method mentioned above can be used for matching to achieve highly adaptive detection of the identifier to be detected.
[0158] S206: Output the detection results corresponding to the image to be detected.
[0159] After step S205 is completed, it is necessary to output the integrity information of the image to be detected, mark the identifiers to be detected with rectangular boxes, and save the image containing the marked identifiers. That is, the detection result can include the identifiers to be detected marked with rectangular boxes, as well as the detection result of the identifiers to be detected, such as whether the detection result of the identifiers to be detected is correct or incorrect.
[0160] In one possible implementation, the detection result can be information indicating completeness, where Y represents yes and N represents no. The output format, from left to right, is: the name of the object to be detected, the name of the identifier to be detected, whether the identifier is complete, the width of the identifier, the height of the identifier, the horizontal coordinate of the identifier, the vertical coordinate of the identifier, the rotation angle of the identifier, and whether the identifier is hollow. For example, the detection result could be "ANW00, H-006, Y, 10, 4, 11, 77, 35, N". This result indicates that the name of the object to be detected is ANW00, the name of the identifier to be detected is H-006, the identifier is complete, the width of the identifier is 10, the height of the identifier is 4, the horizontal coordinate of the identifier is 11, the vertical coordinate of the identifier is 77, the rotation angle of the identifier is 35 degrees, and the identifier is not hollow.
[0161] Based on the image detection method provided in the above embodiments, combined with Figure 9 As shown, the flow of another image detection method provided in this application embodiment can be as follows:
[0162] S901: Establish an image template library and obtain the image to be detected.
[0163] The process of establishing the image template library can be found in step S201 of the above embodiment, and will not be repeated here. The image templates in the image template library can be named according to the matching rules described in step S202. For example, the image templates in the image template library can be saved as ".png" format, and the image template library can be placed in the ". / logs" folder in the root directory of the corresponding project; and the image to be detected can be saved as ".png" format and placed in the ". / image" folder in the root directory. The image to be detected refers to the image that needs to be detected, and the image to be detected includes the identifier to be detected.
[0164] It should be noted that when acquiring the image to be inspected, the corresponding production line inspection information can also be acquired simultaneously. This production line inspection information may include, but is not limited to, inspection files and label parameters.
[0165] S902: Parse the production line inspection information corresponding to the image to be inspected.
[0166] For example, parsing the production line inspection information can yield the name of the image to be inspected, the name and quantity of the identifiers to be inspected in the image (referring to the aforementioned inspection file); and the label parameters of each identifier to be inspected, such as whether it is rotated, whether it is hollow, whether it has color, whether it has character variables, etc., where Y represents valid and N represents invalid.
[0167] S903: Construct threshold parameters.
[0168] It should be noted that, in the embodiments of this application, the threshold parameter can be constructed before or after step S902, and the order of steps for constructing the threshold parameter is not limited here.
[0169] For example, a new `threshold_parameters.csv` file can be created and placed in the root directory. The first column of the threshold_parameters file is the name of the image to be detected, the second column is the name of the identifier to be detected in the image, the third column is the name of the threshold variable, and the fourth column is the threshold value. For example, the following are typical value ranges for the threshold variable:
[0170] scaleEps: 0.08~0.10;
[0171] scaleEpsSeparate:0.015~0.025;
[0172] threshSeparate: 0.06;
[0173] threshL: 0.6~0.8;
[0174] ThreshV: 0.80~0.95;
[0175] threshDown: 0.60~0.85;
[0176] threshMiddle: 0.75~0.95;
[0177] threshUp: 0.85~0.98;
[0178] threshCorrect: 0.85~0.99.
[0179] It should be noted that threshold parameters can be divided into general parameters and specific parameters. General parameters (the first column is "common") are applicable to all images to be detected; specific parameters are for images to be detected in a specific environment and can be obtained through automated training on samples in that specific environment.
[0180] S904: Detect the image to be detected.
[0181] It should be noted that the detection process of the image to be detected in step S904 provided in this application embodiment can refer to the detection process of the preprocessed image in step S204 above, and will not be repeated here.
[0182] It should be noted that, in the embodiments of this application, before detecting the image to be detected, the image to be detected can be preprocessed according to the above step S203 to obtain a processed image, and the preprocessed image can be detected.
[0183] It should be noted that, in this embodiment of the application, after executing step S904, it is necessary to output the integrity information of the image to be detected, mark the identifiers to be detected with rectangular boxes, and save the image containing the marked identifiers to be detected. That is, the detection result may include the identifiers to be detected marked with rectangular boxes, and also include the detection result of the identifiers to be detected, such as whether the detection result of the identifiers to be detected is correct or incorrect.
[0184] Based on the image detection method provided in the above embodiments, combined with Figure 10 As shown, this application further provides an image detection system 1000, which may include:
[0185] The matching rule definition module 1001 is used to save the image to be detected to a preset location according to a preset format, and to determine the detection rules of the identifier to be detected according to the detection file and label parameters corresponding to the image to be detected.
[0186] The preprocessing module 1002 is used to perform preprocessing on the image to be detected, such as cropping, annotation removal, color and morphology, to obtain a preprocessed image.
[0187] The detection module 1003 is used to perform corresponding rotation matching, contour matching, grayscale processing and character variable recognition on the preprocessed image according to the detection rules, and then perform template matching.
[0188] Among them, the detection rules refer to the rules of which matching method to use for detection.
[0189] The output module 1004 is used to mark the detected labels with a red minimum bounding rectangle and print the specific label information.
[0190] The image detection system provided in this application has the same beneficial effects as the image detection method provided in any of the above embodiments, and will not be described again here.
[0191] It should be noted that the image detection method provided in any of the above embodiments can be applied to electronic devices, such as mobile phones, tablets, desktops, laptops, notebooks, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, etc. This application does not impose any special restrictions on the specific form of the above-mentioned electronic devices.
[0192] In this embodiment, the structure of the electronic device can be as follows: Figure 11 As shown, Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0193] like Figure 11 As shown, the electronic device may include a processor 1110, internal memory 1120, camera 1130, display screen 1140, etc.
[0194] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0195] Processor 1110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0196] The processor 1110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1110 is a cache memory. This memory can store instructions or data that the processor 1110 has just used or that are used repeatedly. If the processor 1110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 1110, and thus improves the efficiency of the system.
[0197] Electronic devices implement display functions through a GPU, a display screen 1140, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 1140 and the application processor. The GPU performs mathematical and geometric calculations for graphics rendering. The processor 1110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0198] Display screen 1140 is used to display images, videos, etc. Display screen 1140 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 194, where N is a positive integer greater than 1.
[0199] Electronic devices can achieve shooting functions through ISP, camera 1130, video codec, GPU, display 1140 and application processor.
[0200] The ISP is used to process data fed back from the camera 1130. For example, when taking a picture and opening the shutter, the ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 1130.
[0201] Camera 1130 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device may include one or N cameras 1130, where N is a positive integer greater than 1.
[0202] Internal memory 1120 can be used to store computer executable program code, which includes instructions. Processor 1110 executes various functional applications and data processing of the electronic device by running the instructions stored in internal memory 1120. Internal memory 1120 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, phonebook, etc.). In addition, internal memory 1120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 1110 executes various functional applications and data processing of the electronic device by running instructions stored in internal memory 1120 and / or instructions stored in memory disposed in the processor.
[0203] The technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard drive, read-only memory, random access memory, magnetic disk, or optical disk.
[0204] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.
[0205] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0206] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A detection method, characterized in that, The method includes: Acquire an image to be detected; the image to be detected includes at least one identifier to be detected; Extract at least one contour from the image to be detected; The regions corresponding to the connected contours in at least one contour are segmented to obtain the minimum bounding rectangles corresponding to each contour. The image to be detected is segmented to obtain at least one segmented region; Merge one or more smallest bounding rectangles in each segmented region to obtain the rectangles corresponding to each segmented region; At least one identifier to be detected in the image to be detected is determined based on at least one rectangular frame; Obtain the file to be detected corresponding to the image to be detected; the file to be detected indicates the type information of the identifier to be detected; the identifier to be detected is an identifier containing invariants and an identifier containing variables; the rotated identifier is an identifier whose rotation angle between the pattern corresponding to the identifier and the unrotated pattern is not zero; the identifier containing variables is an identifier whose pattern corresponding to the identifier includes a barcode; the invariant identifier is an identifier whose pattern corresponding to the identifier does not include a barcode. The detection method corresponding to the identifier to be detected is determined based on the type information in the file to be detected; The detection method is used to detect the image to be detected, and the detection result of the identifier to be detected is obtained; Wherein, when the image to be detected includes both non-variable identifiers to be detected and variable identifiers to be detected, the step of detecting the image to be detected using the detection method to obtain the detection result of the identifiers to be detected includes: Determine the location of the variable's identifier in the image to be detected; Based on the location, the region corresponding to the detection identifier of the variable in the image to be detected is set to 0, and the region corresponding to the detection identifier of the non-variable in the image to be detected is set to 1, thus obtaining a mask; The variable to be detected is masked using a mask to obtain the processed image to be detected; The non-variable identifiers in the processed image to be detected are matched with a third image template to obtain a first detection result; the third image template is an image template in the image template library that corresponds to the non-variable identifiers to be detected; the image template library includes multiple image templates; The optical character recognition (OCR) technology is used to identify the identifier to be detected in the variable, and a second detection result is obtained. The first detection result and the second detection result are used as the detection results to obtain the identifier to be detected.
2. The method according to claim 1, characterized in that, When the identifier to be detected also includes a hollow identifier, it further includes: Contour extraction is performed on the image to be detected and the first image template to obtain a first contour corresponding to the image to be detected and a second contour corresponding to the first image template; the first image template is an image template in the image template library that corresponds to the identifier to be detected; the image template library includes multiple image templates. The first contour and the second contour are drawn on blank drawings of the same size with the same line width to obtain the first drawing corresponding to the first contour and the second drawing corresponding to the second contour. The first drawing is matched with the second drawing to obtain the detection result of the identifier to be detected.
3. The method according to claim 1, characterized in that, When the identifier to be detected also includes a rotating identifier, it further includes: Determine multiple first feature points corresponding to the identifier to be detected in the image to be detected and multiple second feature points corresponding to the second image template; the second image template is an image template in the image template library that corresponds to the identifier to be detected; the image template library includes multiple image templates. The plurality of first feature points are matched with the plurality of second feature points to obtain a plurality of matching results; the matching result indicates whether the matching is successful or failed. If the number of matching results indicating a successful match among the multiple matching results is greater than a preset number, then the rotation angle corresponding to the identifier to be detected is determined, and the second image template is rotated to the rotation angle; The identifier to be detected is matched with the rotated second matching image template to obtain the detection result of the identifier to be detected.
4. The method according to claim 1, characterized in that, Before detecting the image to be detected using the aforementioned detection method, the method further includes: Convert the image to be detected into a binary image; Determine multiple contour regions of the binary image; Each of the aforementioned contour regions is segmented to obtain multiple contours; Determine the minimum circumscribed rectangle corresponding to each of the aforementioned contours; Filter out outlines whose width or length of the circumscribed minimum rectangle is greater than a preset width or a preset length; The binary image is segmented to obtain multiple segmented regions; One or more minimum bounding rectangles in each of the segmented regions are merged to obtain the target rectangle corresponding to each segmented region; the target rectangle indicates the position of the identifier to be detected. The detection method is used to detect the image to be detected, and the detection result of the identifier to be detected is obtained, including: The detection method described above is used to detect the identifier to be detected within the target rectangle, and the detection result of the identifier to be detected is obtained.
5. The method according to any one of claims 1-4, characterized in that, Before determining the detection method corresponding to the identifier to be detected based on the file to be detected, the method further includes: The image to be detected is cropped to obtain a first image to be detected; The first image to be detected is thresholded to obtain the second image to be detected; The second image to be detected is subjected to morphological processing to obtain a preprocessed image; The detection method is used to detect the image to be detected, and the detection result of the identifier to be detected is obtained, including: The preprocessed image is detected using the aforementioned detection method to obtain the detection result of the identifier to be detected.
6. The method according to claim 5, characterized in that, If the image to be detected contains annotations, the method further includes the following steps before thresholding the first image to be detected: The first image to be detected is subjected to annotation and removal processing to obtain an intermediate processed image; The step of thresholding the first image to be detected to obtain the second image to be detected includes: The intermediate image is thresholded to obtain the second image to be detected.
7. An electronic device, characterized in that, include: A processor and a memory; wherein one or more computer programs are stored in the memory, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the detection method as described in any one of claims 1-6.
8. A computer storage medium, characterized in that, Includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the detection method as described in any one of claims 1-6.
Citation Information
Patent Citations
Mask-based image table document identification method
CN104123527A
Multi-certificate type synchronous detection method and device, computer equipment and storage medium
CN111275102A
Image detection method and device, electronic equipment and storage medium
CN113111713A
QR code identification method and device
CN113505773A
Method, device and equipment for identifying interfered sequencing image and medium
CN115331034A