Method, device, equipment and medium for detecting defective characters on watch cover

By processing the vertical direction image of the watch cover and using the YOLOv8 algorithm to train the detection model, the shortcomings of watch cover character detection in the prior art in strict environments are solved, fast and accurate defect detection is achieved, and the detection is improved. Sex and real-time.

CN118918590BActive Publication Date: 2024-12-06GUANGDONG T-XINGMEASURING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411415173.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2024-12-06
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

The existing watch cover character detection methods are insufficient in strict environments and are not sensitive to noise, occlusion, rotation, and scale changes, and are prone to mismatch or mismatch.

Method used

The vertical direction image processing method of watch cover is used to obtain the circular area image, generate defect sample images through multi-layer feature extraction and dimensionality reduction, build a data set and train the detection model using the YOLOv8 algorithm to achieve fast and accurate character defect detection.

Benefits of technology

It improves the real-time and robustness of character detection, can effectively identify defects under lighting, angle and scale changes, reduces memory consumption, and solves the problems of difficulty in obtaining defect samples and low real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918590B_ABST
    Figure CN118918590B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for detecting incomplete characters on a watch cover. The method comprises: obtaining a vertical image of the watch cover; performing a first process on the vertical image of the watch cover to obtain an image of a circular area where the incomplete characters on the watch cover are located in the vertical image of the watch cover; performing a second process on the image of the circular area to obtain a defect sample image of the incomplete characters on the watch cover; performing a third process on the defect sample image and the vertical image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover; training the data set for detecting incomplete characters on the watch cover to obtain a trained detection model for incomplete characters on the watch cover, and inputting the newly collected vertical image of the watch cover into the detection model for incomplete characters on the watch cover to obtain the detection result of incomplete characters on the watch cover. The present application can quickly and accurately determine whether there are defects on the character surface, and display detailed detection result information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of equipment detection technology, and specifically relates to a method, device, equipment and medium for detecting incomplete characters on a watch cover. Background Art

[0002] The character labels on the watch cover contain a lot of information, some of which represent the brand and model name, some represent the origin, movement condition, etc. These characters are important identification of the product. The watch cover character detection method used by some companies usually uses template matching to find defective characters that do not match normal characters. This is achieved by calculating the similarity between the template image and the target in the test image. The main idea of ​​template matching is to create a template image based on the target prototype image, search for the target most similar to the template image in the test image, and find the area closest to the mean or variance of the template. Template matching cannot meet the detection requirements in harsh environments in terms of detection rate, and is insensitive to noise, occlusion, rotation, scale changes, etc., and is prone to mismatching or missed matching.

[0003] Therefore, the existing technology needs to be improved. Summary of the invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a method, device, equipment and medium for detecting incomplete characters on a watch cover, which can meet the needs of the art.

[0005] Based on one aspect of an embodiment of the present invention, the embodiment of the present application provides a method for detecting incomplete characters on a watch cover, comprising:

[0006] Get the vertical image of the watch cover;

[0007] Performing a first process on the vertical direction image of the watch cover to obtain an image of a circular area where the incomplete characters on the watch cover are located in the vertical direction image of the watch cover;

[0008] Performing a second processing on the circular area image to obtain a defect sample image of incomplete characters on the watch cover;

[0009] Performing a third process on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover;

[0010] The data set for detecting incomplete characters on watch covers is trained to obtain a trained model for detecting incomplete characters on watch covers, and the newly collected vertical image of the watch cover is input into the model for detecting incomplete characters on watch covers to obtain the detection result of incomplete characters on watch covers.

[0011] In another embodiment, the first processing of the vertical direction image of the watch cover includes:

[0012] Performing grayscale processing on the image in the vertical direction of the watch cover to obtain a first grayscale image, wherein the first grayscale image is a grayscale image of the image in the vertical direction of the watch cover, and the grayscale processing on the image in the vertical direction of the watch cover adopts an rgb1_to_gray operator algorithm;

[0013] Performing threshold segmentation, continuous image region splitting and specific region selection on the first grayscale image to obtain a first selected region, wherein the first selected region is a specific region selected in the grayscale image of the vertical direction image of the watch cover, wherein the threshold segmentation adopts a threshold operator algorithm, the continuous image region splitting adopts a connection operator algorithm, and the specific region selection adopts a select_shape operator algorithm;

[0014] Performing a dilation algorithm operation on the first selected area to obtain a first dilated area after the selected area of ​​the first selected area is dilated, wherein the dilation algorithm operation on the first selected area adopts a dilation_circle operator algorithm;

[0015] Obtaining the minimum circumscribed circle of the first dilated area, and generating a first circular area according to the minimum circumscribed circle of the first dilated area, wherein the obtaining of the minimum circumscribed circle of the first dilated area adopts the smallest_circle operator algorithm;

[0016] Based on the first circular area, the first grayscale image is loaded in the first circular area to obtain a first circular image, which is an image in the first circular area where the incomplete characters on the watch cover are located in the grayscale image after grayscale processing of the vertical image of the watch cover.

[0017] In another embodiment, the obtaining of the minimum circumscribed circle of the first dilated area and generating the first circular image according to the minimum circumscribed circle of the first dilated area includes:

[0018] Using the smallest_circle operator algorithm to obtain the smallest circumscribed circle of the first dilated area;

[0019] Use the gen_circle operator algorithm to generate a minimum circumscribed circle area from the area where the minimum circumscribed circle is located;

[0020] Obtaining a first intersection area between the minimum circumscribed circle area and the first dilated area, wherein the obtaining of the first intersection area between the minimum circumscribed circle area and the first dilated area uses an intersection operator algorithm;

[0021] The minimum enclosing rectangle of the first intersection area is obtained, and the image area of ​​the minimum enclosing rectangle is cropped to obtain a first circular image, wherein the method of obtaining the minimum enclosing rectangle of the first intersection area adopts the smallest_rectangle1 operator algorithm, the method of cropping the image area of ​​the minimum enclosing rectangle adopts the crop_rectangle1 operator algorithm, the method of obtaining the first circular image adopts the crop_rectangle1 operator algorithm, and the first circular image is saved through the write_image operator algorithm.

[0022] In another embodiment, the second processing of the circular area image to obtain a defect sample image of incomplete characters on the watch cover includes:

[0023] Performing grayscale processing on the annular region image to obtain a second grayscale image, where the second grayscale image is a grayscale image of the annular region image after the grayscale processing;

