Image measuring instrument calibration method, device, image measuring instrument and storage medium
By combining the double calibration method of the camera and the distance sensor in the image measuring instrument, the problem of low calibration accuracy in the existing technology is solved, a high-precision calibration effect is achieved, the calibration process is simplified and the cost is reduced.
Patent Information
- Application Number
- CN202210892856.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-07-27
AI Technical Summary
Existing calibration methods for image measuring instruments suffer from low calibration accuracy, especially those that rely on the naked eye or customized calibration devices, resulting in insufficient accuracy or high processing costs.
By combining the camera and distance sensor in the image measuring instrument, a two-step calibration method is adopted. First, the mechanical coordinates of the calibration area are measured by the camera and distance sensor for fuzzy calibration. Then, the distance sensor is used to sense the distance of the set scanning path for precise calibration, improving the accuracy of distance measurement.
The calibration accuracy of the image measuring instrument is significantly improved, the influence of the processing accuracy of customized calibration components is avoided, the calibration process is simplified, and the cost is reduced.
Smart Images

Figure CN115420237B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of measurement technology. Specifically, the present application relates to a calibration method and device for an image measuring instrument, an image measuring instrument, and a storage medium. Background Art
[0002] Image measuring machines have gradually become a dimensional measurement tool with a wide range of applications. With the increasing complexity of component geometry and precision of machining dimensions, the requirements for the precision of component installation (such as sensors) in image measuring machines are becoming increasingly higher.
[0003] Currently, the installation of components in image measuring instruments is typically achieved through calibration methods, including visual calibration and calibration device calibration. Visual calibration relies on common devices such as the naked eye or a linear ruler to calibrate components in image measuring instruments, resulting in severe accuracy issues. Calibration device calibration relies on customized calibration devices, which are often custom-made and complex. This not only presents a high barrier to entry, but also compromises the calibration accuracy of the image measuring instrument if the customized calibration device is not precisely machined.
[0004] From the above, we can see that how to improve the calibration accuracy of image measuring instruments remains to be solved. Summary of the Invention
[0005] This application provides a calibration method, device, image measuring instrument, and storage medium for an image measuring instrument, which can solve the problem of low calibration accuracy of image measuring instruments in related technologies. The technical solution is as follows:
[0006] According to one aspect of the present application, a calibration method for an image measuring instrument is provided, the image measuring instrument including a camera and a distance sensor, the method including: determining a first distance between the camera and the distance sensor in the image measuring instrument based on a first mechanical coordinate of a center position of a calibration area measured by the distance sensor and a second mechanical coordinate of the center position of the calibration area measured by the camera; the calibration area is determined by a calibration sheet of the image measuring instrument; based on the first distance between the camera and the distance sensor in the image measuring instrument, controlling the center position of the calibration area to move from a shooting area of the camera to a sensing area of the distance sensor; obtaining third mechanical coordinates of multiple first edge positions of the calibration area based on distance sensing of the calibration area by the distance sensor according to a set scanning path; and determining a second distance between the camera and the distance sensor in the image measuring instrument based on the third mechanical coordinates of the multiple first edge positions of the calibration area, the accuracy of the second distance being higher than that of the first distance.
[0007] According to one aspect of the present application, a calibration device for an image measuring instrument includes a camera and a distance sensor, the device including: a first distance determination module for determining a first distance between the camera and the distance sensor in the image measuring instrument based on a first mechanical coordinate of a center position of a calibration area measured by the distance sensor and a second mechanical coordinate of the center position of the calibration area measured by the camera; the calibration area is determined by a calibration sheet of the image measuring instrument; a movement module for controlling the center position of the calibration area to move from a shooting area of the camera to a sensing area of the distance sensor based on the first distance between the camera and the distance sensor in the image measuring instrument; a scanning module for obtaining third mechanical coordinates of multiple first edge positions of the calibration area based on distance sensing of the calibration area by the distance sensor according to a set scanning path; and a second distance determination module for determining a second distance between the camera and the distance sensor in the image measuring instrument based on the third mechanical coordinates of the multiple first edge positions of the calibration area, the second distance having a higher accuracy than the first distance.
[0008] According to one aspect of the present application, an image measuring instrument includes a camera and a distance sensor, and also includes: at least one processor, at least one memory, and at least one communication bus, wherein a computer program is stored in the memory; the processor reads the computer program in the memory through the communication bus and executes the computer program to implement the calibration method of the image measuring instrument as described above.
[0009] According to one aspect of the present application, a storage medium stores a computer program thereon, and when the computer program is executed by a processor, the calibration method of the image measuring instrument as described above is implemented.
[0010] According to one aspect of the present application, a computer program product includes a computer program, the computer program is stored in a storage medium, a processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, so that when the computer device executes the computer program, the calibration method of the image measuring instrument as described above is implemented.
[0011] The beneficial effects of the technical solution provided by this application are:
[0012] In the above technical solution, the image measuring instrument includes a camera and a distance sensor, and obtains first mechanical coordinates and second mechanical coordinates of the center position of the calibration area according to measurements of the distance sensor and the camera respectively, and performs fuzzy calibration on the distance between the camera and the distance sensor in the image measuring instrument according to the first mechanical coordinate system and the second coordinate system. Based on the distance determined by the fuzzy calibration, the center position of the calibration area is controlled to move from the shooting area of the camera to the sensing area of the distance sensor, so as to combine the distance sensing of the calibration area by the distance sensor according to the set scanning path, and accurately calibrate the distance between the camera and the distance sensor in the image measuring instrument again, wherein the calibration area is determined by the calibration piece of the image measuring instrument. That is, the calibration accuracy can be greatly improved through two calibrations, and the two calibrations rely on a very universal calibration piece, and do not rely on customized calibration devices, so as to avoid the processing accuracy of the customized calibration device affecting the calibration accuracy of the image measuring instrument, thereby effectively solving the problem of low calibration accuracy of the image measuring instrument existing in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.
[0014] Figure 1 This is a schematic diagram of the hardware structure of the image measuring instrument involved in this application;
[0015] Figure 2 is a flow chart showing a calibration method of an image measuring instrument according to an exemplary embodiment;
[0016] Figure 3 is a schematic diagram showing that a calibration area determined by a calibration sheet of an image measuring instrument is a circular area according to an exemplary embodiment;
[0017] Figure 4 is a flow chart of another method for calibrating an image measuring instrument according to an exemplary embodiment;
[0018] Figure 5 is a schematic diagram showing that a calibration area is located in a sensing area of a distance sensor according to an exemplary embodiment;
[0019] Figure 6 is a schematic diagram showing that a calibration area moves from a sensing area of a distance sensor to a shooting area of a camera according to an exemplary embodiment;
[0020] Figure 7a is one of the schematic diagrams showing a set scanning path corresponding to a point scanning distance sensor according to an exemplary embodiment;
[0021] Figure 7bis a second schematic diagram showing a set scanning path corresponding to a point scanning distance sensor according to an exemplary embodiment;
[0022] Figure 7c is a schematic diagram showing a set scanning path corresponding to a line scanning distance sensor according to an exemplary embodiment;
[0023] Figure 8 yes Figure 2 A flowchart of an embodiment corresponding to step 370 in one embodiment;
[0024] Figure 9 yes Figure 8 A schematic diagram of a second distance between the camera and the distance sensor in the image measuring instrument in the corresponding embodiment;
[0025] Figure 10 yes Figure 2 A flowchart of an embodiment corresponding to step 350 in an embodiment;
[0026] Figure 11 This is a schematic diagram of a specific implementation of a calibration method for an image measuring instrument in an application scenario;
[0027] Figure 12 is a structural block diagram of a calibration device for an image measuring instrument according to an exemplary embodiment;
[0028] Figure 13 The figure is a structural block diagram of an image measuring instrument according to an exemplary embodiment. DETAILED DESCRIPTION
[0029] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limiting the present application.
[0030] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.
[0031] The following is an introduction and explanation of several terms involved in this application:
[0032] Calibration: In vision measuring machines, installation errors are inevitable due to the physical distance between multiple sensors. To accurately measure parts in multiple dimensions, it is necessary to calibrate the mechanical coordinates of the different sensors and the machine to ensure that all sensors can accurately sense the parts.
[0033] Mechanical coordinate system: Since the camera used with an image measuring instrument can be mounted anywhere on the instrument in physical space, a reference coordinate system is used to describe the camera's position, using any origin on the instrument's measuring platform. This reference coordinate system is then used to describe the position of components in physical space. This reference coordinate system is considered a mechanical coordinate system. In a mechanical coordinate system, units are typically real physical dimensions, such as millimeters.
[0034] Pixel coordinate system: A two-dimensional rectangular coordinate system with pixels as the unit, established with the upper left corner of the image taken by the camera as the origin, is considered a pixel coordinate system.
[0035] Pixel scaling refers to the conversion ratio between a single pixel and the actual physical size (such as millimeters) in the image captured by the camera.
[0036] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0037] Figure 1 The hardware structure diagram of an image measuring instrument is shown in FIG. The image measuring instrument 100 includes: a machine platform 110 , a grating ruler 130 , a camera 150 and at least one distance sensor 170 .
[0038] Specifically, the machine platform 110 is the CNC machine portion of the vision measuring machine 100. The machine platform 110 can move freely on a two-dimensional plane. For example, the two-dimensional plane is a horizontal plane. Then, the machine platform 110 can move freely in the horizontal direction (X-axis direction) and / or the vertical direction (Y-axis direction) on the horizontal plane.
[0039] The linear scale 130 is a measurement feedback device that utilizes the optical principle of a grating. For example, the linear scale 130 is a linear scale displacement sensor. In the image measuring instrument 100, the linear scale 130 can measure any point on the measuring platform surface (machine surface) and obtain the mechanical coordinates of that point. For example, if the machine 110 is freely movable on a horizontal plane, the mechanical coordinates of any point on the machine surface can be expressed as (x, y).
[0040] The camera 150 has a shooting area, and is used to shoot and collect components located in the shooting area to obtain images of the components.
[0041] Distance sensor 170, also known as a height sensor, is freely movable in the Z-axis direction and has a sensing area for sensing the distance of components within the sensing area to obtain distance data for the components. Distance sensor 170 can be one or more of a laser focusing sensor, a laser triangulation sensor, and a spectral confocal displacement sensor.
[0042] Based on the above-mentioned image measuring instrument, it is possible to perform fuzzy calibration and precise calibration on the distance between the camera and the distance sensor in the image measuring instrument, thereby effectively solving the problem of low calibration accuracy of the image measuring instrument existing in the related art.
[0043] See also Figure 2 The embodiment of the present application provides a calibration method for an image measuring instrument. The method is applicable to an image measuring instrument. The hardware structure of the image measuring instrument is as follows: Figure 1 As shown, it includes at least a camera and a distance sensor.
[0044] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an example of an image measuring instrument, but this does not constitute a specific limitation.
[0045] like Figure 2 As shown, the method may include the following steps:
[0046] Step 310 : determining a first distance between the camera and the distance sensor in the image measuring instrument according to the first mechanical coordinates of the center position of the calibration area measured by the distance sensor and the second mechanical coordinates of the center position of the calibration area measured by the camera.
[0047] The calibration area is defined by the image measuring instrument's calibration sheet. This area is used to perform both fuzzy and precise calibration of the distance between the camera and the distance sensor in the image measuring instrument. The calibration area can be any geometric shape defined by the image measuring instrument's calibration sheet. For example, the geometric shape can be a circle, triangle, rectangle, polygon, or other edged shape.
[0048] In a possible implementation, the calibration area determined by the calibration piece of the image measuring instrument is a plurality of circular areas with different diameters, such as Figure 3 shown.
[0049] like Figure 4 As shown, in a possible implementation, before step 310, the above method may further include the following steps:
[0050] Step 410: Obtain a first mechanical coordinate of the center position of the calibration area according to the distance sensor measurement.
[0051] Specifically, in the first step, the distance sensor is controlled to align with the center position of the calibration area.
[0052] Here, alignment refers to aligning the distance sensor with the center position of the calibration area.
[0053] Since the calibration piece of the image measuring instrument is placed on the surface of the machine, the center position of the calibration area is actually located on the surface of the machine. Then, by moving the machine, the center position of the calibration area on the surface of the machine can be moved to the bottom of the distance sensor. Figure 5 As shown, the distance sensor is aligned with the center position of the calibration area.
[0054] The second step is to adjust the distance between the distance sensor and the calibration area so that the center of the calibration area enters the sensing area of the distance sensor.
[0055] If the distance between the distance sensor and the calibration area is too large, the center of the calibration area will be out of the sensing area of the distance sensor, which will cause the distance sensor to be unable to measure the first mechanical coordinate of the center of the calibration area. Therefore, in order to be able to use the distance sensor to sense the distance of the center of the calibration area, it is necessary to make the center of the calibration area enter the sensing area of the distance sensor. Figure 5 , the distance sensor is located above the center of the calibration area. Then, by moving the distance sensor in the Z-axis direction, the distance between the distance sensor and the calibration area can be adjusted, so that the center of the calibration area enters the sensing area of the distance sensor.
[0056] Therefore, the sensing area refers to the area where the distance sensor can measure the distance, specifically refers to the distance between the distance sensor and the measurement object (such as the calibration area) that can meet the measurement requirements when the distance sensor is located above the measurement object.
[0057] The third step is to measure and obtain the first mechanical coordinate in the sensing area of the distance sensor.
[0058] Specifically, the center position R0 of the calibration area measured by the distance sensor is represented by the first mechanical coordinates (x, y, z), where (x, y) is obtained by measuring the center position of the calibration area using the optical scale, and z is obtained by measuring the center position of the calibration area using the distance sensor, representing the distance between the distance sensor and the calibration area. It should be noted that the measurement of the center position of the calibration area by the optical scale and the distance sensor are performed synchronously to ensure that the x, y, and z values in the first mechanical coordinates belong to the same center position of the calibration area.
[0059] Step 430 : When the first mechanical coordinate is obtained by measurement, the center position of the calibration area is controlled to move from the sensing area of the distance sensor to the shooting area of the camera to measure the second mechanical coordinate.
[0060] In order to perform fuzzy calibration on the distance between the camera and the distance sensor in the image measuring instrument, after obtaining the first mechanical coordinates based on the distance sensor, it is also necessary to obtain the second mechanical coordinates based on the camera measurement. Figure 6 As shown, by moving the machine, the center of the calibration area on the machine surface moves to the bottom of the camera, and the camera can take a picture of the calibration area. Figure 6 Since the camera is located below the center of the calibration area, if the distance between the camera and the calibration area is not appropriate, for example, the distance is too large, the image of the calibration area captured by the camera will not be clear enough. Therefore, in order to obtain a sufficiently clear image of the calibration area, it is necessary to move the camera in the Z-axis direction until the camera can capture an image of the calibration area with sufficient clarity.
[0061] Therefore, the shooting area refers to the area where the camera can capture images with sufficient clarity. Specifically, it refers to the distance between the camera and the shooting object (such as the calibration area) that can meet the clarity requirements when the camera is located above the shooting object.
[0062] Step 450: Obtain the second mechanical coordinates of the center position of the calibration area according to camera measurement.
[0063] Specifically, in the first step, the camera is controlled to shoot the calibration area in the shooting area to obtain an image of the calibration area.
[0064] In the second step, center fitting is performed on multiple second edge positions of the calibration area in the calibration area image to obtain the pixel coordinates of the center position of the calibration area in the calibration area image.
[0065] Continue reading Figure 6 Taking the calibration area as a circular area as an example, for the circular area in the calibration area image, any three edge points on the circular edge are determined, which are regarded as multiple second edge positions of the circular area. Then, the three-point fitting circle center algorithm can be used to determine the center of the circular area, which is regarded as the center position of the circular area. Among them, the center C1 of the circular area is obtained by the pixel coordinate (p x ,p y ,p z )express.
[0066] Of course, as the calibration area can be any geometric shape with edges, the implementation algorithm of the center fitting also changes accordingly, which is not limited here.
[0067] The third step is to map the pixel coordinates from the pixel coordinate system to the mechanical coordinate system to obtain the second mechanical coordinates.
[0068] It can be understood that the pixel coordinates are based on pixels, which describe the center position of the calibration area through the pixel coordinate system, while the second mechanical coordinates are based on real physical dimensions, which describe the center position of the calibration area through the mechanical coordinate system. Therefore, in order to obtain the second mechanical coordinate system, it is necessary to perform a projection transformation between the pixel coordinates and the second mechanical coordinates, that is, to map the pixel coordinates from the pixel coordinate system to the mechanical coordinate system.
[0069] In one possible implementation, the projection transformation between the pixel coordinates and the second mechanical coordinates is implemented according to the following calculation formula:
[0070] R 1x =((p x – Image center x) / Scale X)+x;
[0071] R 1y =((p y – Image center y) / Scale Y)+y;
[0072] R 1z =z.
[0073] Among them, the center position R1 of the calibration area measured by the camera is obtained by the second mechanical coordinate (R 1x , R 1y , R 1z )express;
[0074] (p x ,py ,p z ) represents the pixel coordinates of the center position of the calibration area in the calibration area image;
[0075] (x, y) is the center position of the calibration area measured by the grating ruler, and z represents the distance between the camera and the center position of the calibration area;
[0076] Scale X represents the pixel scaling ratio of the calibration area image in the X-axis direction, and Scale Y represents the pixel scaling ratio of the calibration area image in the Y-axis direction. It is worth mentioning that in order to ensure that Scale X and Scale Y can be used to accurately describe the corresponding pixel scaling ratios, it is necessary to ensure that the camera lens has no obvious distortion, the camera lens magnification is not switched arbitrarily, and the camera is not tilted when installed, so that the camera lens is parallel to the machine plane. This can fully ensure that the pixel size of any object can remain unchanged when imaging.
[0077] The image center can also be considered as the center of the camera in the horizontal plane, expressed as (image center x, image center y), which is determined by the installation position of the camera on the image measuring instrument.
[0078] After executing steps 410 to 450, the first mechanical coordinates of the center position of the calibration area can be obtained according to the measurement of the distance sensor, and the second mechanical coordinates of the center position of the calibration area can be obtained according to the measurement of the camera. Then, the first distance between the camera and the distance sensor in the image measuring instrument can be determined according to the first mechanical coordinates and the second mechanical coordinates.
[0079] Specifically, if the center position of the calibration area is R0, which is represented by the first mechanical coordinate system, and the center position of the calibration area is R1, which is represented by the second mechanical coordinate system, then the first distance between the camera and the distance sensor in the image measuring machine is dR0 = (R1 - R0). This first distance describes the relatively accurate installation distance between the camera and the distance sensor in the image measuring machine.
[0080] Step 330 : Based on a first distance between the camera and the distance sensor in the image measuring instrument, control the center position of the calibration area to move from the shooting area of the camera to the sensing area of the distance sensor.
[0081] As mentioned above, during the fuzzy calibration process, the center position of the calibration area has been moved from the sensing area of the distance sensor to the shooting area of the camera. In order to perform accurate calibration in the subsequent process, the center position of the calibration area needs to be moved back to the sensing area of the distance sensor.
[0082] The inventors recognized that the aforementioned movement of the calibration area actually occurs between the camera and the distance sensor, and can reflect the installation distance between the camera and the distance sensor in the image measuring instrument. If this installation distance relies on visual calibration or the distance obtained by calibration of ordinary devices is not accurate enough, it is likely to cause the subsequent precise calibration process to fail. Therefore, in this embodiment, the movement of the calibration area is achieved based on the first distance between the camera and the distance sensor in the image measuring instrument.
[0083] In other words, the first distance between the camera and the distance sensor in the image measuring instrument more accurately reflects the installation distance between the camera and the distance sensor in the image measuring instrument, which can ensure that the center position of the calibration area is moved more accurately from the camera's shooting area to the sensing area of the distance sensor, so as to ensure that the subsequent precise calibration process can be achieved.
[0084] Step 350 : obtaining third mechanical coordinates of a plurality of first edge positions of the calibration area based on distance sensing of the calibration area by the distance sensor according to the set scanning path.
[0085] The number of scanning paths can be flexibly adjusted according to the scanning type of the distance sensor. For example, if the distance sensor is a point scanning distance sensor, the number of scanning paths is set to at least two, such as Figure 7a As shown in , the calibration area is a circular area, so the set scanning path can be two; Figure 7b As shown in , if the calibration area is a triangular area, then the number of scanning paths can be set to three. If the distance sensor is a line scanning distance sensor, then the number of scanning paths can be set to one, such as Figure 7c shown.
[0086] In one possible implementation, the scanning path is set to meet at least the following set conditions: there are at least two arbitrary intersections between the path and the calibration area; the path length is much greater than the distance between the two first edge positions of the calibration area; for a point scanning distance sensor, at least two paths need to intersect.
[0087] When the distance sensor scans the calibration area according to the set scanning path, the distance sensor can continuously measure the distance between itself and the calibration area, and obtain the third mechanical coordinates of multiple first edge positions of the calibration area.
[0088] Specifically, the first edge positions P0, P1, P2, and P3 of the calibration area are represented by the third mechanical coordinates (x0, y0, z0), (x1, y1, z1), (x2, y2, z2), and (x3, y3, z3), respectively. i ,y i ) is obtained by measuring the edge position of the ith edge of the calibration area based on the grating ruler, zi It is obtained by measuring the i-th edge position of the calibration area based on the distance sensor, and represents the distance between the distance sensor and the calibration area.
[0089] Step 370 : Determine a second distance between the camera and the distance sensor in the image measuring machine based on the third mechanical coordinates of the plurality of first edge positions in the calibration area.
[0090] The accuracy of the second distance is higher than that of the first distance.
[0091] like Figure 8 As shown, in a possible implementation, step 370 may include the following steps:
[0092] Step 371 : Based on the third mechanical coordinates of the plurality of first edge positions of the calibration area, perform center fitting on the plurality of first edge positions of the calibration area to obtain fifth mechanical coordinates of the center position of the calibration area.
[0093] Continuing to take the calibration area as a circular area as an example, for the circular area in the calibration area image, based on the multiple first edge positions of the circular area, that is, at least three edge points on the circular edge, the three-point fitting circle center algorithm can be used to determine the center of the circular area, which is regarded as the center position of the circular area, specifically R2. 2x , R 2y , R 2z )express.
[0094] Of course, as the calibration area can be any geometric shape with edges, the implementation algorithm of the center fitting also changes accordingly, which is not limited here.
[0095] Step 373 : Determine a second distance between the camera and the distance sensor in the image measuring instrument according to the second mechanical coordinate and the fifth mechanical coordinate of the center position of the calibration area.
[0096] Specifically, dR1 = (R2 - R1).
[0097] Wherein, dR1 represents the second distance between the camera and the distance sensor in the image measuring instrument;
[0098] R1 represents the center position of the calibration area represented by the second machine coordinate system, and R2 represents the center position of the calibration area represented by the fifth machine coordinate system.
[0099] That is to say, if Figure 9As shown in the figure, the second distance between the camera and the distance sensor in the image measuring instrument is actually the distance between the center position R1 obtained by fitting the calibration area image under the camera's perspective and the center position R2 obtained by fitting multiple edge positions of the calibration area under the distance sensor's perspective. It is regarded as an extremely precise installation distance between the camera and the distance sensor in the image measuring instrument.
[0100] Of course, in other embodiments, steps 310 to 370 may be repeated n times, and the calibration area used in each calibration process may be the same or different calibration area determined by the calibration sheet of the image measuring instrument, thereby obtaining n second distances dR between the camera and the distance sensor in the image measuring instrument, and finally the average value of the n second distances dR is calculated, that is, As a result of the calibration, this method can further ensure the calibration accuracy and effectively reduce the impact of random errors in machine movement and errors in the calibration piece of the image measuring instrument on the calibration accuracy.
[0101] Through the above process, fuzzy calibration and precise calibration of the distance between the camera and distance sensor in the image measuring instrument are achieved. The calibration accuracy can be greatly improved through two calibrations. Moreover, both calibrations rely on very universal calibration pieces, and do not rely on customized calibration devices. This avoids the impact of the calibration accuracy of the image measuring instrument due to insufficient processing accuracy of customized calibration devices, thereby effectively solving the problem of low calibration accuracy of image measuring instruments existing in related technologies.
[0102] See also Figure 10 In an exemplary embodiment, step 350 may include the following steps:
[0103] Step 351: Control the distance sensor to scan the calibration area according to the set scanning path.
[0104] Step 353 : During the scanning process, a plurality of fourth mechanical coordinates located on the set scanning path are obtained based on the distance sensing of the calibration area by the distance sensor.
[0105] Step 355 : filtering the plurality of fourth mechanical coordinates based on the material property differences of the image measuring instrument calibration piece at different positions in the calibration area to obtain third mechanical coordinates of the plurality of first edge positions in the calibration area.
[0106] Material attributes are used to describe the material characteristics of the image measuring instrument calibration sheet. For example, material attributes include, but are not limited to, material reflectivity and material color. In one possible implementation, the calibration area of the image measuring instrument calibration sheet is made transparent inside and opaque outside, ensuring that the reflectivity inside and outside the calibration area are different.
[0107] Taking the material property of material reflectivity as an example, the material reflectivity inside and outside the calibration area of the calibration piece is different, so that the material reflectivity of the calibration piece at different positions in the calibration area is also different. For example, the calibration piece has different material reflectivities at the center and edge positions of the calibration area. The inventors found that based on the above-mentioned material characteristics of the calibration piece, during the scanning process, when the distance sensor performs distance sensing on the center and edge positions of the calibration area respectively, there will be very obvious amplitude changes, thereby being able to identify the edge position of the calibration area.
[0108] Under the effect of the above embodiment, the edge position of the calibration area is identified by using the calibration sheet, so that the center position of the calibration area can be obtained by fitting multiple edge positions of the calibration area during the precise calibration process, thereby avoiding reliance on customized calibration devices during the calibration process. This not only simplifies the calibration method and lowers the threshold, but also avoids affecting the calibration accuracy of the hardness measuring instrument due to insufficient processing accuracy of the customized calibration device.
[0109] Of course, in other embodiments, in addition to distance sensors, other types of sensors may also be used to identify differences in material properties of the calibration piece at different locations in the calibration area, and this embodiment does not constitute a specific limitation to this.
[0110] Figure 11 This diagram illustrates a specific implementation of a calibration method for an image measuring instrument in an application scenario. In this scenario, the camera and distance sensor in the image measuring instrument are used for fuzzy calibration and precision calibration, respectively. This determines the precise calibration value of the distance between the camera and distance sensor, enabling accurate measurement of parts.
[0111] like Figure 11 As shown in FIG, the calibration method of the image measuring instrument includes: a fuzzy calibration process and a precise calibration process.
[0112] The fuzzy calibration process includes the following steps:
[0113] Step 801: calibrate multiple circles provided by the calibration sheet of the image measuring instrument (refer to Figure 3 ), a calibration circle is selected, which can also be considered as the calibration area in this application scenario as a circular area.
[0114] In step 802 , the distance sensor is aligned with the center of the calibration circle to obtain a first mechanical coordinate of the center R0 of the calibration circle according to the measurement of the distance sensor.
[0115] Step 803 : Move the calibration circle from the sensing area of the distance sensor to the shooting area of the camera to obtain a calibration circle image according to the camera shooting.
[0116] Step 804 : Based on the calibration circle image, a three-point fitting circle center algorithm is used to obtain the pixel coordinates of the center C1 of the calibration circle in the calibration circle image.
[0117] Step 805 : Map the center C1 of the calibration circle in the calibration circle image from pixel coordinates to the mechanical coordinate system to obtain the second mechanical coordinates of the center R1 of the calibration circle, and further obtain the first distance dR0 between the camera and the distance sensor.
[0118] Based on the above fuzzy calibration process, the alignment of the center of the calibration circle and the distance sensor still has errors due to relying on naked eye estimation. Correspondingly, the first distance dR0 between the camera and the distance sensor is also allowed to have errors, and further precise calibration process is required.
[0119] The precise calibration process includes the following steps:
[0120] Step 806: Determine several set scanning paths S0 and S1 for the calibration circle. It is worth noting that these set scanning paths must meet certain conditions. For example, the set condition is that the path length is significantly greater than the diameter of the calibration circle. This ensures that the margin of error for alignment between the center of the calibration circle and the distance sensor during the fuzzy calibration process is as large as possible, allowing the scanning path to pass through the edge of the calibration circle, thereby facilitating the acquisition of at least two arbitrary edge points of the calibration circle during the subsequent precise calibration process.
[0121] Step 807 : Based on the first distance dR0 , the calibration circle is moved back to the sensing area of the distance sensor, so that the distance sensor can scan the calibration circle according to the set scanning paths S0 and S1 .
[0122] In step 808, during the scanning process, the distance sensor senses the distance of the calibration circle to obtain distance data sets L0 and L1 corresponding to the set scanning paths S0 and S1, respectively. The distance data sets L0 and L1 respectively include a plurality of fourth machine coordinates located on the set scanning paths S0 and S1.
[0123] Step 809 , using the material properties of the image measuring instrument calibration sheet, filter the fourth mechanical coordinates in the distance data sets L0 and L1 to obtain the four edge points P0 , P1 , P2 , and P3 of the calibration circle.
[0124] Step 810 : Based on the four edge points P0 , P1 , P2 , and P3 of the calibration circle, a three-point fitting circle center algorithm is used to obtain the fifth mechanical coordinate of the center R2 of the calibration circle.
[0125] In step 811 , a second distance dR1 between the camera and the distance sensor is calculated based on the second mechanical coordinate of the center R1 of the calibration circle and the fifth mechanical coordinate of the center R2 , which is regarded as an accurate calibration value of the distance between the camera and the distance sensor.
[0126] In this way, the fuzzy calibration and precise calibration of the distance between the camera and the distance sensor in the image measuring instrument are achieved.
[0127] In this application scenario, the calibration accuracy can be greatly improved through two calibrations. Moreover, the two calibrations rely on very universal calibration pieces, and do not rely on customized calibration devices. This avoids the calibration accuracy of the image measuring instrument being affected by the insufficient processing accuracy of the customized calibration devices, thereby effectively solving the problem of low calibration accuracy of image measuring instruments in related technologies.
[0128] The following is an embodiment of the device of the present application, which can be used to perform the calibration method of the image measuring instrument involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the calibration method of the image measuring instrument involved in the present application.
[0129] See also Figure 12 In an embodiment of the present application, a calibration device 900 for an image measuring instrument is provided. The image measuring instrument includes a camera and a distance sensor. The calibration device 900 for the image measuring instrument includes but is not limited to: a first distance determination module 910, a moving module 930, a scanning module 950, and a second distance determination module 970.
[0130] The first distance determination module 910 is configured to determine a first distance between the camera and the distance sensor in the image measuring machine based on the first mechanical coordinates of the center of the calibration area measured by the distance sensor and the second mechanical coordinates of the center of the calibration area measured by the camera. The calibration area is determined by a calibration sheet of the image measuring machine.
[0131] The moving module 930 is configured to control the center position of the calibration area to move from the shooting area of the camera to the sensing area of the distance sensor based on a first distance between the camera and the distance sensor in the image measuring instrument.
[0132] The scanning module 950 is configured to obtain third mechanical coordinates of a plurality of first edge positions of the calibration area by performing distance sensing on the calibration area according to a set scanning path by the distance sensor.
[0133] The second distance determination module 970 is configured to determine a second distance between the camera and the distance sensor in the image measuring machine based on the third mechanical coordinates of the plurality of first edge positions in the calibration area, wherein the second distance has a higher accuracy than the first distance.
[0134] It should be noted that the calibration device of the image measuring instrument provided in the above embodiment only uses the division of the above functional modules as an example when performing calibration. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the calibration device of the image measuring instrument will be divided into different functional modules to complete all or part of the functions described above.
[0135] In addition, the calibration device of the image measuring instrument and the calibration method of the image measuring instrument provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0136] See also Figure 13 In an embodiment of the present application, an image measuring instrument 4000 is provided. The image measuring instrument 4000 may be a composite image measuring instrument or the like.
[0137] exist Figure 13 In the embodiment, the image measuring instrument 4000 includes at least one processor 4001 , at least one communication bus 4002 and at least one memory 4003 .
[0138] The processor 4001 and the memory 4003 are connected, for example, via a communication bus 4002. Optionally, the image measuring instrument 4000 may further include a transceiver 4004, which can be used for data exchange between the image measuring instrument and other image measuring instruments, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the image measuring instrument 4000 does not constitute a limitation on the embodiments of this application.
[0139] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0140] The communication bus 4002 may include a path for transmitting information between the above components. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 13 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0141] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0142] The memory 4003 stores a computer program, and the processor 4001 reads the computer program stored in the memory 4003 through the communication bus 4002 .
[0143] When the computer program is executed by the processor 4001 , the calibration method of the image measuring instrument in the above-mentioned embodiments is implemented.
[0144] The image measuring instrument 4000 further includes a camera and at least one distance sensor, so as to accurately calibrate the installation distance between the camera and the at least one distance sensor through the above calibration method.
[0145] In addition, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the calibration method of the image measuring instrument in the above embodiments is implemented.
[0146] In one embodiment of the present application, a computer program product is provided. The computer program product includes a computer program stored in a storage medium. A processor of a computer device reads the computer program from the storage medium and executes the computer program, causing the computer device to perform the calibration method for an image measuring instrument described in each of the above embodiments.
[0147] Compared with related technologies, this method realizes fuzzy calibration and precise calibration of the distance between the camera and the distance sensor in the image measuring instrument. On the one hand, the calibration accuracy can be greatly improved through two calibrations, and the accuracy is much higher than the target calibration scheme; on the other hand, the two calibrations rely on very common calibration pieces. For example, the calibration pieces that are mature and low-priced (less than 200 yuan) on the market do not rely on any other customized calibration devices. For example, the high-precision customized calibration devices on the market often cost thousands of yuan. This not only simplifies the calibration method and is simple to operate, greatly lowering the threshold for precise calibration, but also avoids the problem of low calibration accuracy of the image measuring instrument due to insufficient processing accuracy of the customized calibration device, thereby effectively solving the problem of low calibration accuracy of the image measuring instrument in related technologies.
[0148] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0149] The above description is only part of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A calibration method for an image measuring instrument, wherein the image measuring instrument comprises a camera and a distance sensor, wherein: The method comprises: determining a first distance between the camera and the distance sensor in the image measuring instrument based on a first mechanical coordinate of a center position of a calibration area measured by the distance sensor and a second mechanical coordinate of the center position of the calibration area measured by the camera; the calibration area is determined by a calibration sheet of the image measuring instrument; wherein, when the first mechanical coordinate is measured, the center position of the calibration area is controlled to move from a sensing area of the distance sensor to a capturing area of the camera to measure the second mechanical coordinate; Based on a first distance between the camera and the distance sensor in the image measuring instrument, controlling the center position of the calibration area to move from a shooting area of the camera to a sensing area of the distance sensor; obtaining third mechanical coordinates of a plurality of first edge positions of the calibration area according to distance sensing of the calibration area by the distance sensor according to a set scanning path; Based on the third mechanical coordinates of the plurality of first edge positions of the calibration area, a second distance between the camera and the distance sensor in the image measuring instrument is determined, wherein the accuracy of the second distance is higher than that of the first distance.
2. The method according to claim 1, wherein The method further comprises: obtaining a first mechanical coordinate of the center position of the calibration area according to measurement by the distance sensor; The obtaining of the first mechanical coordinates of the center position of the calibration area according to the distance sensor measurement includes: Controlling the distance sensor to align with the center position of the calibration area, and adjusting the distance between the distance sensor and the calibration area so that the center position of the calibration area enters the sensing area of the distance sensor; The first mechanical coordinate is measured in a sensing area of the distance sensor.
3. The method according to claim 1, wherein The method further includes: obtaining a second mechanical coordinate of the center position of the calibration area according to the camera measurement; The obtaining of the second mechanical coordinates of the center position of the calibration area according to the camera measurement includes: Controlling the camera to shoot the calibration area in the shooting area to obtain an image of the calibration area; Performing center fitting on a plurality of second edge positions of the calibration area in the calibration area image to obtain pixel coordinates of the center position of the calibration area in the calibration area image; The pixel coordinates are mapped from a pixel coordinate system to a mechanical coordinate system to obtain the second mechanical coordinates.
4. The method according to claim 1, wherein The step of sensing the distance of the calibration area by the distance sensor according to the set scanning path to obtain third mechanical coordinates of a plurality of first edge positions of the calibration area includes: Controlling the distance sensor to scan the calibration area according to the set scanning path; During the scanning process, a plurality of fourth mechanical coordinates located on the set scanning path are obtained based on the distance sensing of the calibration area by the distance sensor; Based on the material property differences of the image measuring instrument calibration piece at different positions in the calibration area, the plurality of fourth mechanical coordinates are filtered to obtain the third mechanical coordinates of the plurality of first edge positions in the calibration area.
5. The method according to claim 1, wherein The determining, based on the third mechanical coordinates of the plurality of first edge positions of the calibration area, a second distance between the camera and the distance sensor in the image measuring instrument comprises: performing center fitting on the plurality of first edge positions of the calibration area based on the third mechanical coordinates of the plurality of first edge positions of the calibration area to obtain fifth mechanical coordinates of the center position of the calibration area; A second distance between the camera and the distance sensor in the image measuring instrument is determined according to the second mechanical coordinate and the fifth mechanical coordinate of the center position of the calibration area.
6. The method according to any one of claims 1 to 5, characterized in that The calibration area is a circular area.
7. A calibration device for an image measuring instrument, the image measuring instrument comprising a camera and a distance sensor, characterized in that: The device comprises: a first distance determination module, configured to determine a first distance between the camera and the distance sensor in the image measuring instrument based on a first mechanical coordinate of a center position of a calibration area measured by the distance sensor and a second mechanical coordinate of the center position of the calibration area measured by the camera, wherein the calibration area is determined by a calibration sheet of the image measuring instrument; wherein, when the first mechanical coordinate is measured, the center position of the calibration area is controlled to move from a sensing area of the distance sensor to a capturing area of the camera to measure the second mechanical coordinate; a moving module, configured to control the center position of the calibration area to move from a shooting area of the camera to a sensing area of the distance sensor based on a first distance between the camera and the distance sensor in the image measuring instrument; a scanning module, configured to obtain third mechanical coordinates of a plurality of first edge positions of the calibration area by performing distance sensing of the calibration area by the distance sensor according to a set scanning path; The second distance determination module is configured to determine a second distance between the camera and the distance sensor in the image measuring instrument based on the third mechanical coordinates of the plurality of first edge positions of the calibration area, wherein the accuracy of the second distance is higher than that of the first distance.
8. An image measuring instrument comprising a camera and a distance sensor, characterized in that: Also includes: at least one processor, at least one memory, and at least one communication bus, wherein the memory stores a computer program; The processor reads the computer program in the memory through the communication bus and executes the computer program to implement the calibration method of the image measuring instrument according to any one of claims 1 to 6.
9. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the calibration method of the image measuring instrument according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Coordinate unification calibrator of high-precision composite measuring machine and calibration method thereof
CN106092008A