Label drawing method and device, computer equipment and readable storage medium

By drawing target edges to form marking lines and creating labels with a preset width in the image measuring instrument, the problem of low efficiency in manual labeling in the image measuring instrument is solved, achieving fast and accurate label generation and reducing labor costs.

CN122023938APending Publication Date: 2026-05-12CHOTEST TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHOTEST TECH INC
Filing Date
2025-10-24
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Manual labeling in traditional image measuring instruments is inefficient, resulting in a lot of repetitive work and high labor costs.

Method used

By acquiring at least one image from the training set of images to be labeled, drawing the target edge to form a marker line in the training software, and forming a region of a preset width centered on the marker line as the label, the label can be quickly and accurately labeled.

Benefits of technology

This reduces the repetitive work of labeling each image from scratch, improves label generation efficiency, and lowers labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122023938A_ABST
    Figure CN122023938A_ABST
Patent Text Reader

Abstract

The invention relates to a label drawing method and device, computer equipment and a readable storage medium. The label drawing method comprises the steps that at least one first image in a to-be-labeled image training set is acquired, and a target edge of the first image is described in a drawing interface of training software through an adaptive label drawing style to form a marking line attached to the target edge; forming an area with a preset width by taking the marking line as a center line, and taking the outline of the area as a marking label of the first image; the preset width is the width of the labeling label. By adopting the method, the label generation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application filed on October 24, 2025, with application number 202511528578.9, entitled "Label Inheritance Method, Model Training Method and Measurement Method, Device and Medium". Technical Field

[0002] This application relates to the field of artificial intelligence technology, and in particular to a label drawing method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0003] Image measurement devices (such as image measuring instruments or quick-reading instruments) can achieve precise measurement of the surface dimensions, contours, angles, positions, and geometric tolerances of various complex parts. In practical applications, image measuring instruments can extract the geometric features (such as planes, lines, and points) of a workpiece, calculate the length or angle information of these geometric features, and thus determine whether the workpiece's machining accuracy meets the requirements. With the rapid development of artificial intelligence technology, image measurement can be performed based on artificial intelligence (AI) models. However, training the AI ​​model in an image measuring instrument often requires a large number of sample images, and each sample image needs to be labeled.

[0004] In traditional techniques, labeling sample images is often done manually, drawing each one individually. This requires a lot of repetitive work and is inefficient. Summary of the Invention

[0005] Therefore, it is necessary to provide a label drawing method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the efficiency of label marking in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a label drawing method, including:

[0007] Obtain at least one first image from the training set of images to be labeled;

[0008] In the drawing interface of the training software, the target edge of the first image is drawn using an adapted label drawing style to form a marker line that fits the target edge;

[0009] A region of a preset width is formed with the marked line as the center line, and the outline of the region is used as the label of the first image; the preset width is the width of the label.

[0010] Secondly, this application also provides a label drawing device, comprising:

[0011] The image acquisition module is used to acquire at least one first image from the training set of images to be labeled;

[0012] The marker line drawing module is used to draw the target edge of the first image in the drawing interface of the training software using an adapted label drawing style to form a marker line that fits the target edge.

[0013] The labeling module is used to form a region of a preset width with the marking line as the center line, and to use the outline of the region as the label of the first image; the preset width is the width of the label.

[0014] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the label drawing method provided in the first aspect.

[0015] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the label drawing method provided in the first aspect.

[0016] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the label drawing method provided in the first aspect.

[0017] The aforementioned label drawing method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire at least one first image from the training set of images to be labeled. In the drawing interface of the training software, the target edge of the first image is drawn using an adapted label drawing style to form a marker line that fits the target edge. An area of ​​a preset width is formed with the marker line as the center line, and the outline of this area is used as the label of the first image. This enables fast and accurate image labeling in the training software, avoiding the need to label each image from scratch, which leads to a large amount of repetitive work, thereby reducing labor costs and improving label generation efficiency. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a diagram illustrating the application environment of the tag inheritance method in one embodiment;

[0020] Figure 2 This is a flowchart illustrating the tag inheritance method in one embodiment;

[0021] Figure 3 This is a schematic diagram of the annotation labels for the first image in one embodiment;

[0022] Figure 4 This is a schematic diagram of different sample images of the same category in one embodiment;

[0023] Figure 5 This is a schematic diagram of the marker points and marker lines in one embodiment;

[0024] Figure 6 This is a schematic diagram of different label categories on the same sample image in one embodiment;

[0025] Figure 7 This is a schematic diagram of tag inheritance in one embodiment;

[0026] Figure 8 This is a schematic diagram of the adjusted label in one embodiment;

[0027] Figure 9 This is a structural block diagram of a tag inheritance device in one embodiment;

[0028] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0030] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0031] The label generation method (or label annotation method, annotation method, batch annotation method, label retention method, label inheritance method) provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 can obtain the image training set to be labeled sent by terminal 102, and select at least one first image from the image training set for labeling, obtaining the label of the first image; wherein, the label is used to characterize the target edge features in the image; server 104 determines the label of the second image based on the label of the first image, thereby obtaining the labels of all images in the image training set. The second image is any image in the image training set other than the first image. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, image measuring instruments, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. It should be noted that the tag inheritance method provided in this application embodiment is not limited to application scenarios involving interaction between a server and a terminal; it can also be applied to application scenarios involving a single terminal or a single server.

[0032] In one exemplary embodiment, such as Figure 2 As shown, a labeling method is provided, which can be applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 202 to 206. Wherein:

[0033] Step 202: Obtain the training set of images to be labeled.

[0034] The image training set includes multiple sample images, each of which can be an image acquired by an image measurement device. The image training set is unlabeled; that is, the sample images in the training set do not contain labels. Labels are used to characterize image edge features; that is, a label is not a line or point, but a closed contour, and the region corresponding to this closed contour includes the target edge features.

[0035] In practical applications, multiple sample images in the image training set can be obtained by an image measuring instrument or a flash measuring instrument from multiple samples with the same or similar measurement requirements. The sample image can be a complete image of the sample or a partial image of the sample. The sample image can be an image acquired from a target region of the sample, which can encompass the edge the user wants to measure. In other words, the sample image can be an image acquired from a local region of the sample, which at least includes the target edge features within that local region, corresponding to the edge (also called the target edge) that the user needs to measure. In one embodiment, the number of target edges in the same sample image can be one or more. The same target edge, in theoretical drawings, refers to a continuous local edge containing only one shape (such as a straight line, arc, or circle).

[0036] In some applications, a local image of the sample can be acquired using an image measuring instrument or a flash measuring instrument as a sample image. This sample image includes a local sample region containing the target edge features and a surrounding region of a preset width. The preset width can be set according to the measurement requirements of the image measuring instrument. For example, assuming the local sample region containing the target edge features is 4 cm x 6 cm and the preset width is 1 cm, a 6 cm x 8 cm region can be selected to acquire the sample image. This better suits the measurement requirements of the image measuring instrument, ensuring the integrity of the target edge while reducing the influence of other complex edges on the target edge recognition, thus improving the accuracy of target edge feature recognition. Of course, this is not the only option; the scanned image of the entire field of view of the scanning camera in the image measuring instrument at a selected location can also be used as a sample image. This selected location can be determined by the target edge to be measured, ensuring that the scanned image covers the target edge.

[0037] Step 204: Select at least one first image from the training set of images to be labeled and label it to obtain the label of the first image; wherein, the label is used to characterize the target edge features in the image.

[0038] The first image is selected from the training set of images to be labeled and then labeled. The number of first images can be 1, 2, 3, or more, and the number can be selected according to the actual application scenario. The first image can be labeled manually or by a labeling algorithm to obtain the label. It should be noted that the embodiments of this application do not impose too many restrictions on the method of obtaining the label of the first image, as long as the label of the first image is accurate. The area corresponding to the label includes the target edge features. The label can be regarded as a closed contour that can select the area where the target edge features are located in the sample image, rather than a line or a point. In some embodiments, the same label includes a target edge, that is, the two correspond one-to-one. Optionally, the closed contour of the same label does not cover other edges besides the target edge, thereby reducing the influence of other edges on the target edge recognition, especially when used to train the target edge detection model, which can effectively improve the recognition accuracy of the target edge features of the trained target edge detection model.

[0039] For example, the first image can be labeled manually. For instance, in the drawing interface of the training software, a suitable label drawing style (such as line, arc, circle, or curve) can be selected to draw the target edges of the first image, forming marker lines that fit the image edges. A region of preset width is formed centered on the marker lines, and the outline of this region serves as the label for the first image. The preset width can be set according to the actual application scenario. The preset width is the label width. Alternatively, the target edge features of the first image can also be labeled automatically. For instance, target edge features in the first image can be detected using an edge detection algorithm, and the target edge features can be labeled using marker points. Marker lines are formed using these marker points, and a region of preset width is formed centered on the marker lines. The outline of this region serves as the label for the first image.

[0040] Step 206: Determine the label of the second image based on the label of the first image; wherein the second image is an image in the image training set other than the first image.

[0041] Here, the label of the second image refers to the label characterizing the target edge features in the second image. For example, the label of the first image can be copied or generated and directly used as the label of the second image. Alternatively, the label of the copied first image can be adjusted based on the edge features in the second image that match the target edge features in the first image to obtain the label of the second image. It is easy to understand that when the number of sample images in the image training set is large, the number of second images is usually greater than the number of first images.

[0042] In some examples, a first image matching the second image can be determined based on the first similarity between the first image and the second image, and the label of the corresponding second image can be determined based on the label of the matching first image, which can improve the accuracy of the second image label.

[0043] In the above-described label inheritance method, a training set of images to be labeled is obtained, and at least one first image is selected from the training set for labeling to obtain the label of the first image. Based on the label of the first image, the label of the second image is determined. The second image is an image in the training set other than the first image. This method can automatically determine the labels of other images based on the labels of a small number of images, thereby quickly determining the labels of all images in the training set of images to be labeled. This avoids the situation where the label of each image needs to be labeled from scratch, resulting in a large amount of repetitive work, thus reducing labor costs and improving label generation efficiency.

[0044] In some embodiments, determining the label of the second image based on the annotation label of the first image in step 206 includes:

[0045] Calculate the first similarity between the second image and the first image, and use the first image with a first similarity greater than or equal to the similarity threshold as a candidate image; determine the label of the second image based on the annotation label of the candidate image.

[0046] The first similarity between the second image and the first image is essentially the similarity between the edge features of the two images. This first similarity can be characterized by the cosine similarity or Euclidean distance between the edge features of the first and second images. Alternatively, it can be determined by the pixel mean square error (MSE) or structural similarity index (SSIM) between the two images. Alternatively, the first similarity can be determined by separately determining the color histograms of the first and second images and then using the Bach distance or chi-square distance between them. It should be noted that the calculation method for the first similarity can be set according to the actual application scenario and is not specifically limited here.