[0024] Generate a second selected area that meets the set conditions through the gen_circle operator algorithm, where the second selected area is a circular area used to limit the area for image processing of the incomplete character detection image of the watch cover;

[0025] According to the image pixel values ​​of the second grayscale image, threshold segmentation is performed on the second grayscale image to obtain a third selected area with set pixel values, wherein the third selected area is an image area in the second grayscale image whose pixel values ​​are between set parameters, and threshold segmentation is performed on the second grayscale image by a threshold operator algorithm to extract a certain area;

[0026] Performing a morphological closing operation on the third selected area, and using a circle structure of a set size to eliminate the small hole area of ​​the third selected area, to obtain a fourth selected area;

[0027] Performing connectivity analysis on the fourth selected area, distinguishing different connected areas, and calculating the minimum circumscribed circles of different connected areas;

[0028] Filtering the connected areas in the fourth selected area that do not meet the set parameters by shape features, retaining the connected areas that meet the set parameters, obtaining the fifth selected area, and calculating the number of selected connected areas in the fifth selected area;

[0029] Selecting the row coordinates of the first point in each connected area of ​​the fifth selected area, and sorting each connected area according to the row coordinates of the first point in each connected area, to obtain a sixth selected area, wherein the sixth selected area is a connected area set obtained by sorting each connected area according to the row coordinates of the first point in each connected area of ​​the fifth selected image;

[0030] Select one or more connected areas in the sixth selected area to obtain a seventh selected area, where the seventh selected area includes the one or more connected areas in the sixth selected area;

[0031] Obtaining the calculated minimum circumscribed rectangle and the minimum circumscribed circle of each connected area in the seventh selected area, and calculating the calculated minimum circumscribed rectangle parameters and the minimum circumscribed circle parameters of each connected area;

[0032] Generate an eighth selected area according to the calculated minimum bounding rectangle parameters of each connected area, and obtain coordinate parameters of each pixel in the eighth selected area, wherein the eighth selected area is an image area that meets the set parameters and is generated according to the calculated minimum bounding rectangle parameters of each connected area;

[0033] According to the eighth selected area, cropping the second grayscale image to the eighth selected area to obtain a third grayscale image;

[0034] Calculating the grayscale value of the third grayscale image, as well as the average grayscale, grayscale standard deviation and grayscale value median of the third grayscale image;

[0035] Generate a ninth selected area of ​​random position and size, calculate the distance between the ninth selected area and the set point, and generate an interference area, where the interference area is a rectangular area or a circular area;

[0036] The intersection of the interference area and the seventh selected area is calculated, and the intersection of the interference area and the seventh selected area is filled with the median of the grayscale value of the third grayscale image to generate a defect sample image of incomplete characters on the watch cover.

[0037] In another embodiment, the step of performing a third process on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover includes:

[0038] Obtaining a first TXT format file, wherein the first TXT format file is a TXT format file containing character coordinates and categories of incomplete characters on the watch cover in the defect sample image;

[0039] Converting the first TXT format file into a first VOC format XML file, and converting the first VOC format XML file into a first XML format file and manually modifying and marking inaccurate parts of character coordinates and category markings of the defect sample image in the first XML format file;

[0040] The first modified VOC format XML file is converted into a YOLO format TXT file, wherein the YOLO format TXT file contains TXT and its corresponding data set of the incomplete character image of the watch cover, which is divided into a training set and a verification set.

[0041] In another embodiment, the data set for detecting incomplete characters on a watch cover is trained to obtain a trained watch cover incomplete character detection model, and a newly collected vertical image of the watch cover is input into the watch cover incomplete character detection model to obtain a watch cover incomplete character detection result, including:

[0042] Building a training environment for the watch cover incomplete character detection model;

[0043] Configuring training parameters of the watch cover incomplete character detection model;

[0044] Training the watch cover incomplete character detection model to obtain a trained watch cover incomplete character detection model;

[0045] The newly collected vertical image of the watch cover is input into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

[0046] In another embodiment, the watch cover incomplete character detection result includes:

[0047] The detection result image of the incomplete characters on the watch cover, the defect category of the incomplete characters on the target watch cover, the confidence of the predicted target box of the incomplete characters on the target watch cover, the detection time of the incomplete characters on the watch cover, and the number of defects.

[0048] In another aspect of the embodiments of the present invention, a device for detecting incomplete characters on a watch cover is disclosed, comprising:

[0049] An acquisition module, used for acquiring an image of a watch cover in a vertical direction;

[0050] A processing module is used to perform a first processing on the vertical direction image of the watch cover to obtain a circular area image where the incomplete characters on the watch cover are located in the vertical direction image of the watch cover; perform a second processing on the circular area image to obtain a defect sample image of the incomplete characters on the watch cover; perform a third processing on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover;

[0051] A training module, used for training a data set for detecting incomplete characters on a watch cover to obtain a trained model for detecting incomplete characters on a watch cover;

[0052] The detection module inputs the newly collected vertical image of the watch cover into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

[0053] According to another aspect of an embodiment of the present invention, an electronic device is disclosed, characterized in that the device includes one or more processors and a memory, and the memory is used to store one or more programs;

[0054] When the one or more programs are executed by the processor, the processor implements the method for detecting incomplete characters on a watch cover provided by each embodiment of the present invention.

[0055] According to another aspect of the embodiments of the present invention, a computer-readable storage medium storing a computer program is disclosed. When the computer program is executed, the method for detecting incomplete characters on a watch cover provided by the embodiments of the present invention is implemented.

[0056] In the embodiment of the present application, by acquiring a vertical image of a watch cover; performing a first process on the vertical image of the watch cover to acquire an image of a circular area where the incomplete characters of the watch cover are located in the vertical image of the watch cover; performing a second process on the image of the circular area to acquire a defect sample image of the incomplete characters of the watch cover; performing a third process on the defect sample image and the vertical image of the watch cover to acquire a data set for detecting incomplete characters of the watch cover; training the data set for detecting incomplete characters of the watch cover to acquire a trained detection model for incomplete characters of the watch cover, and inputting the newly acquired vertical image of the watch cover into the detection model for incomplete characters of the watch cover to acquire the detection result of incomplete characters of the watch cover. The present application can quickly and accurately determine whether there are defects on the character surface, and display detailed detection result information. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0058] Figure 1 is a flow chart of a method for detecting incomplete characters on a watch cover provided by an embodiment of the present application;

[0059] Figure 2 A schematic diagram of the structure of a device for detecting incomplete characters on a watch cover provided by one embodiment of the present application;

