Dimension Measurement Method, Device, Equipment and Storage Medium

Through the visual transformation algorithm based on the bidirectional feature cascade module and the bidirectional attention fusion module, the target visual transformation model is trained, and the problem of low dimensional accuracy in measuring products in the prior art is solved, and high-precision dimensional measurement is achieved, which is suitable for the measurement of complex shape components and surfaces of different materials.

CN119904505BActive Publication Date: 2025-07-08GOERTEK INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510388107.6
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

Technical Problem

When measuring complex shape parts and surfaces of different materials, the accuracy of measuring product size is low. Traditional convolutional neural networks have poor ability to capture feature relationships, and they are unable to accurately locate key features of the product.

Method used

The visual transformation algorithm based on the bidirectional feature cascade module and the bidirectional attention fusion module is used to train the target visual transformation model. By obtaining the image data of the product to be tested, the coordinates of the points to be measured, and the point number is identified, and the product size is measured using geometric measurement strategies.

Benefits of technology

It improves the accuracy of measuring product size, meets the high-precision measurement needs of high-end manufacturing, and ensures the ability to capture features and positioning accuracy of key details in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904505B_ABST
    Figure CN119904505B_ABST
Patent Text Reader

Abstract

The present application discloses a size measurement method, device, equipment and storage medium, relating to the technical field of industrial measurement, including: obtaining current image data of a product to be measured, and determining the coordinates of the point to be measured corresponding to the current image data according to a target visual conversion model; performing point number identification on the point to be measured; when it is determined according to the identification result that there is no special point among the points to be measured, measuring the size of the product to be measured according to the coordinates of the point to be measured. By the above method, the coordinates of the point to be measured are determined according to the target visual conversion model trained by a visual transformation algorithm based on a newly added bidirectional feature cascade module and a bidirectional attention fusion module, and then whether there is a special point is judged according to the identification result of the point number. If not, the size of the product to be measured is measured based on a geometric measurement strategy, so as to effectively improve the accuracy of measuring the size of the product, meet the requirements of high-precision size measurement, and provide strong technical support for modern high-end manufacturing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial measurement technologies, and particularly to a dimension measurement method, device, equipment, and storage medium. Background Art

[0002] At present, with the booming development of high-end manufacturing, accurate measurement of product dimensions is a key link to ensure product quality and improve production efficiency. Currently, the common method for measuring product dimensions is non-contact measurement combining an optical measurement microscope and image analysis technology. However, existing image analysis algorithms still have many limitations when dealing with complex-shaped parts, different material surface characteristics, and high-precision measurement requirements. For example, traditional convolutional neural networks have poor ability to capture feature relationships and cannot accurately locate the key features of products, ultimately resulting in low accuracy in measuring product dimensions.

[0003] The above content is only used to assist in understanding the technical solution of this application and does not represent an admission that the above content is 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 accuracy in measuring product dimensions in the prior art.

[0005] To achieve the above purpose, this application proposes a dimension measurement method, which 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, where the target visual conversion model is trained based on a visual transformation algorithm with a newly added bidirectional feature cascade module and a bidirectional attention fusion module;

[0007] Identify the point numbers of the points to be measured;

[0008] When it is determined based on the recognition result that there are no special points among the points to be measured, measure the dimensions of the product to be measured based on a geometric measurement strategy according to the coordinates of the points to be measured.

[0009] In one embodiment, before 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, it further includes:

[0010] Obtain the original model training sample set, and equally divide the image data in the original model training sample set according to a preset specification;

[0011] Based on the self-attention module in the visual transformation algorithm, perform feature recognition on the divided image data blocks to obtain a preset number of image feature information;

[0012] Generate target three-dimensional image feature information based on the preset number of image feature information;

[0013] Based on the newly added bidirectional feature cascade module and bidirectional attention fusion module in the visual transformation algorithm, train a target visual conversion model according to the target three-dimensional image feature information.

[0014] In one embodiment, the step of generating target three-dimensional image feature information based on the preset number of image feature information includes:

[0015] Group the preset number of image feature information in a preset order;

[0016] Perform convolution operations on each group of image feature information through a target rule convolution module;

[0017] Reshape each piece of image feature information after the convolution operation to obtain target three-dimensional image feature information.

[0018] In one embodiment, the step of training a target visual conversion model based on the newly added bidirectional feature cascade module and bidirectional attention fusion module in the visual transformation algorithm according to the target three-dimensional image feature information includes:

[0019] Determine each group of bottom features and each group of top features according to the target three-dimensional image feature information;

[0020] Based on the newly added bidirectional feature cascade module in the visual transformation algorithm, perform feature fusion starting from each group of bottom features according to the bottom-up fusion strategy to obtain upper branch fusion features;