[0047] In practical applications, if the number of first images includes multiple images, for each second image, if there is more than one first image whose first similarity is greater than or equal to the similarity threshold between the second image and the multiple first images, then the first image with the highest first similarity can be used as a candidate image.

[0048] In this embodiment, by calculating the first similarity between the second image and the first image, the first image with a first similarity greater than or equal to the similarity threshold is used as a candidate image. Based on the annotation labels of the candidate images, the label of the second image is determined. This realizes the determination of the label of the second image based on the annotation labels of the candidate images with a similarity threshold or higher, which can determine the accurate label of the second image more quickly and improve the generation efficiency of the label of the second image.

[0049] In some embodiments, step 204, which involves selecting at least one first image from the training set of images to be labeled and obtaining the label of the first image, includes:

[0050] The sample images in the training set are classified according to the image edge features to obtain at least one class of images to be labeled; at least one first image is selected from each class of images to be labeled to obtain the label of the first image.

[0051] Step 206 involves determining the label of the second image based on the annotation label of the first image, including:

[0052] Calculate the first similarity between the second image and the first image in each class of images to be labeled, and determine candidate images from the first images whose first similarity with the second image is greater than or equal to the similarity threshold; determine the label of the second image based on the label of the candidate images.

[0053] Image edge features refer to the edge features included in an image. An image may contain one or more edge features; that is, a sample image may contain multiple edge features. Different sample images may have different edge features. Therefore, sample images in the image training set can be classified based on image edge features to obtain at least one class of images to be labeled, and each class of images to be labeled contains at least the same image edge features. In other words, different classes of images to be labeled contain different image edge features.

[0054] Multiple sample images can be subjected to edge feature recognition separately to obtain the edge feature recognition result for each sample image. Based on the edge feature recognition result, the multiple sample images can be classified to obtain at least one class of images to be labeled. Specifically, sample images with the same edge feature recognition result or a similarity higher than a preset threshold can be grouped into the same category of images to be labeled. Images to be labeled within the same category can be named using the same naming rules, meaning images to be labeled in different categories can be distinguished by different naming identifiers. Images to be labeled within the same category include the same or similar edge features. Images to be labeled within the same category can be images corresponding to the same region on multiple samples, or images corresponding to multiple edges on the same sample with a similarity higher than a preset threshold. Alternatively, image edge features refer to the target edges to be labeled included in the image; classification can be based on whether sample images have the same or similar target edges, for example, directly grouping sample images with the same or similar (similarity higher than a preset threshold) target edge features into the same category of images to be labeled.

[0055] It is easy to understand that the number of the first images can be set according to the actual application scenario, for example, it can be 1, 2, 3 or more. The labels of the first images can be obtained by manual annotation or annotation algorithms. For specific annotation methods, please refer to the relevant content in the above embodiments, which will not be repeated here.

[0056] For example, after obtaining at least one class of images to be labeled, for each class of images to be labeled, a first similarity between each second image and the first image can be calculated. Candidate images with a first similarity greater than or equal to a similarity threshold with the second image can be determined from the first image. The labels of the candidate images can be directly applied to the second images to generate the labels of the second images. Alternatively, the labels of the candidate images applied to the second images can be adjusted according to the edge features in the second image that match the target edge features corresponding to the labels in the candidate images to obtain the labels of the second images.

[0057] In some examples, after the label of the second image is determined, the second image with the determined label can be used as a new first image so that other second images can determine the corresponding candidate images based on the first similarity. This can increase the number of first images and improve the accuracy of candidate images.

[0058] In this embodiment, by classifying sample images in the image training set according to image edge features, at least one class of images to be labeled is obtained. For each class of images to be labeled, at least one first image is selected for labeling to obtain the label of the first image. Based on the first similarity between the second image and the first image, candidate images with a first similarity not less than a similarity threshold are determined. Based on the label of the candidate image, the label of the second image is determined. This achieves the matching of unlabeled images with labeled images in the same class of images to be labeled, and the determination of the label of the unlabeled image based on the label of the matched labeled image, which can further improve the accuracy of the candidate images, thereby improving the label accuracy of the second image.

[0059] In some embodiments, determining the label of the second image based on the annotation label of the first image includes:

[0060] Use the label of the first image as the label of the second image, which belongs to the same category of images to be labeled as the first image.

[0061] Specifically, using the annotation labels of the first image as labels for the second image, which belongs to the same category of images to be annotated as the first image, means copying or directly generating the annotation labels of the first image into the second image, which belongs to the same category of images to be annotated, and using it as the label for the second image. Alternatively, the annotation labels copied or directly generated into the second image can be adjusted to obtain the labels for the second image.

[0062] For example, the sample images in the image training set are classified according to image edge features to obtain at least one class of images to be labeled. At least one first image is selected from each class of images to be labeled, and its label is obtained. For each class of images to be labeled, the label of the first image is used as the label of the second image in the corresponding class. For example, if a class of images to be labeled includes one first image and three second images, denoted as A, and the second images include B and C, then the label of A can be directly used as the label of B and C. That is, the label of A can be copied or directly generated into B and C, and the copied or directly generated label can be directly used as the label of B and C. Alternatively, the copied or directly generated label can be adjusted accordingly and used as the label of B and C respectively.

[0063] In this embodiment, by using the annotation labels of the first image in the same type of images to be annotated as the labels of the second image, the labels of the second image can be generated quickly based on the labels of the first image, thereby improving the label generation efficiency of the second image.

