Standard part size measurement error compensation method, device, equipment and medium
By adjusting the single pixel accuracy and calculating the error compensation value, the problem of low accuracy of the existing measurement system is solved, and the measurement accuracy and repeatability accuracy are significantly improved.
Patent Information
- Application Number
- CN202411671024.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-11
AI Technical Summary
The existing measurement systems formed by parallel surface light sources and telecentric lenses have the problem of insufficient measurement accuracy in practical applications.
By obtaining the initial value of single pixel accuracy, determining the compensation value of single pixel accuracy based on the measured size values in multiple captured images, the single pixel accuracy is adjusted, and the error compensation value of each measurement point is calculated.
It effectively reduces the measurement error during the measurement of standard parts size, significantly improves the measurement accuracy and repeatability accuracy, and meets the user's usage needs.
Smart Images

Figure CN119594922A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of dimension measurement technology, and in particular to a method, device, equipment and medium for compensating for dimension measurement errors of standard parts. Background Art
[0002] At present, compared with traditional dimensional measurement methods, visual measurement has the advantages of non-contact, high efficiency, and non-destructiveness. It is becoming more and more widely used in industries such as lithium battery equipment.
[0003] In the related art, a parallel light source and a telecentric lens are usually used as a measurement system. However, in actual applications, it is found that the current measurement system formed by a parallel light source and a telecentric lens often has the defect that the measurement accuracy still cannot meet the requirements.
[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0005] The embodiments of the present application provide a method, device, equipment and medium for compensating standard part size measurement errors, which can effectively reduce the measurement errors in the standard part size measurement process, significantly improve the measurement accuracy and repeatability, and thus effectively meet the user's usage needs.
[0006] On the one hand, an embodiment of the present application provides a method for compensating for standard part size measurement errors, comprising the following steps:
[0007] Get the initial value of single pixel precision;
[0008] Acquire a plurality of first captured images to determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, thereby adjusting the single pixel precision according to the compensation value of the single pixel precision;
[0009] A plurality of second photographed images are reacquired to determine an error compensation value for the standard component dimension measurement according to a measured dimension value in each of the second photographed images.
[0010] Optionally, acquiring a plurality of first captured images to determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, thereby adjusting the single pixel precision according to the compensation value of the single pixel precision, includes:
[0011] Acquire a plurality of first captured images, and determine the measured dimension values of all the measuring points in each of the first captured images;
[0012] Determine the maximum and minimum values of the differences between the measured size value and the standard size value of each measuring point in all the first captured images, so as to determine the extreme difference value of each measuring point;
[0013] Determine a compensation value of single pixel accuracy of each measuring point according to the extreme difference value and pixel size of each measuring point;
[0014] Calculating an average value of the compensation value with single pixel precision of all the measuring points to obtain the compensation value with single pixel precision;
[0015] The single pixel precision is adjusted according to the compensation value of the single pixel precision.
[0016] Optionally, after adjusting the single pixel precision according to the compensation value of the single pixel precision, the method further includes:
[0017] Return to the step of acquiring multiple first captured images and determining the measured size values of all measurement points in each of the first captured images, until the number of iterative adjustments of the compensation value of the single-pixel precision meets the first preset threshold, and determine the current single-pixel precision.
[0018] Optionally, the reacquisition of the plurality of second photographed images to determine the error compensation value of the standard component size measurement according to the measured size value in each of the second photographed images includes:
[0019] Reacquiring a plurality of second captured images, and determining the measured dimension values of all the measuring points in each of the second captured images;
[0020] Determine the maximum and minimum values of the differences between the measured size value and the standard size value of each measuring point in all the first captured images;
[0021] The error compensation value of each measuring point is calculated according to the maximum value and the minimum value of the difference between the measured dimension value of each measuring point and the standard dimension value.
[0022] Optionally, the calculation formula for calculating the error compensation value of each measuring point according to the maximum and minimum values of the difference between the measured dimension value of each measuring point and the standard dimension value is:
[0023]
[0024] Wherein, ΔA is the error compensation value of each measuring point; Max k The maximum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point; Min k It is the minimum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point.
[0025] Optionally, the first captured image and the second captured image are captured by a measuring machine;
[0026] The measuring machine comprises an area array camera, a high-beam lens and a surface light source.
[0027] Optionally, the first captured image and the second captured image are captured by an industrial lens.
[0028] On the other hand, an embodiment of the present application provides a device for compensating for standard part size measurement errors, the device comprising:
[0029] The precision acquisition module is used to obtain the initial value of single pixel precision;
[0030] A precision adjustment module, used for acquiring a plurality of first captured images, determining a compensation value of single pixel precision according to a measured size value in each of the first captured images, and adjusting the single pixel precision according to the compensation value of the single pixel precision;
[0031] The compensation acquisition module is used to reacquire a plurality of second captured images to determine an error compensation value of the standard part size measurement according to the measured size value in each of the second captured images.
[0032] On the other hand, an embodiment of the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above-mentioned standard part size measurement error compensation method when executing the computer program.
[0033] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned standard part size measurement error compensation method is implemented.
[0034] The embodiment of the present application obtains a compensation value of single-pixel precision, then corrects the single-pixel precision, improves the accuracy of single-pixel precision, and calculates the error compensation value of each measurement point based on the corrected single-pixel precision. This can effectively reduce the measurement error in the process of standard part size measurement, significantly improve the measurement accuracy and repeatability accuracy, thereby effectively meeting the user's usage needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a schematic diagram of an implementation environment of a standard part size measurement error compensation method provided in an embodiment of the present application;
[0036] Figure 2 It is a flow chart of a method for compensating standard part size measurement errors provided in an embodiment of the present application;
[0037] Figure 3 It is a schematic diagram of a process for correcting and adjusting single pixel precision provided in an embodiment of the present application;
[0038] Figure 4is a schematic diagram of a process for determining an error compensation value provided by an embodiment of the present application;
[0039] Figure 5 It is a structural schematic diagram of a standard part size measurement error compensation device provided in an embodiment of the present application;
[0040] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0042] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0043] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0045] At present, compared with traditional dimensional measurement methods, visual measurement has the advantages of non-contact, high efficiency, and non-destructiveness. It is becoming more and more widely used in industries such as lithium battery equipment.
[0046] In the related art, a parallel light source and a telecentric lens are usually used as a measurement system. However, in actual applications, it is found that the current measurement system formed by a parallel light source and a telecentric lens often has the defect that the measurement accuracy still cannot meet the requirements.
[0047] In view of this, a method, device, equipment and medium for compensating for standard part size measurement errors are provided in the embodiments of the present application. By obtaining a compensation value of single-pixel precision, and then correcting the single-pixel precision, the accuracy of the single-pixel precision is improved, and the error compensation value of each measuring point is calculated based on the corrected single-pixel precision, the measurement error in the standard part size measurement process can be effectively reduced, and the measurement accuracy and repeatability accuracy can be significantly improved, thereby effectively meeting the user's usage needs.
[0048] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. First, a standard part size measurement error compensation method provided in the embodiment of the present application is described in conjunction with the accompanying drawings.
[0049] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment of a standard part dimension measurement error compensation method provided in an embodiment of the present application. In the implementation environment, the main software and hardware entities involved include a terminal processor 110 and a server 120.
[0050] Specifically, a control program of a related standard part size measurement error compensation method may be installed in the terminal processor 110, and the server 120 is a background server of the control program. The terminal processor 110 and the background server 120 are connected in communication. The standard part size measurement error compensation method provided in the embodiment of the present application can be executed on the terminal processor 110 side.
[0051] Server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0052] In addition, the server 120 may also be a node server in the blockchain network.
[0053] The terminal processor 110 and the server 120 may establish a communication connection through a wireless network. The wireless network uses standard communication technology and / or protocols, and the network may be set to the Internet, or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, or any combination of a wireless network, a private network, or a virtual private network. Moreover, the above-mentioned software and hardware entities may use the same communication connection mode or different communication connection modes, and this application does not impose any specific restrictions on this.
[0054] Of course, it is understandable that Figure 1 The implementation environment in the embodiment of the present application is only some optional application scenarios of the standard part size measurement error compensation method provided in the embodiment of the present application, and the actual application is not fixed. Figure 1 The software and hardware environment shown is not specifically limited in this application.
[0055] like Figure 2 As shown, Figure 2 It is a flowchart of a method for compensating standard part size measurement errors provided in an embodiment of the present application, which specifically includes but is not limited to steps S100 to S300.
[0056] Step S100: Obtain an initial value of single-pixel precision.
[0057] In the embodiment of the present application, the single-pixel precision reflects the actual physical size represented by each pixel in the image. By acquiring the physical size and pixel size of the object in the image, the initial value of the single-pixel precision can be calculated.
[0058] For example, the physical size of object A is measured to be 50 mm, and the pixel size is 1920 pixels, then the initial value of the single pixel accuracy can be calculated to be 50 / 1920=0.026 mm / pixel.
[0059] Therefore, in the subsequent measurement process, after measuring the measurement values of different measurement points, the measurement value can be multiplied by the single pixel accuracy to obtain the measurement size value corresponding to the measurement point. For example, the measurement value of point A is 800 pixels, the measurement value of point B is 1200 pixels, and the single pixel accuracy is 0.05mm / pixel, then the measurement size value of point A can be quickly calculated to be 40mm and the measurement size value of point B is 60mm.
[0060] In practical applications, before obtaining the initial value of single-pixel accuracy, relevant preparatory work such as standard part preparation and measurement algorithm preparation can also be implemented. Specifically, the coordinate system for standard part size measurement can be determined first, that is, determine which two sides of the standard part are used to establish the measurement coordinate system OXY, determine the X-axis, Y-axis and coordinate origin, and further obtain standard measurement values based on different measurement points in the measurement coordinate system.
[0061] For example, when measuring the diameter value of a battery standard part, any vertex of the battery's longitudinal section can be selected as the coordinate origin, and the length and width intersecting at the vertex can be used as the X-axis and Y-axis. The standard measurement values of different measuring points relative to the coordinate origin can be determined based on the product parameter information provided by the manufacturer (such as shoulder height and diameter), and a data table of standard size values of standard parts can be generated for quick reference during subsequent measurement error compensation operations.
[0062] Furthermore, when preparing the measurement algorithm in the visual measurement process, based on the determined measurement coordinate system, the target edge can be captured in the captured image through the visual recognition algorithm to obtain the X-axis edge and the Y-axis edge, and the intersection of the X-axis edge and the Y-axis edge can be calculated to obtain the coordinate origin, and then the position of each measurement point on the image is determined according to the X-axis, Y-axis and the coordinate origin on the image, and then the pixel size of each measurement point is calculated, and the physical size of each measurement point, that is, the measured size value, is calculated based on the pixel size of each measurement point and the single-pixel accuracy.
[0063] Step S200: Acquire a plurality of first captured images to determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, thereby adjusting the single pixel precision according to the compensation value of the single pixel precision.
[0064] In an embodiment of the present application, standard parts can be randomly placed in different positions for photographing, so as to obtain multiple first photographed images, and the positions of all measurement points in each first photographed image can be measured by a pre-set measurement algorithm, and then the measured dimension value in the first photographed image can be determined, and based on the difference between the measured dimension value and the pre-determined standard dimension value, the compensation value of the single-pixel accuracy can be determined, and the single-pixel accuracy can be corrected and adjusted.
[0065] It is understandable that by improving the accuracy of single-pixel precision, the error in the standard part size measurement process can also be effectively reduced.
[0066] Specifically, as an optional implementation, please refer to Figure 3 , Figure 3: is a flow chart of correcting and adjusting single pixel precision provided by an embodiment of the present application, wherein the step of acquiring a plurality of first captured images to determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, and adjusting the single pixel precision according to the compensation value of the single pixel precision, comprises:
[0067] Acquire a plurality of first captured images, and determine the measured dimension values of all the measuring points in each of the first captured images;
[0068] Determine the maximum and minimum values of the differences between the measured size value and the standard size value of each measuring point in all the first captured images, so as to determine the extreme difference value of each measuring point;
[0069] Determine a compensation value of single pixel accuracy of each measuring point according to the extreme difference value and pixel size of each measuring point;
[0070] Calculating an average value of the compensation value with single pixel precision of all the measuring points to obtain the compensation value with single pixel precision;
[0071] The single pixel precision is adjusted according to the compensation value of the single pixel precision.
[0072] In an embodiment of the present application, after obtaining the measured dimension values of all measuring points in the first captured image, the difference is obtained by subtracting the measured dimension value of each measuring point from the standard dimension value, and then the maximum and minimum values of the difference of each measuring point are determined, and then the maximum and minimum values are subtracted to obtain the extreme value of each measuring point.
[0073] Furthermore, the extreme difference value and the pixel size of each measuring point are divided to obtain the compensation value of the single pixel accuracy of each measuring point, and finally the average value of the compensation values of the single pixel accuracy of all measuring points is calculated to obtain the compensation value of the single pixel accuracy to correct and adjust the single pixel accuracy.
[0074] Exemplarily, three first captured images are acquired, namely, image A, image B and image C, and there are four measuring points on each first captured image, that is, the measured dimension value of the first measuring point in the first captured image A is A1, the measured dimension value of the second measuring point is A2, the measured dimension value of the third measuring point is A3, and the measured dimension value of the fourth measuring point is A4, and so on. The measured dimension values of image B also include B1-B4, and the measured dimension values of image C also include C1-C4. Through the product parameters provided by the standard parts manufacturer and the pre-established measurement coordinate system, the standard dimension values of the four measuring points can be determined as S1-S4.
[0075] Furthermore, for image A, the difference between the measured dimension value and the standard dimension value of each measuring point can be calculated, which are the difference AS1=A1-S1 of the first measuring point, the difference AS2=A2-S2 of the second measuring point, the difference AS3=A3-S3 of the third measuring point and the difference AS4=A1-S4 of the fourth measuring point, and so on. For image B, four difference values BS1, BS2, BS3 and BS4 can also be obtained, as well as four difference values CS1, CS2, CS3 and CS4 of image C.
[0076] Further, the maximum and minimum values of the difference between the measured dimension value and the standard dimension value of each measuring point are determined. For example, for the first measuring point, there are three difference values AS1, BS1 and CS1. The maximum and minimum values are determined, and the maximum and minimum values are subtracted to obtain the extreme value MM1 of the first measuring point; for the second measuring point, there are three difference values AS2, BS2 and CS2. The maximum and minimum values are determined, and the maximum and minimum values are subtracted to obtain the extreme value MM2 of the second measuring point. By analogy, the extreme difference values MM1, MM2, MM3, and MM4 of the four measuring points can be obtained, and then the pixel sizes of the four measuring points can be determined, and the extreme difference value of each measuring point can be divided by the pixel size to obtain the compensation value of the single pixel precision corresponding to each measuring point (for example, the extreme difference value MM1 of the first measuring point is divided by the pixel size of the first measuring point to obtain the compensation value of the single pixel precision corresponding to the first measuring point), and finally the average value of the compensation values of the single pixel precision corresponding to the four measuring points is calculated to obtain the compensation value of the single pixel precision.
[0077] It can be understood that the number of the above-mentioned first captured images and the number of measuring points are only used to describe the standard part size measurement error compensation method provided in the embodiment of the present application. The actual application is not fixed to the number shown in the above embodiment, and the present application does not impose specific restrictions on this.
[0078] Finally, the calculated compensation value of the single pixel precision is used to correct and adjust the initial value of the single pixel precision, and the single pixel precision is updated.
[0079] Specifically, as an optional implementation manner, after adjusting the single pixel precision according to the compensation value of the single pixel precision, the method further includes:
[0080] Return to the step of acquiring multiple first captured images and determining the measured size values of all measurement points in each of the first captured images, until the number of iterative adjustments of the compensation value of the single-pixel precision meets the first preset threshold, and determine the current single-pixel precision.
[0081] In the embodiment of the present application, after completing a correction adjustment of single pixel accuracy, it is possible to return to the step of reacquiring multiple first captured images based on the updated single pixel accuracy, and restart the correction adjustment of single pixel accuracy, that is, by iteratively correcting and adjusting the single pixel accuracy multiple times until the number of iterative adjustments of the compensation value of the single pixel accuracy meets the first preset threshold, it can be considered that the single pixel accuracy can meet the use requirements, thereby effectively reducing the error generated in the process of measuring the size of the standard part. Among them, the first preset threshold can be set according to the specific use scenario requirements, for example, it can be set to 5 times.
[0082] Step S300: reacquire a plurality of second photographed images to determine an error compensation value for standard component dimension measurement according to a measured dimension value in each of the second photographed images.
[0083] In an embodiment of the present application, after completing the correction and adjustment of the single-pixel accuracy, based on the updated single-pixel accuracy, multiple second captured images are reacquired, and according to the difference between the measured dimension value of each measurement point in the second captured image and the predetermined standard dimension value, the error compensation value of each measurement point in the standard part size measurement process is determined, thereby effectively reducing the error caused by measuring instruments, etc., and effectively improving the measurement accuracy and repeatability accuracy.
[0084] Specifically, as an optional implementation, please refer to Figure 4 , Figure 4 : is a flow chart of determining an error compensation value provided by an embodiment of the present application, wherein the reacquisition of multiple second captured images to determine the error compensation value of the standard part size measurement according to the measured size value in each of the second captured images includes:
[0085] Reacquiring a plurality of second captured images, and determining the measured dimension values of all the measuring points in each of the second captured images;
[0086] Determine the maximum and minimum values of the differences between the measured size value and the standard size value of each measuring point in all the first captured images;
[0087] The error compensation value of each measuring point is calculated according to the maximum value and the minimum value of the difference between the measured dimension value of each measuring point and the standard dimension value.
[0088] In an embodiment of the present application, after obtaining the measured dimension values of all measuring points in the second captured image, the difference is obtained by subtracting the measured dimension value of each measuring point from the standard dimension value, and then the maximum and minimum values of the difference of each measuring point are determined, and then the error compensation value of each measuring point is calculated based on the maximum and minimum values.
[0089] Exemplarily, three second captured images are acquired, namely, image D, image E and image F, and there are four measuring points on each second captured image, that is, the measured dimension value of the first measuring point in the first captured image D is D1, the measured dimension value of the second measuring point is D2, the measured dimension value of the third measuring point is D3, and the measured dimension value of the fourth measuring point is D4. Similarly, the measured dimension values of image E also include E1-E4, and the measured dimension values of image F also include F1-F4. Through the product parameters provided by the standard parts manufacturer and the pre-established measurement coordinate system, the standard dimension values of the four measuring points can be determined to be S1-S4.
[0090] Furthermore, for image D, the difference between the measured dimension value and the standard dimension value of each measuring point can be calculated, which are the difference DS1=D1-S1 of the first measuring point, the difference DS2=D2-S2 of the second measuring point, the difference DS3=D3-S3 of the third measuring point and the difference DS4=D1-S4 of the fourth measuring point, and so on. For image E, four difference values ES1, ES2, ES3 and ES4 can also be obtained, as well as the four difference values FS1, FS2, FS3 and FS4 of image F.
[0091] Furthermore, the maximum and minimum values of the difference between the measured dimension value and the standard dimension value of each measuring point are determined. For example, for the first measuring point, there are three differences, DS1, ES1 and FS1. The maximum value Max1 and the minimum value Min1 are determined, and the error compensation value of the first measuring point is calculated based on the maximum value Max1 and the minimum value Min1.
[0092] That is to say, for different measuring points, an error compensation value can be automatically calculated, so that the measurement accuracy of each measuring point is higher, the influence of distortion can be effectively reduced, and the measurement accuracy and repeatability accuracy of each measuring point can be improved.
[0093] Specifically, as an optional implementation, the calculation formula for calculating the error compensation value of each measuring point according to the maximum and minimum values of the difference between the measured dimension value of each measuring point and the standard dimension value is:
[0094]
[0095] Where Δk is the error compensation value of the kth measurement point; Max k The maximum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point; Min k It is the minimum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point.
[0096] In an embodiment of the present application, after obtaining the maximum and minimum values of the difference between the measured dimension value and the standard dimension value of any measuring point, the error compensation value of any measuring point can be calculated using the calculation formula provided in the present application.
[0097] For example, the difference between the measured dimension value of a measuring point k and the standard dimension value has three values: 0.04 mm, 0.06 mm and 0.07 mm, of which the maximum value Max k The minimum value is 0.07mm. k is 0.04mm, the error compensation value of the measuring point k can be calculated as -0.055mm through the above calculation formula. In the subsequent standard part dimension measurement operation, the measured dimension value obtained by measuring the measuring point k each time can be added to the error compensation value (for example, the measured dimension value obtained by measuring the measuring point k is 14mm, and the actual value after error compensation is 13.945mm), thereby effectively reducing the error generated in the measurement process, significantly improving the measurement accuracy and repeatability, and meeting the user's usage needs.
[0098] For example, in practical applications, the standard part size measurement error compensation method provided in this application can improve the repeatability accuracy from ±0.032mm to ±0.0056mm.
[0099] Specifically, as an optional implementation manner, the first captured image and the second captured image are captured by a measuring machine;
[0100] The measuring machine comprises an area array camera, a high-beam lens and a surface light source.
[0101] In the embodiment of the present application, the image of the standard part can be captured by using a measuring machine composed of an area array camera, a high-beam lens and a surface light source. This not only can utilize the advantages of visual measurement such as non-contact, high efficiency and non-destructiveness, but also can effectively improve the measurement accuracy of the measurement system to meet the user's usage needs.
[0102] Specifically, as an optional implementation, the first captured image and the second captured image are acquired by using an industrial lens.
[0103] In the embodiments of the present application, the standard part size measurement error compensation method provided by the present application is not only applicable to the measurement system composed of a high-beam lens and a surface light source, but can also be applied to general measurement scenes shot using an industrial lens (such as a FA lens).
[0104] Optionally, the camera and lens can be firstly calculated for parameters and distortion correction, and then error compensation can be performed using the standard part size measurement error compensation method provided in the embodiment of the present application, thereby further significantly improving the measurement accuracy and repeatability accuracy of the measurement system.
[0105] Next, in conjunction with a specific application implementation process, the standard part size measurement error compensation method provided in the present invention is introduced and described in detail:
[0106] In an embodiment of the present application, a method for compensating errors in the dimension measurement of standard parts is provided. The method can be applied to the dimension measurement scenario of standard parts. By obtaining a compensation value of single-pixel precision, and then correcting the single-pixel precision, the accuracy of the single-pixel precision is improved, and the error compensation value of each measuring point is calculated based on the corrected single-pixel precision. The measurement error in the process of standard part dimension measurement can be effectively reduced, and the measurement accuracy and repeatability accuracy can be significantly improved, thereby effectively meeting the user's usage needs.
[0107] Specifically, relevant preparatory work such as standard part preparation and measurement algorithm preparation can be implemented. Specifically, the coordinate system for standard part size measurement can be determined first, that is, determine which two sides of the standard part are used to establish the measurement coordinate system OXY, determine the X-axis, Y-axis and coordinate origin, and further obtain standard measurement values based on different measurement points in the measurement coordinate system, and further prepare the measurement algorithm in the visual measurement process. Based on the determined measurement coordinate system, the target edge can be captured in the captured image through a visual recognition algorithm to obtain the X-axis edge and the Y-axis edge, and the intersection of the X-axis edge and the Y-axis edge can be calculated to obtain the coordinate origin, and then the position of each measurement point on the image is determined according to the X-axis, Y-axis and coordinate origin on the image, and then the pixel size of each measurement point is calculated, and the physical size of each measurement point, that is, the measured size value, is calculated according to the pixel size and single-pixel accuracy of each measurement point.
[0108] Furthermore, by acquiring the physical size and pixel size of the object in the image, the initial value of the single-pixel accuracy can be calculated, and then by randomly placing standard parts in different positions for shooting, multiple first captured images are obtained, and the positions of all measurement points in each first captured image are measured through a pre-set measurement algorithm, and then the measured size value in the first captured image is determined, and based on the difference between the measured size value and the pre-determined standard size value, the compensation value of the single-pixel accuracy is determined, and the single-pixel accuracy is corrected and adjusted.
[0109] Furthermore, after completing a correction and adjustment of single-pixel accuracy, it is possible to return to the step of reacquiring multiple first captured images based on the updated single-pixel accuracy, and restart the correction and adjustment of single-pixel accuracy. That is to say, by iteratively correcting and adjusting the single-pixel accuracy for multiple times until the number of iterative adjustments of the compensation value of the single-pixel accuracy meets the first preset threshold, it can be considered that the single-pixel accuracy can meet the use requirements, thereby effectively reducing the errors generated in the standard part size measurement process.
[0110] Finally, after obtaining the measured size values of all the measuring points in the second captured image, the measured size value of each measuring point is subtracted from the standard size value to obtain the difference value, and then the maximum and minimum values of the difference value of each measuring point are determined, and then the error compensation value of each measuring point is calculated based on the maximum and minimum values. Among them, the error compensation value of each measuring point calculated based on the maximum and minimum values can be calculated by the following formula:
[0111]
[0112] Where Δk is the error compensation value of the kth measurement point; Max k The maximum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point; Min k It is the minimum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point.
[0113] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a standard part size measurement error compensation device provided in an embodiment of the present application. The embodiment of the present application also provides a standard part size measurement error compensation device 500, which can implement the above-mentioned standard part size measurement error compensation method, and the device includes:
[0114] The precision acquisition module 510 is used to obtain the initial value of the single pixel precision;
[0115] The precision adjustment module 520 is used to obtain a plurality of first captured images, determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, and adjust the single pixel precision according to the compensation value of the single pixel precision;
[0116] The compensation acquisition module 530 is used to reacquire a plurality of second photographed images to determine an error compensation value for the standard component dimension measurement according to a measured dimension value in each of the second photographed images.
[0117] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0118] Please refer to Figure 6 , Figure 6 : is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device includes:
[0119] The processor 601 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0120] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 602, and the processor 601 calls and executes the standard part size measurement error compensation method of the embodiment of this application;
[0121] Input / output interface 603, used to implement information input and output;
[0122] Communication interface 604, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0123] Bus 605 , which transmits information between various components of the device (e.g., processor 601 , memory 602 , input / output interface 603 , and communication interface 604 );
[0124] The processor 601 , the memory 602 , the input / output interface 603 and the communication interface 604 are connected to each other in communication within the device via a bus 605 .
[0125] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned standard part size measurement error compensation method is implemented.
[0126] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0127] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] The embodiments of the present application provide a method, device, equipment and medium for compensating errors in standard part size measurement. The method obtains a compensation value of single-pixel precision, corrects the single-pixel precision, improves the accuracy of single-pixel precision, and calculates the error compensation value of each measuring point based on the corrected single-pixel precision. The method can effectively reduce the measurement error in the standard part size measurement process, significantly improve the measurement accuracy and repeatability accuracy, and thus effectively meet the user's usage needs.
[0129] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0130] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0131] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0133] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0134] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0135] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0136] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0138] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0139] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.
Claims
1. A method for compensating standard part size measurement errors, characterized in that: The method comprises the following steps: Get the initial value of single pixel precision; Acquire a plurality of first captured images to determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, thereby adjusting the single pixel precision according to the compensation value of the single pixel precision; A plurality of second photographed images are reacquired to determine an error compensation value for the standard component dimension measurement according to a measured dimension value in each of the second photographed images.
2. The method for compensating standard part size measurement errors according to claim 1, characterized in that: The acquiring of a plurality of first captured images to determine a compensation value of single pixel precision according to a measured size value in each of the first captured images, thereby adjusting the single pixel precision according to the compensation value of the single pixel precision, comprises: Acquire a plurality of first captured images, and determine the measured dimension values of all the measuring points in each of the first captured images; Determine the maximum and minimum values of the differences between the measured size value and the standard size value of each measuring point in all the first captured images, so as to determine the extreme difference value of each measuring point; Determine a compensation value of single pixel accuracy of each measuring point according to the extreme difference value and pixel size of each measuring point; Calculating an average value of the compensation value with single pixel precision of all the measuring points to obtain the compensation value with single pixel precision; The single pixel precision is adjusted according to the compensation value of the single pixel precision.
3. The method for compensating standard part size measurement errors according to claim 2, characterized in that: After adjusting the single pixel precision according to the compensation value of the single pixel precision, the method further includes: Return to the step of acquiring multiple first captured images and determining the measured size values of all measurement points in each of the first captured images, until the number of iterative adjustments of the compensation value of the single-pixel precision meets the first preset threshold, and determine the current single-pixel precision.
4. The method for compensating standard part size measurement errors according to claim 1, characterized in that: The reacquisition of the plurality of second photographed images to determine the error compensation value of the standard component size measurement according to the measured size value in each of the second photographed images includes: Reacquiring a plurality of second captured images, and determining the measured dimension values of all the measuring points in each of the second captured images; Determine the maximum and minimum values of the differences between the measured size value and the standard size value of each measuring point in all the first captured images; The error compensation value of each measuring point is calculated according to the maximum value and the minimum value of the difference between the measured dimension value of each measuring point and the standard dimension value.
5. The method for compensating standard part size measurement error according to claim 4, characterized in that: The calculation formula for calculating the error compensation value of each measuring point according to the maximum and minimum values of the difference between the measured dimension value of each measuring point and the standard dimension value is: Where Δk is the error compensation value of the kth measurement point; Max k The maximum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point; Min k It is the minimum value of the difference between the measured dimension value and the standard dimension value at the kth measuring point.
6. The method for compensating standard part size measurement error according to claim 1, characterized in that: The first photographed image and the second photographed image are obtained by photographing a measuring machine; The measuring machine comprises an area array camera, a high-beam lens and a surface light source.
7. The method for compensating standard part size measurement error according to claim 1, characterized in that: The first captured image and the second captured image are captured by using an industrial lens.
8. A device for compensating standard part size measurement errors, characterized in that: The device comprises: The precision acquisition module is used to obtain the initial value of single pixel precision; A precision adjustment module, used for acquiring a plurality of first captured images, determining a compensation value of single pixel precision according to a measured size value in each of the first captured images, and adjusting the single pixel precision according to the compensation value of the single pixel precision; The compensation acquisition module is used to reacquire a plurality of second captured images to determine an error compensation value of the standard component size measurement according to the measured size value in each of the second captured images.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the standard part size measurement error compensation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for compensating standard part size measurement errors according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Measurement system, method and equipment of battery device and storage medium
CN120333309A