[0021] Based on the newly added bidirectional feature cascade module in the visual transformation algorithm, perform feature fusion starting from each group of top features according to the top-down fusion strategy to obtain lower branch fusion features;

[0022] Based on the newly added bidirectional attention fusion module in the visual transformation algorithm, train a target visual conversion model according to the upper branch fusion features and the lower branch fusion features.

[0023] In one embodiment, the step of training a target visual conversion model based on the newly added bidirectional attention fusion module in the visual transformation algorithm according to the upper branch fusion features and the lower branch fusion features includes:

[0024] Perform convolution operations on the upper branch fusion features and the lower branch fusion features respectively to obtain new upper branch fusion features and new lower branch fusion features;

[0025] Based on the newly added bidirectional attention fusion module in the visual transformation algorithm, multiply the fused features of the new upper branch and the fused features of the lower branch to obtain the first enhanced feature;

[0026] Based on the newly added bidirectional attention fusion module in the visual transformation algorithm, multiply the fused features of the new lower branch and the fused features of the upper branch to obtain the second enhanced feature;

[0027] Add the first enhanced feature and the second enhanced feature, and perform integration processing on the added enhanced features to obtain the target model training sample set;

[0028] Based on the preset adaptive optimization algorithm, train the target visual conversion model according to the target model training sample set.

[0029] In one embodiment, the step of obtaining the current image data of the product to be measured and determining the coordinates of the point to be measured corresponding to the current image data according to the target visual conversion model includes:

[0030] Obtain the current image data of the product to be measured, and encapsulate the current image data to obtain an image data packet;

[0031] Based on the target communication protocol, transmit the image data packet to the target artificial intelligence service device in the same network segment;

[0032] Receive the coordinate data packet inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the image data packet;

[0033] Parse the coordinate data packet to obtain the coordinates of the point to be measured corresponding to the current image data.

[0034] In one embodiment, after the step of identifying the point number of the point to be measured, the following steps are further included:

[0035] When it is determined that there are special points in the points to be measured according to the recognition result, determine the special point processing strategy according to the type of the special points in the points to be measured;

[0036] Preprocess the special points in the points to be measured according to the special point processing strategy, and update the points to be measured according to the processing result;

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

[0038] In addition, to achieve the above object, the present application also proposes a size measurement device, and the size measurement device includes:

[0039] 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 visual conversion model, where the target visual conversion model is trained by a visual transformation algorithm based on a newly added bidirectional feature cascade module and a bidirectional attention fusion module;

[0040] An identification module, configured to identify a point number of the point to be measured;

[0041] A measurement module, configured to, when it is determined according to the identification result that there is no special point in the point to be measured, measure dimensions of the product to be measured according to coordinates of the point to be measured based on a geometric measurement strategy.

[0042] In addition, to achieve the above object, the present application further provides a dimension measurement device, where the device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement steps of the dimension measurement method as described above.

[0043] In addition, to achieve the above object, the present application further provides a storage medium, where 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 a processor, steps of the dimension measurement method as described above are implemented.

[0044] One or more technical solutions provided by the present application have at least 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 visual conversion model, where the target visual conversion model is trained by a visual transformation algorithm based on a newly added bidirectional feature cascade module and a bidirectional attention fusion module; identifying a point number of the point to be measured; when it is determined according to the identification result that there is no special point in the point to be measured, measuring dimensions of the product to be measured according to coordinates of the point to be measured based on a geometric measurement strategy. By the above method, coordinates of a point to be measured are determined by a target visual conversion model trained by a visual transformation algorithm based on a newly added bidirectional feature cascade module and a bidirectional attention fusion module, and then whether there is a special point is judged according to the identification result of the point number. If not, dimensions of the product to be measured are measured based on a geometric measurement strategy, so that the accuracy of measuring product dimensions can be effectively improved, the requirement of high-precision dimension measurement can be met, and strong technical support can be provided for modern high-end manufacturing. Description of the Drawings

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

[0046] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying 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.

[0047] Figure 1 It is a schematic flowchart provided for the first embodiment of the dimension measurement method of the present application;

[0048] Figure 2 It is a schematic structural diagram of the bidirectional feature cascade module provided for the first embodiment of the dimension measurement method of the present application;

[0049] Figure 3 It is a schematic structural diagram of the bidirectional attention fusion module provided for the first embodiment of the dimension measurement method of the present application;

[0050] Figure 4 It is a schematic flowchart provided for the specific implementation of step S10 in the first embodiment of the dimension measurement method of the present application;

[0051] Figure 5 It is a schematic module structure diagram provided for the second embodiment of the dimension measurement device of the present application;

[0052] Figure 6 It is a schematic device structure diagram provided for the third embodiment of the dimension measurement device of the present application.

[0053] The realization of the purpose, functional features, and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. Specific Embodiments

[0054] 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 dimension measurement device, etc. that can implement the above functions. Hereinafter, taking the dimension measurement device as an example, this embodiment and the following embodiments will be described.

