Label inheritance method, model training method, and measurement method, device, medium

By acquiring an image training set in the image measuring instrument and selecting one image for annotation, the labels of other images are automatically determined, solving the problem of low labeling efficiency in traditional image measuring instruments and achieving improved label generation efficiency and reduced costs.

CN120997602BActive Publication Date: 2026-02-06CHOTEST TECH INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511528578.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-02-06
Estimated Expiration
2045-10-24

AI Technical Summary

Technical Problem

In the training of AI models for traditional image measuring instruments, the labeling of sample images is inefficient and requires a lot of repetitive manual labor.

Method used

By acquiring an image training set, at least one first image is selected for annotation, generating annotation labels, and the labels of other images are automatically determined based on the annotation labels of the first image, thus achieving label inheritance and rapid generation.

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 CN120997602B_ABST
    Figure CN120997602B_ABST
Patent Text Reader

Abstract

The application relates to a label inheritance method, a model training method and a measurement method, equipment and a medium. The label inheritance method comprises the following steps: acquiring an image training set to be labeled, selecting at least one first image from the image training set to be labeled for labeling to obtain a labeling label of the first image; the labeling label is used for representing a target edge feature in an image; determining a label of a second image according to the labeling label of the first image; the second image is an image in the image training set except the first image. The method can improve the label generation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a label inheritance method, a model training method and a measurement method, a computer device and a computer readable storage medium. BACKGROUND

[0002] An image measuring device (such as an image measuring instrument or a flash measuring instrument) can realize precise measurement of surface size, contour, angle, position and geometric tolerance of various complex parts. In actual application, the geometric features (such as planes, lines and points) of a workpiece can be extracted by the image measuring instrument, the length or angle information of the geometric features can be calculated, and then it can be judged whether the machining precision of the workpiece meets the requirements. With the rapid development of artificial intelligence technology, image measurement can be carried out based on an artificial intelligence (AI) model. However, when training the AI model in the image measuring instrument, a large number of sample images are often required, and each sample image needs to be labeled.

[0003] In the traditional technology, when labeling the sample images, it is often drawn one by one by artificial, which needs a lot of repetitive labor, and the efficiency of label annotation is low. SUMMARY

[0004] Therefore, it is necessary to provide a label inheritance method, device, computer device, computer readable storage medium and computer program product which can improve the efficiency of label annotation.

[0005] In a first aspect, the present application provides a label inheritance method, comprising:

[0006] obtaining an image training set to be labeled;

[0007] selecting at least one first image from the image training set to be labeled to obtain a labeled label of the first image; the labeled label is used to represent a target edge feature in the image;

[0008] determining a label of a second image according to the labeled label of the first image; the second image is an image in the image training set except the first image.

[0009] In a second aspect, the present application further provides a label inheritance device, comprising:

[0010] an image obtaining module configured to obtain an image training set to be labeled;

[0011] a label annotation module configured to select at least one first image from the image training set to be annotated to obtain an annotation label of the first image, the annotation label being used to represent a target edge feature in the image;

[0012] a label determination module configured to determine a label of a second image according to the annotation label of the first image, the second image being an image in the image training set other than the first image.

[0013] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the label inheritance method according to the first aspect when executing the computer program.

[0014] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the label inheritance method according to the first aspect when executed by a processor.

[0015] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program implements the steps of the label inheritance method according to the first aspect when executed by a processor.

[0016] In a sixth aspect, the present application provides a model training method, comprising:

[0017] obtaining an image training set, and generating a label of the image training set according to the label inheritance method;

[0018] training an initial edge detection model based on the image training set and the label of the image training set until a training condition is met, to obtain a target edge detection model.

[0019] In a seventh aspect, the present application provides a model training device, comprising:

[0020] a training set obtaining module configured to obtain an image training set, and generate a label of the image training set according to the label inheritance method;

[0021] a model training module configured to train an initial edge detection model based on the image training set and the label of the image training set until a training condition is met, to obtain a target edge detection model.

[0022] In an eighth aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the model training method according to the sixth aspect when executing the computer program.

[0023] In a ninth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the steps of the model training method provided in the sixth aspect.

[0024] In a tenth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the model training method provided in the sixth aspect.

[0025] In an eleventh aspect, the present application provides a measurement method, comprising:

[0026] obtaining a target image corresponding to a to-be-measured object;

[0027] performing edge detection on the target image by using a target edge detection model trained based on the model training method to obtain a target edge;

[0028] determining a target size of the target edge, and obtaining a measurement result of the to-be-measured object based on the target size.

[0029] In a twelfth aspect, the present application also provides a measurement device, comprising:

[0030] an image obtaining module, configured to obtain a target image corresponding to a to-be-measured object;

[0031] an edge detection module, configured to perform edge detection on the target image by using a target edge detection model trained based on the model training method to obtain a target edge;

[0032] a measurement result determining module, configured to determine a target size of the target edge, and obtain a measurement result of the to-be-measured object based on the target size.

[0033] In a thirteenth aspect, the present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the measurement method provided in the eleventh aspect when executing the computer program.

[0034] In a fourteenth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the steps of the measurement method provided in the eleventh aspect.

[0035] In a fifteenth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the measurement method provided in the eleventh aspect.

[0036] The label inheritance method, the model training method and the measurement method, the device, the computer equipment, the computer readable storage medium and the computer program product can obtain an image training set to be labeled, select at least one first image from the image training set to be labeled, obtain a labeled label of the first image, determine a label of a second image according to the labeled label of the first image, and realize automatic determination of the label of the other images based on the labeled label of the small amount of images, so as to quickly determine the labels of all the images in the image training set to be labeled, avoid the situation that the label of each image needs to be labeled from the beginning, cause a large amount of repetitive labor, realize reduction of the labor cost, and improve the label generation efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0038] Figure 1 An application environment diagram of the label inheritance method in an embodiment;

