Dimension Measurement Method, Device, Equipment and Storage Medium
By obtaining the image data of the product to be tested, using visual conversion models and geometric measurement strategies, the problem of low product dimension measurement efficiency and accuracy in the prior art is solved, efficient and accurate dimensional measurement is achieved, and quality control is supported in the production process.
Patent Information
- Application Number
- CN202510388106.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-03-31
AI Technical Summary
In the prior art, the efficiency and accuracy of product size measurement are low, especially in large-scale measurement tasks, and it is difficult to meet the demand for rapid production. Optical measurement equipment is susceptible to human factors and the measurement results are inaccurate.
By obtaining the current image data of the product to be tested, the coordinates of the point to be tested are determined using the target visual transformation model, and pre-processing is performed when special points exist, the product size is measured in combination with geometric measurement strategies, and optical measurement equipment and artificial intelligence service equipment work together.
It improves the efficiency and accuracy of product size measurement, ensures the reliability of measurement results, and provides strong support for quality control and decision-making in the production process.
Smart Images

Figure CN119904504B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial measurement technologies, and particularly to a dimension measurement method, device, equipment, and storage medium. Background Art
[0002] In industrial production, the accurate measurement of product dimensions is crucial. Currently, the common method for measuring product dimensions is to use contact measuring tools, such as calipers, micrometers, etc. Measuring product dimensions with contact measuring tools has low efficiency and is easily affected by human factors, with limited measurement accuracy. For this reason, some employees also use existing optical measurement equipment. However, this optical measurement equipment has problems in terms of operation and personnel dependence during use. For example, only one person can operate one device, which greatly limits the measurement efficiency. When a large number of measurement tasks need to be carried out, it is difficult to meet the requirements of rapid production. In addition, the traditional use method of optical measurement equipment requires pure manual point selection, which is also affected by subjective factors, and there are differences in the operating habits and skill levels of different employees, which may lead to inaccurate point selection positions, thereby affecting the accuracy of measurement results. Therefore, the efficiency and accuracy of measuring product dimensions by the above methods are relatively low.
[0003] The above content is only used to assist in understanding the technical solution of the present application and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of the present application is to provide a dimension measurement method, device, equipment, and storage medium, aiming to solve the technical problem of low efficiency and accuracy in measuring product dimensions in the prior art.
[0005] To achieve the above purpose, the present application proposes a dimension measurement method, and the method includes:
[0006] Obtain the current image data of the product to be measured, and determine the coordinates of the points to be measured corresponding to the current image data according to the target visual conversion model;
[0007] When there are special points among the points to be measured, preprocess the special points among the points to be measured, and update the points to be measured according to the processing results;
[0008] Based on the geometric measurement strategy, measure the dimensions of the product to be measured according to the coordinates of the updated points to be measured.
[0009] In one embodiment, the step of obtaining the current image data of the product to be measured and determining the coordinates of the points to be measured corresponding to the current image data according to the target visual conversion model includes:
[0010] Obtain the basic attribute data of the product to be measured, and set the optical parameters of the optical measurement equipment according to the basic attribute data;
[0011] Collect the current image data of the product to be measured by the optical measurement device after setting the optical parameters;
[0012] Annotate the current image data based on the target image annotation tool;
[0013] Determine the coordinates of the point to be measured corresponding to the current image data according to the label annotated on the current image data and the target visual conversion model.
[0014] In one embodiment, the step of determining the coordinates of the point to be measured corresponding to the current image data according to the label annotated on the current image data and the target visual conversion model includes:
[0015] Convert the format of the label annotated on the current image data according to the data format supported by the target visual conversion model, and encode the converted label;
[0016] Associate the encoded label with the current image data, and crop the associated current data to obtain target associated data;
[0017] Transmit the target associated data to the target artificial intelligence service device;
[0018] Receive the coordinates of the point to be measured corresponding to the current image data inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the target associated data.
[0019] In one embodiment, before the step of transmitting the target associated data to the target artificial intelligence service device, it further includes:
[0020] Control the test device and the target artificial intelligence service device to be connected to the same local area network, and configure the network parameters of the connected test device and the target artificial intelligence service device;
[0021] Install communication drivers and software interfaces on the configured test device and the target artificial intelligence service device respectively based on the target communication protocol;
[0022] Encapsulate the target associated data to obtain an associated data packet;
[0023] Transmit the associated data packet to the configured target artificial intelligence service device based on the target communication protocol.
[0024] In one embodiment, before the step of determining the coordinates of the point to be measured corresponding to the current image data according to the target visual conversion model, it further includes:
[0025] Obtain model training sample data, and partition the image data in the model training sample data;
[0026] Tile the partitioned image data, and perform transformation on the tiled one-dimensional image data based on a linear transformation layer;
[0027] Add target position information to the transformed image data based on a position embedding layer to obtain target sequence data;
[0028] Based on a target encoding layer and a prediction head, determine an image feature vector according to the target sequence data;
[0029] Train a target visual conversion model according to the image feature vector and the point coordinates in the model training sample data.
[0030] In one embodiment, the step of preprocessing the special points in the to-be-tested points and updating the to-be-tested points according to the processing result when there are special points in the to-be-tested points includes:
[0031] Perform point number recognition on the to-be-tested points to obtain the current recognition result;
[0032] When it is determined that there are special points in the to-be-tested points according to the current recognition result, obtain the types of the special points in the to-be-tested points;
[0033] Determine a special point processing strategy according to the type;
[0034] Preprocess the special points in the to-be-tested points according to the special point processing strategy, and update the to-be-tested points according to the processing result.
[0035] In one embodiment, after the step of measuring the size of the to-be-tested product according to the coordinates of the updated to-be-tested points based on a geometric measurement strategy, it further includes:
[0036] Obtain the standard size range of the device, and determine that the to-be-tested product is qualified when the size of the to-be-tested product is within the standard size range of the device;
[0037] After a preset number of iterative measurements, obtain an iterative measurement result according to a target statistical index;
[0038] Evaluate the iterative measurement result;
[0039] When the evaluation result does not meet the preset requirements, send out a warning prompt message.
[0040] In addition, to achieve the above object, the present application also proposes a size measurement device, and the size measurement device includes:
[0041] A determination module, configured to obtain current image data of a product to be measured, and determine coordinates of a point to be measured corresponding to the current image data according to a target vision conversion model;
[0042] A processing module, configured to preprocess special points among the points to be measured when there are special points among the points to be measured, and update the points to be measured according to the processing results;
[0043] A measurement module, configured to measure dimensions of the product to be measured based on a geometric measurement strategy according to coordinates of the updated points to be measured.
[0044] In addition, to achieve the above object, the present application further provides a dimension measurement device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the computer program is configured to implement the steps of the dimension measurement method as described above.
[0045] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the dimension measurement method as described above.
[0046] One or more technical solutions provided by the present application at least have the following technical effects: By obtaining current image data of a product to be measured, determining coordinates of a point to be measured corresponding to the current image data according to a target vision conversion model; when there are special points among the points to be measured, preprocessing the special points among the points to be measured, and updating the points to be measured according to the processing results; measuring dimensions of the product to be measured based on a geometric measurement strategy according to coordinates of the updated points to be measured. In this way, after collecting current image data of a product to be measured by using an optical measurement device, based on a target artificial intelligence service device, coordinates of a point to be measured are determined according to a target vision conversion model, and it is judged whether there are special points among the points to be measured. If so, dimensions of the product to be measured are measured based on a geometric measurement strategy, so that the efficiency and accuracy of measuring product dimensions can be effectively improved, the reliability of measurement results can be ensured, and strong support is provided for quality control and decision-making in the production process. Description of the Drawings
[0047] The drawings here are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0048] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0049] Figure 1 It is a schematic flowchart provided for the first embodiment of the size measurement method of the present application;
[0050] Figure 2 It is a schematic diagram of model training provided for the first embodiment of the size measurement method of the present application;
[0051] Figure 3 It is a schematic structural diagram of the target encoding layer provided for the first embodiment of the size measurement method of the present application;
[0052] Figure 4 It is a schematic flowchart provided for the specific implementation manner of step S10 in the first embodiment of the size measurement method of the present application;
[0053] Figure 5 It is a schematic module structure diagram provided for the second embodiment of the size measurement device of the present application;
[0054] Figure 6 It is a schematic device structure diagram provided for the third embodiment of the size measurement device of the present application.
[0055] The realization of the purpose, functional features, and advantages of the present application will be further described in conjunction with the embodiments with reference to the drawings. Specific Embodiments
[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a size measurement device, etc. that can implement the above functions. Hereinafter, taking the size measurement device as an example, this embodiment and the following embodiments will be described.
[0057] Based on this, the first embodiment of the present application provides a size measurement method, referring to Figure 1 , Figure 1 It is a schematic flowchart of the first embodiment of the size measurement method of the present application.
[0058] In this embodiment, the size measurement method includes steps S10 to S30:
[0059] Step S10, obtain the current image data of the product to be measured, and determine the coordinates of the point to be measured corresponding to the current image data according to the target visual conversion model.
[0060] It should be noted that the product to be measured refers to the product for which dimensional measurement is required. The product to be measured includes, but is not limited to, products, product components, and components of equipment, etc. For example, the casing of a smart wearable device, TWS earphones, and the irregular contacts when the TWS earphones are charging in a charging case. The product to be measured has characteristics such as large differences in material, color, shape, and texture, making it impossible to perform automatic measurement.
[0061] It should be understood that the target visual transformation model refers to the coordinate transformation model that identifies and infers the coordinates of the points to be measured. Before inference, it is necessary to use the highly abstract and representative feature vectors of the current image data. The target visual transformation model can be an AI model based on Vit (Vision Transformer). Among them, the points to be measured refer to the points for dimensional measurement of the product to be measured, including but not limited to conventional points to be measured, special points to be measured, etc.
[0062] Further, before the step of determining the coordinates of the points to be measured corresponding to the current image data according to the target visual transformation model, it further includes: obtaining model training sample data and partitioning the image data in the model training sample data; tiling the partitioned image data, and performing transformation on the one-dimensional image data after tiling based on a linear transformation layer; adding target position information to the transformed image data based on a position embedding layer to obtain target sequence data; determining image feature vectors according to the target sequence data based on a target encoding layer and a prediction head; training the target visual transformation model according to the image feature vectors and the point coordinates in the model training sample data.
[0063] It should be understood that the model training sample data refers to the sample data used for model training. The model training can be completed on NVIDIA L40. After obtaining the model training sample data, the image data in the model training sample data is divided into multiple blocks. Refer to Figure 2 , Figure 2 For the model training schematic diagram, taking 9 blocks as an example for illustration, they are image block 1, image block 2, image block 3, image block 4, image block 5, image block 6, image block 7, image block 8, and image block 9. At this time, each image block 1 is tiled into one-dimensional image data and transmitted to the linear transformation layer, and the linear transformation layer can be a LinearProjection layer.
[0064] It can be understood that since the Transformer architecture itself does not have the ability to perceive the position information of elements in a sequence, and the position information of elements in an image is crucial for understanding the image content. Therefore, in this embodiment, the target position information is added to the transformed image data based on the position embedding layer, which can be Position embedding. Then, based on the target encoding layer, feature extraction and transformation are performed on the target sequence data to capture the global semantics and long-distance dependencies of the image. The target encoding layer can be a Transformer Encoder. Refer to Figure 3 , Figure 3 is a schematic structural diagram of the target encoding layer, specifically including: layer normalization, multi-head attention, and a multi-layer perceptron. Then, the image feature vector is input into the prediction head, which can be represented as Head, to achieve global modeling of the pixel sequence, accurately capture the long-distance dependencies in the image data, deeply excavate key features such as the edges, corners, and texture changes of components, generate highly abstract and representative feature vectors, and then train the target visual transformation model. The algorithm used for model training can be a Vit-based AI algorithm, which has good generalization ability and can adapt to the measurement requirements of devices with relatively large differences from the training pictures.
[0065] Step S20, when there are special points in the points to be measured, preprocess the special points in the points to be measured, and update the points to be measured according to the processing results.
[0066] It can be understood that the special points include, but are not limited to, cusp points, intersection points, extreme points of arcs, large die differences, and points with unstable position widths of sealant lines. After determining the coordinates of the points to be measured corresponding to the current image data, it is necessary to determine whether there are special points in the points to be measured. If so, preprocess the special points in the points to be measured to accurately determine the position of the special points, thereby solving the defect of unstable algorithm accuracy in special cases.
[0067] Further, step S20 includes: identifying the point numbers of the points to be measured to obtain the current recognition result; when it is determined that there are special points in the points to be measured according to the current recognition result, obtaining the types of the special points in the points to be measured; determining the special point processing strategy according to the types; preprocessing the special points in the points to be measured according to the special point processing strategy, and updating the points to be measured according to the processing results.
[0068] It should be understood that for each point to be measured, there is a point number, which can characterize the characteristics of the point. For example, if the point number is a special point number, it indicates that the point corresponding to the point number is a special point, that is, there are special points among the points to be measured. The special point processing strategy refers to the processing strategy for accurately determining the position of the special point. For different types of special points, the corresponding special point processing strategies are different. For example, for a cusp, the special point processing strategy is: use the regression binarization strategy to binarize the image data at the position of the special point, and then calculate the change rate of the image gradient, transforming the problem of determining the cusp position into a mathematical problem of finding the maximum value of the gradient change rate. For the extreme point of an arc, extract the skeleton line of the arc image data through the skeleton line extraction strategy, and then use the Euclidean geometric principle to calculate the distance from each point on the arc to the center of the circle, transforming the problem of determining the extreme point into a mathematical problem of solving the maximum and minimum values of the distance. For the above transformed problems, construct an optimal solution solving model, such as a conjugate gradient model, a Fermat point model, etc. Through learning and optimization of a large number of sample data, continuously adjust the model parameters to improve the accuracy and stability of determining the position of the special point.
[0069] It can be understood that after accurately obtaining the position of the special point, update the points to be measured according to the position of the special point. At this time, the coordinates of the updated points to be measured are all accurate, so as to effectively improve the accuracy of measuring the size of the product.
[0070] Step S30: Based on the geometric measurement strategy, measure the size of the product to be measured according to the coordinates of the updated points to be measured.
[0071] It should be understood that the geometric measurement strategy refers to the strategy of measuring various sizes of the product according to the geometric measurement algorithm. The sizes include but are not limited to length, width, diameter, and angle, etc. For products to be measured with different characteristics, the geometric measurement strategies used are different. For example, for a feature identified as a straight line, calculate the distance between the two endpoints to obtain the length of the product to be measured; for a feature identified as a circle, calculate the radius to obtain the diameter of the product to be measured; for a component with a complex shape, decompose it into multiple simple geometric shapes for segmented calculation, and then integrate the calculation results of each part to obtain the size of the product to be measured. For example, split an arch into a rectangle and an arc. Thus, fully automatic and high-precision size measurement can be achieved.
[0072] Further, after step S30, it also includes: obtaining the standard size range of the device, determining that the product to be measured is qualified when the size of the product to be measured is within the standard size range of the device; after a preset number of iterative measurements, obtain the iterative measurement results according to the target statistical indicators; evaluate the iterative measurement results; when the evaluation result does not meet the preset requirements, send out a warning prompt message.
[0073] It can be understood that the standard size range of the device refers to the optimal size range of the device that meets the production requirements. When the size of the product to be measured is within the standard size range of the device, it is determined that the product to be measured is qualified. Conversely, when the size of the product to be measured is not within the standard size range of the device, it indicates that the product to be measured is unqualified. At the same time, in order to avoid contingency, after a preset number of iterative measurements, the target statistical index, including but not limited to the average value, standard deviation, etc., is used to obtain the result of the preset iterative measurement. When the evaluation result does not meet the preset requirements, it indicates that the measured size exceeds the normal range. At this time, a warning prompt message is sent, and the most appropriate solution strategy is provided, such as detecting whether the device parameters are correct and whether there are errors in the image data acquisition, so as to effectively improve the accuracy and stability of the evaluation measurement and provide strong support for quality control and decision-making in the production process.
[0074] In this embodiment, the current image data of the product to be measured is obtained, and the coordinates of the points to be measured corresponding to the current image data are determined according to the target vision conversion model; when there are special points among the points to be measured, the special points among the points to be measured are preprocessed, and the points to be measured are updated according to the processing result; based on the geometric measurement strategy, the size of the product to be measured is measured according to the coordinates of the updated points to be measured. In the above manner, after the current image data of the product to be measured is collected by the optical measurement device, the coordinates of the points to be measured are determined based on the target artificial intelligence service device according to the target vision conversion model, and it is determined whether there are special points among the points to be measured. If so, the size of the product to be measured is measured based on the geometric measurement strategy, so as to effectively improve the efficiency and accuracy of measuring the product size, ensure the reliability of the measurement result, and provide strong support for quality control and decision-making in the production process.
[0075] Based on the first embodiment of the present application, a specific implementation manner for further limiting step S10 in the first embodiment is proposed. For the same or similar content in this specific implementation manner as in the first embodiment, reference can be made to the above introduction and will not be repeated hereinafter. Please refer to Figure 4 This specific implementation manner includes steps S101 to S104:
[0076] Step S101, obtain the basic attribute data of the product to be measured, and set the optical parameters of the optical measurement device according to the basic attribute data.
[0077] It should be noted that for the products to be measured with different basic attribute data, the set optical parameters are also different. The basic attribute data includes but is not limited to shape, surface characteristics, etc. The optical measurement device can be an Optical Measuring Microscope (OMM). The set optical parameters of the optical measurement device include but are not limited to focal length, aperture, illumination intensity, and angle, etc., to collect clear and appropriately contrasted current image data.
[0078] Step S102: Based on the optical measurement device with the set optical parameters, collect the current image data of the product to be measured.
[0079] It can be understood that the current image data refers to the image data collected by the optical measurement device after setting the optical parameters, and the product to be measured refers to the product for which dimensional measurement is required.
[0080] Step S103: Based on the target image annotation tool, annotate the current image data.
[0081] It should be understood that in order to clarify the key measurement positions, it is necessary to annotate the current image data based on the target image annotation tool, and the target image annotation tool can be the Labelme tool.
[0082] Step S104: Determine the coordinates of the points to be measured corresponding to the current image data according to the labels annotated on the current image data and the target visual conversion model.
[0083] It can be understood that the target visual conversion model refers to the coordinate conversion model that identifies and infers the coordinates of the points to be measured. After the annotation is completed, there will be a label on the current image data. At this time, the coordinates of the points to be measured corresponding to the current image data are determined in combination with the target visual conversion model.
[0084] Further, step S104 includes: converting the format of the labels annotated on the current image data according to the data format supported by the target visual conversion model, and encoding the converted labels; associating the encoded labels with the current image data, cropping the associated current data to obtain target associated data; transmitting the target associated data to the target artificial intelligence service device; receiving the coordinates of the points to be measured corresponding to the current image data inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the target associated data.
[0085] It should be understood that, in order to effectively improve the determination of the coordinates of the point to be measured, a format conversion script code is written, and the format of the labels marked on the current image data is converted into the data format supported by the target visual conversion model through the format conversion script code. After encoding the converted labels, in order to facilitate the target visual conversion model to understand the relationship between the labels and the current image data, the encoded labels need to be associated with the current image data.
[0086] It can be understood that, in order to effectively improve the processing efficiency of the target visual conversion model, the associated current data needs to be cropped to remove irrelevant backgrounds and redundant information, reduce the occupancy of video memory, and at the same time highlight the main body of the device, making the features of the associated current data more obvious. The cropping operation can be based on the labels and the approximate outline of the product to be measured to ensure that all key measurement points are retained.
[0087] Further, before the step of transmitting the target associated data to the target artificial intelligence service device, it further includes: controlling the test device and the target artificial intelligence service device to be connected to the same local area network, and configuring the network parameters of the connected test device and the target artificial intelligence service device; installing communication drivers and software interfaces on the configured test device and the target artificial intelligence service device respectively based on the target communication protocol; encapsulating the target associated data to obtain an associated data packet; and transmitting the associated data packet to the configured target artificial intelligence service device based on the target communication protocol.
[0088] It can be understood that, in order to achieve intelligent collaborative work between devices and make the measurement more intelligent and automated, a data transmission channel between the test device and the target artificial intelligence service device needs to be established. The test device can be a dimension measurement device, and the target artificial intelligence service device can be an AI server.
[0089] It should be understood that the test device and the target artificial intelligence service device can be connected to the same local area network through Ethernet, and the configured network parameters include but are not limited to IP addresses, subnet masks, etc., so as to ensure network connectivity. For different communication protocols, the communication drivers and software interfaces to be installed are also different. The target communication protocol can be the TCP / IP protocol. In order to effectively improve the data transmission efficiency, the target associated data needs to be encapsulated into an associated data packet and the associated data packet is transmitted to the configured target artificial intelligence service device based on the target communication protocol.
[0090] It should be noted that for the configured target artificial intelligence service device, after receiving the associated data packet, it unpacks and validates the data to ensure the integrity of the target associated data, and then calls the target visual conversion model to identify and reason about the target associated data to determine the coordinates of the point to be measured, and then repackages the coordinates of the point to be measured into a coordinate data packet for feedback. For the dimension measurement device, after receiving the coordinate data packet, it unpacks and extracts the coordinates, and calls the mouse control function according to the coordinates of the point to be measured to control the mouse arrow to move to the corresponding position and simulate a click operation to achieve the purpose of intelligent point selection.
[0091] In this embodiment, the basic attribute data of the product to be measured is obtained, and the optical parameters of the optical measurement device are set according to the basic attribute data; the current image data of the product to be measured is collected based on the optical measurement device with the set optical parameters; the current image data is labeled based on the target image annotation tool; and the coordinates of the point to be measured corresponding to the current image data are determined according to the labels labeled on the current image data and the target visual conversion model. By the above method, setting the basic attribute data according to the basic attribute data of the product to be measured and collecting the image data based on the optical measurement device with the set optical parameters can effectively improve the accuracy of collecting the current image data, and after labeling based on the target image annotation tool, combining the target visual conversion model to determine the coordinates of the point to be measured corresponding to the current image data, thereby effectively improving the accuracy of determining the coordinates of the point to be measured, and further improving the accuracy of measuring the size of the product.
[0092] Embodiment 2 of the present application provides a dimension measurement device. Please refer to Figure 5 , the dimension measurement device includes:
[0093] A determination module 10, configured to obtain current image data of a product to be measured, and determine coordinates of a point to be measured corresponding to the current image data according to a target visual conversion model.
[0094] A processing module 20, configured to preprocess special points in the points to be measured and update the points to be measured according to the processing result when there are special points in the points to be measured.
[0095] A measurement module 30, configured to measure the size of the product to be measured based on a geometric measurement strategy according to the coordinates of the updated points to be measured.
[0096] In this embodiment, the current image data of the product to be measured is obtained, and the coordinates of the points to be measured corresponding to the current image data are determined according to the target vision conversion model; when there are special points among the points to be measured, the special points among the points to be measured are preprocessed, and the points to be measured are updated according to the processing results; based on the geometric measurement strategy, the size of the product to be measured is measured according to the coordinates of the updated points to be measured. In the above manner, after the current image data of the product to be measured is collected by the optical measurement device, the coordinates of the points to be measured are determined based on the target artificial intelligence service device according to the target vision conversion model, and it is determined whether there are special points among the points to be measured. If so, the size of the product to be measured is measured based on the geometric measurement strategy, so that the efficiency and accuracy of measuring the size of the product can be effectively improved, the reliability of the measurement result can be ensured, and strong support can be provided for quality control and decision-making in the production process.
[0097] The size measurement device provided in the second embodiment of the present application adopts the size measurement method in the first embodiment above, and can solve the technical problem that the efficiency and accuracy of measuring the size of the product in the prior art are relatively low. Compared with the prior art, the beneficial effects of the size measurement device provided in the second embodiment of the present application are the same as the beneficial effects of the size measurement method provided in the first embodiment above, and other technical features in the size measurement device are the same as the features disclosed in the first embodiment above, and will not be elaborated here.
[0098] In one embodiment, the determination module 10 is further configured to obtain the basic attribute data of the product to be measured, and set the optical parameters of the optical measurement device according to the basic attribute data; collect the current image data of the product to be measured based on the optical measurement device with the set optical parameters; perform annotation on the current image data based on the target image annotation tool; determine the coordinates of the points to be measured corresponding to the current image data according to the labels annotated on the current image data and the target vision conversion model.
[0099] In one embodiment, the determination module 10 is further configured to convert the format of the labels annotated on the current image data according to the data format supported by the target vision conversion model, and encode the converted labels; associate the encoded labels with the current image data, and crop the associated current data to obtain target associated data; transmit the target associated data to the target artificial intelligence service device; receive the coordinates of the points to be measured corresponding to the current image data inferred and fed back by the target artificial intelligence service device according to the target vision conversion model and the target associated data.
[0100] In one embodiment, the determining module 10 is further configured to control the test device and the target artificial intelligence service device to be connected to the same local area network, and configure the network parameters of the connected test device and the target artificial intelligence service device; install communication drivers and software interfaces on the configured test device and the target artificial intelligence service device respectively based on the target communication protocol; encapsulate the target associated data to obtain an associated data packet; and transmit the associated data packet to the configured target artificial intelligence service device based on the target communication protocol.
[0101] In one embodiment, the determining module 10 is further configured to obtain model training sample data, and partition the image data in the model training sample data; tile the partitioned image data, and perform transformation on the tiled one-dimensional image data based on a linear transformation layer; add target position information to the transformed image data based on a position embedding layer to obtain target sequence data; determine an image feature vector according to the target sequence data based on a target encoding layer and a prediction head; and train a target visual conversion model according to the image feature vector and the point coordinates in the model training sample data.
[0102] In one embodiment, the processing module 20 is further configured to perform point number recognition on the to-be-tested point to obtain a current recognition result; when it is determined that there is a special point in the to-be-tested point according to the current recognition result, obtain the type of the special point in the to-be-tested point; determine a special point processing strategy according to the type; preprocess the special point in the to-be-tested point according to the special point processing strategy, and update the to-be-tested point according to the processing result.
[0103] In one embodiment, the measuring module 30 is further configured to obtain a device standard size range, and determine that the to-be-tested product is qualified when the size of the to-be-tested product is within the device standard size range; after iterative measurement for a preset number of times, obtain an iterative measurement result according to a target statistical index; evaluate the iterative measurement result; and send a warning prompt message when the evaluation result does not meet the preset requirements.
[0104] Embodiment 3 of the present application provides a size measuring device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the size measuring method in Embodiment 1 above.
[0105] Next, refer to Figure 6, which shows a schematic structural diagram of a dimension measuring device suitable for implementing Embodiment 3 of the present application. The dimension measuring device in Embodiment 3 of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The shown dimension measuring device is merely an example and should not impose any limitation on the functions and usage scope of Embodiment 3 of the present application.
[0106] As Figure 6 shown, the dimension measuring device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a ROM (Read Only Memory) 1002 or a program loaded from a storage device 1003 into a RAM (Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the dimension measuring device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the dimension measuring device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a dimension measuring device having various systems, it should be understood that it is not required to implement or include all the shown systems. Instead, more or fewer systems may be implemented or included.
[0107] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. The computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by a processing device 1001, the above functions defined in the methods of the disclosed embodiments of the present application are executed.
[0108] The dimension measurement device provided in the third embodiment of the present application adopts the dimension measurement method in the first embodiment above, and can solve the technical problem that the efficiency and accuracy of measuring the dimensions of products in the prior art are relatively low. Compared with the prior art, the beneficial effects of the dimension measurement device provided in the third embodiment of the present application are the same as those of the dimension measurement method provided in the first embodiment above, and other technical features in the dimension measurement device are the same as those disclosed in the previous first embodiment, and will not be elaborated here.
[0109] It should be understood that each part disclosed in the present application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0110] As mentioned above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0111] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the dimension measurement method in the first embodiment above.
[0112] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0113] The above computer-readable storage medium can be included in a dimension measurement device; or it can exist independently and not be assembled into a dimension measurement device.
[0114] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems and methods according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0116] The modules described in the embodiments of the present application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0117] The readable storage medium provided by the present application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned dimension measurement method, and can solve the technical problem of low efficiency and accuracy of measuring product dimensions in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as those of the dimension measurement method provided in the first embodiment above, and will not be elaborated here.
[0118] The above are only some embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural transformation made by using the description of the present application and the content of the accompanying drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for dimension measurement, characterized in that, The method includes: Obtaining current image data of the product to be measured, and determining the coordinates of the points to be measured corresponding to the current image data according to the target visual conversion model; When there are special points in the points to be measured, preprocessing the special points in the points to be measured, and updating the points to be measured according to the processing results, where the special points include cusp points, intersection points, extreme points of arcs, points with large die differences, and points with unstable position widths of sealing lines; Based on the geometric measurement strategy, measuring the size of the product to be measured according to the coordinates of the updated points to be measured; The step of determining the coordinates of the points to be measured corresponding to the current image data according to the target visual conversion model includes: Annotating the current image data based on the target image annotation tool; Converting the format of the labels annotated on the current image data according to the data format supported by the target visual conversion model, and encoding the converted labels; Associating the encoded labels with the current image data, and cropping the associated current data to obtain target associated data; Transmitting the target associated data to the target artificial intelligence service device; Receiving the coordinates of the points to be measured corresponding to the current image data inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the target associated data.
2. The method according to claim 1, wherein The step of obtaining the current image data of the product to be measured includes: Obtaining the basic attribute data of the product to be measured, and setting the optical parameters of the optical measurement device according to the basic attribute data; Collecting the current image data of the product to be measured based on the optical measurement device with the set optical parameters.
3. The method according to claim 1, wherein, Before the step of transmitting the target associated data to the target artificial intelligence service device, it further includes: Controlling the test device and the target artificial intelligence service device to be connected to the same local area network, and configuring the network parameters of the connected test device and the target artificial intelligence service device; Installing communication drivers and software interfaces on the configured test device and the target artificial intelligence service device respectively based on the target communication protocol; Encapsulating the target associated data to obtain an associated data packet; Transmitting the associated data packet to the configured target artificial intelligence service device based on the target communication protocol.
4. The method according to claim 1, characterized in that, Before the step of determining the coordinates of the points to be measured corresponding to the current image data according to the target visual conversion model, it further includes: Obtaining model training sample data, and dividing the image data in the model training sample data; Tiling the divided image data, and performing transformation on the tiled one-dimensional image data based on the linear transformation layer; Adding target position information to the transformed image data based on the position embedding layer to obtain target sequence data; Determining image feature vectors based on the target sequence data according to the target encoding layer and the prediction head; Training the target visual conversion model according to the image feature vectors and the point coordinates in the model training sample data.
5. The method according to claim 1, characterized in that The step of, when there are special points in the points to be measured, preprocessing the special points in the points to be measured, and updating the points to be measured according to the processing results includes: Perform point number identification on the point to be measured to obtain the current identification result; When it is determined according to the current identification result that there are special points in the point to be measured, obtain the types of the special points in the point to be measured; Determine the special point processing strategy according to the type; Preprocess the special points in the point to be measured according to the special point processing strategy, and update the point to be measured according to the processing result.
6. The method according to any one of claims 1 to 5, characterized in that, After the step of measuring the size of the product to be measured based on the geometric measurement strategy according to the coordinates of the updated point to be measured, it further includes: Obtain the device standard size range, and when the size of the product to be measured is within the device standard size range, determine that the product to be measured is qualified; After a preset number of iterative measurements, obtain the iterative measurement result according to the target statistical index; Evaluate the iterative measurement result; When the evaluation result does not meet the preset requirements, send out a warning prompt message.
7. A dimension measuring device, characterized in that, The device includes: A determination module, configured to obtain the current image data of the product to be measured, and determine the coordinates of the point to be measured corresponding to the current image data according to the target visual conversion model; A processing module, configured to preprocess the special points in the point to be measured when there are special points in the point to be measured, and update the point to be measured according to the processing result, where the special points include cusp points, intersection points, extreme points of arcs, large die differences, and points with unstable position widths of sealant lines; A measurement module, configured to measure the size of the product to be measured based on the geometric measurement strategy according to the coordinates of the updated point to be measured; The determination module is further configured to perform annotation on the current image data based on the target image annotation tool; perform format conversion on the labels annotated on the current image data according to the data format supported by the target visual conversion model, and encode the converted labels; associate the encoded labels with the current image data, crop the associated current data to obtain target associated data; transmit the target associated data to the target artificial intelligence service device; receive the coordinates of the point to be measured corresponding to the current image data inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the target associated data.
8. A dimension measuring device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the computer program is configured to implement the steps of the size measurement method according to any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by the processor, it implements the steps of the size measurement method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Size detection method and device, electronic equipment and readable storage medium
CN115205273A
Production monitoring equipment for radio frequency filter and monitoring method thereof
CN116665134A