[0055] Based on this, the first embodiment of the present application provides a dimension measurement method, referring to Figure 1 , Figure 1 It is a schematic flowchart of the first embodiment of the dimension measurement method of the present application.

[0056] In this embodiment, the dimension measurement method includes steps S10 to S30:

[0057] Step S10: 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. The target visual conversion model is trained based on a visual transformation algorithm with an added bidirectional feature cascade module and a bidirectional attention fusion module.

[0058] It should be noted that the product to be measured refers to a product that requires ultra-precise and rapid size measurement. The product to be measured includes, but is 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 when the TWS earphones are charging in the 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.

[0059] It should be understood that the target visual conversion model refers to a coordinate conversion model that identifies and infers the points to be measured. Compared with the visual transformation algorithm used to train the conventional visual conversion model, the visual transformation algorithm used to train the target visual conversion model adds a bidirectional feature cascade module and a bidirectional attention fusion module, that is, it improves the original visual transformation (Vision Transformer, Vit) algorithm. Refer to Figure 2 , Figure 2 For the structural schematic diagram of the improved visual transformation algorithm, specifically: the dashed part indicates the modules included in the original visual transformation algorithm, and the implemented part indicates the newly added modules of the improved visual transformation algorithm, that is, the bidirectional feature cascade module and the bidirectional attention fusion module. The improved visual transformation algorithm has stronger generalization ability and can handle various complex measurement scenarios.

[0060] It can be understood that the bidirectional feature cascade module is used to fuse features bidirectionally, so that each group of three-dimensional image feature information can be fully utilized, strengthening the feature expression and further improving the ability to capture the features of the product to be measured in complex scenarios; the bidirectional attention fusion module is used to achieve precise focusing on the key feature areas, enhancing the positioning accuracy and efficiency of the algorithm for fuzzy or tiny points, and ensuring that no key details are missed. The addition of the bidirectional feature cascade module and the bidirectional attention fusion module makes the determined image features more comprehensive and accurate, providing a solid guarantee for high-precision measurement.

[0061] Furthermore, before the step of obtaining the 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 transformation model, it also includes: obtaining the original model training sample set, and equally dividing the image data in the original model training sample set according to preset specifications; performing feature recognition on the divided image data blocks based on the self-attention module in the visual transformation algorithm to obtain a preset number of image feature information; generating target three-dimensional image feature information based on the preset number of image feature information; and training the target visual transformation model based on the target three-dimensional image feature information based on the newly added bidirectional feature cascade module and bidirectional attention fusion module in the visual transformation algorithm.

[0062] It should be noted that after obtaining the original model training sample set, the image data in the original model training sample set is equally divided according to preset specifications. For example, the image data is divided into 16 image data blocks of equal size, each of which carries local information of the image. Then, the multi-head attention mechanism based on the self-attention module in the visual transformation algorithm is fully utilized, that is, feature recognition is performed on the divided image data blocks, one part of the attention is focused on capturing the texture feature changes within the image block, and the other part focuses on the boundary information between adjacent blocks, and so on. The long-distance feature dependency is fully mined, and finally 16 image feature information containing rich information is output.

[0063] It should be understood that the current image data of the product to be tested can be acquired at multiple angles and multiple viewing angles by the optical measuring device after the optical parameters are set. Specifically, if it is detected that the product to be tested is located on the high-precision measuring platform of the optical measuring device, the basic attribute data of the product to be tested is obtained through the human-computer interaction interface. At this time, an optical parameter setting program is generated according to the basic attribute data. The optical parameters of the optical measuring device are set by automatically running the optical parameter setting program to ensure uniform illumination, precise focal length, and adapted aperture, so as to obtain high-quality current image data. The basic attribute data includes but is not limited to shape, surface characteristics, etc. The optical measuring device may be an optical measuring microscope (OMM). Setting the optical parameters of the optical measuring device includes but is not limited to focal length, aperture, illumination intensity, and angle, etc., can significantly enhance the flexibility and adaptability of measuring dimensions.

[0064] Furthermore, the step of generating target three-dimensional image feature information based on the preset number of image feature information includes: grouping the preset number of image feature information in a preset order; performing a convolution operation on each group of image feature information through a convolution module of a target rule; and reshaping each image feature information after the convolution operation to obtain the target three-dimensional image feature information.

[0065] It can be understood that, in order to enable the image feature information to adapt to the subsequent complex feature fusion and processing processes and enhance the expression ability of the features, a two-dimensional to three-dimensional conversion is required. The preset order can be the order of collecting each sample in the original model training sample set. The target rule of the convolutional module can be 1*1. Each image feature information after the convolutional operation is two-dimensional. At this time, each image feature information after the convolutional operation is converted into the target three-dimensional image feature information in a reshaping manner.