[0064] In some embodiments, step 204, which involves selecting at least one first image from the training set of images to be labeled and obtaining the label of the first image, includes:

[0065] Select at least one first image from the training set of images to be labeled, label the target edge features of the first image by marking points, and determine the label of the first image based on the marking line formed by the marking points and the label width.

[0066] Specifically, edge detection algorithms or models can be used to detect target edge features in the first image, and the detected target edge features can be marked using marker points, thus indicating the location of the target edge features in the first image. This can be easily understood as either manually marking the target edge features in the first image using marker points, or automatically marking the target edge features in the first image using marking software (algorithms).

[0067] For example, at least one first image is selected from the training set of images to be labeled. Edge features of the first image are detected using an edge detection algorithm to obtain edge detection results. These edge detection results are then labeled with marker points. The labeled marker points are fitted to obtain marker lines. The label of the first image is determined based on the marker lines and the label width. The label width can be pre-set and can be adjusted according to the actual application scenario. For example, ... Figure 3 As shown, the marker points 302 are connected sequentially to form a marker line 304. With the marker line 304 as the center, the annotation label 306 of the first image is formed according to the preset label width.

[0068] In this embodiment, by selecting at least one first image from the training set of images to be labeled, marking the target edge features of the first image with marker points, and determining the label of the first image based on the marker line formed by the marker points and the label width, a label that better matches the target edge features can be generated.

[0069] In some embodiments, determining the label of the second image based on the annotation labels of the candidate images includes:

[0070] Based on the edge features in the second image that match the target edge features in the first image, the labels of the candidate images are adjusted to obtain the labels of the second images.

[0071] In this context, edge features in the second image that match the target edge features in the first image are, for example, edge features in the second image that are similar in shape or position to the target edge features and belong to the same category as the edge features to be measured. Based on the edge features that match the target edge features in the first image, the labels of the candidate images can be adjusted manually or automatically to obtain the labels for the second image.

[0072] For example, the label of the second image can be obtained by adjusting the number or position of the markers in the annotation labels of the candidate image. For instance, the number of markers in the annotation labels can be increased or decreased, or the position of the markers in the annotation labels can be moved to obtain the label of the second image. Alternatively, the label of the second image can also be obtained by moving and adjusting the overall position of the annotation labels of the candidate image.

[0073] In this embodiment, by adjusting the label of the candidate image based on the edge features in the second image that match the target edge features in the first image, the label of the second image is obtained. This makes the label of the second image more consistent with the corresponding actual edge situation, thereby improving the accuracy of the label of the second image.

[0074] In some embodiments, determining the label of the second image based on the annotation labels of the candidate images includes:

[0075] The target region is determined based on the annotations of the candidate image. A global match is then performed between this target region and the second image. Within the second image, the region with the highest similarity to the target region is identified. A copied annotation is placed on this matched region, and the label of the second image is determined based on the annotation in the matched region. During the matching process, the target region can be rotated or translated until the similarity to the target region no longer increases. In practical applications, the copied annotation can be placed at any position in the second image, and then moved to the matched region to obtain the label of the second image.

[0076] Specifically, the shape and size of the target region unit can be determined based on the shape and size of the annotation labels of the candidate images. The shape and size of the target region unit must be at least the same as the shape and size of the annotation labels of the candidate images. The calculation method for the second similarity can be implemented by referring to the calculation method for the first similarity, and will not be elaborated here.

[0077] In this embodiment, the target region unit (i.e., the region selected by the label) is determined based on the annotation labels of the candidate image. The target region unit is used as the matching object to match the second image. The second matching region with the highest similarity to the target region unit is determined in the second image. The copied label is placed on the matching region. Based on the label on the matching region, the label of the second image is determined. The position of the copied label in the second image can be accurately determined, so that the copied label is placed at a position that matches the edge features in the second image. Based on this, the label of the second image can be determined, which can improve the accuracy of the label of the second image.

[0078] In some embodiments, the position of the label in the first image can be determined, and the copied or directly generated label can be placed in the corresponding position in the second image. That is, the label of the second image is determined based on the copied or directly generated label in the corresponding position in the second image.

[0079] In some embodiments, the positional relationship of the same edge feature in a first image and a second image can be determined. Based on this positional relationship and the position of the annotation label in the first image, a target position in the second image is determined. A copied or directly generated annotation label is then placed at the target position in the second image. Based on the copied or directly generated annotation label at the target position in the second image, the label of the second image is determined. For example, if the positional relationship of the same edge feature in the first image and the second image is a 90° counterclockwise rotation, meaning the edge feature in the first image is rotated 90° counterclockwise to obtain the position of the edge feature in the second image, then the position of the annotation label in the first image, after being rotated 90° counterclockwise, can be determined as the position of the copied annotation label in the second image. By understanding the positional relationship of the same edge feature in the first and second images, it is possible to place the copied annotation label in the second image at a position that matches the corresponding edge feature, improving the accuracy of the copied annotation label's position and reducing the adjustment workload.

[0080] In some embodiments, this application provides a model training method, including:

[0081] Obtain the image training set and generate labels for the image training set according to the label inheritance method described above; train the initial edge detection model based on the image training set and its labels until the training conditions are met, and obtain the target edge detection model.

[0082] The image training set may include multiple sample images, each of which can be a sample image acquired through an image measurement device. The image training set consists of unlabeled images, and labels for the sample images in the image training set can be generated based on the label inheritance method provided in the above embodiments. The initial edge detection model can be, for example, a convolutional neural network architecture for edge detection, such as U-Net, FCN, Mask R-CNN, or a generative adversarial network (GAN).