[0039] Figure 2 A flowchart of the label inheritance method in an embodiment;

[0040] Figure 3 An annotation label diagram of the first image in an embodiment;

[0041] Figure 4 A different sample image diagram of the same category in an embodiment;

[0042] Figure 5 A label point and a label line diagram in an embodiment;

[0043] Figure 6 A different label category diagram on the same sample image in an embodiment;

[0044] Figure 7 A label inheritance diagram in an embodiment;

[0045] Figure 8 An adjusted label diagram in an embodiment;

[0046] Figure 9 A structure block diagram of the label inheritance device in an embodiment;

[0047] Figure 10Fig. 1 is a diagram of an internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0049] It should be noted that the terms "first", "second", and the like used in the present 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 "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "multiple" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the options or any combination of multiple options.

[0050] The label generation method (or label annotation method, annotation method, batch annotation method, label retention method, label inheritance method) provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The server 104 can obtain the image training set to be labeled sent by the terminal 102, and select at least one first image from the image training set to be labeled to label, and obtain the label of the first image. Wherein, the label is used to represent the edge feature of the target in the image; the server 104 determines the label of the second image according to the label of the first image, so as to obtain the label of all images in the image training set. Wherein, the second image is an image in the image training set except the first image. Wherein, the terminal 102 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, unmanned aerial vehicles, low-altitude aircraft, image measuring instruments, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be a stand-alone physical server, or 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 label inheritance method provided in the embodiments of the present application is not limited to the application in the application scenario of the interaction between the server and the terminal, but can also be applied to the application scenario of a single terminal or a single server.

[0051] In an exemplary embodiment, as shown in Figure 2 A label labeling method is provided, which is applied to Figure 1 The server in the example is described, including the following steps 202 to 206. Wherein:

[0052] Step 202, obtaining an image training set to be labeled.

[0053] Wherein, the image training set includes multiple sample images, and each sample image can be an image obtained by an image measuring device collecting a sample. The image training set has not been labeled, that is, the sample images in the image training set do not include labels. The label can be used to represent the edge feature of the image, that is, the label is not a line or a point, but a closed contour, and the area corresponding to the closed contour includes the target edge feature.

[0054] In actual application scenarios, the plurality of sample images in the image training set can be obtained by the image measuring instrument or the flash measuring instrument on a plurality of samples with the same or similar measurement requirements. The sample image can be an overall image of the sample or a partial image of the sample. The sample image can be an image obtained by capturing a target region of the sample, and the target region can cover the edge to be measured by the user. In other words, the sample image can be an image obtained by capturing a partial region of the sample, and the sample image at least includes a target edge feature in the partial region of the sample, and the target edge feature corresponds to the edge (also referred to as the target edge) to be measured by the user. In an embodiment, the number of target edges in the same sample image can be one or more. The same target edge corresponds to a local edge in the theoretical drawing, which is a continuous edge and only includes one shape (such as a straight line, an arc, or a circle).

[0055] In some application scenarios, the partial image of the sample can be captured by the image measuring instrument or the flash measuring instrument as the sample image, and the sample image includes the partial region of the sample including the target edge feature and a peripheral region of the partial region of the sample with a preset width. The preset width can be set according to the measurement requirement of the image measuring instrument. For example, assuming that the partial region of the sample including the target edge feature is a region with a size of 4 cm*6 cm, and the preset width is 1 cm, a region with a size of 6 cm*8 cm can be selected to capture the sample image by extending outward on the basis of the partial region of the sample. In this way, the measurement requirement of the image measuring instrument can be more matched, the influence of other complex edges on the identification of the target edge can be reduced while ensuring the integrity of the target edge, and the identification accuracy of the target edge feature can be improved. Of course, the scanning image of the scanning camera in the image measuring instrument in the entire field of view at the selected position can also be used as the sample image. The selected position can be determined by the target edge to be measured, so that the scanning image covers the target edge.

[0056] Step 204: selecting at least one first image from the image training set to be labeled to obtain a labeled label of the first image; wherein the labeled label is used to represent the target edge feature in the image.

[0057] The first image is an image selected from the image training set to be labeled. The number of first images can be 1, 2, 3 or more, and the number of first images can be selected according to the actual application scenario. The first image can be labeled by manual labeling or a label labeling algorithm to obtain the labeling label of the first image. It should be noted that the present application does not make too many restrictions on the acquisition method of the labeling label of the first image, as long as the labeling label of the first image is accurate. The labeling label corresponds to the region including the target edge feature, and the labeling label can be regarded as a closed contour that can enclose the region where the target edge feature in the sample image is located, rather than a line or a point. In some embodiments, the same labeling label includes one target edge, that is, one-to-one correspondence. Alternatively, the closed contour of the same labeling label does not cover other edges except the target edge, thereby reducing the influence of other edges on the identification of the target edge, especially when used to train the target edge detection model, which can effectively improve the identification accuracy of the target edge feature of the trained target edge detection model.

[0058] Exemplarily, the first image can be labeled in the form of manual labeling. For example, a suitable label drawing style (such as a line, an arc, a circle or a curve, etc.) can be selected on a drawing interface in the training software to draw a mark line that fits the edge of the image by depicting the target edge of the first image, and a region with a preset width is formed around the center of the mark line, and the contour of the region is the labeling label of 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 feature of the first image can also be labeled by automatic labeling. For example, the target edge feature in the first image can be detected by an edge detection algorithm, the target edge feature can be labeled by a marker point, a marker line can be formed by the marker point, a region with a preset width can be formed around the center of the marker line, and the contour of the region is taken as the labeling label of the first image.