[0066] Further, the step of training the target visual transformation model according to the target three-dimensional image feature information by using the newly added bidirectional feature cascading module and bidirectional attention fusion module in the visual transformation algorithm includes: determining each group of bottom features and each group of top features according to the target three-dimensional image feature information; based on the newly added bidirectional feature cascading module in the visual transformation algorithm, starting from each group of bottom features, performing feature fusion according to the bottom-up fusion strategy to obtain the upper branch fusion features; based on the newly added bidirectional feature cascading module in the visual transformation algorithm, starting from each group of top features, performing feature fusion according to the top-down fusion strategy to obtain the lower branch fusion features; based on the newly added bidirectional attention fusion module in the visual transformation algorithm, training the target visual transformation model according to the upper branch fusion features and the lower branch fusion features.

[0067] It should be understood that when the preset number of the image feature information is 16, the target three-dimensional image feature information is divided into 4 groups, and each group of three-dimensional image feature information includes bottom features and top features, that is, each group of bottom features and each group of top features. Refer to Figure 2 , Figure 2 is a structural schematic diagram of the bidirectional feature cascading module, including multiple fusion modules. Specifically, based on the newly added bidirectional feature cascading module in the visual transformation algorithm, starting from each group of bottom features according to the bottom-up fusion strategy, the adjacent two features are sequentially fused. The specific fusion method is to splice and then perform feature compression and refinement through a small convolutional neural network, so that the local features at the bottom are gradually transmitted upward and fused to obtain the upper branch fusion features. Similarly, based on the newly added bidirectional feature cascading module in the visual transformation algorithm, starting from each group of top features according to the top-down fusion strategy, the above-mentioned fusion process is executed in reverse, so that the local features at the top penetrate downward and are integrated to obtain the lower branch fusion features. Through this bidirectional feature fusion, each group of three-dimensional image feature information can be fully utilized, the feature expression is strengthened, and the ability to capture the features of the product to be measured in a complex scene is further improved.

[0068] Further, the steps of training the target visual transformation model according to the newly added bidirectional attention fusion module in the visual transformation algorithm, including: performing convolution operations on the upper-branch fusion feature and the lower-branch fusion feature respectively to obtain a new upper-branch fusion feature and a new lower-branch fusion feature; multiplying the new upper-branch fusion feature and the lower-branch fusion feature based on the newly added bidirectional attention fusion module in the visual transformation algorithm to obtain a first enhanced feature; multiplying the new lower-branch fusion feature and the upper-branch fusion feature based on the newly added bidirectional attention fusion module in the visual transformation algorithm to obtain a second enhanced feature; adding the first enhanced feature and the second enhanced feature, and integrating the added enhanced features to obtain a target model training sample set; training the target visual transformation model according to the target model training sample set based on a preset adaptive optimization algorithm.

[0069] It can be understood that after obtaining the branch fusion feature and the lower-branch fusion feature, convolution operations are performed on the branch fusion feature and the lower-branch fusion feature to obtain new fusion features, namely the new upper-branch fusion feature and the new lower-branch fusion feature. Refer to Figure 3 , Figure 3 is a schematic structural diagram of the bidirectional attention fusion module, including multiple convolutional layers. In order to make the information interaction between the upper and lower layer features more sufficient, feature multiplication is performed in a cross-multiplication manner, specifically multiplying the new upper-branch fusion feature and the lower-branch fusion feature, and multiplying the new lower-branch fusion feature and the upper-branch fusion feature. In order to effectively improve the richness of features, it is also necessary to add the first enhanced feature obtained by multiplication to the first enhanced feature, then integrate the added enhanced features through a convolutional layer, and output the target model training sample set to the prediction head Head, so as to achieve precise focusing on the key feature area, enhance the positioning accuracy and efficiency of the algorithm for fuzzy or tiny points, and ensure that key details are not missed.

[0070] It should be noted that after being processed by the visual transformation algorithm with the newly added bidirectional feature cascade module and the bidirectional attention fusion module, a target model training sample set is obtained. At this time, based on a preset adaptive optimization algorithm, the target visual transformation model is trained according to the target model training sample set. This preset adaptive optimization algorithm can be the adaptive moment estimation optimization algorithm, and the cross-entropy loss function can also be used to calculate the loss value between the predicted value and the true value of the target visual transformation model, and the target visual transformation model is verified and trained based on the target model validation sample set until the loss value converges to a preset value.

[0071] Step S20, perform point number recognition on the to-be-detected point.

[0072] It can be understood that, in order to effectively improve the accuracy of measuring the size of a product, it is necessary to identify the point numbers of the points to be measured to determine whether there are special points among the points to be measured. 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. For each point to be measured, there is a point number, and this point number can characterize the characteristics of this point. For example, when a special point number is identified, it indicates that the point corresponding to this point number is a special point, that is, there is a special point among the points to be measured.