[0083] For example, the initial detection model can be trained based on the image training set and the corresponding labels until the training conditions are met, such as the difference between the label and the prediction result being less than the difference threshold, or the number of training iterations reaching a preset number, to obtain the target edge detection model for edge detection.

[0084] In some examples, labels in the image training set can be classified based on the edge features corresponding to the labels. Labels corresponding to edge features with similarity higher than a threshold are grouped into the same category. The initial edge detection model can be trained sequentially using sample images corresponding to each label category until the model's predictions for each label category meet preset conditions, resulting in the target edge detection model. This target edge detection model can accurately identify edge features across multiple categories. In practical applications, the initial edge detection model can also be trained using sample images corresponding to the target category label. This target edge detection model is more accurate in identifying edge features specific to the target category label. The target category can be any label category.

[0085] The above model training method generates labels for the image training set through label inheritance. Based on the image training set and the corresponding labels, the initial edge detection model is trained until the training conditions are met, thus obtaining the target edge detection model. This method can quickly and accurately obtain labels for a large number of image training sets to train the model, improving the training efficiency and accuracy.

[0086] In some embodiments, this application provides a measurement method, including: acquiring a target image corresponding to an object to be measured; performing edge detection on the target image using a target edge detection model trained by the above-described model training method to obtain a target edge; determining the target size of the target edge; and obtaining a measurement result of the object to be measured based on the target size.

[0087] The target image can be a complete image or a partial image of the object to be measured. For example, the target image can be obtained by taking a picture of only the part of the object that needs to be measured.

[0088] For example, a target image corresponding to the object to be measured can be acquired using an image measuring instrument. The target image is then edge-detected using a target edge detection model embedded in the image measuring instrument to obtain the target edge. The size of the target edge is measured according to the measurement requirements to obtain the target size. The measurement result of the object to be measured is then calculated based on the target size. In practical applications, the trained target edge detection model can be loaded into the measurement software of the image measuring instrument. After the user selects the feature measurement region in the target image using a feature selection tool, the target edge detection model can identify the edge features in the selected feature measurement region to obtain the target edge. The size of the target edge is measured to obtain the target size. The measurement result of the object to be measured is then obtained based on the target size.

[0089] In this embodiment, the target edge detection model is used to perform edge detection on the target image corresponding to the object to be measured, and the target edge is obtained. The measurement result is obtained based on the target size of the target edge. This can realize accurate detection of the edge in the target image based on the target edge detection model, thereby improving the accuracy of the measurement result.

[0090] In some application scenarios, label drawing involves manually drawing the target edges of a sample image (i.e., a sample image) each time. This requires manually drawing the edges of the sample image from scratch using tools such as lines or arcs, which is a lot of repetitive work, greatly reducing label drawing efficiency and increasing labor and production costs. Based on this, this application provides a label inheritance method. When drawing labels for a sample image, manually drawn labels can be inherited. If the image similarity is higher than a similarity threshold, the previously drawn labels are retained or copied to the current sample image. The retained or copied labels are then fine-tuned to match the current sample image and better fit its edges. This eliminates the need to draw the image edges from scratch using drawing tools, requiring only minor adjustments, thus reducing repetitive work and greatly improving label generation efficiency. A specific implementation process is described below. The related operations described in steps S1-S3 below can also be applied to the above label inheritance method, model training method, and measurement method without excessive limitations. Specifically, this includes:

[0091] S1: Prepare multiple sample images to be labeled (i.e., obtain the training set of images to be labeled).

[0092] Multiple sample images can be obtained by an image measuring instrument capturing images of multiple samples with the same or similar testing requirements. Sample images do not necessarily reflect the entire sample; they may be images of areas of interest to the user, such as the edges of targets the user wants to measure.

[0093] Multiple sample images in the training set can be classified to obtain at least one class of images to be labeled. For example, multiple sample images with the same or highly similar edge features can be grouped into the same class; that is, sample images of the same class can share the same or similar target edges to be labeled. Images of the same class can be distinguished by using the same naming rules. Specifically, sample images belonging to the same class may be images of multiple samples located in roughly the same region, or images of the same sample with multiple highly similar edge features. Images taken in the regions containing these highly similar edge features can also be classified as the same class. For example, different sample images of the same class, such as... Figure 4 As shown.

[0094] S2: Draw labels on the sample images.

[0095] S2.1 Select at least one sample image (first image) and manually draw a label (label).

[0096] Import the sample image into the training software, select a sample image and display it on the interface. Choose an appropriate label drawing style (such as line, arc, circle, or curve) to draw the target edge of the selected sample image, forming a marker line that fits the target edge. A region with a preset width is formed around the formed marker line; the outline of this region is the label we create. The preset width can be set according to actual needs. In this scheme, the label is set as a closed contour, and the region corresponding to this closed contour includes the target edge features, rather than just an edge line. The label defines a range, and even if there are small errors in the marker line drawing at the boundary, it will not affect the judgment of the overall edge features to a certain extent, effectively reducing labeling errors. Of course, the closer the marker line fits the corresponding edge, the more accurately the formed label region can cover the corresponding edge, and the higher the edge recognition accuracy of the subsequently trained AI model (i.e., the target edge detection model).