[0059] In step 206, the label of the second image is determined according to the labeling label of the first image. The second image is an image in the image training set except the first image.

[0060] The label of the second image refers to a label representing the target edge feature in the second image. Exemplarily, the labeling label of the first image can be copied or generated to the second image as the label of the second image. Alternatively, the copied labeling label of the first image can be adjusted according to the edge feature in the second image that matches the target edge feature 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.

[0061] In some examples, the first image matched with the second image can be determined according to the first similarity between the first image and the second image, and the label of the corresponding second image can be determined according to the labeled label of the matched first image, so that the accuracy of the label of the second image can be improved.

[0062] In the above label inheritance method, the image training set to be labeled is obtained, at least one first image is selected from the image training set to be labeled for labeling, the labeled label of the first image is obtained, and the label of the second image is determined according to the labeled label of the first image, wherein the second image is an image in the image training set except the first image. Based on a small amount of labeled labels, the labels of other images can be automatically determined, so that the labels of all images in the image training set to be labeled can be quickly determined, and the situation that the labels of each image need to be labeled from the beginning, resulting in a large amount of repetitive labor, can be avoided. The artificial cost is reduced, and the label generation efficiency is improved.

[0063] In some embodiments, the label of the second image is determined according to the labeled label of the first image in step 206, comprising:

[0064] The first similarity between the second image and the first image is calculated, and the first image with the first similarity greater than or equal to the similarity threshold is taken as the candidate image; and the label of the second image is determined according to the labeled label of the candidate image.

[0065] The first similarity between the second image and the first image is essentially the similarity between the edge features in the first image and the second image. The first similarity between the first image and the second image can be represented by the cosine similarity or the Euclidean distance between the edge features of the first image and the edge features of the second image. Alternatively, the first similarity between the first image and the second image can be determined by the pixel mean square error (MSE) or the structural similarity index (SSIM) between the first image and the second image. Alternatively, the color histogram of the first image and the color histogram of the second image can be determined respectively, and the first similarity between the first image and the second image can be determined by the Bhattacharyya distance or the Chi-square distance between the color histogram of the first image and the color histogram of the second image. It should be noted that the calculation method of the first similarity can be set according to the actual application scenario, which is not limited here.

[0066] In the actual application scenario, if the number of first images includes multiple images, for each second image, if there is more than one first image between the second image and the first image with the first similarity greater than or equal to the similarity threshold, the first image with the highest first similarity can be taken as the candidate image.

[0067] In the embodiment, by calculating the first similarity between the second image and the first image, the first image with the first similarity greater than or equal to the similarity threshold is taken as a candidate image, and the label of the second image is determined according to the labeled label of the candidate image, so that the label of the second image is determined based on the labeled label of the candidate image not less than the similarity threshold, the accurate label of the second image can be determined faster, and the generation efficiency of the label of the second image is improved.

[0068] In some embodiments, the selecting at least one first image from the image training set to be labeled in step 204 to obtain the labeled label of the first image comprises:

[0069] According to the image edge features, the sample images in the image training set are classified to obtain at least one type of image to be labeled; at least one first image is selected from each type of image to be labeled for labeling to obtain the labeled label of the first image;

[0070] In step 206, the label of the second image is determined according to the labeled label of the first image, which comprises:

[0071] The first similarity between the second image and the first image in each type of image to be labeled is calculated, and the candidate image with the first similarity greater than or equal to the similarity threshold is determined from the first image; and the label of the second image is determined according to the labeled label of the candidate image.

[0072] The image edge feature refers to the edge feature included in the image. One image may include one or more edge features, that is, the image edge feature in one sample image may include multiple. The image edge features of different sample images may be different. Therefore, the sample images in the image training set can be classified according to the image edge features to obtain at least one type of image to be labeled, and each type of image to be labeled includes at least the same image edge feature. In other words, the image edge features included in different types of images to be labeled are different.

[0073] The edge feature recognition can be performed on multiple sample images respectively to obtain an edge feature recognition result of each sample image. The multiple sample images can be classified according to the edge feature recognition result to obtain at least one type of image to be labeled. The sample images with the same edge feature recognition result or a similarity higher than a preset threshold can be classified into the same type of image to be labeled. The same type of image to be labeled can be named using the same naming rule, that is, different types of image to be labeled can be distinguished by different naming identifiers. The same type of image to be labeled includes the same or similar edge features. The same type of image to be labeled can be images corresponding to the same region on multiple samples or images corresponding to multiple edges with a similarity higher than a preset threshold on the same sample. Alternatively, the image edge feature refers to a target edge included in the image to be labeled. The sample images can be classified according to whether they have the same or similar target edges, for example, the sample images with the same or similar (a similarity higher than a preset threshold) target edge features can be directly classified into the same type of image to be labeled.

[0074] It is easy to understand that the number of first images can be set according to actual application scenarios, for example, 1, 2, 3 or more. The labels of the first images can be labeled by manual labeling or labeling algorithm to obtain labeled labels of the first images. The specific labeling method can refer to the introduction of the corresponding content in the above embodiments, which will not be described here.

[0075] Exemplarily, after obtaining at least one type of image to be labeled, for each type of image to be labeled, a first similarity between each second image and the first image can be calculated. The candidate image with a first similarity greater than or equal to a similarity threshold can be determined from the first image. The labeled label of the candidate image can be directly applied to the second image to generate the label of the second image, or the labeled label of the candidate image applied to the second image can be adjusted according to the edge feature matching the target edge feature corresponding to the labeled label in the candidate image in the second image to obtain the label of the second image.

[0076] In some examples, after determining the label of the second image, the second image with the determined label can be used as a new first image for other second images to determine the corresponding candidate image according to the first similarity, which can increase the number of first images and improve the accuracy of the candidate image.