[0073] Further, after step S20, it further includes: when it is determined that there are special points among the points to be measured according to the recognition result, determining a special point processing strategy according to the type of the special points in the points to be measured; 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 result; 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.

[0074] It should be understood that the special point processing strategy refers to a processing strategy for accurately determining the position of special points. When it is determined that there are special points among the points to be measured according to the recognition result, a special point processing strategy is determined according to the type of the special points in the points to be measured. For different types of special points, the corresponding special point processing strategies are different. For example, for cusp points, the special point processing strategy is: performing binaryzation processing on the image data at the position of the special point by using the regression binaryzation strategy, and then calculating the change rate of the image gradient, converting the problem of determining the cusp point position into a mathematical problem of finding the maximum value of the gradient change rate. For extreme points of arcs, extracting the skeleton line of the arc image data through the skeleton line extraction strategy, and then using the Euclidean geometric principle to calculate the distances from each point on the arc to the center of the circle, converting the problem of determining the extreme points into a mathematical problem of solving the maximum and minimum values of the distances. For the above transformed problems, constructing an optimal solution solving model, such as a conjugate gradient model, a Fermat point model, etc., and continuously adjusting the model parameters through learning and optimization of a large amount of sample data to improve the accuracy and stability of determining the position of special points.

[0075] It can be understood that after accurately obtaining the position of the special point through preprocessing, updating the points to be measured according to the position of this special point. At this time, the coordinates of the updated points to be measured are all accurate, and then measuring the size of the product to be measured based on the geometric measurement strategy, so as to effectively improve the accuracy of measuring the size of the product.

[0076] Step S30, when it is determined that there are no special points among the points to be measured according to the recognition result, measuring the size of the product to be measured based on the geometric measurement strategy according to the coordinates of the points to be measured.

[0077] It should be understood that the geometric measurement strategy refers to the strategy of measuring various dimensions of a product according to a geometric measurement algorithm. The dimensions include but are not limited to length, width, diameter, and angle, etc. When it is determined that there are no special points in the points to be measured according to the recognition result, the dimension measurement is directly based on the geometric measurement strategy. For products to be measured with different features, different geometric measurement strategies are used. For example, for a feature recognized as a straight line, the length of the product to be measured is obtained by calculating the distance between two endpoints; for a feature recognized as a circle, the diameter of the product to be measured is obtained by calculating the radius; for a component with a complex shape, it is decomposed into multiple simple geometric shapes for segmented calculation, and then the calculation results of each part are integrated to obtain the dimensions of the product to be measured. For example, an arch is split into a rectangle and an arc. Thus, high-precision dimension measurement is achieved, ensuring compliance with the stringent standards of high-end manufacturing. And it shortens the measurement cycle, efficiently meeting the rigid demand for large-scale and rapid measurement in modern industry, injecting strong impetus into the leap of enterprise production efficiency.

[0078] 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 visual transformation model. Among them, the target visual transformation model is trained based on a visual transformation algorithm with a newly added bidirectional feature cascade module and a bidirectional attention fusion module; the point numbers of the points to be measured are identified; when it is determined according to the recognition result that there are no special points in the points to be measured, based on the geometric measurement strategy, the dimensions of the product to be measured are measured according to the coordinates of the points to be measured. In the above manner, the coordinates of the points to be measured are determined by the target visual transformation model trained based on the visual transformation algorithm with the newly added bidirectional feature cascade module and the bidirectional attention fusion module, and then it is judged whether there are special points according to the recognition result of the point numbers. If not, the dimensions of the product to be measured are measured based on the geometric measurement strategy, so as to effectively improve the accuracy of measuring the product dimensions, meet the requirements of high-precision dimension measurement, and provide strong technical support for modern high-end manufacturing.

[0079] 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 and 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:

[0080] Step S101, obtain the current image data of the product to be measured, and encapsulate the current image data to obtain an image data packet.

[0081] It should be noted that in order to effectively improve the data transmission efficiency, after obtaining the current image data of the product to be measured, the current image data is encapsulated into an image data packet and the data packet is transmitted.

[0082] Step S102: Based on the target communication protocol, transmit the image data packet to the target artificial intelligence service device in the same network segment.

[0083] It can be understood that the target communication protocol can be the TCP / IP protocol. Before transmitting the image data packet, it is necessary to configure network parameters, install communication drivers and software interfaces to ensure stable and reliable network connection with the target artificial intelligence service device and the transmission delay is within an acceptable range. Then, based on the target communication protocol, the image data packet is transmitted to the target artificial intelligence service device in the same network segment at a high-speed data transmission mode. The target artificial intelligence service device can be an AI server.