[0060] Figure 3 It is a diagram of the internal structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0061] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0062] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0063] Please refer to Figure 1 , which shows an exemplary process of the watch cover incomplete character detection method that can be applied to the embodiment of the present application.

[0064] like Figure 1 As shown, the method includes:

[0065] Step 110, obtaining a vertical image of the watch cover;

[0066] Specifically, in an embodiment of the present application, a camera is used to vertically photograph the watch cover to capture images with a resolution of 4096*3000, ensuring that the captured image has sufficient resolution and clarity so that subsequent image processing and feature extraction can proceed smoothly, making defect detection more accurate.

[0067] Step 120, performing a first processing on the vertical direction image of the watch cover to obtain an image of a circular area where the incomplete characters on the watch cover are located in the vertical direction image of the watch cover;

[0068] Specifically, after obtaining the vertical image of the watch cover, the image is preprocessed to remove other parts of the image and retain the circle where the characters are located. Data augmentation operations can also be used to rotate the image to increase the diversity of the image and prevent model overfitting.

[0069] Specifically, in one embodiment of the present application, the first processing of the vertical direction image of the watch cover includes:

[0070] Performing grayscale processing on the vertical direction image of the watch cover to obtain a first grayscale image, wherein the first grayscale image is a grayscale image of the vertical direction image of the watch cover, and the grayscale processing on the vertical direction image of the watch cover adopts an rgb1_to_gray operator algorithm; the rgb1_to_gray operator algorithm converts an image into a grayscale image and stores it in Image;

[0071] Performing threshold segmentation, continuous image region splitting and specific region selection on the first grayscale image to obtain a first selected region, wherein the first selected region is a specific region selected in the grayscale image of the vertical direction image of the watch cover, wherein the threshold segmentation adopts a threshold operator algorithm, the continuous image region splitting adopts a connection operator algorithm, and the specific region selection adopts a select_shape operator algorithm; the threshold operator algorithm performs threshold segmentation on the first grayscale image to divide the first grayscale image into different regions and extract a certain region; the connection operator algorithm performs connectivity analysis on the region after threshold segmentation to distinguish different connected regions, and the select_shape operator algorithm filters the connected regions by shape features and retains only the regions that meet the specified range;

[0072] Performing a dilation algorithm operation on the first selected area to obtain a first dilated area after the selected area of ​​the first selected area is dilated, wherein the dilation algorithm operation on the first selected area adopts a dilation_circle operator algorithm; the dilation_circle operator algorithm performs regional dilation on the first selected area to expand the selected range of the first selected area;

[0073] Obtaining the minimum circumscribed circle of the first dilated area, and generating a first circular area according to the minimum circumscribed circle of the first dilated area, wherein the obtaining of the minimum circumscribed circle of the first dilated area adopts the smallest_circle operator algorithm;

[0074] Based on the first circular area, the first grayscale image is loaded in the first circular area to obtain a first circular image, which is an image in the first circular area where the incomplete characters on the watch cover are located in the grayscale image after grayscale processing of the vertical image of the watch cover.

[0075] In another embodiment, the obtaining of the minimum circumscribed circle of the first dilated area and generating the first circular image according to the minimum circumscribed circle of the first dilated area includes:

[0076] Using the smallest_circle operator algorithm to obtain the smallest circumscribed circle of the first dilated area; the smallest_circle operator algorithm is used to calculate the smallest circumscribed circle of the first dilated area;

[0077] Using the gen_circle operator algorithm to generate a minimum circumscribed circle area from the area where the minimum circumscribed circle is located; the gen_circle operator algorithm is used to generate a circular area that meets the set conditions, which is used to limit the subsequent image processing area;

[0078] Obtaining a first intersection area between the minimum circumscribed circle area and the first dilated area, wherein the obtaining of the first intersection area between the minimum circumscribed circle area and the first dilated area uses an intersection operator algorithm;

[0079] The minimum enclosing rectangle of the first intersection area is obtained, and the image area of ​​the minimum enclosing rectangle is cropped to obtain a first circular image. The smallest_rectangle1 operator algorithm is used to obtain the minimum enclosing rectangle of the first intersection area, and the crop_rectangle1 operator algorithm is used to crop the image area of ​​the minimum enclosing rectangle. The crop_rectangle1 operator algorithm is used to obtain the first circular image, and the first circular image is saved through the write_image operator algorithm. Specifically, the reduce_domain operator algorithm limits the processing area of ​​the image to a certain area, and the crop_rectangle1 operator algorithm is used to crop and obtain the first circular image.

[0080] Step 130, performing a second process on the circular area image to obtain a defect sample image of incomplete characters on the watch cover;

[0081] The circular area image after the first processing is used to generate an image sample for detecting incomplete characters on a watch cover by performing a second processing on the circular area image.

[0082] Specifically, in one embodiment of the present application, the second processing of the annular region image to obtain a defect sample image of incomplete characters on the watch cover includes:

[0083] Performing grayscale processing on the annular region image to obtain a second grayscale image, wherein the second grayscale image is a grayscale image of the annular region image after the grayscale processing; reading the annular region image by the read_image operator algorithm; converting the annular region image into a grayscale image again by the rgb1_to_gray operator algorithm, generating a second grayscale image and storing it in Image;

[0084] Generate a second selected area that meets the set conditions through the gen_circle operator algorithm, where the second selected area is a circular area used to limit the area for image processing of the incomplete character detection image of the watch cover;

[0085] According to the image pixel values ​​of the second grayscale image, threshold segmentation is performed on the second grayscale image to obtain a third selected area with set pixel values, wherein the third selected area is an image area in the second grayscale image whose pixel values ​​are between set parameters, and threshold segmentation is performed on the second grayscale image by a threshold operator algorithm to extract a certain area;

[0086] Performing a morphological closing operation on the third selected area, and using a circle structure of a set size to eliminate the small hole area of ​​the third selected area, to obtain a fourth selected area; performing a morphological closing operation on the segmented third selected area by a closing_circle operator algorithm, and using a circle structure of a set size to eliminate the small hole area of ​​the third selected area;

[0087] Performing connectivity analysis on the fourth selected area, distinguishing different connected areas, and calculating the smallest circumscribed circles of different connected areas; performing connectivity analysis on the fourth selected area after the closing operation using the connection operator algorithm to distinguish different connected areas in the fourth selected area, and then calculating the smallest circumscribed circles of different connected areas using the smallest_circle operator algorithm;

