Dimension measurement method and device, equipment and storage medium
By using target visual transformation models and geometric measurement strategies, the problem of low dimensional efficiency and accuracy of measuring products in the prior art is solved, and efficient and reliable dimensional measurement is achieved, supporting rapid production and quality control.
Patent Information
- Application Number
- CN202510388106.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The prior art has low efficiency and accuracy when measuring product sizes, and is susceptible to human factors, making it difficult to meet the needs of rapid production.
By obtaining the current image data of the product to be tested, the coordinates of the point to be measured are determined according to the target visual transformation model, pre-processing and updating when special points exist, and the size of the product is measured based on the geometric measurement strategy.
It improves the efficiency and accuracy of measuring product size, ensures the reliability of measurement results, and provides strong support for quality control and decision-making in the production process.
Smart Images

Figure CN119904504A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial measurement technology, and in particular to a dimension measurement method, device, equipment and storage medium. Background Art
[0002] In industrial production, accurate measurement of product dimensions is crucial. At present, the common method for measuring product dimensions is to use contact measuring tools, such as calipers and micrometers. The efficiency of using contact measuring tools to measure product dimensions is low, and it is easily affected by human factors, and the measurement accuracy is limited. For this reason, some employees will also use existing optical measuring equipment. However, the optical measuring equipment has operation and personnel dependence during use. For example, only one person can operate one device, which greatly limits the measurement efficiency. When large-scale measurement tasks are required, it is difficult to meet the needs of rapid production. In addition, the traditional use of optical measuring equipment requires pure manual point selection, which will also be affected by subjective factors. 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 the measurement results. Therefore, the efficiency and accuracy of measuring product dimensions in the above method are low.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this 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 objectives, the present application proposes a size measurement method, which comprises: Acquire current image data of the product to be tested, and determine the coordinates of the points to be tested 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; Based on the geometric measurement strategy, the size of the product to be measured is measured according to the updated coordinates of the points to be measured.
[0006] In one embodiment, the step of acquiring current image data of the product to be tested and determining the coordinates of the point to be tested corresponding to the current image data according to the target visual conversion model includes: Acquire basic property data of the product to be measured, and set optical parameters of the optical measuring device according to the basic property data; Collecting current image data of the product to be measured based on the optical measuring device after setting the optical parameters; Annotating the current image data based on a target image annotation tool; The coordinates of the point to be measured corresponding to the current image data are determined according to the label annotated on the current image data and the target visual conversion model.
[0007] 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: 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 label with the current image data, and cropping the associated current data to obtain target associated data; Transmitting the target-related data to the target artificial intelligence service device; Receive the coordinates of the point to be measured corresponding to the current image data, which is inferred and fed back by the target artificial intelligence service device based on the target visual conversion model and the target associated data.
[0008] In one embodiment, before the step of transmitting the target-related data to the target artificial intelligence service device, the step further includes: 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 the communication driver and software interface on the configured test device and the target artificial intelligence service device based on the target communication protocol; Encapsulating the target associated data to obtain an associated data packet; The associated data packet is transmitted to the configured target artificial intelligence service device based on the target communication protocol.
[0009] 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, the step further includes: Acquire model training sample data, and divide image data in the model training sample data; Tiling the divided image data, and transforming the tiled one-dimensional image data based on a linear transformation layer; Add target position information to the transformed image data based on the position embedding layer to obtain target sequence data; Determining an image feature vector according to the target sequence data based on the target coding layer and the prediction head; The target visual transformation model is trained according to the image feature vector and the point coordinates in the model training sample data.
[0010] In one embodiment, when there are special points in the points to be measured, the step of preprocessing the special points in the points to be measured and updating the points to be measured according to the processing results includes: Identify the point number of the point to be measured and obtain the current identification result; When it is determined according to the current recognition result that there is a special point in the points to be measured, obtaining the type of the special point in the points to be measured; Determine the special point processing strategy according to the type; The special points in the points to be measured are preprocessed according to the special point processing strategy, and the points to be measured are updated according to the processing results.
[0011] In one embodiment, after the step of measuring the size of the product to be measured according to the updated coordinates of the points to be measured based on the geometric measurement strategy, the method further includes: Obtaining a standard size range of the device, and determining that the product to be tested is qualified when the size of the product to be tested is within the standard size range of the device; After a preset number of iterative measurements, the iterative measurement results are obtained according to the target statistical indicators; evaluating the iterative measurement results; When the evaluation results do not meet the preset requirements, a warning message will be issued.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a size measuring device, which includes: A determination module, used to obtain current image data of the product to be tested, and determine the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model; A processing module, used for preprocessing the special points among the points to be measured when there are special points among the points to be measured, and updating the points to be measured according to the processing results; The measuring module is used to measure the size of the product to be measured according to the updated coordinates of the points to be measured based on a geometric measurement strategy.
[0013] In addition, to achieve the above objectives, the present application also proposes a dimension measuring device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the dimension measuring method described above.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the dimension measurement method described above are implemented.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: by acquiring the current image data of the product to be tested, the coordinates of the points to be tested corresponding to the current image data are determined according to the target visual conversion model; when there are special points in the points to be tested, the special points in the points to be tested are preprocessed, and the points to be tested are updated according to the processing results; based on the geometric measurement strategy, the size of the product to be tested is measured according to the updated coordinates of the points to be tested. In the above manner, after the current image data of the product to be tested is collected by the optical measuring device, the coordinates of the points to be tested are determined according to the target visual conversion model based on the target artificial intelligence service device, and it is judged whether there are special points in the points to be tested. If so, the size of the product to be tested is measured based on the geometric measurement strategy, thereby effectively improving the efficiency and accuracy of measuring the product size, ensuring the reliability of the measurement results, and providing strong support for quality control and decision-making in the production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the dimension measurement method of the present application; Figure 2 A schematic diagram of model training provided for the first embodiment of the dimension measurement method of the present application; Figure 3 A schematic diagram of the structure of the target coding layer provided in Example 1 of the size measurement method of the present application; Figure 4 A flowchart diagram for providing a specific implementation of step S10 in Example 1 of the size measurement method of the present application; Figure 5 A schematic diagram of the module structure provided for the second embodiment of the size measuring device of the present application; Figure 6 This is a schematic diagram of the device structure provided for Example 3 of the dimension measuring device of the present application.
[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] 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 capable of realizing the above functions, a dimension measuring device, etc. The following takes the dimension measuring device as an example to illustrate this embodiment and the following embodiments.
[0021] Based on this, the first embodiment of the present application provides a size measurement method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the dimension measurement method of the present application.
[0022] In this embodiment, the size measurement method includes steps S10 to S30: Step S10, obtaining current image data of the product to be tested, and determining the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model.
[0023] It should be noted that the products to be tested refer to products that require dimensional measurement, and include but are not limited to products, product components and equipment components, etc. For example, the casing of a smart wearable device, TWS earphones, and the irregular contacts of TWS earphones when charging in a charging box. The products to be tested have characteristics such as large differences in material, color, shape and texture that cannot be automatically measured.
[0024] It should be understood that the target visual transformation model refers to a coordinate transformation model that is obtained by identifying and inferring the points to be measured. Before reasoning, a highly abstract and representative feature vector of the current image data is required. The target visual transformation model can be an AI model based on Vit (Vision Transformer), wherein the points to be measured refer to the points at which the dimensions of the products to be measured are measured, including but not limited to conventional points to be measured, special points to be measured, etc.
[0025] Furthermore, 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 also includes: acquiring model training sample data, and dividing the image data in the model training sample data; tiling the divided image data, and transforming 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 the image feature vector based on the target coding layer and the prediction head according to the target sequence data; and training the target visual conversion model according to the image feature vector and the point coordinates in the model training sample data.
[0026] 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 the NVIDIA L40. After the model training sample data is obtained, the image data in the model training sample data is divided into multiple blocks. Figure 2 , Figure 2 This is a schematic diagram of model training, taking 9 blocks as an example, namely 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 flattened into one-dimensional image data and transmitted to the linear transformation layer, which can be a LinearProjection layer.
[0027] It is understandable that since the Transformer architecture itself does not have the ability to perceive the position information of elements in the sequence, and the position information of elements in the image is crucial to understanding the image content, this embodiment adds target position information to the transformed image data based on the position embedding layer, and the position embedding layer can be Position embedding, and then extracts and transforms the target sequence data based on the target encoding layer to capture the global semantics and long-distance dependencies of the image. The target encoding layer can be Transformer Encoder, refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of the target encoding layer, which specifically includes: layer normalization, multi-head attention, and multi-layer perceptron. The image feature vector is then input into the prediction head, which can be represented as Head, to achieve global modeling of the pixel sequence, accurately capture long-distance dependencies in image data, deeply mine key features such as edges, corners, and texture changes of parts, generate highly abstract and representative feature vectors, and then train the target visual conversion model. The algorithm used for model training can be an AI algorithm based on Vit, which has good generalization ability and can adapt to the measurement needs of equipment that is relatively different from the training images.
[0028] Step S20, when there are special points in the points to be measured, pre-process the special points in the points to be measured, and update the points to be measured according to the processing result.
[0029] It can be understood that special points include but are not limited to sharp points, intersection points, arc extreme points, points with large mold differences, and points with unstable sealing line position width. 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, the special points in the points to be measured are preprocessed to accurately determine the position of the special points, thereby solving the defect of unstable algorithm accuracy under special circumstances.
[0030] Further, step S20 includes: identifying the point number of the point to be measured to obtain a current identification result; when it is determined that there are special points in the points to be measured according to the current identification result, obtaining the type of the special points in the points to be measured; determining a special point processing strategy according to the type; pre-processing 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.
[0031] It should be understood that for each point to be measured, there is a point number, and the point number can characterize the characteristics of the point. For example, when 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 in 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 sharp point, the special point processing strategy is: use the regression binarization strategy to binarize the image data at the location of the special point, and then calculate the rate of change of the image gradient, and transform the problem of determining the position of the sharp point into a mathematical problem of finding the maximum value of the gradient change rate. For the extreme point of the arc, the skeleton line of the arc image data is extracted by the skeleton line extraction strategy, and then the distance from each point on the arc to the center of the circle is calculated using the principle of Euclidean geometry, and the problem of determining the extreme point is transformed into a mathematical problem of solving the maximum distance value. For the above-mentioned transformed problems, we construct optimal solution models, such as the conjugate gradient model and the Fermat point model. By learning and optimizing a large amount of sample data, we continuously adjust the model parameters to improve the accuracy and stability of determining the positions of special points.
[0032] It can be understood that after the position of the special point is accurately obtained, the point to be measured is updated according to the position of the special point. At this time, the coordinates of the updated point to be measured are accurate, thereby effectively improving the accuracy of measuring product dimensions.
[0033] Step S30, based on the geometric measurement strategy, measuring the size of the product to be measured according to the updated coordinates of the points to be measured.
[0034] It should be understood that the geometric measurement strategy refers to a strategy for measuring various dimensions of a product according to a geometric measurement algorithm, including but not limited to length, width, diameter, and angle. Different geometric measurement strategies are used for products with different features. For example, for features identified as straight lines, the length of the product to be measured is obtained by calculating the distance between the two end points; for features identified as circles, the diameter of the product to be measured is obtained by calculating the radius; for parts with complex shapes, they are decomposed into multiple simple geometric shapes for segmented calculations, and then the various calculation results are integrated to obtain the dimensions of the product to be measured, for example, an arch is split into a rectangle and an arc. This enables fully automatic and high-precision dimension measurement.
[0035] Furthermore, after step S30, it also includes: obtaining a standard size range of the equipment, and determining that the product to be tested is qualified when the size of the product to be tested is within the standard size range of the equipment; obtaining an iterative measurement result according to a target statistical indicator after a preset number of iterative measurements; evaluating the iterative measurement result; and issuing a warning prompt message when the evaluation result does not meet the preset requirements.
[0036] It is understandable that the standard size range of the equipment refers to the optimal size range of the equipment that meets production needs. When the size of the product to be tested is within the standard size range of the equipment, it is determined that the product to be tested is qualified. Conversely, when the size of the product to be tested is not within the standard size range of the equipment, it indicates that the product to be tested is unqualified. At the same time, in order to avoid contingency, after a preset number of iterative measurements, the preset iterative measurement results are obtained according to the target statistical indicators. The target statistical indicators include but are not limited to the mean value, standard deviation, etc. When the evaluation results do not meet the preset requirements, it indicates that the measured size exceeds the normal range. At this time, an early warning prompt message is issued and the most appropriate solution strategy is provided, such as whether the detection equipment 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.
[0037] This embodiment obtains the current image data of the product to be tested, and determines the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model; when there are special points in the points to be tested, the special points in the points to be tested are preprocessed, and the points to be tested are updated according to the processing results; based on the geometric measurement strategy, the size of the product to be tested is measured according to the updated coordinates of the points to be tested. In the above manner, after the current image data of the product to be tested is collected by the optical measuring device, the coordinates of the points to be tested are determined according to the target visual conversion model based on the target artificial intelligence service device, and it is determined whether there are special points in the points to be tested. If so, the size of the product to be tested is measured based on the geometric measurement strategy, thereby effectively improving the efficiency and accuracy of measuring the product size, ensuring the reliability of the measurement results, and providing strong support for quality control and decision-making in the production process.
[0038] Based on the first embodiment of the present application, the present application proposes a specific implementation method that further defines step S10 in the first embodiment. The same or similar contents in the specific implementation method as those in the first embodiment can be referred to the above introduction, and will not be repeated later. Please refer to Figure 4 , the specific implementation includes steps S101~S104: Step S101, acquiring basic property data of a product to be measured, and setting optical parameters of an optical measuring device according to the basic property data.
[0039] It should be noted that for products to be tested with different basic attribute data, the optical parameters set are also different. The basic attribute data include but are not limited to shape, surface characteristics, etc. The optical measuring device can be an optical measuring microscope (Optical Measuring Microscope, OMM). The optical parameters of the optical measuring device are set including but not limited to focal length, aperture, lighting intensity and angle, etc., so as to collect clear current image data with appropriate contrast.
[0040] Step S102 : collecting current image data of the product to be measured based on the optical measuring device after the optical parameters are set.
[0041] It can be understood that the current image data refers to the image data collected by the optical measuring device after the optical parameters are set, and the product to be measured refers to the product that needs to be measured in size.
[0042] Step S103: annotate the current image data based on a target image annotation tool.
[0043] It should be understood that in order to clarify the key measurement position, it is necessary to annotate the current image data based on a target image annotation tool, and the target image annotation tool may be a Labelme tool.
[0044] Step S104, 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.
[0045] It can be understood that the target visual transformation model refers to the coordinate transformation model of the point to be measured after identification and inference. After the labeling is completed, there will be a label on the current image data. At this time, the coordinates of the point to be measured corresponding to the current image data are determined in combination with the target visual transformation model.
[0046] Furthermore, step S104 includes: converting the format of the labels marked 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 test point corresponding to the current image data inferred and fed back by the target artificial intelligence service device based on the target visual conversion model and the target associated data.
[0047] It should be understood that in order to effectively improve the determination of the coordinates of the points 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 a 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.
[0048] It is understandable 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 background and redundant information, reduce the occupancy of video memory, and highlight the device body, making the features of the associated current data more obvious. The cropping operation can be performed based on the approximate outline of the label and the product to be tested to ensure that all key measurement points are retained.
[0049] Furthermore, before the step of transmitting the target associated data to the target artificial intelligence service device, it also 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 the communication driver and software interface 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.
[0050] It is understandable that in order to achieve intelligent collaboration between devices and make measurements more intelligent and automated, it is necessary to build a data transmission channel between the test equipment and the target artificial intelligence service equipment. The test equipment can be a dimensional measuring device, and the target artificial intelligence service equipment can be an AI server.
[0051] It should be understood that the test equipment and the target artificial intelligence service equipment can be connected to the same local area network through Ethernet control. The configured network parameters include but are not limited to IP address, subnet mask, etc., so as to ensure network connectivity. For different communication protocols, the communication drivers and software interfaces that need 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 associated data packets, and the associated data packets will be transmitted to the configured target artificial intelligence service device based on the target communication protocol.
[0052] It should be noted that for the configured target artificial intelligence service device, after receiving the associated data packet, it unpacks and verifies the data to ensure the integrity of the target associated data, and then calls the target visual conversion model to identify and infer the target associated data to determine the coordinates of the points to be measured, and again encapsulates the coordinates of the points 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 points to be measured to control the mouse arrow to move to the corresponding position and simulate the click operation to achieve the purpose of intelligent point selection.
[0053] This embodiment obtains the basic attribute data of the product to be tested, and sets the optical parameters of the optical measuring device according to the basic attribute data; collects the current image data of the product to be tested based on the optical measuring device after the optical parameters are set; annotates the current image data based on the target image annotation tool; and determines the coordinates of the points to be tested corresponding to the current image data based on the labels annotated on the current image data and the target visual conversion model. In the above manner, the basic attribute data of the product to be tested is set according to the basic attribute data of the product to be tested, and the image data is collected based on the optical measuring device after the optical parameters are set, which can effectively improve the accuracy of collecting the current image data, and after annotating based on the target image annotation tool, the coordinates of the points to be tested corresponding to the current image data are determined in combination with the target visual conversion model, thereby effectively improving the accuracy of determining the coordinates of the points to be tested, thereby improving the accuracy of measuring the product size.
[0054] The second embodiment of the present application provides a size measuring device, please refer to Figure 5 , the size measuring device comprises: The determination module 10 is used to obtain current image data of the product to be tested, and determine the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model.
[0055] The processing module 20 is used for preprocessing the special points among the points to be measured when there are special points among the points to be measured, and updating the points to be measured according to the processing result.
[0056] The measuring module 30 is used to measure the size of the product to be measured according to the updated coordinates of the points to be measured based on a geometric measurement strategy.
[0057] This embodiment obtains the current image data of the product to be tested, and determines the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model; when there are special points in the points to be tested, the special points in the points to be tested are preprocessed, and the points to be tested are updated according to the processing results; based on the geometric measurement strategy, the size of the product to be tested is measured according to the updated coordinates of the points to be tested. In the above manner, after the current image data of the product to be tested is collected by the optical measuring device, the coordinates of the points to be tested are determined according to the target visual conversion model based on the target artificial intelligence service device, and it is determined whether there are special points in the points to be tested. If so, the size of the product to be tested is measured based on the geometric measurement strategy, thereby effectively improving the efficiency and accuracy of measuring the product size, ensuring the reliability of the measurement results, and providing strong support for quality control and decision-making in the production process.
[0058] The dimension measuring device provided in the second embodiment of the present application adopts the dimension measuring method in the first embodiment above, and can solve the technical problem of low efficiency and accuracy in measuring product dimensions in the prior art. Compared with the prior art, the beneficial effects of the dimension measuring device provided in the second embodiment of the present application are the same as the beneficial effects of the dimension measuring method provided in the first embodiment above, and other technical features in the dimension measuring device are the same as those disclosed in the first embodiment above, and are not described in detail here.
[0059] In one embodiment, the determination module 10 is further used to obtain basic attribute data of the product to be tested, and set optical parameters of the optical measuring device according to the basic attribute data; collect current image data of the product to be tested based on the optical measuring device after setting the optical parameters; annotate the current image data based on the target image annotation tool; determine the coordinates of the point to be tested corresponding to the current image data according to the label annotated on the current image data and the target visual conversion model.
[0060] In one embodiment, the determination module 10 is also used to convert the format of the label marked on the current image data according to the data format supported by the target visual conversion model, and encode the converted label; associate the encoded label 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 test point corresponding to the current image data inferred and fed back by the target artificial intelligence service device based on the target visual conversion model and the target associated data.
[0061] In one embodiment, the determination module 10 is also used 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 the communication driver and software interface 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.
[0062] In one embodiment, the determination module 10 is also used to obtain model training sample data and divide the image data in the model training sample data; tile the divided image data, and transform the tiled one-dimensional image data based on the linear transformation layer; add target position information to the transformed image data based on the position embedding layer to obtain target sequence data; determine the image feature vector based on the target coding layer and the prediction head according to the target sequence data; and train the target visual transformation model according to the image feature vector and the point coordinates in the model training sample data.
[0063] In one embodiment, the processing module 20 is also used to identify the point number of the point to be measured and obtain a current identification result; when it is determined that there are special points in the points to be measured according to the current identification result, the type of the special points in the points to be measured is obtained; a special point processing strategy is determined according to the type; the special points in the points to be measured are pre-processed according to the special point processing strategy, and the points to be measured are updated according to the processing results.
[0064] In one embodiment, the measurement module 30 is also used to obtain the standard size range of the equipment, and when the size of the product to be tested is within the standard size range of the equipment, determine that the product to be tested is qualified; after a preset number of iterative measurements, obtain the iterative measurement results according to the target statistical indicators; evaluate the iterative measurement results; and issue a warning prompt message when the evaluation results do not meet the preset requirements.
[0065] Embodiment 3 of the present application provides a dimension 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 dimension measuring method in the above-mentioned embodiment 1.
[0066] Reference below Figure 6 , which shows a schematic diagram of the structure of a dimension measuring device suitable for implementing the third embodiment of the present application. The dimension measuring device in the third embodiment 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 dimension measuring device shown is merely an example and should not bring any limitation to the function and scope of use of the third embodiment of the present application.
[0067] like Figure 6 As shown, the dimension measuring device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can 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 to 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 can 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: Liquid Crystal Display), 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 can allow the dimension measuring device to communicate with other devices wirelessly or wired to exchange data. Although the dimension measuring device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0068] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. The computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0069] The dimension measuring device provided in the third embodiment of the present application adopts the dimension measuring method in the first embodiment above, which can solve the technical problem of low efficiency and accuracy in measuring product dimensions in the prior art. Compared with the prior art, the beneficial effects of the dimension measuring device provided in the third embodiment of the present application are the same as the beneficial effects of the dimension measuring method provided in the first embodiment above, and the other technical features in the dimension measuring device are the same as those disclosed in the first embodiment above, which will not be described in detail here.
[0070] It should be understood that the various parts disclosed in this 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 any one or more embodiments or examples in a suitable manner.
[0071] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0072] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the dimension measurement method in the above-mentioned embodiment 1.
[0073] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0074] The computer-readable storage medium may be included in the dimension measuring device; or may exist independently without being assembled into the dimension measuring device.
[0075] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate 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 may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0076] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system and method according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0077] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0078] The readable storage medium provided in the present application is a computer-readable storage medium, which 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 in measuring product dimensions in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the dimension measurement method provided in the above-mentioned embodiment 1, and will not be elaborated here.
[0079] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A size measurement method, characterized in that: The method comprises: Acquire current image data of the product to be tested, and determine the coordinates of the points to be tested 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; Based on the geometric measurement strategy, the size of the product to be measured is measured according to the updated coordinates of the points to be measured.
2. The method according to claim 1, characterized in that The step of acquiring current image data of the product to be tested and determining the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model comprises: Acquire basic property data of the product to be measured, and set optical parameters of the optical measuring device according to the basic property data; Collecting current image data of the product to be measured based on the optical measuring device after setting the optical parameters; Annotating the current image data based on a target image annotation tool; The coordinates of the point to be measured corresponding to the current image data are determined according to the label annotated on the current image data and the target visual conversion model.
3. The method according to claim 2, characterized in that 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 comprises: 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 label with the current image data, and cropping the associated current data to obtain target associated data; Transmitting the target-related data to the target artificial intelligence service device; Receive the coordinates of the point to be measured corresponding to the current image data, which is inferred and fed back by the target artificial intelligence service device based on the target visual conversion model and the target associated data.
4. The method according to claim 3, characterized in that Before the step of transmitting the target associated data to the target artificial intelligence service device, the step further includes: 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 the communication driver and software interface on the configured test device and the target artificial intelligence service device based on the target communication protocol; Encapsulating the target associated data to obtain an associated data packet; The associated data packet is transmitted to the configured target artificial intelligence service device based on the target communication protocol.
5. The method according to claim 1, characterized in that 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, the method further includes: Acquire model training sample data, and divide image data in the model training sample data; Tiling the divided image data, and transforming the tiled one-dimensional image data based on a linear transformation layer; Add target position information to the transformed image data based on the position embedding layer to obtain target sequence data; Determining an image feature vector according to the target sequence data based on the target coding layer and the prediction head; The target visual transformation model is trained according to the image feature vector and the point coordinates in the model training sample data.
6. The method according to claim 1, characterized in that When there are special points in the points to be measured, the step of preprocessing the special points in the points to be measured and updating the points to be measured according to the processing result includes: Identify the point number of the point to be measured and obtain the current identification result; When it is determined according to the current recognition result that there is a special point in the points to be measured, obtaining the type of the special point in the points to be measured; Determine the special point processing strategy according to the type; The special points in the points to be measured are preprocessed according to the special point processing strategy, and the points to be measured are updated according to the processing results.
7. The method according to any one of claims 1 to 6, characterized in that After the step of measuring the size of the product to be measured according to the updated coordinates of the points to be measured based on the geometric measurement strategy, the method further includes: Obtaining a standard size range of the device, and determining that the product to be tested is qualified when the size of the product to be tested is within the standard size range of the device; After a preset number of iterative measurements, the iterative measurement results are obtained according to the target statistical indicators; evaluating the iterative measurement results; When the evaluation results do not meet the preset requirements, a warning message will be issued.
8. A dimension measuring device, characterized in that: The device comprises: A determination module, used to obtain current image data of the product to be tested, and determine the coordinates of the points to be tested corresponding to the current image data according to the target visual conversion model; A processing module, used for preprocessing the special points among the points to be measured when there are special points among the points to be measured, and updating the points to be measured according to the processing results; The measuring module is used to measure the size of the product to be measured according to the updated coordinates of the points to be measured based on a geometric measurement strategy.
9. A dimension measuring device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the dimension measurement method according to any one of claims 1 to 7.
10. 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. When the computer program is executed by a processor, the steps of the dimension measurement method according to any one of claims 1 to 7 are implemented.
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
Visual image detection method and training method of image measurement model
CN117422692A
Target measurement method and device, client, medium and product
CN118918166A
Target detection method and device, equipment, storage medium and product
CN119273890A
Cited By
Automatic detection method and system, coordinate measuring machine and readable storage medium
CN120426925A
Measurement method, upper computer, measurement system and storage medium
CN120926883A