[0084] It should be noted that for the target artificial intelligence service device, after receiving the image data packet, it first needs to be parsed, then the current image data is labeled based on the target image annotation tool, the labels labeled on the parsed image data are format-converted according to the data format supported by the target visual conversion model, the converted labels are encoded, the associated current data is cropped, the encoded labels are associated with the current image data, and a series of operations are performed to obtain the target associated data. Then, the deployed target visual conversion model is started, and the target associated data is input into the target visual conversion model. The target visual conversion model quickly locks the key features of the product to be measured and infers the coordinates of the point to be measured. Similarly, the coordinates of the point to be measured also need to be encapsulated into a coordinate data packet to improve the transmission efficiency.

[0085] Step S103: Receive the coordinate data packet inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the image data packet.

[0086] It should be understood that for the target artificial intelligence service device, after inferring the coordinates of the point to be measured and encapsulating the coordinates of the point to be measured into a coordinate data packet, the coordinate data packet will be fed back to the dimension measurement device, that is, receive the coordinate data packet fed back by the target artificial intelligence service device.

[0087] Step S104: Parse the coordinate data packet to obtain the coordinates of the point to be measured corresponding to the current image data.

[0088] It can be understood that after receiving the coordinate data packet fed back by the target artificial intelligence service device, the coordinate data packet is parsed to obtain the coordinates of the point to be measured corresponding to the current image data. At this time, the mouse will also be driven to move to the coordinates of the point to be measured and simulate a click operation to achieve precise positioning of the point to be measured and provide precise guidance for subsequent dimension measurement.

[0089] In this embodiment, the current image data is encapsulated to obtain an image data packet; based on the target communication protocol, the image data packet is transmitted to a target artificial intelligence service device in the same network segment; the coordinate data packet inferred and fed back by the target artificial intelligence service device according to the target visual conversion model and the image data packet is received; and the coordinate data packet is parsed to obtain the coordinates of the point to be measured corresponding to the current image data. By the above method, after the current image data is encapsulated into an image data packet, the image data packet is transmitted to a target artificial intelligence service device in the same network segment based on the target communication protocol, and the target artificial intelligence service device processes the image data in the image data packet and infers the coordinates of the point to be measured corresponding to the current image data according to the target visual conversion model, so as to effectively improve the accuracy of obtaining the coordinates of the point to be measured, and further provide accurate guidance for subsequent dimension measurement.

[0090] Embodiment 2 of this application provides a dimension measurement device. Please refer to Figure 5 , the dimension measurement device includes:

[0091] A determination module 10, 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, where the target visual conversion model is trained based on a visual transformation algorithm with an added bidirectional feature cascade module and a bidirectional attention fusion module.

[0092] An identification module 20, configured to perform point number identification on the point to be measured.

[0093] A measurement module 30, configured to, when it is determined according to the recognition result that there are no special points in the points to be measured, measure the size of the product to be measured according to the coordinates of the points to be measured based on a geometric measurement strategy.

[0094] In this embodiment, the current image data of the product to be measured is obtained, the coordinates of the point to be measured corresponding to the current image data are determined according to the target visual conversion model, where the target visual conversion model is trained based on a visual transformation algorithm with an added bidirectional feature cascade module and a bidirectional attention fusion module; point number identification is performed on the point to be measured; when it is determined according to the recognition result that there are no special points in the points to be measured, the size of the product to be measured is measured according to the coordinates of the points to be measured based on a geometric measurement strategy. By the above method, the coordinates of the point to be measured are determined by the target visual conversion model trained based on the visual transformation algorithm with an added bidirectional feature cascade module and a bidirectional attention fusion module, and then whether there are special points is judged according to the recognition result of the point number. If not, the size of the product to be measured is measured based on the geometric measurement strategy, so as to effectively improve the accuracy of measuring the size of the product, meet the requirements of high-precision dimension measurement, and provide strong technical support for modern high-end manufacturing.

[0095] The dimensional measurement device provided in the second embodiment of the present application adopts the dimensional measurement method in the first embodiment above, and can solve the technical problem of low accuracy in measuring the dimensions of products in the prior art. Compared with the prior art, the beneficial effects of the dimensional measurement device provided in the second embodiment of the present application are the same as those of the dimensional measurement method provided in the above embodiment, and other technical features in the dimensional measurement device are the same as those disclosed in the first embodiment above, and will not be elaborated here.

[0096] In one embodiment, the determination module 10 is further configured to obtain current image data of the product to be measured, encapsulate the current image data to obtain an image data packet; based on a target communication protocol, transmit the image data packet to a target artificial intelligence service device in the same network segment; receive a coordinate data packet inferred and fed back by the target artificial intelligence service device according to a target vision conversion model and the image data packet; and parse the coordinate data packet to obtain the coordinates of the point to be measured corresponding to the current image data.