[0097] The manual drawing process is as follows: After importing multiple prepared sample images into the training software, the image information will be displayed in a preset order in the corresponding image list interface. For example, the image list interface displays image information such as image number, sample image name, label type, label width, and whether it participates in training. By clicking on the image information in the image list interface, the corresponding sample image will be displayed on the screen. Furthermore, batch configuration of sample images is possible in the image list interface, such as batch selecting sample images to configure whether they participate in training, and batch setting label widths.

[0098] After selecting a sample image, you can choose a suitable label drawing style in the label settings interface to determine the desired target edge shape. The label settings interface includes options for label drawing style, label width, and label transparency (adjusting the label's transparency allows for easier observation of the drawn edge below the label, facilitating drawing and adjustment). For example, if you want a straight line, select "line" as the label drawing style in the interface; if you want a standard arc or circle, select "arc" or "circle" as the style. Then, on the display interface, click the target edge location with the mouse to create coarse marker points. If the label drawing style is set to "line," two coarse marker points will define a straight line; if the style is set to "arc" or "circle," three coarse marker points will define an arc or circle.

[0099] Due to software limitations, the lines connecting points are defaulted to straight lines. Therefore, to represent the corresponding drawn shape, multiple fine-line markers are formed between adjacent coarse-line markers along the defined shape path. These coarse and fine-line markers are collectively referred to as marker points. Connecting these marker points sequentially forms a marker line with the corresponding shape. A schematic diagram of marker points and marker lines is shown below. Figure 5 As shown.

[0100] When drawing each target edge, it can be done in segments. Each segment of the marker line can better fit (match) the edge and adapt to complex edge shapes. That is, each segment can correspond to two or three coarse marker points. To ensure that adjacent segments are connected, the end of the previous segment and the beginning of the next segment can share a coarse marker point. The drawing is complete when the marker lines cover the selected target edge. Of course, if the edge shape is regular and clear, it can be drawn in one go without segments.

[0101] It should be noted that the lines, arcs, or circles mentioned above are suitable for relatively regular edge shapes in sample images. We also provide a curve with stronger applicability, capable of handling more complex boundary conditions. If the label drawing style is selected as a curve, then every three coarse-drawn marker points can determine a segment of the curve. Specifically, every three coarse-drawn marker points form a group, and the size, curvature, etc. of the segment can be determined by dragging the third coarse-drawn marker point to adjust its position. When drawing the next segment of the curve connected to it after drawing a segment, the first coarse-drawn marker point of the next segment can be the third coarse-drawn marker point of the previous segment. Even if the edge conditions are complex, the formed marker lines can cover the target edge. Labels can be directly generated based on the drawn marker lines and the set label width, and the labels (such as in the form of marker point coordinates and corresponding label width information) are saved to the corresponding training file. In this embodiment, the generated labels only need to cover the target edge. Compared with existing label drawing methods that at least cover the area of ​​a closed loop boundary, the label drawing in this embodiment is relatively easy, and the resulting labels have a small coverage of the sample image, which is more conducive to the user's observation of the boundary conditions in the image and facilitates subsequent label adjustments.

[0102] Furthermore, the entire label (annotation label) can be moved to align the marker line with the target edge. The entire label can also be deleted. Each marker point in the label can be deleted or moved to adjust misaligned marker points. For example, additional marker points can be added at selected locations. Marker points can be added between existing marker points to enrich internal details and make the overall marker line better match the target edge; or marker points can be added outwards along the original shape trajectory (such as the original curvature) on both sides of the marker line, so that the marker line can completely cover the selected target edge.

[0103] In step S2.1, in addition to drawing the labels (labels of the first image) entirely manually, a semi-automatic labeling method can also be used to draw the labels (labels). That is, the training software can also use a method based on traditional algorithms to generate labels. For example, in the corresponding label selection interface, a suitable bounding box shape (such as a fan, rectangle, or circle) is selected in the display interface to select the target edge. Then, the software uses a configured algorithm such as Canny edge detection to automatically detect the edge in the selected area (the target edge features of the first image), and marks it in the form of marker points. These marker points are then connected to form a marker line, thus forming the initial label. Due to the complexity of the image edge, the accuracy of the edge detection algorithm may not meet the requirements. Therefore, after automatic labeling, the marker points are manually adjusted to make the marker line fit the target edge features, and the optimized label (label) is obtained to better meet the training requirements.

[0104] In this embodiment, labels can also be classified, where labels corresponding to identical or highly similar target edges in sample images can be grouped into one category. Determining whether two target edges are identical or highly similar can be achieved by comparing their edge characteristics, such as edge shape, texture, or intensity. Edges with similar characteristics belong to the same category, and labels corresponding to the same category belong to the same category. Labels belonging to the same category participate in the training of the subsequent AI model, enabling the trained AI model to recognize edges with similar characteristics. When training the same AI model, it is preferable to use sample images of the same graph class to ensure the accuracy of the AI ​​model in recognizing edges with similar characteristics. However, this is not the only possibility. If sample images of different graph classes are used to train the same AI model, the AI ​​model can recognize a wider range of edge types, but with the same number of images used for training, the recognition accuracy is lower than that of an AI model trained using a single graph class. The same AI model can be trained using multiple categories of labels, thereby improving the applicability of the AI ​​model and enabling it to recognize various edges with different characteristics. The categories of multiple labels can be the label categories drawn corresponding to different target edges on the same sample image, such as... Figure 6 As shown, Label 1 and Label 2 belong to different edge categories on the same sample image. The number of sample images used for training must meet the minimum training requirement, such as no less than 10 images. Different categories of labels can be distinguished by displaying different colors. For example, in the same sample image, it may be necessary to focus on two different edges; therefore, different colors can be used to depict the two edges when drawing labels, thus corresponding to different label categories. Labels on different sample images belonging to the same category can be displayed using the same color. The label drawing type for each sample image in the image list interface can be displayed in the corresponding color.

[0105] The training software can also include a label list interface, which can include label color, label name, label width, number of images, etc. The label list interface allows for batch management of labels, such as adjusting label width and label naming. Label color corresponds to the corresponding label category, and the number of images corresponds to the number of sample images with this type of label.

[0106] S2.2 Inherit the drawn labels into other sample images (i.e., the second image).

[0107] For the sample image where labels need to be drawn later (i.e., the second image), we can directly inherit the previously drawn labels (i.e., the annotation labels from the first image) into the current sample image. Since labels in the current training software are formed using marker points and marker lines, the inherited labels will also contain marker points and marker lines, such as... Figure 7 As shown. Inheritance can be done by manually copying directly or by the software automatically retaining the data.

[0108] Manual copying: The labels drawn in the current sample image can be copied and pasted as a whole into another sample image. Therefore, if the two images belong to the same image type, or if the edges of the targets to be drawn are highly similar, in order to reduce repetitive work, the drawn labels (the annotation labels of the first image) can be directly copied over to obtain the labels of the second image.

[0109] Automatic label retention: The label settings interface can also include label retention options, with settings such as no retention, default retention, and retention based on similarity. Default retention means the software doesn't participate in the judgment and directly retains the labels drawn in the current sample image to the selected next sample image. In this case, the retained labels may have significant differences from the target edges in the sample image. If the labels are retained to other image types, adjusting them would waste more time. Therefore, it's better to delete the entire label and redraw it. Retention based on similarity means that after labeling one sample image and selecting another, the software can compare the overall similarity between the two sample images. When the similarity reaches a similarity threshold, the drawn labels (the annotation labels of the first image) can be retained to the other sample image (the second image).

[0110] S2.3 Adaptively adjust the inherited labels (the annotation labels of the candidate images) based on the actual target edge conditions in the sample images (edge ​​features in the second image that match the target edge features in the first image).

[0111] Due to manufacturing processes, even sample images belonging to the same image type may have some deviations between their target edges, or the inherited label positions may be completely offset relative to the target edges. Therefore, if the labels on the current sample image are inherited, the inherited labels should be adaptively adjusted on the display interface according to the actual target edge conditions, such as moving the labels or adjusting the marker point positions, so that the labels can better fit the edges on the current sample image (the edges in the second image that match the target edge features). An illustration of the adjusted labels is shown below. Figure 8 As shown.

[0112] S3: Train an AI model based on images with pre-drawn labels.

[0113] In the image list interface, the sample images to be used for training are set. All selected sample images are pre-labeled. The prepared sample image data and corresponding label data are input as the image training set into the selected model architecture (initial edge detection model) for training, thereby obtaining an AI model (target edge detection model) for edge feature recognition. The model architecture can be a convolutional neural network architecture for edge detection, such as U-Net, FCN, Mask R-CNN, etc., or some architectures based on generative adversarial networks (GANs) can also be selected. This embodiment does not impose too many restrictions.

[0114] After the AI ​​model is trained, it can be loaded into the training software. The AI ​​model can then be used to perform recognition and inference on sample images to obtain inference results. The accuracy of the AI ​​model can be evaluated based on these results. If the accuracy of the AI ​​model is low, it indicates that the number of training images is still too small. In this case, new sample images can be added and labeled. The new sample image data and corresponding label data can be added to the image training set to further train the AI ​​model. This means training the AI ​​model based on the existing model, thereby improving its accuracy.

[0115] After the AI ​​model passes evaluation, it can be loaded into the measurement software of the image measuring instrument. Users select the feature measurement area using feature selection tools (such as circles, sectors, or rectangles). The AI ​​model then identifies the target edges based on the selected feature measurement area (target image) and marks the dimensions to be measured based on the identified target edge features, thus completing the feature measurement. Compared to the edge recognition algorithm built into the measurement software, the AI ​​model achieves more accurate feature recognition and can identify edges that traditional edge recognition algorithms cannot. For example, the edge recognition algorithm built into the measurement software is prone to errors, identifying edge features that deviate from the actual target edge, requiring manual adjustment; furthermore, for some complex edges, it may fail to identify them, requiring manual point selection. However, after loading the AI ​​model, even with complex edge conditions, accurate feature recognition within the feature measurement area can be achieved. The process of an AI model (object edge detection model) recognizing features can include acquiring an image to be recognized based on a feature measurement region. The AI ​​model uses its trained knowledge to analyze the information in the image to identify potential feature edges, which are then displayed as contour lines in the measurement software. The image to be recognized can be obtained by appropriately expanding the image within the feature measurement region. This appropriate expansion means extending the feature measurement region outwards by a certain area, but the expanded image will not excessively increase the edge features in the image. This ensures complete recognition of the edge features within the feature measurement region while reducing the influence of other edges on the AI ​​model, thus improving recognition efficiency and accuracy.

[0116] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0117] Based on the same inventive concept, this application also provides a tag inheritance apparatus for implementing the tag inheritance method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more tag inheritance apparatus embodiments provided below can be found in the limitations of the tag inheritance method described above, and will not be repeated here.