[0077] In the embodiment, the sample images in the image training set are classified according to the image edge features to obtain at least one type of image to be labeled, at least one first image is selected from each type of image to be labeled for labeling to obtain a labeling label of the first image, and the labeling label of the first image is taken as the label of the second image in the corresponding type of image to be labeled. For example, a type of image to be labeled includes one first image and three second images, the first image is denoted as A, and the second images include B and C. The labeling label of A can be directly taken as the labels of B and C. That is, the labeling label of A can be copied or directly generated into B and C, and the copied or directly generated labeling label can be directly taken as the labels of B and C, or the copied or directly generated labeling label can be adjusted and then taken as the labels of B and C.

[0078] In some embodiments, the labeling label of the first image is taken as the label of the second image in the same type of image to be labeled.

[0079] The labeling label of the first image is taken as the label of the second image in the same type of image to be labeled.

[0080] The labeling label of the first image is taken as the label of the second image in the same type of image to be labeled.

[0081] In some embodiments, the labeling label of the first image is taken as the label of the second image in the same type of image to be labeled.

[0082] In the embodiment, the labeling label of the first image in the same type of image to be labeled is taken as the label of the second image, the label of the second image can be quickly generated based on the label of the first image, and the label generation efficiency of the second image is improved.

[0083] In some embodiments, the step 204 of selecting at least one first image from the image training set to be labeled to obtain a labeling label of the first image includes:

[0084] select at least one first image from the image training set to be labeled, mark the target edge feature of the first image through the marking points, and determine the labeling label of the first image according to the marking line formed by the marking points and the label width.

[0085] Wherein, the target edge feature of the first image can be detected by an edge detection algorithm or an edge detection model, and the detected target edge feature can be marked in the form of marking points, that is, the position of the target edge feature in the first image can be marked. It is easy to understand that the target edge feature of the first image can be marked by manual marking points, or the target edge feature of the first image can be automatically marked by marking software (algorithm).

[0086] For example, at least one first image is selected from the image training set to be labeled, the edge feature of the first image is detected by an edge detection algorithm to obtain an edge detection result, the edge detection result is marked by marking points, the marked marking points are fitted to obtain a marking line, and the labeling label of the first image is determined according to the marking line and the label width. Wherein, the label width can be pre-set, and the label width can be set according to the actual application scene. For example, as shown in Figure 3 The marking points 302 are connected in sequence to form a marking line 304, and the labeling label 306 of the first image is formed according to the preset label width and taking the marking line 304 as the center.

[0087] In this embodiment, at least one first image is selected from the image training set to be labeled, the target edge feature of the first image is marked by marking points, and the labeling label of the first image is determined according to the marking line formed by the marking points and the label width, so that a labeling label more matched with the target edge feature can be generated.

[0088] In some embodiments, the label of the second image is determined according to the labeling label of the candidate image, comprising:

[0089] Based on the edge feature in the second image matched with the target edge feature in the first image, the labeling label of the candidate image is adjusted to obtain the label of the second image.

[0090] Wherein, the edge feature in the second image matched with the target edge feature in the first image, for example, refers to the edge feature in the second image which is similar to the shape or position of the target edge feature and belongs to the edge feature to be measured. Based on the edge feature matched with the target edge feature in the first image, the labeling label of the candidate image can be adjusted by manual or automatic means to obtain the label of the second image.

[0091] Exemplarily, the label of the second image can be obtained by adjusting the number or position of the marked points in the annotation label of the candidate image. For example, the number of the marked points in the annotation label can be increased or decreased, or the position of the marked points in the annotation label can be moved to obtain the label of the second image. Alternatively, the label of the second image can also be obtained by moving the entire position of the annotation label of the candidate image.

[0092] In this embodiment, the label of the second image is obtained by adjusting the annotation 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 that the label of the second image is more consistent with the actual edge situation, and the accuracy of the label of the second image is improved.

[0093] In some embodiments, the label of the second image is determined according to the annotation label of the candidate image, comprising:

[0094] The target region unit is determined according to the annotation label of the candidate image, and global matching is performed between the target region unit and the second image, a matching region with the highest second similarity to the target region unit is determined in the second image, the copied annotation label is placed on the matching region, and the label of the second image is determined according to the annotation label on the matching region. In the matching process, the target region unit can be rotated or translated until the similarity to the target region unit is no longer increased. In actual application scenarios, the copied annotation label can be placed at any position in the second image, and then the copied annotation label is moved to the position of the matching region to obtain the label of the second image.

[0095] The shape and size of the target region unit can be determined according to the shape and size of the annotation label of the candidate image. The shape and size of the target region unit are at least the shape and size of the annotation label of the candidate image. The calculation method of the second similarity can refer to the calculation method of the first similarity, which will not be described here.

[0096] In this embodiment, the target region unit (i.e. the region selected by the annotation label frame) is determined according to the annotation label of the candidate image, the matching is performed between the target region unit and the second image, the matching region with the highest second similarity to the target region unit is determined in the second image, the copied annotation label is placed on the matching region, the label of the second image is determined according to the annotation label on the matching region, the position of the copied annotation label in the second image can be accurately determined, so that the copied annotation label is placed at the position matching the edge features in the second image, the label of the second image is determined based on this, and the accuracy of the label of the second image is improved.

[0097] 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.

[0098] 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.

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

[0100] 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.

[0101] 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).

[0102] 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.