[0088] Filtering the connected areas that do not meet the set parameters in the fourth selected area by shape features, retaining the connected areas that meet the set parameters, obtaining the fifth selected area, and calculating the number of selected connected areas in the fifth selected area; using the select_shape operator algorithm to filter each connected area in the fourth selected area by shape features, deleting the connected areas that do not meet the set parameters, retaining only the connected areas that meet the set parameter range, integrating the connected areas that meet the set parameter range into the fifth selected area, and calculating the number of connected areas retained in the fifth selected area by the count_obj operator algorithm;

[0089] Selecting the row coordinates of the first point in each connected area of ​​the fifth selected area, and sorting each connected area according to the row coordinates of the first point in each connected area, to obtain a sixth selected area, wherein the sixth selected area is a connected area set obtained by sorting each connected area according to the row coordinates of the first point in each connected area of ​​the fifth selected image; using the sort_region operator algorithm to sort each connected area of ​​the fifth selected area according to the row coordinates of the first point in each connected area of ​​the fifth selected area, and integrating all the sorted connected areas of the fifth selected area into the sixth selected area;

[0090] Select one or more connected areas in the sixth selected area to obtain a seventh selected area, where the seventh selected area includes the one or more connected areas in the sixth selected area;

[0091] Obtain the calculated minimum circumscribed rectangle and the minimum circumscribed circle of each connected area in the seventh selected area, and calculate the calculated minimum circumscribed rectangle parameters and the minimum circumscribed circle parameters of each connected area; calculate the minimum circumscribed rectangle of each connected area in the seventh selected area by the smallest_rectangle1 operator algorithm, calculate the minimum circumscribed circumscribed circle of each connected area in the seventh selected area by the smallest_circle operator algorithm, and obtain the parameters of the minimum circumscribed rectangle and the minimum circumscribed circle;

[0092] According to the calculated minimum bounding rectangle parameters of each connected area, an eighth selected area is generated, and the coordinate parameters of each pixel in the eighth selected area are obtained, wherein the eighth selected area is an image area that meets the set parameters and is generated according to the calculated minimum bounding rectangle parameters of each connected area; the minimum bounding rectangle 2 of the set parameters is selected for the minimum rectangular parameters calculated for the seventh selected area by the gen_rectangle1 operator algorithm to generate a rectangular selected area of ​​the set parameters, and the rectangular selected area is the eighth selected area, and the coordinates of all pixels in the eighth selected area are obtained by the get_region_points operator algorithm;

[0093] According to the eighth selected area, the second grayscale image is cropped to the eighth selected area to obtain a third grayscale image; the second grayscale image is copied to the eighth selected area by the copy_image operator algorithm, and then the second grayscale image is cropped according to the area range selected by the eighth selected area, and the cropped second grayscale image is the third grayscale image;

[0094] Calculate the grayscale value of the third grayscale image, as well as the average grayscale, grayscale standard deviation and grayscale median of the third grayscale image; obtain the grayscale value of the third grayscale image by using the get_grayval operator algorithm, calculate the average grayscale and grayscale standard deviation of the third grayscale image by using the intensity operator algorithm, and calculate the median of the grayscale value of the third grayscale image by using the tuple_median operator algorithm;

[0095] Generate a ninth selected area of ​​random position and size, calculate the distance from the ninth selected area to the set point, and generate an interference area, which is a rectangular area or a circular area; generate a ninth selected area of ​​random position and size and shape within the eighth selected area, calculate the distance from the minimum circumscribed circle in the seventh selected area to the set point by the distance_pp operator algorithm, and randomly generate an interference area; specifically, the ninth selected area generates an area of ​​random position and size, which is used for subsequent gen_rectangle1 operator algorithm and gen_circle operator algorithm to generate areas, and calculate the distance from the center of the minimum circumscribed circle in the seventh selected area to the center of the ring by the distance_pp operator algorithm, and this distance is used for subsequent character category judgment;

[0096] Calculate the intersection of the interference area and the seventh selected area, use the median of the grayscale value of the third grayscale image to fill the intersection of the interference area and the seventh selected area, generate a defective sample image of the incomplete characters on the watch cover, calculate the intersection of the interference area and the seventh selected area through the intersection operator algorithm, and then use the overpaint_region operator algorithm to fill the intersection according to the median of the grayscale value of the third grayscale image, use the fwrite_string operator algorithm to write the character category and the target frame coordinates, and use the write_image operator algorithm to save the defective sample image of the incomplete characters on the watch cover. At this time, the final defective sample image of the incomplete characters on the watch cover is obtained. Specifically, the area screened out by the select_obj operator algorithm and the gen_rectangle1 operator algorithm and the gen_circle operator algorithm regenerate the area according to the random position and size generated above, and the intersection of the two areas is calculated by the intersection operator algorithm.

[0097] Step 140, performing a third process on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover;

[0098] Specifically, the difference between the generated defect sample image of incomplete characters on the watch cover and the collected vertical image of the watch cover is that each of the generated defect sample images of incomplete characters on the watch cover has many incomplete characters. After the third processing, the obtained data set for detecting incomplete characters on the watch cover ensures that the data set has a reasonable structure and is easy for the model to use, so as to facilitate subsequent model training.

[0099] Specifically, in one embodiment of the present application, the defect sample image and the vertical direction image of the watch cover are subjected to a third process to obtain a data set for detecting incomplete characters on the watch cover, including:

[0100] Obtaining a first TXT format file, wherein the first TXT format file is a TXT format file containing character coordinates and categories of incomplete characters on the watch cover in the defect sample image;

[0101] Convert the first TXT format file into a first VOC format XML file, and convert the first VOC format XML file into a first XML format file and manually modify and annotate the character coordinates and inaccurate category marking parts of the defective sample image containing the incomplete characters on the watch cover in the first XML format file to generate a first corrected VOC format XML file;

[0102] The first modified VOC format XML file is converted into a YOLO format TXT file, wherein the YOLO format TXT file contains TXT and its corresponding data set of the incomplete character image of the watch cover, which is divided into a training set and a verification set.

[0103] Specifically, the first corrected VOC format XML file is converted into a YOLO format TXT file, wherein the YOLO format TXT file includes a TXT file and a corresponding data set of the incomplete character image of the watch cover divided into a training set and a verification set.

[0104] Step 150, training the data set for detecting incomplete characters on watch covers to obtain a trained model for detecting incomplete characters on watch covers, and inputting the newly collected vertical image of the watch cover into the model for detecting incomplete characters on watch covers to obtain detection results for incomplete characters on watch covers.