[0097] In one embodiment, the determination module 10 is further configured to obtain an original model training sample set, equally divide the image data in the original model training sample set according to a preset specification; perform feature recognition on the divided image data blocks based on the self-attention module in the vision transformation algorithm to obtain a preset number of image feature information; generate target three-dimensional image feature information according to the preset number of image feature information; and train a target vision conversion model based on the newly added bidirectional feature cascade module and bidirectional attention fusion module in the vision transformation algorithm according to the target three-dimensional image feature information.

[0098] In one embodiment, the determination module 10 is further configured to group the preset number of image feature information in a preset order; perform convolution operations on each group of image feature information through a convolutional module with a target rule; and reshape each group of image feature information after the convolution operation to obtain target three-dimensional image feature information.

[0099] In one embodiment, the determination module 10 is further configured to determine bottom features and top features of each group according to the target three-dimensional image feature information; perform feature fusion starting from the bottom features of each group according to a bottom-up fusion strategy based on the newly added bidirectional feature cascade module in the vision transformation algorithm to obtain an upper branch fusion feature; perform feature fusion starting from the top features of each group according to a top-down fusion strategy based on the newly added bidirectional feature cascade module in the vision transformation algorithm to obtain a lower branch fusion feature; and train a target vision conversion model based on the upper branch fusion feature and the lower branch fusion feature based on the newly added bidirectional attention fusion module in the vision transformation algorithm.

[0100] In one embodiment, the determining module 10 is further configured to perform convolution operations on the upper branch fusion feature and the lower branch fusion feature respectively to obtain a new upper branch fusion feature and a new lower branch fusion feature; based on the newly added bidirectional attention fusion module in the vision transformation algorithm, multiply the new upper branch fusion feature and the lower branch fusion feature to obtain a first enhanced feature; based on the newly added bidirectional attention fusion module in the vision transformation algorithm, multiply the new lower branch fusion feature and the upper branch fusion feature to obtain a second enhanced feature; add the first enhanced feature and the second enhanced feature, and perform integration processing on the added enhanced features to obtain a target model training sample set; based on a preset adaptive optimization algorithm, train a target vision transformation model according to the target model training sample set.

[0101] In one embodiment, the recognition module 20 is further configured to, when determining that there is a special point in the to-be-measured point according to the recognition result, determine a special point processing strategy according to the type of the special point in the to-be-measured point; preprocess the special point in the to-be-measured point according to the special point processing strategy, and update the to-be-measured point according to the processing result; based on a geometric measurement strategy, measure the size of the to-be-measured product according to the coordinates of the updated to-be-measured point.

[0102] Embodiment 3 of the present application provides a size measurement 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 to enable the at least one processor to execute the size measurement method in Embodiment 1 above.

[0103] The following refers to Figure 6 , which shows a schematic structural diagram of a size measurement device suitable for implementing Embodiment 3 of the present application. The size measurement 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), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The size measurement device shown is only an example and should not impose any limitation on the functions and usage scope of Embodiment 3 of the present application.

[0104] As Figure 6As shown, the dimension measurement 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 measurement 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 measurement device to communicate with other devices wirelessly or wiredly to exchange data. Although the dimension measurement device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be implemented or had alternatively.

[0105] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts may be implemented as computer software programs. The computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the 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 methods of the disclosed embodiments of the present application are executed.

[0106] 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 of relatively low accuracy in measuring the dimensions of products in the prior art. 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 above embodiment, and other technical features in this dimension measurement device are the same as those disclosed in the previous first embodiment, and will not be elaborated here.

[0107] It should be understood that each part disclosed in the present application may be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in a suitable manner in any one or more embodiments or examples.

[0108] As described above, this 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 within the technical scope disclosed in the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claimed rights.

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

[0110] The computer-readable storage medium provided by the present application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination of the above. More specific examples of the computer-readable storage medium may 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, and this program can be used by or in combination with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0111] The above computer-readable storage medium can be included in the dimension measurement device; it can also exist independently and not be assembled into the dimension measurement device.

[0112] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned 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 kind of network, including a local area network (LAN: Local Area Network) or a wide area network (WAN: Wide Area Network), or it can be connected to an external computer (for example, by connecting through an Internet service provider via the Internet).

[0113] 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 this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks can actually be executed substantially in parallel, and they can 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, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0114] The modules described in the embodiments of this 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.

[0115] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned dimension measurement method, and can solve the technical problem of low accuracy in measuring the dimensions of products in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the dimension measurement method provided in the first embodiment above, and will not be elaborated here.