[0103] In some examples, the labels of the image training set can be classified according to the edge features corresponding to the labels. The labels corresponding to the edge feature pairs with a similarity higher than a threshold are divided into the same class. The initial edge detection model can be trained by the sample images corresponding to each label class in turn until the prediction results of the sample images corresponding to each label class of the model all meet the preset condition, and the target edge detection model is obtained. The target edge detection model obtained in this way can accurately identify a large number of edge features of different classes. In actual application scenarios, the initial edge detection model can also be trained by the sample images corresponding to the target class label to obtain the target edge detection model. The target edge detection model obtained in this way is more accurate in identifying the edge features of the target class label. The target class can be any label class.

[0104] The above model training method generates the labels of the image training set by the label inheritance method, trains the initial edge detection model based on the image training set and the corresponding labels until the training condition is met, and obtains the target edge detection model. The model training method can quickly and accurately train the labels of a large number of image training sets, and improves the model training efficiency and training accuracy.

[0105] In some embodiments, the present application provides a measurement method, which includes: obtaining a target image corresponding to a to-be-measured object; performing edge detection on the target image by the target edge detection model obtained by the above model training method to obtain a target edge; determining a target size of the target edge, and obtaining a measurement result of the to-be-measured object based on the target size.

[0106] The target image can be a whole image or a partial image of the to-be-measured object. For example, only the part of the to-be-measured object that needs to be measured can be photographed to obtain the target image.

[0107] For example, the target image corresponding to the to-be-measured object can be obtained by an image measuring instrument, and the target edge detection model embedded in the image measuring instrument can be used to perform edge detection on the target image to obtain a target edge. The size of the target edge can be measured according to the measurement requirement to obtain a target size, and the measurement result of the to-be-measured object can be calculated according to the target size. In actual application scenarios, the target edge detection model obtained by training can be loaded into the measurement software of the image measuring instrument. After the user selects a feature measurement region in the target image by using a feature selection tool, the target edge detection model can identify the edge features in the selected feature measurement region to obtain a target edge, measure the size of the target edge to obtain a target size, and obtain the measurement result of the to-be-measured object according to the target size.

[0108] In this embodiment, the target edge detection model is used to detect the edges of the target image corresponding to the object to be measured, obtain the target edges, and obtain the measurement result based on the target size of the target edges. The edges in the target image can be accurately detected based on the target edge detection model, thereby improving the accuracy of the measurement result.

[0109] In some application scenarios, when performing label drawing, the target edges of a sample image (i.e., a sample image) are manually labeled each time, that is, the edges in the sample image are manually drawn from scratch by using a tool such as a line or an arc, which requires a large amount of repetitive labor, greatly reduces the label drawing efficiency, and increases the labor cost and the production cost. Based on this, the embodiments of the present application provide a label inheritance method. When drawing labels on a sample image, the manually drawn labels can be inherited. If the similarity of the image is higher than a similarity threshold, the previously drawn labels are retained or copied into the current sample image. The retained or copied labels are adjusted in detail to match the current sample image and better fit the edges of the current sample image. The image edges can be drawn without using a drawing tool from scratch, and at most, the edges can be fine-tuned to obtain the edges. This can reduce a large amount of repetitive labor and greatly improve the 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 label inheritance method, the model training method, and the measurement method, without further limitation. Specifically, the method comprises the following steps:

[0110] S1: Prepare multiple sample images to be labeled (i.e., obtain an image training set to be labeled).

[0111] The multiple sample images can be obtained by an image measuring instrument for multiple samples with the same or similar detection requirements. The sample image does not reflect the entire sample. The sample image can be an image corresponding to a region of the sample that the user is interested in, for example, the region includes a target edge that the user wants to measure.

[0112] The multiple sample images to be labeled in the image training set can be classified to obtain at least one type of image to be labeled. For example, multiple sample images with the same or highly similar edge features can be classified into the same class, that is, sample images of the same class can share the same or similar target edges to be drawn. The same image class can be distinguished by the same naming rule. Specifically, the sample images belonging to the same image class are images corresponding to approximately the same region on multiple samples, or have multiple edge features with high similarity on the same sample. The images taken in the regions with high similarity of edge features can also be classified into the same image class. For example, different sample images of the same class are as shown in FIG. 1. Figure 4

[0113] S2: Draw labels on the sample image.​

[0114] S2.1 At least one sample image (first image) is selected to draw a label manually.

[0115] The sample image is imported into the training software, and one sample image is selected and displayed on the display interface. A suitable label drawing style (such as line, arc, circle, or curve style, etc.) is selected to draw a mark line that fits the target edge of the selected sample image. A region with a preset width is formed with the mark line as the center line. The contour of this region is the label we made. The preset width can be set according to the actual situation. In this scheme, the label is set as a closed contour, and the region corresponding to the closed contour includes the target edge feature, not just an edge line. Through the label, a range can be determined, so that even if there is a small error in the mark line drawing on the boundary, it will not affect the judgment of the overall characteristics of the edge to a certain extent, and the mark error can be effectively reduced. Of course, the closer the mark line fits the corresponding edge, the more accurately the label region formed can cover the corresponding edge, and the higher the edge recognition accuracy of the AI model (i.e. the target edge detection model) trained subsequently.

[0116] The manual drawing process is as follows: After importing the prepared multiple sample images into the training software, the image information will be displayed in the corresponding image list interface in a preset order, for example, the image information displayed in the image list interface includes image serial number, sample image name, label type, label width, whether to participate in training, etc. The corresponding sample image can be displayed on the display interface by clicking the image information in the image list interface. Batch configuration of sample images can also be performed in the image list interface, such as batch selection of sample images to configure whether to participate in training, batch setting of label width, etc.