[0118] In one exemplary embodiment, such as Figure 9 As shown, a tag inheritance device 900 is provided, including: an image acquisition module 902, a tag annotation module 904, and a tag determination module 906, wherein:

[0119] Image acquisition module 902 is used to acquire the training set of images to be labeled;

[0120] The labeling module 904 is used to select at least one first image from the training set of images to be labeled and to obtain the label of the first image; the label is used to characterize the target edge features in the image;

[0121] The label determination module 906 is used to determine the label of the second image based on the label of the first image; the second image is an image in the image training set other than the first image.

[0122] In some embodiments, the labeling module 904 is further configured to classify the sample images in the image training set according to the image edge features to obtain at least one class of images to be labeled; and to select at least one first image from each class of images to be labeled to obtain the label of the first image.

[0123] The label determination module 906 is also used to calculate the first similarity between the second image and the first image in each class of images to be labeled, and to determine candidate images from the first image whose first similarity with the second image is greater than or equal to the similarity threshold; and to determine the label of the second image based on the label of the candidate image.

[0124] In some embodiments, the label determination module 906 is further configured to use the annotation label of the first image as the label of the second image that belongs to the same class of images to be annotated as the first image.

[0125] In some embodiments, the label determination module 906 is further configured to calculate a first similarity between the second image and the first image, and to use the first image with a first similarity greater than or equal to a similarity threshold as a candidate image; and to determine the label of the second image based on the labeled labels of the candidate images.