[0105] In the embodiment of the present application, the YOLOv8 algorithm is used for training, and finally a model capable of detecting incomplete characters on a watch cover is obtained. YOLOv8 is a major improved version of the YOLO series, with improvements in model structure, performance optimization, and ease of use. YOLOv8 consists of a Backbone network, a Neck feature fusion layer, and a Head detection head. It inherits the core idea of ​​the YOLO algorithm, converts the target detection problem into a regression problem, and directly predicts the bounding box and category through a single forward propagation, thereby achieving fast and accurate target detection.

[0106] Specifically, in one embodiment of the present application, the data set for detecting incomplete characters on a watch cover is trained to obtain a trained watch cover incomplete character detection model, and a newly collected vertical image of the watch cover is input into the watch cover incomplete character detection model to obtain a watch cover incomplete character detection result, including:

[0107] Build the training environment of the watch cover incomplete character detection model; the training environment of the watch cover incomplete character detection model of the present application is: create a virtual environment on the server, activate the virtual environment, install the libraries required for training, use the PyTorch framework as the deep learning framework, and compile the language Python3.10;

[0108] Configure the training parameters of the watch cover incomplete character detection model; the training parameters of the watch cover incomplete character detection model of the present application are: the number of training epochs is 500, the batch size is 4, and the learning rate is 0.01;

[0109] Training the watch cover incomplete character detection model to obtain a trained watch cover incomplete character detection model;

[0110] The newly collected vertical image of the watch cover is input into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

[0111] Specifically, the trained watch cover incomplete character detection model is used to infer the test image data to detect whether the characters on the watch cover are incomplete. The inference result image is compared with the inference original image to determine whether the trained model correctly identifies the incomplete characters and the time required for inference for each image, and to determine whether the model meets the requirements.

[0112] Specifically, the watch cover incomplete character detection result includes:

[0113] The detection result image of the incomplete characters on the watch cover, the defect category of the incomplete characters on the target watch cover, the confidence of the predicted target box of the incomplete characters on the target watch cover, the detection time of the incomplete characters on the watch cover, and the number of defects.

[0114] The method for detecting incomplete characters on a watch cover of the present application is as follows: obtaining a vertical image of the watch cover; performing a first process on the vertical image of the watch cover to obtain an image of a circular area where the incomplete characters on the watch cover are located in the vertical image of the watch cover; performing a second process on the image of the circular area to obtain a defect sample image of the incomplete characters on the watch cover; performing a third process on the defect sample image and the vertical image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover; training the data set for detecting incomplete characters on the watch cover to obtain a trained model for detecting incomplete characters on the watch cover, and inputting the newly collected vertical image of the watch cover into the model for detecting incomplete characters on the watch cover to obtain a detection result of incomplete characters on the watch cover. Compared with the traditional template matching detection method, the present application adopts a data-driven model, does not require manual production of template features, and can greatly reduce memory consumption through multi-layer feature extraction and dimensionality reduction, and has high detection real-time performance, and has high robustness to changes in illumination, angle, scale, etc. This application integrates an independently designed automatic defect generation algorithm and develops watch cover incomplete character detection software, realizing a one-stop project from data annotation to defect detection, solving the problems of difficulty in obtaining defect samples and low real-time performance of character detection.

[0115] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0116] Figure 2 FIG. 1 is a schematic diagram of a structure of a device for detecting incomplete characters on a watch cover provided by an embodiment of the present application. Figure 2 As shown, the watch cover incomplete character detection device comprises:

[0117] Acquisition module, processing module, training module, detection module;

[0118] An acquisition module, used for acquiring an image of a watch cover in a vertical direction;

[0119] A processing module is used to perform a first processing on the vertical direction image of the watch cover to obtain a circular area image where the incomplete characters on the watch cover are located in the vertical direction image of the watch cover; perform a second processing on the circular area image to obtain a defect sample image of the incomplete characters on the watch cover; perform a third processing on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover;

[0120] A training module, used for training a data set for detecting incomplete characters on a watch cover to obtain a trained model for detecting incomplete characters on a watch cover;

[0121] The detection module inputs the newly collected vertical image of the watch cover into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

[0122] In another embodiment of the present application, the processing module is used to:

[0123] Performing grayscale processing on the image in the vertical direction of the watch cover to obtain a first grayscale image, wherein the first grayscale image is a grayscale image of the image in the vertical direction of the watch cover, and the grayscale processing on the image in the vertical direction of the watch cover adopts an rgb1_to_gray operator algorithm;

[0124] Performing threshold segmentation, continuous image region splitting and specific region selection on the first grayscale image to obtain a first selected region, wherein the first selected region is a specific region selected in the grayscale image of the vertical direction image of the watch cover, wherein the threshold segmentation adopts a threshold operator algorithm, the continuous image region splitting adopts a connection operator algorithm, and the specific region selection adopts a select_shape operator algorithm;

[0125] Performing a dilation algorithm operation on the first selected area to obtain a first dilated area after the selected area of ​​the first selected area is dilated, wherein the dilation algorithm operation on the first selected area adopts a dilation_circle operator algorithm;

[0126] Obtaining the minimum circumscribed circle of the first dilated area, and generating a first circular area according to the minimum circumscribed circle of the first dilated area, wherein the obtaining of the minimum circumscribed circle of the first dilated area adopts the smallest_circle operator algorithm;

[0127] Based on the first circular area, the first grayscale image is loaded in the first circular area to obtain a first circular image, which is an image in the first circular area where the incomplete characters on the watch cover are located in the grayscale image after grayscale processing of the vertical image of the watch cover.

[0128] In another embodiment of the present application, the processing module is further used for:

[0129] Using the smallest_circle operator algorithm to obtain the smallest circumscribed circle of the first dilated area;

[0130] Use the gen_circle operator algorithm to generate a minimum circumscribed circle area from the area where the minimum circumscribed circle is located;

[0131] Obtaining a first intersection area between the minimum circumscribed circle area and the first dilated area, wherein the obtaining of the first intersection area between the minimum circumscribed circle area and the first dilated area uses an intersection operator algorithm;

[0132] The minimum enclosing rectangle of the first intersection area is obtained, and the image area of ​​the minimum enclosing rectangle is cropped to obtain a first circular image, wherein the method of obtaining the minimum enclosing rectangle of the first intersection area adopts the smallest_rectangle1 operator algorithm, the method of cropping the image area of ​​the minimum enclosing rectangle adopts the crop_rectangle1 operator algorithm, the method of obtaining the first circular image adopts the crop_rectangle1 operator algorithm, and the first circular image is saved through the write_image operator algorithm.