[0117] After selecting a sample image, a suitable label drawing style can be selected in the label setting interface according to the shape of the target edge to be drawn, wherein the label setting interface can include label drawing style, label width, label transparency (adjusting the transparency of the displayed label, which can facilitate the observation of the edge drawn below the label, and is beneficial to drawing and adjusting the label), etc. For example, if the edge shape to be drawn is a straight line, the label drawing style can be selected as a line in the label setting interface; if the edge shape to be drawn is a standard arc or a circle, the label drawing style can be selected as an arc or a circle in the label setting interface. Then, on the display interface, the mouse is clicked at the location of the target edge to form a rough drawing mark point. If the label drawing style is selected as a line, two rough drawing mark points can determine a straight line; if the label drawing style is selected as an arc or a circle, three rough drawing mark points can determine an arc or a circle.

[0118] Because of the limitation of software, the connection between two points is a straight line by default, so in order to reflect the corresponding drawing shape, a plurality of fine drawing mark points are formed between the two adjacent rough drawing mark points along the determined shape path, the rough drawing mark points and the fine drawing mark points are collectively referred to as mark points, and the mark points are sequentially connected to fit to form a mark line with a corresponding shape. The schematic diagram of the mark points and the mark line is shown in Figure 5

[0119] When each target edge is drawn, it can be drawn in segments, and each segment mark line can better match the edge and adapt to complex edge shapes, that is, each segment can correspond to two or three rough drawing mark points. In order to ensure that the adjacent two segments are connected, the end of the previous segment and the start of the next segment can share one rough drawing mark point. Until the mark line covers the selected target edge, the drawing is completed. Of course, if the edge shape is regular and clear, it can be directly drawn without segmentation.

[0120] It should be noted that the above line, arc or circle is suitable for relatively regular edge shapes in the sample image, and a curve with stronger applicability is also given, which can meet more complex boundary conditions for drawing. If the label drawing style is selected as a curve, each three rough drawing mark points can determine a segment of the curve. Specifically, each three rough drawing mark points form a group, and the size and curvature of the segment of the curve can be determined by adjusting the position of the third rough drawing mark point. When a segment of the curve is drawn, the first rough drawing mark point of the next segment of the curve can be the third rough drawing mark point of the previous segment of the curve. Even if the edge condition is complex, the formed mark line can cover the target edge. According to the drawn mark line and the set label width, the label can be directly generated, and the label (such as in the form of mark point coordinates and corresponding label width information) is saved to the corresponding training file. The label generated in the embodiment of the present application only covers the target edge, and compared with the existing label drawing which covers at least the region of a closed loop boundary, the label drawing of the embodiment of the present application is relatively easy, and the coverage of the formed label on the sample image is small, which is more conducive to the observation of the user on the boundary condition of the image, and can facilitate subsequent label adjustment.

[0121] Further, the label (annotated label) can be moved as a whole, so that the position of the mark line coincides with the target edge. The label as a whole can also be deleted. Each mark point in the label can be deleted or moved to adjust the position of the mark point that does not match, for example, an additional mark point can be added at the selected position. The mark point can be added between the generated mark points to enrich the internal details and make the mark line as a whole more match the target edge, or the mark point can be added outward on both sides of the head and tail of the mark line along the original shape track (such as the original arc), so that the mark line can cover the selected target edge as a whole.

[0122] ​In step S2.1, in addition to manually drawing the label (the annotation label of the first image), a semi-automatic annotation method can also be used to draw the label (the annotation label), that is, the software can also use a method assisted by a traditional algorithm to generate the label, for example, selecting a suitable frame shape (such as a fan shape, a rectangular shape, or a circular shape) in a corresponding label selection interface, and then using a configured algorithm such as Canny edge detection to automatically detect the edge in the frame selection area (the target edge feature of the first image) to mark the points in the form of a mark line, thereby forming an initial label. Due to the complexity of the image edge, the accuracy of the edge detection algorithm may not meet the requirements, so after automatic annotation, the mark line is adjusted manually to fit the target edge feature, and an optimized label (the annotation label) is obtained to better meet the training requirements.

[0123] In this embodiment, the labels can also be classified, wherein the labels corresponding to the same or highly similar target edges in the sample images can belong to the same class. Whether two target edges are the same or highly similar can be determined by comparing the edge conditions such as the edge shape contour, the edge texture, or the edge intensity of the two target edges. The edges with similar edge conditions belong to the same class, and the labels corresponding to the edges in the same class belong to the same class of labels. The labels belonging to the same class are collectively used for the training of the subsequent AI model, so that the trained AI model can recognize edges with similar edge conditions. When training the same AI model, sample images of the same image class are preferably used for training, so as to ensure the recognition accuracy of the AI model for edges with similar edge conditions. Of course, this is not limited thereto. If different image classes of sample images are used to train the same AI model, the AI model can recognize a wider range of edge types, but the recognition accuracy is lower than that of the AI model trained by using a single image class. A single AI model can have multiple classes of labels participating in the training thereof, thereby improving the applicability of the AI model and enabling the AI model to recognize multiple edges with different edge conditions. Among them, the classes of the multiple classes of labels can be the classes of the labels drawn corresponding to different target edges on the same sample image, such as Figure 6 As shown in the figure, label 1 and label 2 belong to the label classes corresponding to different edges on the same sample image. The number of sample images participating in the training is at least the minimum training requirement, such as no less than 10 images. Different classes of labels can be distinguished by different colors. For example, two different edges in a sample image may need to be focused on, so different colors can be used to draw the two edges when drawing the labels, thereby corresponding to different classes of labels. The labels on different sample images belong to the same class of labels and can be displayed in the same color. The label drawing type of each sample image in the image list interface can be displayed in the corresponding color.

[0124] The training software can also be provided with a label list interface, which can include label color, label name, label width, image quantity, etc. The label list interface can be used to batch manage labels, such as adjusting label width and label naming, etc. The label color corresponds to the corresponding label category, and the image quantity corresponds to the number of sample images with this type of label.