[0126] In some embodiments, the label determination module 906 is further configured to adjust the label of the candidate image based on the edge features in the second image that match the target edge features of the first image, so as to obtain the label of the second image.

[0127] In some embodiments, the labeling module 904 is further configured to select at least one first image from the training set of images to be labeled, label the target edge features of the first image by marking points, and determine the label of the first image based on the marking line formed by the marking points and the label width.

[0128] Based on the same inventive concept, this application also provides a model training apparatus for implementing the model training method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more model training apparatus embodiments provided below can be found in the limitations of the model training method described above, and will not be repeated here.

[0129] In one exemplary embodiment, a model training apparatus is provided, comprising:

[0130] The training set acquisition module is used to acquire the image training set and generate the labels for the image training set according to the label inheritance method described above.

[0131] The model training module is used to train the initial edge detection model based on the image training set and its labels until the training conditions are met, thus obtaining the target edge detection model.

[0132] Based on the same inventive concept, this application also provides a measuring device for implementing the measurement method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more measuring device embodiments provided below can be found in the limitations of the measurement method described above, and will not be repeated here.

[0133] In one exemplary embodiment, a measuring device is provided, comprising:

[0134] The image acquisition module is used to acquire the target image corresponding to the object to be measured.

[0135] The edge detection module is used to perform edge detection on the target image using the target edge detection model trained based on the above model training method, and obtain the target edge.

[0136] The measurement result determination module is used to determine the target size of the target edge and obtain the measurement result of the object to be measured based on the target size.

[0137] Each module in the aforementioned label inheritance device, model training device, or measurement device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0138] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to the tag inheritance method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a tag inheritance method.

[0139] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0140] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0141] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0142] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0144] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0145] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0146] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A label drawing method, characterized in that, The method includes: Obtain at least one first image from the training set of images to be labeled; In the drawing interface of the training software, the target edge of the first image is drawn using an adapted label drawing style to form a marker line that fits the target edge; A region of a preset width is formed with the marked line as the center line, and the outline of the region is used as the label of the first image; the preset width is the width of the label.

2. The method according to claim 1, characterized in that, The step of drawing the target edge of the first image in the drawing interface of the training software using an adapted label drawing style to form a marker line that fits the target edge includes: In the drawing interface of the training software, draw coarse marker points at the location of the target edge in the first image; Between each pair of adjacent coarse marker points, draw multiple fine marker points along the shape path defined by the target edge; The fine-drawn marker points and the coarse-drawn marker points are connected and fitted to obtain the marker line of the target edge.

3. The method according to claim 2, characterized in that, The step of connecting and fitting the fine-drawn marker points and the coarse-drawn marker points to obtain the marker line of the target edge includes: Delete or move any of the fine-drawn markers and the coarse-drawn markers, or add markers based on the fine-drawn markers and the coarse-drawn markers to obtain the target marker. By connecting and fitting the various target marker points, the marker lines of the target edges are obtained.

4. The method according to claim 1, characterized in that, The step of drawing the target edge of the first image in the drawing interface of the training software using an adapted label drawing style to form a marker line that fits the target edge includes: In the drawing interface of the training software, the target edge of the first image is segmented and drawn using the adapted label drawing style to obtain multiple marker lines; the end of the previous marker line and the beginning of the next marker line share the same coarse drawing marker point. The marking lines are formed by multiple segments of the marking lines to conform to the edge of the target.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The label of the second image is determined based on the label of the first image; the second image is an image in the image training set other than the first image, and the number of the second images is greater than the number of the first images.

6. The method according to claim 5, characterized in that, Determining the label of the second image based on the label of the first image includes: If the similarity between the second image and the first image reaches a similarity threshold, a label for the second image is generated based on the label of the first image.

7. A label drawing device, characterized in that, The device includes: The image acquisition module is used to acquire at least one first image from the training set of images to be labeled; The marker line drawing module is used to draw the target edge of the first image in the drawing interface of the training software using an adapted label drawing style to form a marker line that fits the target edge. The labeling module is used to form a region of a preset width with the marking line as the center line, and to use the outline of the region as the label of the first image; the preset width is the width of the label.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.