[0133] In another embodiment of the present application, the processing module is further used for:

[0134] Performing grayscale processing on the annular region image to obtain a second grayscale image, where the second grayscale image is a grayscale image of the annular region image after the grayscale processing;

[0135] Generate a second selected area that meets the set conditions through the gen_circle operator algorithm, where the second selected area is a circular area used to limit the area for image processing of the incomplete character detection image of the watch cover;

[0136] According to the image pixel values ​​of the second grayscale image, threshold segmentation is performed on the second grayscale image to obtain a third selected area with set pixel values, wherein the third selected area is an image area in the second grayscale image whose pixel values ​​are between set parameters, and threshold segmentation is performed on the second grayscale image by a threshold operator algorithm to extract a certain area;

[0137] Performing a morphological closing operation on the third selected area, and using a circle structure of a set size to eliminate the small hole area of ​​the third selected area, to obtain a fourth selected area;

[0138] Performing connectivity analysis on the fourth selected area, distinguishing different connected areas, and calculating the minimum circumscribed circles of different connected areas;

[0139] Filtering the connected areas in the fourth selected area that do not meet the set parameters by shape features, retaining the connected areas that meet the set parameters, obtaining the fifth selected area, and calculating the number of selected connected areas in the fifth selected area;

[0140] Selecting the row coordinates of the first point in each connected area of ​​the fifth selected area, and sorting each connected area according to the row coordinates of the first point in each connected area, to obtain a sixth selected area, wherein the sixth selected area is a connected area set obtained by sorting each connected area according to the row coordinates of the first point in each connected area of ​​the fifth selected image;

[0141] Select one or more connected areas in the sixth selected area to obtain a seventh selected area, where the seventh selected area includes the one or more connected areas in the sixth selected area;

[0142] Obtaining the calculated minimum circumscribed rectangle and the minimum circumscribed circle of each connected area in the seventh selected area, and calculating the calculated minimum circumscribed rectangle parameters and the minimum circumscribed circle parameters of each connected area;

[0143] Generate an eighth selected area according to the calculated minimum bounding rectangle parameters of each connected area, and obtain coordinate parameters of each pixel in the eighth selected area, wherein the eighth selected area is an image area that meets the set parameters and is generated according to the calculated minimum bounding rectangle parameters of each connected area;

[0144] According to the eighth selected area, cropping the second grayscale image to the eighth selected area to obtain a third grayscale image;

[0145] Calculating the grayscale value of the third grayscale image, as well as the average grayscale, grayscale standard deviation and grayscale value median of the third grayscale image;

[0146] Generate a ninth selected area of ​​random position and size, calculate the distance between the ninth selected area and the set point, and generate an interference area, where the interference area is a rectangular area or a circular area;

[0147] The intersection of the interference area and the seventh selected area is calculated, and the intersection of the interference area and the seventh selected area is filled using the grayscale value median of the third grayscale image to generate a defect sample image of incomplete characters on the watch cover.

[0148] In another embodiment of the present application, the processing module is further used for:

[0149] Obtaining a first TXT format file, wherein the first TXT format file is a TXT format file containing character coordinates and categories of incomplete characters on the watch cover in the defect sample image;

[0150] Convert the first TXT format file into a first VOC format XML file, and manually modify and annotate the character coordinates and inaccurate category marking parts of the defective sample image containing the incomplete characters on the watch cover in the first XML format file to generate a first corrected VOC format XML file;

[0151] The first modified VOC format XML file is converted into a YOLO format TXT file, wherein the YOLO format TXT file contains TXT and its corresponding data set of the incomplete character image of the watch cover, which is divided into a training set and a verification set.

[0152] In another embodiment of the present application, the detection module is used to:

[0153] Building a training environment for the watch cover incomplete character detection model;

[0154] Configuring training parameters of the watch cover incomplete character detection model;

[0155] Training the watch cover incomplete character detection model to obtain a trained watch cover incomplete character detection model;

[0156] The newly collected vertical image of the watch cover is input into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

[0157] In an embodiment of the present application, the device for detecting incomplete characters on a watch cover acquires a vertical image of the watch cover through an acquisition module; performs a first process on the vertical image of the watch cover through a processing module to acquire an image of a circular area where the incomplete characters on the watch cover are located in the vertical image of the watch cover; performs a second process on the image of the circular area to acquire a defect sample image of the incomplete characters on the watch cover; performs a third process on the defect sample image and the vertical image of the watch cover to acquire a data set for detecting incomplete characters on the watch cover; trains the data set for detecting incomplete characters on the watch cover through a training module to acquire a trained model for detecting incomplete characters on the watch cover, and inputs the newly acquired vertical image of the watch cover into the model for detecting incomplete characters on the watch cover through a detection module to acquire a detection result of incomplete characters on the watch cover. Compared with traditional template matching detection methods, the present application adopts a data-driven model, does not require manual production of template features, and can greatly reduce memory consumption through multi-layer feature extraction and dimensionality reduction, and has high detection real-time performance, and has high robustness to changes in illumination, angle, scale, etc. This application integrates an independently designed automatic defect generation algorithm and develops watch cover incomplete character detection software, realizing a one-stop project from data annotation to data detection, solving the problems of difficulty in obtaining defective samples and low real-time performance of character detection.

[0158] The specific definition of the watch cover incomplete character detection device can refer to the definition of the watch cover incomplete character detection method mentioned above, which will not be repeated here. Each module in the above-mentioned watch cover incomplete character detection device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0159] In particular, according to the embodiments of the present disclosure, Figure 3 As shown, the present invention discloses an electronic device, which includes one or more processors and a memory, wherein the memory is used to store one or more programs; when the one or more programs are executed by the processor, the processor implements the watch cover incomplete character detection method described in an embodiment of the present invention.

[0160] In particular, according to an embodiment of the present disclosure, the method for software upgrade described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the method for software upgrade. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium.

[0161] The one or more programs are stored in a read-only memory ROM or a random access memory RAM to perform various appropriate actions and processes. The random access memory RAM includes software programs for the server to complete corresponding services. The server and its controlled hardware devices, the read-only memory ROM, and the random access memory RAM are connected to each other through a bus, and various input / output interfaces are also connected to the bus.