[0125] S2.2 Inherit the drawn label to another sample image (i.e., the second image).

[0126] For sample images (i.e., the second image) that need to be labeled later, we can directly inherit the previously drawn label (i.e., the labeled label of the first image) to the current sample image. Since the label in the current training software is formed by means of marking points and marking lines, the inherited label also contains marking points and marking lines, as shown in Figure 7 The inheritance method can be direct manual copying or software self-preservation.

[0127] Direct manual copying: the label drawn in the current sample image can be copied and pasted to another sample image. Therefore, if two images belong to the same category or the target edge needs to be drawn with high similarity, in order to reduce repetitive work, the drawn label (the labeled label of the first image) can be directly copied to obtain the label of the second image.

[0128] Software self-preservation: the label setting interface can also include a reserved label. The attribute setting of the reserved label can include no reservation, default reservation, reservation according to similarity, etc. Among them, the default reservation is that the software does not participate in the judgment, and directly reserves the label drawn in the current sample image to the selected next sample image. In this case, it is easy to cause the reserved label to have too much difference with the target edge in the sample image, such as reserving the label to the sample image of another category. Adjusting the label would waste more time, so the label can be directly deleted and redrawn. The reservation according to similarity is that when a sample image is drawn with a label and another sample image is selected, the software can compare the overall similarity between the two sample images. When the similarity reaches the similarity threshold, the drawn label (the labeled label of the first image) can be reserved to another sample image (the second image).

[0129] S2.3 According to the actual target edge situation in the sample image (the edge feature in the second image that matches the target edge feature of the first image), the inherited label (the labeled label of the candidate image) is adaptively adjusted.

[0130] Due to process reasons, even if the sample images belong to the same image class, there may be some deviations between the target edges on them, or the inherited label position may be completely offset relative to the target edge. Therefore, if the label on the current sample image is inherited, the inherited label is adaptively adjusted according to the actual target edge condition on the display interface, such as moving the label, adjusting the marker position, etc., so that the label can better fit the edge on the current sample image (the edge in the second image that matches the target edge feature), and the adjusted label display diagram is as shown in Figure 8

[0131] S3: Obtain an AI model based on the image with the drawn label.

[0132] In the image list interface, set the sample images that need to participate in training. The selected sample images are all labeled. The prepared sample image data and corresponding label data are input into the selected model architecture (initial edge detection model) as an image training set for training, so as to obtain an AI model (target edge detection model) for edge feature recognition. The model architecture can be selected as a convolutional neural network architecture for edge detection, such as U-Net, FCN, Mask R-CNN, etc., or some architectures based on generative adversarial network (GAN) can also be selected, and the present embodiment does not make too many limitations.

[0133] After the AI model training is completed, it can be loaded in the training software, and the sample image is recognized and inferred using the AI model to obtain an inference result, and the accuracy of the AI model is evaluated according to the inference result. If the accuracy of the AI model is low, it means that the number of training sets participating in the training is still too small, and new sample images can be added and labeled, and the added sample image data and corresponding label data are added to the image training set to perform additional training on the AI model, that is, the original AI model is trained, so as to improve the accuracy of the AI model.

[0134] ​After the AI model is evaluated to be qualified, the AI model (target edge detection model) can be loaded into the measurement software of the video measuring instrument. After the user selects a feature measurement area by using a feature selection tool (such as a circle, a sector, or a rectangle, etc.), the AI model (target edge detection model) can identify the target edge according to the selected feature measurement area (target image), and label the size to be measured according to the identified target edge feature, thereby completing the feature measurement. Compared with the edge recognition algorithm provided by the measurement software, the AI model (target edge detection model) can achieve more accurate feature recognition, and can identify edges that cannot be identified by the traditional edge recognition algorithm. For example, the edge recognition algorithm provided by the measurement software is prone to errors, and the identified edge feature deviates from the actual target edge, and the two cannot be matched, and can only be manually adjusted. Moreover, for some more complex edges, it can only be manually selected. After loading the AI model (target edge detection model), even if the edge situation is complex, the feature in the feature measurement area can be accurately identified. The process of identifying the feature by the AI model (target edge detection model) can include obtaining a to-be-identified image based on the feature measurement area, and the AI model uses the knowledge trained by itself to analyze the information in the to-be-identified image to identify the potential feature edge, and display it in the form of a contour line in the measurement software. The to-be-identified image can be obtained by appropriately expanding the image contained in the feature measurement area to the outside. Here, the appropriate expansion to the outside can mean expanding a certain area outside the feature measurement area, but the to-be-identified image formed after the expansion does not increase the edge features in the image too much, which can ensure complete identification of the edge features of the feature measurement area, and at the same time, can reduce the influence of other edges on the AI model, and improve the identification efficiency and accuracy.

[0135] It should be understood that, although each step in the flowchart involved in the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.

[0136] Based on the same inventive concept, the embodiments of the present application also provide a label inheritance device for implementing the label inheritance method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more label inheritance device embodiments provided below can refer to the limitations of the label inheritance method described above, which will not be repeated here.

[0137] In one exemplary embodiment, as shown in Figure 9 A label inheritance device 900 is provided, comprising an image acquisition module 902, a label annotation module 904, and a label determination module 906, wherein:

[0138] The image acquisition module 902 is configured to acquire an image training set to be annotated;

[0139] The label annotation module 904 is configured to select at least one first image from the image training set to be annotated to obtain an annotation label of the first image; the annotation label is used to represent the target edge feature in the image;

[0140] The label determination module 906 is configured to determine a label of a second image according to the annotation label of the first image; the second image is an image other than the first image in the image training set.

[0141] In some embodiments, the label annotation module 904 is further configured to classify sample images in the image training set according to image edge features to obtain at least one type of image to be annotated; select at least one first image from each type of image to be annotated to obtain an annotation label of the first image;