[0116] The above are only some embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or any direct / indirect application in other related technical fields is 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 transformation model; Identifying the point numbers of the points to be measured; When it is determined according to the recognition result that there are no special points in the points to be measured, based on the geometric measurement strategy, measuring the size of the product to be measured according to the coordinates of the points to be measured, where the special points include cusp points, intersection points, arc extreme points, points with large die differences, and points with unstable position widths of the sealant lines; Before the step of 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 transformation model, it further includes: Determining each group of bottom features and each group of top features according to the target three-dimensional image feature information; Based on the newly added bidirectional feature cascading module in the visual transformation algorithm, performing feature fusion starting from each group of bottom features according to the bottom-up fusion strategy to obtain the upper branch fusion feature; Based on the newly added bidirectional feature cascading module in the visual transformation algorithm, performing feature fusion starting from each group of top features according to the top-down fusion strategy to obtain the lower branch fusion feature; Performing convolution operations on the upper branch fusion feature and the lower branch fusion feature respectively to obtain a new upper branch fusion feature and a new lower branch fusion feature; Based on the newly added bidirectional attention fusion module in the visual transformation algorithm, multiplying the new upper branch fusion feature and the lower branch fusion feature to obtain a first enhanced feature; Based on the newly added bidirectional attention fusion module in the visual transformation algorithm, multiplying the new lower branch fusion feature and the upper branch fusion feature to obtain a second enhanced feature; Determining a target model training sample set according to the first enhanced feature and the second enhanced feature; Training the target visual transformation model based on the preset adaptive optimization algorithm according to the target model training sample set.

2. The method according to claim 1, characterized in that Before the step of determining each group of bottom features and each group of top features according to the target three-dimensional image feature information, it further includes: Obtaining an original model training sample set, and equally dividing the image data in the original model training sample set according to a preset specification; Performing feature recognition on the divided image data blocks based on the self-attention module in the visual transformation algorithm to obtain a preset number of image feature information; Generating target three-dimensional image feature information according to the preset number of image feature information.

3. The method according to claim 2, characterized in that, The step of generating target three-dimensional image feature information according to the preset number of image feature information includes: Grouping the preset number of image feature information in a preset order; Performing convolution operations on each group of image feature information through a convolutional module with a target rule; Reshaping each image feature information after the convolution operation to obtain target three-dimensional image feature information.

4. The method according to claim 1, wherein The step of determining a target model training sample set according to the first enhanced feature and the second enhanced feature includes: Adding the first enhanced feature and the second enhanced feature, and performing integration processing on the added enhanced features to obtain a target model training sample set.

5. The method according to claim 1, characterized in that The steps 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 vision conversion model include: Obtain the current image data of the product to be measured, and encapsulate the current image data to obtain an image data packet; Based on the target communication protocol, transmit the image data packet to the target artificial intelligence service device in the same network segment; Receive the coordinate data packet inferred and fed back by the target artificial intelligence service device according to the target vision conversion model and the image data packet; Analyze the coordinate data packet to obtain the coordinates of the points to be measured corresponding to the current image data.

6. The method according to claim 1, wherein After the step of identifying the point numbers of the points to be measured, it further includes: When it is determined according to the identification result that there are special points in the points to be measured, determine the special point processing strategy according to the type of the special points in the points to be measured; Preprocess the special points in the points to be measured according to the special point processing strategy, and update the points to be measured according to the processing result; 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.

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 points to be measured corresponding to the current image data according to the target vision conversion model; An identification module, configured to identify the point numbers of the points to be measured; A measurement module, configured to, when it is determined according to the identification result that there are no special points in the points to be measured, measure the size of the product to be measured based on the geometric measurement strategy according to the coordinates of the points to be measured, where the special points include cusp points, intersection points, extreme points of arcs, large die differences, and points with unstable position widths of sealing lines; The determination module is further configured to determine each group of bottom features and each group of top features according to the target three-dimensional image feature information; based on the newly added bidirectional feature cascading module in the vision transformation algorithm, perform feature fusion starting from each group of bottom features according to the bottom-up fusion strategy to obtain the upper branch fusion feature; based on the newly added bidirectional feature cascading module in the vision transformation algorithm, perform feature fusion starting from each group of top features according to the top-down fusion strategy to obtain the lower branch fusion feature; perform convolution operations on the upper branch fusion feature and the lower branch fusion feature respectively to obtain a new upper branch fusion feature and a new lower branch fusion feature; based on the newly added bidirectional attention fusion module in the vision transformation algorithm, multiply the new upper branch fusion feature and the lower branch fusion feature to obtain a first enhanced feature; based on the newly added bidirectional attention fusion module in the vision transformation algorithm, multiply the new lower branch fusion feature and the upper branch fusion feature to obtain a second enhanced feature; determine the target model training sample set according to the first enhanced feature and the second enhanced feature; and train the target vision conversion model according to the target model training sample set based on the preset adaptive optimization algorithm.

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, the computer program being configured to implement the steps of the dimensional 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, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the dimensional measurement method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Paper-plastic composite bag surface defect detection method and system based on machine vision

    CN115294061A

  • Production monitoring equipment for radio frequency filter and monitoring method thereof

    CN116665134A