[0162] The following components are connected to the input / output interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube CRT, a liquid crystal display LCD, etc., and a speaker, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that a computer program read therefrom is installed into the memory as needed.

[0163] In particular, according to an embodiment of the present disclosure, the watch cover incomplete character detection method described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing a method for software upgrading. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium.

[0164] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not constitute limitations on the units or modules themselves in certain circumstances.

[0165] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.

Claims

1. A method for detecting incomplete characters on a watch cover, characterized in that: include: Get the vertical image of the watch cover; Performing a first process on the vertical direction image of the watch cover to obtain an image of a circular area where the incomplete characters on the watch cover are located in the vertical direction image of the watch cover; Performing a second processing on the circular area image to obtain a defect sample image of incomplete characters on the watch cover; Performing a third process on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover; Training a data set for detecting incomplete characters on a watch cover to obtain a trained model for detecting incomplete characters on a watch cover, and inputting a newly collected vertical image of the watch cover into the model for detecting incomplete characters on the watch cover to obtain a detection result for incomplete characters on the watch cover; The first processing of the vertical direction image of the watch cover comprises: Performing grayscale processing on the image in the vertical direction of the watch cover to obtain a first grayscale image, wherein the first grayscale image is a grayscale image of the image in the vertical direction of the watch cover, and the grayscale processing on the image in the vertical direction of the watch cover adopts an rgb1_to_gray operator algorithm; Performing threshold segmentation, continuous image region splitting and specific region selection on the first grayscale image to obtain a first selected region, wherein the first selected region is a specific region selected in the grayscale image of the vertical direction image of the watch cover, wherein the threshold segmentation adopts a threshold operator algorithm, the continuous image region splitting adopts a connection operator algorithm, and the specific region selection adopts a select_shape operator algorithm; Performing a dilation algorithm operation on the first selected area to obtain a first dilated area after the selected area of ​​the first selected area is dilated, wherein the dilation algorithm operation on the first selected area adopts a dilation_circle operator algorithm; Obtaining the minimum circumscribed circle of the first dilated area, and generating a first circular area according to the minimum circumscribed circle of the first dilated area, wherein the obtaining of the minimum circumscribed circle of the first dilated area adopts the smallest_circle operator algorithm; According to the first circular area, the first grayscale image is loaded in the first circular area to obtain a first circular image, wherein the first circular image is an image in the first circular area where the incomplete characters of the watch cover are located in the grayscale image after the vertical direction image of the watch cover is grayscale processed; The second processing of the circular area image to obtain a defect sample image of incomplete characters on the watch cover includes: Performing grayscale processing on the annular region image to obtain a second grayscale image, where the second grayscale image is a grayscale image of the annular region image after the grayscale processing; Generate a second selected area that meets the set conditions through the gen_circle operator algorithm, where the second selected area is a circular area used to limit the area for image processing of the incomplete character detection image of the watch cover; According to the image pixel values ​​of the second grayscale image, threshold segmentation is performed on the second grayscale image to obtain a third selected area with set pixel values, wherein the third selected area is an image area in the second grayscale image whose pixel values ​​are between set parameters, and threshold segmentation is performed on the second grayscale image by a threshold operator algorithm to extract a certain area; Performing a morphological closing operation on the third selected area, and using a circle structure of a set size to eliminate the small hole area of ​​the third selected area, to obtain a fourth selected area; Performing connectivity analysis on the fourth selected area, distinguishing different connected areas, and calculating the minimum circumscribed circles of different connected areas; Filtering the connected areas in the fourth selected area that do not meet the set parameters by shape features, retaining the connected areas that meet the set parameters, obtaining the fifth selected area, and calculating the number of selected connected areas in the fifth selected area; Selecting the row coordinates of the first point in each connected area of ​​the fifth selected area, and sorting each connected area according to the row coordinates of the first point in each connected area, to obtain a sixth selected area, wherein the sixth selected area is a connected area set obtained by sorting each connected area according to the row coordinates of the first point in each connected area of ​​the fifth selected image; Select one or more connected areas in the sixth selected area to obtain a seventh selected area, where the seventh selected area includes the one or more connected areas in the sixth selected area; Obtaining the calculated minimum circumscribed rectangle and the minimum circumscribed circle of each connected area in the seventh selected area, and calculating the calculated minimum circumscribed rectangle parameters and the minimum circumscribed circle parameters of each connected area; Generate an eighth selected area according to the calculated minimum bounding rectangle parameters of each connected area, and obtain coordinate parameters of each pixel in the eighth selected area, wherein the eighth selected area is an image area that meets the set parameters and is generated according to the calculated minimum bounding rectangle parameters of each connected area; According to the eighth selected area, cropping the second grayscale image to the eighth selected area to obtain a third grayscale image; Calculating the grayscale value of the third grayscale image, as well as the average grayscale, grayscale standard deviation and grayscale value median of the third grayscale image; Generate a ninth selected area of ​​random position and size, calculate the distance between the ninth selected area and the set point, and generate an interference area, where the interference area is a rectangular area or a circular area; The intersection of the interference area and the seventh selected area is calculated, and the intersection of the interference area and the seventh selected area is filled with the median of the grayscale value of the third grayscale image to generate a defect sample image of incomplete characters on the watch cover.

2. The method according to claim 1, characterized in that The step of obtaining the minimum circumscribed circle of the first expansion area and generating the first circular area according to the minimum circumscribed circle of the first expansion area includes: Using the smallest_circle operator algorithm to obtain the smallest circumscribed circle of the first dilated area; Use the gen_circle operator algorithm to generate a minimum circumscribed circle area from the area where the minimum circumscribed circle is located; Obtaining a first intersection area between the minimum circumscribed circle area and the first dilated area, wherein the obtaining of the first intersection area between the minimum circumscribed circle area and the first dilated area uses an intersection operator algorithm; The minimum enclosing rectangle of the first intersection area is obtained, and the image area of ​​the minimum enclosing rectangle is cropped to obtain the first circular area. The smallest_rectangle1 operator algorithm is used to obtain the minimum enclosing rectangle of the first intersection area, the crop_rectangle1 operator algorithm is used to crop the image area of ​​the minimum enclosing rectangle, the crop_rectangle1 operator algorithm is used to obtain the first circular area, and the first circular area is saved through the write_image operator algorithm.