[0142] The label determination module 906 is further configured to calculate a first similarity between the second image and the first image in each type of image to be annotated, and determine a candidate image from the first image whose first similarity with the second image is greater than or equal to a similarity threshold; determine the label of the second image according to the annotation label of the candidate image.

[0143] 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 belonging to the same type of image to be annotated as the first image.

[0144] 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 use the first image whose first similarity is greater than or equal to a similarity threshold as a candidate image; determine the label of the second image according to the annotation label of the candidate image.

[0145] In some embodiments, the label determination module 906 is further configured to adjust the label of the candidate image based on the edge feature in the second image that matches the target edge feature of the first image, to obtain the label of the second image.

[0146] In some embodiments, the label annotation module 904 is further configured to select at least one first image from the image training set to be annotated, mark the target edge feature of the first image through the marking points, and determine the annotation label of the first image according to the marking line formed by the marking points and the label width.

[0147] Based on the same inventive concept, the embodiments of the present application also provide a model training device for implementing the above-mentioned model training method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more model training device embodiments provided below can be referred to the limitations of the model training method in the above text, which will not be repeated here.

[0148] In an exemplary embodiment, a model training device is provided, comprising:

[0149] A training set acquisition module is configured to acquire an image training set and generate a label of the image training set according to the above-mentioned label inheritance method;

[0150] A model training module is configured to train an initial edge detection model based on the image training set and the label of the image training set until a training condition is met, to obtain a target edge detection model.

[0151] Based on the same inventive concept, the embodiments of the present application also provide a measurement device for implementing the above-mentioned measurement method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more measurement device embodiments provided below can be referred to the limitations of the measurement method in the above text, which will not be repeated here.

[0152] In an exemplary embodiment, a measurement device is provided, comprising:

[0153] An image acquisition module is configured to acquire a target image corresponding to a to-be-measured object;

[0154] An edge detection module is configured to perform edge detection on the target image through a target edge detection model trained based on the above-mentioned model training method, to obtain a target edge.

[0155] A measurement result determination module is configured to determine a target size of the target edge, and obtain a measurement result of the to-be-measured object based on the target size.

[0156] Each of the modules in the above label inheritance device, model training device or measurement device can be implemented by software, hardware and combinations thereof in whole or in part. The above modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform the operations corresponding to the above modules.

[0157] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 10 The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store label inheritance method related data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement a label inheritance method.

[0158] Those skilled in the art can understand that Figure 10 The structure shown in the above

[0159] In an exemplary embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0160] In an embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

[0161] In an embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

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

[0163] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. In the embodiments provided in the present application, any reference to memory, database or other medium 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 storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive 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. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0164] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.

[0165] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A label inheritance method characterized by, The method comprises: obtaining an image training set to be labeled; selecting at least one first image from the image training set to be labeled for labeling to obtain a labeling label of the first image; the labeling label is used to represent the target edge feature in the image; determining the label of a second image according to the labeling label of the first image; the second image is an image in the image training set except the first image; the selecting at least one first image from the image training set to be labeled for labeling to obtain a labeling label of the first image comprises: classifying sample images in the image training set according to image edge features to obtain at least one type of image to be labeled; selecting at least one first image from each type of image to be labeled for labeling to obtain a labeling label of the first image; the determining the label of a second image according to the labeling label of the first image comprises: calculating a first similarity between the second image and the first image in each type of image to be labeled, and determining a candidate image from the first image whose first similarity with the second image is greater than or equal to a similarity threshold; determining the label of the second image according to the labeling label of the candidate image.

2. The method of claim 1, wherein, the determining the label of a second image according to the labeling label of the candidate image comprises: adjusting the labeling label of the candidate image based on the edge feature in the second image matching the target edge feature of the first image to obtain the label of the second image.

3. The method of claim 2, wherein, the adjusting the labeling label of the candidate image based on the edge feature in the second image matching the target edge feature of the first image to obtain the label of the second image comprises: adjusting the number or position of the marking point in the labeling label of the candidate image based on the edge feature in the second image matching the target edge feature of the first image to obtain the label of the second image.

4. The method of claim 1, wherein, the determining the label of a second image according to the labeling label of the candidate image comprises: taking the labeling label of the candidate image as the label of the second image.

5. The method of claim 1, wherein, the selecting at least one first image from the image training set to be labeled for labeling to obtain a labeling label of the first image comprises: classifying sample images in the image training set according to image edge features to obtain at least one type of image to be labeled; selecting at least one first image from each type of image to be labeled for labeling to obtain a labeling label of the first image; the determining the label of a second image according to the labeling label of the first image comprises: taking the labeling label of the first image as the label of the second image belonging to the same type of image to be labeled as the first image.

6. The method of claim 1, wherein, the selecting at least one first image from the image training set to be labeled for labeling to obtain a labeling label of the first image comprises: selecting at least one first image from the image training set to be labeled, marking the target edge feature of the first image through marking points, and determining the labeling label of the first image according to the marking line and label width formed by the marking points.

7. A model training method, comprising: The method comprises: An image training set is acquired, and labels of the image training set are generated according to the label inheritance method in any one of claims 1 to 6; An initial edge detection model is trained based on the image training set and the labels of the image training set until a training condition is met, to obtain a target edge detection model.

8. A method of measurement, characterized by, The method comprises: An image corresponding to an object to be measured is acquired; An edge of the target image is detected by the target edge detection model obtained by training according to the model training method in claim 7, to obtain a target edge; A target size of the target edge is determined, and a measurement result of the object to be measured is obtained based on the target size. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 8.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Automatic image annotation

    US20220027666A1