3. The method according to claim 1, characterized in that The step of performing a third process on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover includes: Obtaining a first TXT format file, wherein the first TXT format file is a TXT format file containing character coordinates and categories of incomplete characters on the watch cover in the defect sample image; Convert the first TXT format file into a first VOC format XML file, and convert the first VOC format XML file into a first XML format file and manually modify and annotate the character coordinates and inaccurate category marking parts of the defective sample image containing the incomplete characters on the watch cover in the first XML format file to generate a first corrected VOC format XML file; The first corrected VOC format XML file is converted into a YOLO format TXT file, wherein the YOLO format TXT file contains a data set of incomplete character images of watch covers and is divided into a training set and a verification set.

4. The method according to claim 1, characterized in that: The data set for detecting incomplete characters on a watch cover is trained to obtain a trained model for detecting incomplete characters on a watch cover, and a newly collected vertical image of the watch cover is input into the model for detecting incomplete characters on the watch cover to obtain a detection result of incomplete characters on the watch cover, including: Building a training environment for the watch cover incomplete character detection model; Configuring training parameters of the watch cover incomplete character detection model; Training the watch cover incomplete character detection model to obtain a trained watch cover incomplete character detection model; The newly collected vertical image of the watch cover is input into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

5. The method according to claim 4, characterized in that The watch cover incomplete character detection result includes: The detection result image of the incomplete characters on the watch cover, the defect category of the incomplete characters on the target watch cover, the confidence of the predicted target box of the incomplete characters on the target watch cover, the detection time of the incomplete characters on the watch cover, and the number of defects.

6. A device for detecting defective characters on a watch cover, characterized in that: include: An acquisition module, used for acquiring an image of a watch cover in a vertical direction; A processing module is used to perform a first processing on the vertical direction image of the watch cover to obtain a circular area image where the incomplete characters on the watch cover are located in the vertical direction image of the watch cover; perform a second processing on the circular area image to obtain a defect sample image of the incomplete characters on the watch cover; perform a third processing on the defect sample image and the vertical direction image of the watch cover to obtain a data set for detecting incomplete characters on the watch cover; The processing module is used to perform grayscale processing on the vertical direction image of the watch cover to obtain a first grayscale image, wherein the first grayscale image is a grayscale image of the vertical direction image of the watch cover, and the grayscale processing on the vertical direction image of the watch cover adopts an rgb1_to_gray operator algorithm; Performing threshold segmentation, continuous image region splitting and specific region selection on the first grayscale image to obtain a first selected region, wherein the first selected region is a specific region selected in the grayscale image of the vertical direction image of the watch cover, wherein the threshold segmentation adopts a threshold operator algorithm, the continuous image region splitting adopts a connection operator algorithm, and the specific region selection adopts a select_shape operator algorithm; Performing a dilation algorithm operation on the first selected area to obtain a first dilated area after the selected area of ​​the first selected area is dilated, wherein the dilation algorithm operation on the first selected area adopts a dilation_circle operator algorithm; Obtaining the minimum circumscribed circle of the first dilated area, and generating a first circular area according to the minimum circumscribed circle of the first dilated area, wherein the obtaining of the minimum circumscribed circle of the first dilated area adopts the smallest_circle operator algorithm; According to the first circular area, the first grayscale image is loaded in the first circular area to obtain a first circular image, wherein the first circular image is an image in the first circular area where the incomplete characters of the watch cover are located in the grayscale image after the vertical direction image of the watch cover is grayscale processed; The processing module is used to perform grayscale processing on the annular region image to obtain a second grayscale image, where the second grayscale image is a grayscale image of the annular region image after the grayscale processing; Generate a second selected area that meets the set conditions through the gen_circle operator algorithm, where the second selected area is a circular area used to limit the area for image processing of the incomplete character detection image of the watch cover; According to the image pixel values ​​of the second grayscale image, threshold segmentation is performed on the second grayscale image to obtain a third selected area with set pixel values, wherein the third selected area is an image area in the second grayscale image whose pixel values ​​are between set parameters, and threshold segmentation is performed on the second grayscale image by a threshold operator algorithm to extract a certain area; Performing a morphological closing operation on the third selected area, and using a circle structure of a set size to eliminate the small hole area of ​​the third selected area, to obtain a fourth selected area; Performing connectivity analysis on the fourth selected area, distinguishing different connected areas, and calculating the minimum circumscribed circles of different connected areas; Filtering the connected areas in the fourth selected area that do not meet the set parameters by shape features, retaining the connected areas that meet the set parameters, obtaining the fifth selected area, and calculating the number of selected connected areas in the fifth selected area; Selecting the row coordinates of the first point in each connected area of ​​the fifth selected area, and sorting each connected area according to the row coordinates of the first point in each connected area, to obtain a sixth selected area, wherein the sixth selected area is a connected area set obtained by sorting each connected area according to the row coordinates of the first point in each connected area of ​​the fifth selected image; Select one or more connected areas in the sixth selected area to obtain a seventh selected area, where the seventh selected area includes the one or more connected areas in the sixth selected area; Obtaining the calculated minimum circumscribed rectangle and the minimum circumscribed circle of each connected area in the seventh selected area, and calculating the calculated minimum circumscribed rectangle parameters and the minimum circumscribed circle parameters of each connected area; Generate an eighth selected area according to the calculated minimum bounding rectangle parameters of each connected area, and obtain coordinate parameters of each pixel in the eighth selected area, wherein the eighth selected area is an image area that meets the set parameters and is generated according to the calculated minimum bounding rectangle parameters of each connected area; According to the eighth selected area, cropping the second grayscale image to the eighth selected area to obtain a third grayscale image; Calculating the grayscale value of the third grayscale image, as well as the average grayscale, grayscale standard deviation and grayscale value median of the third grayscale image; Generate a ninth selected area of ​​random position and size, calculate the distance between the ninth selected area and the set point, and generate an interference area, where the interference area is a rectangular area or a circular area; Calculating the intersection of the interference area and the seventh selected area, and filling the intersection of the interference area and the seventh selected area with the median of the grayscale value of the third grayscale image to generate a defect sample image of incomplete characters on the watch cover; A training module, used for training a data set for detecting incomplete characters on a watch cover to obtain a trained model for detecting incomplete characters on a watch cover; The detection module inputs the newly collected vertical image of the watch cover into the watch cover incomplete character detection model to obtain the watch cover incomplete character detection result.

7. An electronic device, characterized in that: The device includes one or more processors and a memory, wherein the memory is used to store one or more programs; When the one or more programs are executed by the processor, the processor is caused to implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed, the method according to any one of claims 1 to 5 is implemented.